掲示板

Few queries on vaadin usage in liferay

thumbnail
12年前 に Rajesh Chaurasia によって更新されました。

Few queries on vaadin usage in liferay

Regular Member 投稿: 183 参加年月日: 11/08/18 最新の投稿
Hi

1.I want to know whether/how I can vaadin to define themes just like the classic theme available in liferay.If you have some sample code of vaadin themes which can be applied to LIferay 6.0.6,it would help me a lot.

2.I added the vaading plugins to my eclipse and created portlet.On that created portlet I created a theme.But i was not able to apply the theme.Can some one suggest what is wrong in below code ,what else i need to do to apply my theme to liferay.

public void init() {
final Window mainWindow =
new Window("Vaadin Application");

Label label = new Label("Hello Vaadin user");
mainWindow.addComponent(label);

mainWindow.addComponent(
new Button("What is the time?",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
mainWindow.showNotification(
"The time is " + new Date());
}
}));


setMainWindow(mainWindow);
setTheme("runo");
Panel panel = new Panel("Regular Panel in the Runo Theme");
panel.addComponent(new Button("Regular Runo Button"));
// A button with the "small" style
Button smallButton = new Button("Small Runo Button");
smallButton.addStyleName(Runo.BUTTON_SMALL);

Panel lightPanel = new Panel("Light Panel");
lightPanel.addStyleName(Runo.PANEL_LIGHT);
lightPanel.addComponent(new Label("With addStyleName(\"light\")"));

}
12年前 に Tomek Lipski によって更新されました。

RE: Few queries on vaadin usage in liferay

Junior Member 投稿: 32 参加年月日: 10/11/17 最新の投稿
Hi Rajesh,

Rajesh Chaurasia:
Hi
1.I want to know whether/how I can vaadin to define themes just like the classic theme available in liferay.If you have some sample code of vaadin themes which can be applied to LIferay 6.0.6,it would help me a lot.


Vaadin supports themes through CSS and resources (more info is here: http://demo.vaadin.com/#theming. For example you can use chameleon theme editor to create your own color theme!

To deploy it to Liferay, you have to put it into Vaadin widgetset distributed with Liferay: html/VAADIN/ in liferay web app directory - so if you are using Liferay on Tomcat then just go to webapps/ROOT/html/VAADIN. I also suggest an update to most recent version of Vaadin anyways - even Liferay 6.1.0 Beta 4 runs on ancient Vaadin 6.4.10.

Oh, there is also liferay theme available for Vaadin, which makes Vaadin controls look like Alloy UI.

Rajesh Chaurasia:

2.I added the vaading plugins to my eclipse and created portlet.On that created portlet I created a theme.But i was not able to apply the theme.Can some one suggest what is wrong in below code ,what else i need to do to apply my theme to liferay.

public void init() {
final Window mainWindow =
new Window("Vaadin Application");

Label label = new Label("Hello Vaadin user");
mainWindow.addComponent(label);

mainWindow.addComponent(
new Button("What is the time?",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
mainWindow.showNotification(
"The time is " + new Date());
}
}));


setMainWindow(mainWindow);
setTheme("runo");
Panel panel = new Panel("Regular Panel in the Runo Theme");
panel.addComponent(new Button("Regular Runo Button"));
// A button with the "small" style
Button smallButton = new Button("Small Runo Button");
smallButton.addStyleName(Runo.BUTTON_SMALL);

Panel lightPanel = new Panel("Light Panel");
lightPanel.addStyleName(Runo.PANEL_LIGHT);
lightPanel.addComponent(new Label("With addStyleName(\"light\")"));

}


Please make sure, that the theme is available to your portlet (e.g. deployed in Liferay's html/VAADIN directory). Also you can globally set theme in portal-ext.properties using vaadin.theme property, e.g.:

vaadin.theme=pt-chameleon


For more information and practical samples on using Vaadin on Liferay, please visit our R&D blog: http://www.bluesoft.net.pl/rnd/blog.
thumbnail
12年前 に Rajesh Chaurasia によって更新されました。

RE: Few queries on vaadin usage in liferay

Regular Member 投稿: 183 参加年月日: 11/08/18 最新の投稿
The Vaadin theme you talked about can be applied to vaadin portlets only and not to entitre portal pages.I read this somewhere.Can you jot down the steps i need to do on chameleon theme zip file available on Vaadin site ?
12年前 に Tomek Lipski によって更新されました。

RE: Few queries on vaadin usage in liferay

Junior Member 投稿: 32 参加年月日: 10/11/17 最新の投稿
Rajesh Chaurasia:
The Vaadin theme you talked about can be applied to vaadin portlets only and not to entitre portal pages.I read this somewhere.Can you jot down the steps i need to do on chameleon theme zip file available on Vaadin site ?


Exactly - Vaadin theme is only about Vaadin portlets. You can and have to style Liferay itself independently.

To update Vaadin version and theme and apply custom chameleon theme, you have to:
  • Get vaadin.jar (e.g. vaadin-6.7.2.jar) from vaadin.com and put it in Liferay's WEB-INF/lib (overwriting existing vaadin.jar - so you have to rename downloaded file to vaadin.jar). This step is optional, since your webapp can have its own copy of vaadin.jar.
  • Then get Vaadin 6 Liferay package update from https://vaadin.com/releases (e.g. vaadin-6.7.2-liferay.zip) and replace Liferay's html/VAADIN with its contents
  • And finally you can extract theme zipfile generated by Vaadin Chameleon Theme editor onto Liferay's html/VAADIN directory filled in the previous step. I believe this zipfile always contains VAADIN/themes/theme-name/styles.css file for your theme.


I hope that answers your question emoticon If you want to simply use chameleon theme provided with Vaadin, you can skip step 3.