Liferay Drools Sample Error - liferay

I'm trying to test the sample drool portlet from git-hub and start learning how to work with a Drools portlet integrated in Liferay.
I m working with Liferay 6.1, Tomcat 7.
My code has an error, didn't recognise this library..
<%# page import="com.liferay.portal.kernel.util.ClassResolverUtil" %>
And I changed this line this line several times to avoid using this import..
MethodKey methodKey = new MethodKey(ClassResolverUtil.resolveByPortalClassLoader("com.liferay.portal.security.permission.ResourceActionsUtil"), "getModelResource", PageContext.class, String.class);
But I get the same error always:
generator-rules-portlet-6.1.20.1.war does not support this version of Liferay.
What can I do to solve this error??
Thank you in advance.

You have took the portlet from "master" branch of github. The master branch is 6.2 Milestone. Switch the branch to "6.1.x" and download the portlet, u will not get this error issue.
Regards,
Ramkumar.

Related

Issues Migrating Liferay 6.1 theme to 7

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

liferay 6.2 to liferay 7 Calendar API migrated to OSGi

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

Trying to modify Liferay's classic theme is behaving rare

I have a Liferay 6.1 instance with a custom classic theme, but trying to upgrade it to 7.0 is being so painful that I decided to take Liferay 7's classic theme (downloaded from here).
To bring it into Eclipse - Liferay IDE I created a new module (theme) project and imported files, but trying to deploy it was sending errors (for example, no init.ftl, stuff like that, unexpected given I am using the repo source).
When I arrived to this error, solved it and tried to deploy, it again said there's no init.ftl... Then I searched for it into the war and it actually wasn't there! No idea about what but... I noticed a portal_pop_up.ftl that doesn't exist in my source code!!! What is going on? I'm pretty confused.
Thanks!
Ok, the problem was with code downloaded from Github.
If you want to use classic-theme, just create an "empty" theme in the IDE and then overwrite it's files with the ones from auto"deployed" classic-theme in the L7 instance, in /opt/liferay/osgi/wabs.

Liferay 6.1: Class not found with DynamicQuery

I have a portlet project that needs to do some Group querying. I've not created the project but it was made with the Eclipse Liferay SDK plugin.
I've added a DynamicQueryFactoryUtil.forClass(Group.class) but it fails in runtime. It complains about not finding GroupImpl.class, which is implementation for interface Group. My project dependencies doesn't include portlet-impl (it contains GroupImpl.class).
I'm not sure if I should:
include that jar into dependencies for compiling
include that jar into portlet jar
Or I'm doing something wrong and querying groups would be available right out of the box.
PS: I'm pretty newbie in Liferay things...
PS2: It's Liferay 6.1
To enable Liferay to retrieve the right class, you need to provide a correct classloader to the initialization of your DynamicQuery, in this case the portal's classloader because that one has access to the model implementations:
DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader())

Changes to init_custom.vm not showing up

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.

Resources