Mark
--
"Paradoxically, the more time saving abstractions you are using the
more you actually have to know." - Simon Willison
Starting from bmarks-portlet-0-4-1.war downloaded from sourceforge, I
managed to get the portlet working in Liferay 4.4.2 (but I haven't
fully tested it). The good news is that I did not have to recompile
anything.
This is a screenshot of it working here (you may need to tweak the CSS
in places):
And this is the WAR file I produced that should be ready for you to
deploy by placing it into ~/liferay/deploy:
https://bmarks-portlet.svn.sourceforge.net/svnroot/bmarks-portlet/BookmarksPortlet.war
I almost got the portlet working in Liferay 5.0.1 RC but I encountered
an issue, which I don't think has been fixed yet, namely:
"com.liferay.portlet.ActionRequestImpl cannot be cast to
com.liferay.portlet.RenderRequestImpl"
This is similar to the following bug report.
http://support.liferay.com/browse/LEP-5775
This problem isn't specifically to do with the bookmarks portlet as I
experienced exactly the same error with
sample-struts-portlet-5.0.0.1.war which also uses struts bridge, the
sample-struts-portlet is distributed with Liferay and available here:
http://sourceforge.net/project/showfiles.php?group_id=49260
To get the bookmarks portlet working in 4.4.2 I had to do the following:
* Remove Pluto references: Liferay doesn't use Apache Pluto so I
needed to remove any references to Pluto from the code. I removed the
Pluto servlet from web.xml and removed a pluto reference from
transform.tag.
* Sort out jars: I needed to add commons-logging.jar and revert to a
version of portals-bridges.jar that is known to work with Liferay.
* Change ServletContextProvider: I had to change the
ServletContextProvider setting in portlet.xml to a class that was
compatible with Liferay.
* Add a liferay-portlet.xml file: the portlet does not function
correctly in Liferay without it
* Change _spageview references: The later version of portals-bridges
uses _spageview, the version that Liferay works with uses _spage and
my XSL stylesheets need to use this value, so it had to be changed.
* Replace & with & in the XML output: Liferay has an issue with
"&" rather than "&" in it's URLs.
* Specific to 4.4.2 - change war filename and the display-name in
web.xml to the exact same name as the portlet - this was necessary in
order for the portal to find css and javascript files that the portlet
uses.
I hope this works for you, if you make any further improvements I
would be interested to hear about them.
Mark
https://bmarks-portlet.svn.sourceforge.net/svnroot/bmarks-portlet/BookmarksPortlet.war
Once I am convinced everything is working fine, I could fold the changes
into the proper build.
Mark