Liferay Anyone

146 views
Skip to first unread message

Nolodie

unread,
May 1, 2008, 4:40:42 PM5/1/08
to Bookmarks Portlet
I've twiddled for a day or so trying to get the Bookmarks Portlet
working in Liferay, but to no avail. The latest error that I'm
getting is the IllegalStateException from Pluto stating that "the
prepare method was never called". Does anyone have some insight they
could share? Thank in advance!

Mark McLaren

unread,
May 2, 2008, 4:40:02 AM5/2/08
to bookmark...@googlegroups.com
I'm not a Liferay user, I'll have a twiddle myself and get back to you.

Mark

--
"Paradoxically, the more time saving abstractions you are using the
more you actually have to know." - Simon Willison

Mark McLaren

unread,
May 2, 2008, 3:08:52 PM5/2/08
to bookmark...@googlegroups.com
Hello again,

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):

http://bookmarks-portlet.googlegroups.com/web/liferay.jpg?gda=z7_H4DwAAACG7X56GerfKUJEOp0aDx5zpUUKeQLaNNBJU8TMKXgeeWG1qiJ7UbTIup-M2XPURDQNaSTe1IUvt49F9w8NrhYo

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

Nolodie

unread,
May 5, 2008, 5:00:06 PM5/5/08
to Bookmarks Portlet
That did the trick! Thanks for the excellent fix and detailed
response.

To get the CSS working properly, I made the following changes to the
bookmarkstree.css file:

- Removed the CSS for the "body" element
- Changed the last directive, ".bookmarks-channel ul li a { font-size:
110% }", to 120% font size to make the text more legible

I just noticed that some of the other views, like "add bookmark" and
"add folder" have some formatting issues now. I'll investigate these
and post any findings.

I'm also going to look into extending the code to automatically
retrieve the title from a web site if one isn't specified by the
user. Although, this certainly doesn't sound trivial, so it may take
me a bit to fit the work in.

Thanks again!

Paul S.

Bob

unread,
May 7, 2008, 4:58:31 PM5/7/08
to Bookmarks Portlet
Did you post these changes somewhere? I'd like to look at them.

Thanks

Bob Fleischman

On May 2, 3:08 pm, "Mark McLaren" <mark.mcla...@gmail.com> wrote:
> Hello again,
>
> 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):
>
> http://bookmarks-portlet.googlegroups.com/web/liferay.jpg?gda=z7_H4Dw...
>
> 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/Boo...

Mark McLaren

unread,
May 8, 2008, 12:51:43 PM5/8/08
to bookmark...@googlegroups.com
I only posted them inside the modified WAR file. I am not yet convinced
that everything works as expected in Liferay.

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

mark mclaren

unread,
May 8, 2008, 12:57:36 PM5/8/08
to Bookmarks Portlet
I quite like the fetch the website title idea. In production, we have
a Firefox toolbar that integrates with the bookmarks portlet (and one
or two other things), it does fetch the title (and url). To make
these things useful to the user you have to make them really easy to
use (e.g. del.icio.us toolbar etc).

https://www.bris.ac.uk/portal/help/content/toolbar-help.html
Reply all
Reply to author
Forward
0 new messages