URL Generation Helper classes error - Stateholder
Hi,
I'm trying to use the Portal 6.0 Advanced URL Generation Helper classes ( from [url]http://www-01.ibm.com/support/docview.wss?rs=688&ca=portall2&uid=swg21265900[/url] ) in the Portal Theme and it's not going to well.
I put the jar file into my PortalServer/shared/app folder
In the theme, if I try to run just about anything I get the following error,
.. 00000054 DispatcherSer E com.ibm.wps.services.dispatcher.DispatcherServiceImpl handleRequest EJPFD0004E: The dispatcher call resulted in an error.
java.lang.NoClassDefFoundError: com/ibm/portal/state/StateHolder
One of the lines I tried is:
String navUrl = ThemeURLHelper.generateUrl("wps.content.root", null, null, request, response);
I am running Portal 6.0.1.6
Has anyone run into this and know how to solve it?
thanks :)
Re: URL Generation Helper classes error - Stateholder
That is very odd. as I do not think the class was removed in 6.0.1.6
Can you send me your theme file?
IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM
Re: URL Generation Helper classes error - Stateholder
Thank you for the reply.
Kind of strange, I went back to the code and tried it out again, and for some reason it works now.
I tried using the helper classes in the IBM theme and it worked there, so I tried using them in my custom theme, and now all of a sudden they work there also! :D
On another note, I noticed that the ServletURLHelper class does not preserve the locale in links, so I added a method that does that, including it here if anyone is interested.
Re: URL Generation Helper classes error - Stateholder
Just an FYI there is an easier way to do the preservation
Instead of this call
final EngineURL url = urlFactory.newURL(request, response, mgr.newState(), Constants.EMPTY_COPY);
You make it like this
final EngineURL url = urlFactory.newURL(request, response, mgr.newState(), Constants.SMART_COPY);
No need to add the other code in there
IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM
Re: URL Generation Helper classes error - Stateholder
Thanks for the info :)
I'm guessing though that if I do a smart_copy, then I will retain the navigational state.
The navigation that I am working with is a bit strange in that I need to retain any locale changes, but I must omit any changes in the navigational state.