i have liferay 6.2 GA4, and im trying to migrate to liferay 7
im using the code upgrade tool
the error im getting is Calendar's API migrated to OSGi
but i cant find how to do this, how do i change the portlet to OSGi? how do i import the calendar module to my portlet? the upgrade tool only says "#Legacy" in the documentation change, so i dont know what to do next... i have a lot of this "#Legacy" errors, how do i correct them?
this question is a duplicate from the liferay forums, but i havent got an answer yet
edit
i dont know the best way to migrate, but i do have a portlet (many portlets actually), i want to use it (them) in a liferay 7 instalation... the portlet im trying to migrate first (the simpler one) uses the calendar API of liferay 6.2 im guessing i just have to add the calendar module, so i can use its classes, i just dont know how... i use calendar API in both the controller and the jsps
the text in the migration tool only says "#Legacy"... that it! thats why im so confused... in eclipse the error says "Calendar API migrated to OSGi" and thats it too... thats why i imagine i just need to add the calendar module...
thank you!
What is the text from the error/change message?
Regarding "Calendar API", is it that you want to use the Calendar API from Liferay's Calendar app?
Note, you should first get your existing portlet running on 7.0 before modularizing it. The updated tutorial Planning Plugin Upgrades and Optimizations has a table of Upgrade Paths for each plugin type and feature.
Jim
found it! you just have to add the Calendar api to the gradle configurations
classpath group: "com.liferay", name: "com.liferay.calendar.api", version: "2.0.2"
classpath group: "com.liferay", name: "com.liferay.calendar.service", version: "2.1.9"
in the settings.gradle's dependencys section
and this:
compileOnly group: "com.liferay", name: "com.liferay.calendar.api", version: "2.0.2"
compileOnly group: "com.liferay", name: "com.liferay.calendar.service", version: "2.1.9"
in the build.gradle of your portlet!
and that works!
thank you
Related
I have downloaded Liferay 7.3.5 Community Edition from here and trying to deploy a HelloWorld portlet for testing purposes. It is bundled with Tomcat.
I am using Liferay Developer Studio (the same old Eclipse on steroids) for developing and deploying the portlet. Version 3.8.1.202004240132-ga2
I have also created a Server like in this link - the server is using the tomcat 9.0.37 from the already downloaded bundle.
After steps above, I have followed steps from here to create a Module Project and to deploy it on the already started tomcat server. The portlet appears in the deployed section, but with a red "x" near it:
I went to add the portlet/widget in a widget page that I have created for this purpose, but I could not find the portlet:
Then, logged in with an admin user, I went to Control Panel -> App Manager and searched for my Portlet. It appears as "Installed" and I can activate it. After I hit "Activate", Eclipse logs start writing: ERROR [http-nio-8080-exec-8][PortletServlet:119] javax.portlet.PortletException: org.osgi.framework.BundleException: Could not resolve module: VictorTestPortlet [2716]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc; version="[2.0.0,3.0.0)"_ [Sanitized]
The Question: what is causing this error ?
The problem is as it is already stated - the dependency is not found.
To fix this, I went in build.gradle file that is missing a version for the "com.liferay.portal" dependency. So, my line was looking like this:
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
And now it is looking like this:
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "9.8.1"
The version MUST be the same as found in your Liferay Server instance - you can find it by accessing the portal-kernel.jar and looking into its MANIFEST.MF file for the key "Bundle-Version". The jar is located in ...portal-tomcat-7.3.5\tomcat-9.0.37\lib\ext folder.
Good luck !
You found the complex solution yourself, there are two simpler ways:
Use the target platform. Assuming you're using Liferay Workspace, your gradle.properties in the root of your workspace has an entry liferay.workspace.target.platform.version. Set it to 7.3.5 and the versions will be taken automagically
Have even the required modules be detected automagically by setting the target platform, and declare your dependency as
dependencies {
compileOnly group: "com.liferay.portal", name: "release.portal.api"
}
This will even figure out the exact module (of more than 1000) that you need to depend on. Granted, it kind of works against the whole concept of modularization (to be aware of your dependencies), but it's soooo convenient.
I've been following these instructions, in an attempt to migrate a theme from our 6.1 portal to Liferay 7. The initial issue I seem to be having is getting the imported and upgraded theme to use vm as the template extension. I've added a look-and-feel.xml file containing the correct template-extension element to the 6.1 theme before importing/upgrading, but I am still receiving a "portal_normal.ftl not found" error after applying the theme.
Additionally, after importing and upgrading the theme into the Liferay 7 toolkit, the theme seems to only contain the child-specific theme files, and not the "compiled" set that would include the parent files (as it would had it been generated by the old sdk).
Any help resolving these issues would be greatly appreciated!
Liferay DXP/7 support freemarker. So your template files should be .ftl not .vm.You have to migrate template files into freemarker manually.
Regarding CSS: once you migrated theme, you will find a folder named 'src', you should make changes in files, placed here. Once you will find another folder over here named 'build'here you will find theme like we had in webapps in older versions.
Hope it will help
first intro: I try to get a hook running on a new Liferay 6.1.2 GA3. Previously I was using the portlet plugin mechanism only.
I try to get a simple calendar hook running and get compiler errors, such as "CalEvent cannot be resolved as a type".
My feeling is that I am missing the entire Liferay libraries in the hook, but the included libraries look complete to me (in order of build path priority):
- ear libraries
- Java JDK 6
- Liferay Hook Plugin API
- Liferay V6.1 CE (Tomcat 7)
- Web App Libraries
The libraries got automatically selected when creating the project as a hook. Any ideas?
com.liferay.portlet.calendar.model.CalEvent is in portal-service.jar. This should be on the classpath of your hook and Liferay IDE/DevStudio typically adds this library when you create a new hook. If it's not there, add it. You'll find it on the global classpath of your tomcat installation, e.g. ${liferay.home}/tomcat/lib/ext - assuming that you develop on tomcat.
If you need to add this file to the project, make sure it doesn't get packaged in the plugin's WEB-INF/lib folder - it needs to be picked up from the global classpath when deployed.
You do get the errors during development time (e.g. in IDE), not when you're deploying, right?
Or is it as simple as a forgotten "organize imports"?
I tried to start a new dynamic Web Project with Seam-Faces(Eclipse). I created a new JSF-Facility and addeed all the jar-Files from the official Seam-Faces homepage. When i try to create a dynamic web project eclipse says that the following File ist not found:
javax.faces.FactoryFinder
What i am doing wrong ? Is ist possible to use Seam-Faces without the Seam-Framework ?
There is not a Seam Framework anymore. Seam 3 is a bunch of reusable CDI extensions that you could use. The best way to start with Seam3 modules is to use maven for library management. More info about how to configure seam-faces dependencies can be found here.
For the exception you're facing make sure there are no jsf jars in WEB-INF\lib in case you're using a Java EE server like JBoss AS or Glassfish. For more info look here.
I'm building a new Liferay theme and being crushed by this problem.
When I make changes to the init_custom.vm, the only possible way for me to see the changes is to restart Tomcat. When I make other changes to my theme, such as editing my CSS or adding images, I can see the changes after deploying the theme via the Ant Deploy target. No such luck with the templates.
I checked the $CATALINA_HOME/webapps/my-theme/init_custom.vm after deploying, and that file does reflect my changes.
I cannot continue to develop if this is going to be the cycle. I must be able to make changes to the velocity template without requiring a restart. Any suggestions?
I'm using the Eclipse Liferay IDE and the Ant build to deploy my theme when I make changes. I'm using the Liferay 6.0.6 Tomcat bundle. I've also already added include-and-override=portal-developer.properties to my portal-ide.properties file.
Thanks!!!
(also asked this in the Liferay Forums, and I'll make sure to copy back any answers I get: http://www.liferay.com/community/forums/-/message_boards/message/11292911)
Liferay also caches everything Velocity related which sometimes can present itself in the way you describe: changes to templates don't seem to show unless you restart Liferay. You can turn off this behavior if you set the following property in your portal-ext.properties file:
velocity.engine.resource.manager.cache.enabled=false
I switched to the 6.1 Beta and do not have the problem on that release, so it was just with 6.0.6.
Also: I've seen How to edit a velocimacro without restarting velocity? and Testing JSON API in Rails 3.2 using rspec using exact PUT/POST bodies as Backbone would send and they did not work for me. Upgrading to 6.1 beta did, for some reason, work.