Hi
I am developing liferay 6.0 portlets and I am currently using the latest release of Vaadin i.e 6.4.6. According to Liferay documentation liferay 6.0 supports Vaadin as standard. But I cannot use the new features in Vaadin 6.4.6 such as Table column footer and header click because apparently Liferay has a widgetset which was built with an older version of vaadin i.e 6.3.4. I found that out by using vaadin debug mode. This is the warning I received…
The same application works fine in a stand alone servlet.
How can I use the latest vaadin features in a liferay portlet? Or will I always be dependent on the vaadin release used in building the liferay widgetset?
Briefly (assuming the default Tomcat directory structure), replace webapps/ROOT/WEB-INF/lib/vaadin.jar with the latest (renaming it to “vaadin.jar” without a version number) and replace webapps/ROOT/html/VAADIN (or parts of it if you have added something there yourself) with the contents of the ZIP file.
Vaadin 6.4.6 also has a new theme called “liferay”, matching the look of AlloyUI - you can enable it as the portal-wide default Vaadin theme by adding the line “vaadin.theme=liferay” in portal-ext.properties.
There will soon be a portlet that makes using add-ons with custom widgets and compiling a custom widgetset on the portal easier.
Thanks for the quick response. That fixed my problem.
But why does vaadin have to use a shared widgetset and themes with liferay? IMHO wouldn’t it be better if each portlet came with its own widgetset? That way developers could deploy portlets on a liferay server from the liferay control panel even if they don’t have access to its filesystem.
It is possible for a portlet to define its own CSS rules from within the portlet, e.g. with the header-portlet-css in liferay-portlet.xml refering to a CSS-file in the portlet docroot/css directory - these will be applied in addition to the rules from the theme. This is not using the theme mechanism of Vaadin, though, so e.g. ThemeResource is not available for anything outside the standard themes.
Why it is strongly recommended that portlets do not use their own widgetsets is that you cannot run multiple portlets using different widgetsets on the same page. Managing the widgetset will get much easier with the widgetset compilation portlet - you’ll just need to drop the Vaadin add-ons used by any Vaadin portlet to a shared directory on the portal and click “compile widgetset”, and you’ll have a widgetset that can be used by all the portlets.
There is
an enhancement request to investigate better methods for including themes (and widgetsets) in a (JSR-286) portlet. With portlet 1.0 (JSR-168), serving the theme from the portlet would not be a problem as there is a servlet behind the portlet.
Follow the instructions
here for installing them. If you are running Liferay 6.0.5, it is enough to replace vaadin.jar on the portal and replace the resource directories under VAADIN that are present in the ZIP with the extracted ones. For older Liferay versions, some more configuration in portal-ext.properties might be necessary.
The versions are immediately available at repository.sonatype.org and usually within an hour or so in Maven Central, but I have found replication from there to mvnrepository.com and some other mirrors can take days. This is not specific to Vaadin as far as I can tell.