This post will show you how you can integrate the feature of using Custom Portlet Modes in your Liferay 5.2.3 – Portal. I realized this as part of my Bachelor Thesis at University of Applied Sciences Weingarten.
Custom Portlet Modes are not supported by Liferay Portal because this part is optional in the Portlet Standard (JSR-168 and JSR-286). So the Liferay guys just did not implement it.
It took me quite some time to get it done but finally it worked!! My Liferay portal now supports custom portlet modes.
After you modified your Liferay, your portlets will be able to use custom portlet modes according to the portlet standard! This is a pretty cool feature which a lot people are missing.
What you will need:
- your Liferay EXT-Project
- these modified files
What you have to do:
1.) download the modified files and copy them into your EXT-Project at the correct positions
2.) modify your ext-spring.xml and add the following lines:
3.) modify your portal-ext.properties and add the following line:
With these modifications you will be able to run portlets that are using custom portlet modes.
To test your new functions and to give you an idea of how to use these modes, here is a Test portlet which uses a custom portlet mode. You can download the war file or the sources with the included Eclipse project. Your choice!
If something does not work properly, please let me know. Comments are highly appreciated! 🙂
Maybe this works with Liferay 6 too, but i have not tested it yet. Maybe someone could do this and let me know if it works too!