first of all, I am really impressed with what you’ve created! I implemented your samples one after another just in one day and was really impressed with how easily you can make RIA’s with plain Java code.
Now I am testing Vaadin on Websphere Portal 6.1 and have run into some difficulties.
Firstly, the “Portlet 1.0” way works as it should and I think even this should be enough to cover most of the normal use cases.
Now, there seems to be a problem with Porlet 2.0 implementation, “officially” offered only for Liferay but theoretically should be working on WPS too.
Somehow it doesn’t… I have spent quite a few hours investigating into it. The first problem - inability to load static resources from /html/VAADIN/… which btw WPS doesn’t support the way Liferay does anyhow - I solved by overriding the method getStaticFilesLocation(…) and returning a value that works.
But now I got another problem which seems far more complicated. “UIDL cannot be read from server - Error 400”. It seems like the AJAX requests from the client are not reaching the portlet. Current Vaadin Portlet 2.0 implementation seems to have problems here, specifically with the encoded URLs which is normal in WPS and probably not in Liferay.
Has anyone got Vaadin working in WPS with Portlet 2.0? Maybe I did something completely wrong here… If yes, I wonder why there no other posts about this here.
The base problem here is that the portlet cannot offer static resources using a given url (e.g. /VAADIN/theme/reindeer/styles.css). Therefore the static files need to be deployed to the portal. In Liferay this is deployed in the /html/ directory. Where should you deploy static resources in WPS and what is the url one should use?
The Vaadin portlet generates an url that is used for the UIDL communication according to portlet 2.0 specs so this should not be a problem. It could however be the same problem as with Jetspeed 2 that the client side incorrectly uses ? or & to add parameters to the generated url (see http://dev.vaadin.com/ticket/5911). Could you check this with e.g. Firebug? After the initial load there should be a POST request to a generated url, probably with “?repaintAll=1” or “&repaintAll=1” added
You could try the workaround mentioned in the Jetspeed 2 post: http://vaadin.com/forum/-/message_boards/message/240649 (override ApplicationPortlet2.getVaadinConfigurationMap and change “portletUidlURLBase” to end in an extra “?1”). That’s how I got Jetspeed 2 working.
could you sharean an example of a portlet for websphere as war file? I’m trying to get a working vaadin portlet 2.0 to work on Websphere Portal but it just displays empty portlet, without any content. If I switch to Portlet 1.0 it does show content.
I need some help overriding the method getStaticFilesLocation. I copied the VAADIN widgetsets and themes in my WebSpheres ‘shared libs’ directory, but I don’t know how to override the getStaticFilesLocation method. Can I just change it to something like:
protected String getStaticFilesLocation(PortletRequest request) {
/*
// TODO allow overriding on portlet level?
String staticFileLocation = getPortalProperty(
Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH,
request.getPortalContext());
if (staticFileLocation != null) {
// remove trailing slash if any
while (staticFileLocation.endsWith(".")) {
staticFileLocation = staticFileLocation.substring(0,
staticFileLocation.length() - 1);
}
return staticFileLocation;
} else {
// default for Liferay
return "/html";
}
*/
return "C:/temp/shared libs";
}
While this might not be the only issue in your case, note that the path returned should be a relative path on the server (accessible via HTTP, based on the root context if I remember correctly) - not a local file system path.