summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/WEB-INF/liferay-display.xml34
-rw-r--r--WebContent/WEB-INF/liferay-portlet.xml146
-rw-r--r--WebContent/WEB-INF/portlet.xml291
-rw-r--r--WebContent/WEB-INF/web.xml5
-rw-r--r--build/build.xml7
-rw-r--r--build/buildhelpers/com/vaadin/buildhelpers/PortletConfigurationGenerator.java403
-rw-r--r--build/package/WebContent/WEB-INF/web.xml6
7 files changed, 188 insertions, 704 deletions
diff --git a/WebContent/WEB-INF/liferay-display.xml b/WebContent/WEB-INF/liferay-display.xml
index 0e88c0e862..903f441d8b 100644
--- a/WebContent/WEB-INF/liferay-display.xml
+++ b/WebContent/WEB-INF/liferay-display.xml
@@ -2,26 +2,16 @@
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 4.0.0//EN" "http://www.liferay.com/dtd/liferay-display_4_0_0.dtd">
<display>
- <category name="Vaadin">
- <portlet id="PortletDemoPortlet" />
- <portlet id="SelectDemoPortlet" />
- <portlet id="TableDemoPortlet" />
- <portlet id="FilterSelectPortlet" />
- <portlet id="FeatureBrowserPortlet" />
- <portlet id="ModalWindowPortlet" />
- <portlet id="CalcPortlet" />
- <portlet id="NotificationDemoPortlet" />
- <portlet id="ChatServletPortlet" />
- <portlet id="BrowserDemoPortlet" />
- <portlet id="HelloWorldPortlet" />
- <portlet id="AddressBookPortlet" />
- <portlet id="CalcPortlet"/>
- <portlet id="SamplerPortlet"/>
- <!--
- <portlet id="InterPortletEventPortlet" />
- <portlet id="VaadinInterPortletEventPortlet" />
- -->
- <portlet id="Portlet Mode Example"/>
- <portlet id="Portlet HTML Mode Example"/>
- </category>
+ <category name="Vaadin">
+ <portlet id="PortletDemoPortlet" />
+ <portlet id="CalcPortlet" />
+ <portlet id="SamplerPortlet" />
+ <portlet id="Portlet Mode Example" />
+ <portlet id="Portlet HTML Mode Example" />
+ <portlet id="AddressBookPortlet" />
+
+ <!-- These should be used together -->
+ <portlet id="InterPortletEventPortlet" />
+ <portlet id="VaadinInterPortletEventPortlet" />
+ </category>
</display> \ No newline at end of file
diff --git a/WebContent/WEB-INF/liferay-portlet.xml b/WebContent/WEB-INF/liferay-portlet.xml
index f3c18e57d0..559592a48a 100644
--- a/WebContent/WEB-INF/liferay-portlet.xml
+++ b/WebContent/WEB-INF/liferay-portlet.xml
@@ -2,102 +2,52 @@
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_3_0.dtd">
<liferay-portlet-app>
- <portlet>
- <portlet-name>PortletDemoPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>SelectDemoPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>TableDemoPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>FilterSelectPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>FeatureBrowserPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>ModalWindowPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>CalcPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>NotificationDemoPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>ChatServletPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>BrowserDemoPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>HelloWorldPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>AddressBookPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>CalcPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>SamplerPortlet</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>Portlet Mode Example</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
- <portlet>
- <portlet-name>Portlet HTML Mode Example</portlet-name>
- <instanceable>true</instanceable>
- <ajaxable>false</ajaxable>
- </portlet>
-
- <role-mapper>
- <role-name>administrator</role-name>
- <role-link>Administrator</role-link>
- </role-mapper>
- <role-mapper>
- <role-name>guest</role-name>
- <role-link>Guest</role-link>
- </role-mapper>
- <role-mapper>
- <role-name>power-user</role-name>
- <role-link>Power User</role-link>
- </role-mapper>
- <role-mapper>
- <role-name>user</role-name>
- <role-link>User</role-link>
- </role-mapper>
-
+ <portlet>
+ <portlet-name>PortletDemoPortlet</portlet-name>
+ <instanceable>true</instanceable>
+ <ajaxable>false</ajaxable>
+ </portlet>
+ <portlet>
+ <portlet-name>CalcPortlet</portlet-name>
+ <instanceable>true</instanceable>
+ <ajaxable>false</ajaxable>
+ </portlet>
+ <portlet>
+ <portlet-name>SamplerPortlet</portlet-name>
+ <instanceable>true</instanceable>
+ <ajaxable>false</ajaxable>
+ </portlet>
+ <portlet>
+ <portlet-name>Portlet Mode Example</portlet-name>
+ <instanceable>true</instanceable>
+ <ajaxable>false</ajaxable>
+ </portlet>
+ <portlet>
+ <portlet-name>Portlet HTML Mode Example</portlet-name>
+ <instanceable>true</instanceable>
+ <ajaxable>false</ajaxable>
+ </portlet>
+ <portlet>
+ <portlet-name>AddressBookPortlet</portlet-name>
+ <instanceable>true</instanceable>
+ <ajaxable>false</ajaxable>
+ </portlet>
+
+ <role-mapper>
+ <role-name>administrator</role-name>
+ <role-link>Administrator</role-link>
+ </role-mapper>
+ <role-mapper>
+ <role-name>guest</role-name>
+ <role-link>Guest</role-link>
+ </role-mapper>
+ <role-mapper>
+ <role-name>power-user</role-name>
+ <role-link>Power User</role-link>
+ </role-mapper>
+ <role-mapper>
+ <role-name>user</role-name>
+ <role-link>User</role-link>
+ </role-mapper>
+
</liferay-portlet-app> \ No newline at end of file
diff --git a/WebContent/WEB-INF/portlet.xml b/WebContent/WEB-INF/portlet.xml
index 265c3b3869..2b107d5ae2 100644
--- a/WebContent/WEB-INF/portlet.xml
+++ b/WebContent/WEB-INF/portlet.xml
@@ -11,10 +11,9 @@
<name>application</name>
<value>PortletDemo</value>
</init-param>
-
<init-param>
<name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
@@ -40,31 +39,26 @@
<role-name>user</role-name>
</security-role-ref>
</portlet>
+
<portlet>
- <portlet-name>FeatureBrowserPortlet</portlet-name>
- <display-name>Vaadin FeatureBrowser</display-name>
+ <portlet-name>CalcPortlet</portlet-name>
+ <display-name>Calc</display-name>
<portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
<init-param>
<name>application</name>
- <value>com.vaadin.tests.featurebrowser.FeaturesApplication</value>
- </init-param>
- <init-param>
- <name>style</name>
- <value>height:650px</value>
+ <value>com.vaadin.demo.Calc</value>
</init-param>
<init-param>
<name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
- <portlet-mode>edit</portlet-mode>
- <portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>FeatureBrowser</title>
- <short-title>FeatureBrowser</short-title>
+ <title>Calc</title>
+ <short-title>Calc</short-title>
</portlet-info>
<security-role-ref>
@@ -82,76 +76,56 @@
</portlet>
<portlet>
- <portlet-name>HelloWorldPortlet</portlet-name>
- <display-name>Hello World</display-name>
+ <portlet-name>SamplerPortlet</portlet-name>
+ <display-name>Sampler</display-name>
<portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
<init-param>
<name>application</name>
- <value>com.vaadin.demo.HelloWorld</value>
+ <value>com.vaadin.demo.sampler.SamplerApplication</value>
+ </init-param>
+ <init-param>
+ <name>widgetset</name>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
+ </init-param>
+ <init-param>
+ <name>style</name>
+ <value>height:650px</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
- <title>HelloWorld</title>
- <short-title>HelloWorld</short-title>
+ <title>Sampler</title>
+ <short-title>Sampler</short-title>
</portlet-info>
+
+ <security-role-ref>
+ <role-name>administrator</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>guest</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>power-user</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>user</role-name>
+ </security-role-ref>
</portlet>
- <!--
- <portlet> <portlet-name>VaadinInterPortletEventPortlet</portlet-name>
- <display-name>Hello World Event</display-name>
- <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
- <init-param> <name>application</name>
- <value>com.vaadin.demo.portlet.VaadinInterPortletEventPortlet</value>
- </init-param> <init-param> <name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
- </init-param> <supports> <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode> </supports> <portlet-info>
- <title>Inter-portlet events</title> <short-title>Inter-portlet
- events</short-title> </portlet-info> <supported-processing-event>
- <qname xmlns:vaadin="http://www.vaadin.com/hello">vaadin:Hello</qname>
- </supported-processing-event> <supported-processing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:ReplyToVaadin</qname>
- </supported-processing-event> <supported-publishing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:Reply</qname>
- </supported-publishing-event> <supported-publishing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:FromVaadin</qname>
- </supported-publishing-event>
- <supported-public-render-parameter>HelloState</supported-public-render-parameter>
- </portlet> <portlet>
- <portlet-name>InterPortletEventPortlet</portlet-name>
- <display-name>Hello World Event (non-Vaadin)</display-name>
- <portlet-class>com.vaadin.demo.portlet.InterPortletEventPortlet</portlet-class>
- <supports> <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode> </supports> <portlet-info>
- <title>Inter-portlet events (non-Vaadin)</title>
- <short-title>Inter-portlet events (non-Vaadin)</short-title>
- </portlet-info> <supported-processing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:Reply</qname>
- </supported-processing-event> <supported-processing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:FromVaadin</qname>
- </supported-processing-event> <supported-publishing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:Hello</qname>
- </supported-publishing-event> <supported-publishing-event> <qname
- xmlns:vaadin="http://www.vaadin.com/hello">vaadin:ReplyToVaadin</qname>
- </supported-publishing-event>
- <supported-public-render-parameter>HelloState</supported-public-render-parameter>
- </portlet>
- -->
<portlet>
<portlet-name>Portlet Mode Example</portlet-name>
<display-name>Portlet Mode Example</display-name>
<portlet-class>com.vaadin.demo.portlet.PortletModePortlet</portlet-class>
<init-param>
- <name>widgetset</name>
- <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
- </init-param>
- <init-param>
<name>application</name>
<value>com.vaadin.demo.portlet.PortletModeExample</value>
</init-param>
+ <init-param>
+ <name>widgetset</name>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
@@ -164,12 +138,29 @@
<title>PortletModeExample</title>
<short-title>PortletModeExample</short-title>
</portlet-info>
+
+ <security-role-ref>
+ <role-name>administrator</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>guest</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>power-user</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>user</role-name>
+ </security-role-ref>
</portlet>
<portlet>
<portlet-name>Portlet HTML Mode Example</portlet-name>
<display-name>Portlet HTML Mode Example</display-name>
<portlet-class>com.vaadin.demo.portlet.HtmlModePortlet</portlet-class>
+ <init-param>
+ <name>widgetset</name>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
@@ -181,6 +172,19 @@
<title>Portlet HTML Mode Example</title>
<short-title>Portlet HTML Mode Example</short-title>
</portlet-info>
+
+ <security-role-ref>
+ <role-name>administrator</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>guest</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>power-user</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>user</role-name>
+ </security-role-ref>
</portlet>
<portlet>
@@ -191,81 +195,17 @@
<name>application</name>
<value>com.vaadin.demo.tutorial.addressbook.AddressBookApplication</value>
</init-param>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode>
- </supports>
- <portlet-info>
- <title>Address Book</title>
- <short-title>Address Book</short-title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>SamplerPortlet</portlet-name>
- <display-name>Sampler</display-name>
- <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
- <init-param>
- <name>application</name>
- <value>com.vaadin.demo.sampler.SamplerApplication</value>
- </init-param>
<init-param>
<name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
- </init-param>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode>
- </supports>
- <portlet-info>
- <title>Sampler</title>
- <short-title>Sampler</short-title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>CalcPortlet</portlet-name>
- <display-name>Calc</display-name>
- <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
- <init-param>
- <name>application</name>
- <value>com.vaadin.demo.Calc</value>
- </init-param>
- <init-param>
- <name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
- </init-param>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>view</portlet-mode>
- </supports>
- <portlet-info>
- <title>Calc</title>
- <short-title>Calc</short-title>
- </portlet-info>
- </portlet>
- <portlet>
- <portlet-name>ChatServletPortlet</portlet-name>
- <display-name>Vaadin ChatServlet</display-name>
- <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet</portlet-class>
- <init-param>
- <name>application</name>
- <value>chat</value>
- </init-param>
-
- <init-param>
- <name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
- <portlet-mode>edit</portlet-mode>
- <portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>ChatServlet</title>
- <short-title>ChatServlet</short-title>
+ <title>Address Book</title>
+ <short-title>Address Book</short-title>
</portlet-info>
<security-role-ref>
@@ -281,47 +221,70 @@
<role-name>user</role-name>
</security-role-ref>
</portlet>
+
+ <!-- A Vaadin portlet and a non-Vaadin portlet that can communicate with each other -->
<portlet>
- <portlet-name>BrowserDemoPortlet</portlet-name>
- <display-name>Vaadin BrowserDemo</display-name>
- <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet</portlet-class>
+ <portlet-name>VaadinInterPortletEventPortlet</portlet-name>
+ <display-name>Hello World Event</display-name>
+ <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>
<init-param>
<name>application</name>
- <value>BrowserDemo</value>
- </init-param>
- <init-param>
- <name>style</name>
- <value>height:650px</value>
+ <value>com.vaadin.demo.portlet.VaadinInterPortletEventPortlet</value>
</init-param>
<init-param>
<name>widgetset</name>
- <value>com.vaadin.demo.sampler.gwt.SamplerWidgetSet</value>
+ <value>com.vaadin.portal.gwt.PortalDefaultWidgetSet</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
- <portlet-mode>edit</portlet-mode>
- <portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>BrowserDemo</title>
- <short-title>BrowserDemo</short-title>
+ <title>Inter-portlet events</title>
+ <short-title>Inter-portlet
+ events</short-title>
</portlet-info>
-
- <security-role-ref>
- <role-name>administrator</role-name>
- </security-role-ref>
- <security-role-ref>
- <role-name>guest</role-name>
- </security-role-ref>
- <security-role-ref>
- <role-name>power-user</role-name>
- </security-role-ref>
- <security-role-ref>
- <role-name>user</role-name>
- </security-role-ref>
+ <supported-processing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:Hello</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:ReplyToVaadin</qname>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:Reply</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:FromVaadin</qname>
+ </supported-publishing-event>
+ <supported-public-render-parameter>HelloState</supported-public-render-parameter>
</portlet>
-
+ <portlet>
+ <portlet-name>InterPortletEventPortlet</portlet-name>
+ <display-name>Hello World Event (non-Vaadin)</display-name>
+ <portlet-class>com.vaadin.demo.portlet.InterPortletEventPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Inter-portlet events (non-Vaadin)</title>
+ <short-title>Inter-portlet events (non-Vaadin)</short-title>
+ </portlet-info>
+ <supported-processing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:Reply</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:FromVaadin</qname>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:Hello</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:ReplyToVaadin</qname>
+ </supported-publishing-event>
+ <supported-public-render-parameter>HelloState</supported-public-render-parameter>
+ </portlet>
+
<!-- Used by the Portlet mode demo -->
<custom-portlet-mode>
<description>Custom mode</description>
@@ -334,24 +297,26 @@
be serializable and have JAXB binding.
-->
<event-definition>
- <qname xmlns:vaadin="http://www.vaadin.com/hello">vaadin:Hello</qname>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:Hello</qname>
<value-type>java.lang.String</value-type>
</event-definition>
<event-definition>
- <qname xmlns:vaadin="http://www.vaadin.com/hello">vaadin:Reply</qname>
+ <qname xmlns:vaadin="http://vaadin.com/hello">vaadin:Reply</qname>
<value-type>java.lang.String</value-type>
</event-definition>
<public-render-parameter>
<identifier>HelloState</identifier>
- <qname xmlns:vaadin="http://www.vaadin.com/params">vaadin:HelloState</qname>
+ <qname xmlns:vaadin="http://vaadin.com/params">vaadin:HelloState</qname>
</public-render-parameter>
<!--
This can be used to work around an issue in liferay 5.0-5.1.1
- <container-runtime-option> <name>javax.portlet.escapeXml</name>
- <value>false</value> </container-runtime-option>
+ <container-runtime-option>
+ <name>javax.portlet.escapeXml</name>
+ <value>false</value>
+ </container-runtime-option>
-->
</portlet-app> \ No newline at end of file
diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml
index 6b6b681525..a30990e896 100644
--- a/WebContent/WEB-INF/web.xml
+++ b/WebContent/WEB-INF/web.xml
@@ -370,13 +370,11 @@
<servlet-mapping>
<servlet-name>FeatureBrowser</servlet-name>
<url-pattern>/FeatureBrowser/*</url-pattern>
- <!-- portlet style=height:650px -->
</servlet-mapping>
<servlet-mapping>
<servlet-name>Sampler</servlet-name>
<url-pattern>/sampler/*</url-pattern>
- <!-- portlet style=height:650px -->
</servlet-mapping>
<servlet-mapping>
@@ -407,7 +405,6 @@
<servlet-mapping>
<servlet-name>ModalWindow</servlet-name>
<url-pattern>/ModalWindow/*</url-pattern>
- <!-- portlet -->
</servlet-mapping>
<servlet-mapping>
@@ -418,7 +415,6 @@
<servlet-mapping>
<servlet-name>Calc</servlet-name>
<url-pattern>/Calc/*</url-pattern>
- <!-- portlet -->
</servlet-mapping>
<servlet-mapping>
@@ -437,7 +433,6 @@
<servlet-mapping>
<servlet-name>ChatServlet</servlet-name>
<url-pattern>/chat/*</url-pattern>
- <!-- portlet -->
</servlet-mapping>
<servlet-mapping>
diff --git a/build/build.xml b/build/build.xml
index bc3a3a4775..fe83c7449f 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -562,13 +562,6 @@
<include name="**/*" />
</fileset>
</copy>
- <java classname="com.vaadin.buildhelpers.PortletConfigurationGenerator" failonerror="yes" fork="yes" maxmemory="512m">
- <arg value="${output-dir}/WebContent/WEB-INF" />
- <arg value="com.vaadin.portal.gwt.PortalDefaultWidgetSet" />
- <classpath>
- <pathelement location="build/buildhelpers/" />
- </classpath>
- </java>
</target>
<target name="compile-fileupload">
diff --git a/build/buildhelpers/com/vaadin/buildhelpers/PortletConfigurationGenerator.java b/build/buildhelpers/com/vaadin/buildhelpers/PortletConfigurationGenerator.java
deleted file mode 100644
index 24cb6e5a76..0000000000
--- a/build/buildhelpers/com/vaadin/buildhelpers/PortletConfigurationGenerator.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/**
- *
- */
-package com.vaadin.buildhelpers;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.nio.charset.Charset;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Generates portlet.xml, liferay-portlet.xml, liferay-display.xml from web.xml.
- * Currently uses regular expressions to avoid dependencies; does not strictly
- * adhere to xml rules, but should work with a 'normal' web.xml.
- *
- * To be included, the servlet-mapping must include a special comment: <!--
- * portlet --> If the portlet requires some special styles (i.e height): <!--
- * portlet style=height:400px -->
- *
- * @author marc
- */
-public class PortletConfigurationGenerator {
- // can be changed for debugging:
- private static final String WEB_XML_FILE = "web.xml";
- private static final String PORTLET_XML_FILE = "portlet.xml";
- private static final String LIFERAY_PORTLET_XML_FILE = "liferay-portlet.xml";
- private static final String LIFERAY_DISPLAY_XML_FILE = "liferay-display.xml";
- private static final String JBOSS_OBJECT_FILE = "vaadin-object.xml";
- private static final String JBOSS_INSTANCE_FILE = "portlet-instances.xml";
-
- // "templates" follow;
- private static final String PORTLET_XML_HEAD = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<portlet-app\n"
- + " xmlns=\"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd\"\n"
- + " version=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
- + " xsi:schemaLocation=\"http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd\">\n";
- private static final String PORTLET_XML_SECTION = " <portlet>\n"
- + " <portlet-name>%PORTLETNAME%</portlet-name>\n"
- + " <display-name>Vaadin %NAME%</display-name>\n"
- + " <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet</portlet-class>\n"
- + " <init-param>\n"
- + " <name>application</name>\n"
- + " <value>%URL%</value>\n"
- + " </init-param>\n"
- + " %EXTRAPARAMS%\n"
- + " <supports>\n"
- + " <mime-type>text/html</mime-type>\n"
- + " <portlet-mode>view</portlet-mode>\n"
- + " <portlet-mode>edit</portlet-mode>\n"
- + " <portlet-mode>help</portlet-mode>\n"
- + " </supports>\n"
- + " <portlet-info>\n"
- + " <title>%NAME%</title>\n"
- + " <short-title>%NAME%</short-title>\n"
- + " </portlet-info>\n" + " \n"
- + " <security-role-ref>\n"
- + " <role-name>administrator</role-name>\n"
- + " </security-role-ref>\n"
- + " <security-role-ref>\n"
- + " <role-name>guest</role-name>\n"
- + " </security-role-ref>\n"
- + " <security-role-ref>\n"
- + " <role-name>power-user</role-name>\n"
- + " </security-role-ref>\n"
- + " <security-role-ref>\n"
- + " <role-name>user</role-name>\n"
- + " </security-role-ref>\n" + " </portlet>\n";
- private static final String PORTLET_XML_FOOT = "\n" + "</portlet-app>";
-
- private static final String LIFERAY_PORTLET_XML_HEAD = "<?xml version=\"1.0\"?>\n"
- + "<!DOCTYPE liferay-portlet-app PUBLIC \"-//Liferay//DTD Portlet Application 4.3.0//EN\" \"http://www.liferay.com/dtd/liferay-portlet-app_4_3_0.dtd\">\n"
- + "\n" + "<liferay-portlet-app>\n" + "";
- private static final String LIFERAY_PORTLET_XML_SECTION = " <portlet>\n"
- + " <portlet-name>%PORTLETNAME%</portlet-name>\n"
- + " <instanceable>true</instanceable> \n"
- + " <ajaxable>false</ajaxable>\n"
- + " </portlet>\n" + "";
- private static final String LIFERAY_PORTLET_XML_FOOT = " \n"
- + " <role-mapper>\n"
- + " <role-name>administrator</role-name>\n"
- + " <role-link>Administrator</role-link>\n"
- + " </role-mapper>\n" + " <role-mapper>\n"
- + " <role-name>guest</role-name>\n"
- + " <role-link>Guest</role-link>\n"
- + " </role-mapper>\n" + " <role-mapper>\n"
- + " <role-name>power-user</role-name>\n"
- + " <role-link>Power User</role-link>\n"
- + " </role-mapper>\n" + " <role-mapper>\n"
- + " <role-name>user</role-name>\n"
- + " <role-link>User</role-link>\n"
- + " </role-mapper>\n" + " \n"
- + "</liferay-portlet-app>";
- private static final String LIFERAY_DISPLAY_XML_HEAD = "<?xml version=\"1.0\"?>\n"
- + "<!DOCTYPE display PUBLIC \"-//Liferay//DTD Display 4.0.0//EN\" \"http://www.liferay.com/dtd/liferay-display_4_0_0.dtd\">\n"
- + "\n"
- + "<display>\n"
- + " <category name=\"Vaadin\">\n" + "";
- private static final String LIFERAY_DISPLAY_XML_SECTION = " <portlet id=\"%PORTLETNAME%\" />\n";
- private static final String LIFERAY_DISPLAY_XML_FOOT = "\n"
- + " </category>\n" + "</display>";
-
- private static final String JBOSS_INSTANCE_HEAD = "<?xml version=\"1.0\" standalone=\"yes\"?>\r\n"
- + "<!DOCTYPE deployments PUBLIC\r\n"
- + " \"-//JBoss Portal//DTD Portlet Instances 2.6//EN\"\r\n"
- + " \"http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd\">\r\n"
- + "<deployments>\r\n";
- private static final String JBOSS_INSTANCE_SECTION = " <deployment>\r\n <instance>\r\n"
- + " <instance-id>%PORTLETNAME%Instance</instance-id>\r\n"
- + " <portlet-ref>%PORTLETNAME%</portlet-ref>\r\n"
- + " </instance>\r\n </deployment>\r\n";
- private static final String JBOSS_INSTANCE_FOOT = "</deployments>";
- private static final String JBOSS_OBJECT_HEAD = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
- + "<!DOCTYPE deployments PUBLIC\r\n"
- + " \"-//JBoss Portal//DTD Portal Object 2.6//EN\"\r\n"
- + " \"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd\">\r\n"
- + "<deployments>\r\n";
- private static final String JBOSS_OBJECT_SECTION = " <deployment>\r\n"
- + " <parent-ref>default.default</parent-ref>\r\n"
- + " <if-exists>overwrite</if-exists>"
- + " <window>\r\n"
- + " <window-name>%PORTLETNAME%Window</window-name>\r\n"
- + " <content>\r\n"
- + " <content-type>portlet</content-type>\r\n"
- + " <content-uri>%PORTLETNAME%Instance</content-uri>\r\n"
- + " </content>\r\n"
- + " <region>center</region>\r\n"
- + " <height>1</height>\r\n"
- + " </window>\r\n </deployment>\r\n";
- private static final String JBOSS_OBJECT_FOOT = "</deployments>";
-
- /**
- * @param args
- * <path to directory with web.xml> [default widgetset to use]
- */
- public static void main(String[] args) {
- if (args.length < 1 || !new File(args[0]).isDirectory()) {
- System.err
- .println("Usage: PortletConfigurationGenerator <directory> [widgetset]");
- return;
- }
-
- String widgetset = "";
- if (args.length > 1) {
- widgetset = args[1];
- }
-
- /*
- * Read web.xml
- */
- File dir = new File(args[0]);
- File webxmlFile = new File(dir.getAbsolutePath() + File.separatorChar
- + WEB_XML_FILE);
- String webXml = "";
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(webxmlFile));
- String line = in.readLine();
- while (line != null) {
- webXml += line;
- line = in.readLine();
- }
- } catch (FileNotFoundException e1) {
- System.out.println(webxmlFile + " not found!");
- return;
- } catch (IOException e2) {
- System.out.println("IOException while reading " + webxmlFile);
- webXml = null;
- }
- try {
- if (in != null) {
- in.close();
- }
- } catch (IOException e1) {
- System.out.println("IOException while closing " + webxmlFile);
- }
- if (webXml == null) {
- System.out.println("Could not read web.xml!");
- return;
- }
-
- /*
- * Open outputs
- */
-
- // Open portlet.xml
- File portletXmlFile = new File(args[0] + File.separatorChar
- + PORTLET_XML_FILE);
- OutputStreamWriter pout = null;
- try {
- pout = new OutputStreamWriter(new FileOutputStream(portletXmlFile),
- Charset.forName("UTF-8"));
- } catch (FileNotFoundException e) {
- System.out.println(portletXmlFile + " not found!");
- }
- // open liferay-portlet.xml
- File liferayPortletXmlFile = new File(args[0] + File.separatorChar
- + LIFERAY_PORTLET_XML_FILE);
- OutputStreamWriter lpout = null;
- try {
- lpout = new OutputStreamWriter(new FileOutputStream(
- liferayPortletXmlFile), Charset.forName("UTF-8"));
- } catch (FileNotFoundException e) {
- System.out.println(liferayPortletXmlFile + " not found!");
- }
- // open liferay-display.xml
- File liferayDisplayXmlFile = new File(args[0] + File.separatorChar
- + LIFERAY_DISPLAY_XML_FILE);
- OutputStreamWriter ldout = null;
- try {
- ldout = new OutputStreamWriter(new FileOutputStream(
- liferayDisplayXmlFile), Charset.forName("UTF-8"));
- } catch (FileNotFoundException e) {
- System.out.println(liferayDisplayXmlFile + " not found!");
- }
- // open jboss object.xml
- File jbossObjectXmlFile = new File(args[0] + File.separatorChar
- + JBOSS_OBJECT_FILE);
- OutputStreamWriter joout = null;
- try {
- joout = new OutputStreamWriter(new FileOutputStream(
- jbossObjectXmlFile), Charset.forName("UTF-8"));
- } catch (FileNotFoundException e) {
- System.out.println(jbossObjectXmlFile + " not found!");
- }
- // open jboss instance.xml
- File jbossInstanceXmlFile = new File(args[0] + File.separatorChar
- + JBOSS_INSTANCE_FILE);
- OutputStreamWriter jiout = null;
- try {
- jiout = new OutputStreamWriter(new FileOutputStream(
- jbossInstanceXmlFile), Charset.forName("UTF-8"));
- } catch (FileNotFoundException e) {
- System.out.println(jbossInstanceXmlFile + " not found!");
- }
-
- if (pout != null && lpout != null && ldout != null && joout != null
- && jiout != null) {
-
- String pstring = PORTLET_XML_HEAD;
- String lpstring = LIFERAY_PORTLET_XML_HEAD;
- String ldstring = LIFERAY_DISPLAY_XML_HEAD;
- String jostring = JBOSS_OBJECT_HEAD;
- String jistring = JBOSS_INSTANCE_HEAD;
-
- Pattern p1 = Pattern
- .compile("<servlet-mapping>.*?<servlet-name>(.*?)<\\/servlet-name>.*?<url-pattern>(.*?)<\\/url-pattern>(.*?)<\\/servlet-mapping>");
- Pattern p2 = Pattern
- .compile(".*?<!--\\s+portlet\\s?style=([^ ]*)?\\s+-->.*?");
- Pattern findWidgetset = Pattern
- .compile("<init-param>.*?<param-name>widgetset<\\/param-name>.*?<param-value>(.*?)<\\/param-value>");
-
- Matcher m = p1.matcher(webXml);
- while (m.find()) {
- if (m.groupCount() < 3) {
- // don't include
- continue;
- }
-
- String name = m.group(1);
- // remove leading- and trailing whitespace
- name = name.replaceAll("^\\s*", "");
- name = name.replaceAll("\\s*$", "");
-
- String comment = m.group(3);
- Matcher m2 = p2.matcher(comment);
- if (!m2.find()) {
- // don't include
- continue;
- }
-
- String style = "";
- if (m2.groupCount() == 1 && m2.group(1) != null
- && !m2.group(1).equals("")) {
- style = "<init-param><name>style</name><value>"
- + m2.group(1) + "</value></init-param>";
- }
-
- // Find widgetset
- Pattern findServlet = Pattern
- .compile("<servlet>.*?<servlet-name>" + name
- + "<\\/servlet-name>(.*?)<\\/servlet>");
- Matcher servletMatcher = findServlet.matcher(webXml);
- if (servletMatcher.find()) {
- String servletXml = servletMatcher.group(1);
- Matcher widgetsetMatcher = findWidgetset
- .matcher(servletXml);
- if (widgetsetMatcher.find()) {
- String definedWidgetSet = widgetsetMatcher.group(1);
- if (!definedWidgetSet.equals(widgetset)) {
- System.err
- .println("WARNING: Widgetset in web.xml ("
- + definedWidgetSet
- + ") does not match used ("
- + widgetset + ")");
- }
- }
- }
-
- if (widgetset != null && !widgetset.equals("")) {
- System.err.println("Using widgetset: " + widgetset);
- style += "\n "
- + "<init-param><name>widgetset</name><value>"
- + widgetset + "</value></init-param>";
-
- }
-
- String pname = name + "Portlet";
- String url = m.group(2);
- // remove leading- and trailing whitespace
- url = url.replaceAll("^\\s*", "");
- url = url.replaceAll("\\s*$", "");
- if (url.startsWith("/")) {
- url = url.substring(1);
- }
- if (url.endsWith("*")) {
- url = url.substring(0, url.length() - 1);
- }
- if (url.endsWith("/")) {
- url = url.substring(0, url.length() - 1);
- }
-
- System.out.println("Mapping " + pname + " to " + url);
-
- String s = PORTLET_XML_SECTION;
- s = s.replaceAll("%NAME%", name);
- s = s.replaceAll("%PORTLETNAME%", pname);
- s = s.replaceAll("%URL%", url);
- s = s.replaceAll("%EXTRAPARAMS%", style);
-
- pstring += s;
-
- s = LIFERAY_PORTLET_XML_SECTION;
- s = s.replaceAll("%NAME%", name);
- s = s.replaceAll("%PORTLETNAME%", pname);
- s = s.replaceAll("%URL%", url);
- lpstring += s;
-
- s = LIFERAY_DISPLAY_XML_SECTION;
- s = s.replaceAll("%NAME%", name);
- s = s.replaceAll("%PORTLETNAME%", pname);
- s = s.replaceAll("%URL%", url);
- ldstring += s;
-
- s = JBOSS_OBJECT_SECTION;
- s = s.replaceAll("%NAME%", name);
- s = s.replaceAll("%PORTLETNAME%", pname);
- s = s.replaceAll("%URL%", url);
- jostring += s;
-
- s = JBOSS_INSTANCE_SECTION;
- s = s.replaceAll("%NAME%", name);
- s = s.replaceAll("%PORTLETNAME%", pname);
- s = s.replaceAll("%URL%", url);
- jistring += s;
-
- }
-
- pstring += PORTLET_XML_FOOT;
- lpstring += LIFERAY_PORTLET_XML_FOOT;
- ldstring += LIFERAY_DISPLAY_XML_FOOT;
- jostring += JBOSS_OBJECT_FOOT;
- jistring += JBOSS_INSTANCE_FOOT;
-
- try {
- pout.write(pstring);
- lpout.write(lpstring);
- ldout.write(ldstring);
- joout.write(jostring);
- jiout.write(jistring);
- } catch (IOException e) {
- System.out.println("Write FAILED:" + e);
- }
-
- }
-
- try {
- if (pout != null) {
- pout.close();
- }
- if (lpout != null) {
- lpout.close();
- }
- if (ldout != null) {
- ldout.close();
- }
- if (joout != null) {
- joout.close();
- }
- if (jiout != null) {
- jiout.close();
- }
- } catch (IOException e) {
- System.out.println("Close FAILED: " + e);
- }
- System.out.println("Done.");
- }
-}
diff --git a/build/package/WebContent/WEB-INF/web.xml b/build/package/WebContent/WEB-INF/web.xml
index 7048ffd64e..0d7af3dae2 100644
--- a/build/package/WebContent/WEB-INF/web.xml
+++ b/build/package/WebContent/WEB-INF/web.xml
@@ -135,8 +135,6 @@
<servlet-mapping>
<servlet-name>PortletDemo</servlet-name>
<url-pattern>/PortletDemo/*</url-pattern>
- <!-- Hint for the automatic deployment descriptor generator -->
- <!-- portlet style= -->
</servlet-mapping>
<servlet-mapping>
<servlet-name>VaadinApplicationRunner</servlet-name>
@@ -149,8 +147,6 @@
<servlet-mapping>
<servlet-name>Sampler</servlet-name>
<url-pattern>/sampler/*</url-pattern>
- <!-- Hint for the automatic deployment descriptor generator -->
- <!-- portlet style=height:650px -->
</servlet-mapping>
<servlet-mapping>
<servlet-name>AddressBook</servlet-name>
@@ -163,8 +159,6 @@
<servlet-mapping>
<servlet-name>Calc</servlet-name>
<url-pattern>/Calc/*</url-pattern>
- <!-- Hint for the automatic deployment descriptor generator -->
- <!-- portlet style= -->
</servlet-mapping>
<servlet-mapping>
<servlet-name>ColorPickerApplication</servlet-name>