diff options
author | Marc Englund <marc.englund@itmill.com> | 2008-04-15 09:16:32 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2008-04-15 09:16:32 +0000 |
commit | 671708d240a998f33b32c9759270312ff5c83697 (patch) | |
tree | 69789b3b21622661c5ad9212d440aa698e2ba0c5 | |
parent | c95bf3d9ff40e79174536905450c9e62b4ef3eee (diff) | |
download | vaadin-framework-671708d240a998f33b32c9759270312ff5c83697.tar.gz vaadin-framework-671708d240a998f33b32c9759270312ff5c83697.zip |
Strange Liferay / Portlet problem fixed, intermediate commit.
svn changeset:4177/svn branch:trunk
-rw-r--r-- | WebContent/WEB-INF/liferay-display.xml | 6 | ||||
-rw-r--r-- | WebContent/WEB-INF/liferay-portlet.xml | 6 | ||||
-rw-r--r-- | WebContent/WEB-INF/portlet.xml | 12 | ||||
-rw-r--r-- | WebContent/WEB-INF/web.xml | 15 | ||||
-rw-r--r-- | portlet-src/com/itmill/toolkit/demo/PortletDemo.java | 23 | ||||
-rw-r--r-- | portlet-src/com/itmill/toolkit/terminal/gwt/server/ITMillApplicationPortlet.java (renamed from portlet-src/com/itmill/toolkit/terminal/gwt/server/ApplicationPortlet.java) | 8 |
6 files changed, 44 insertions, 26 deletions
diff --git a/WebContent/WEB-INF/liferay-display.xml b/WebContent/WEB-INF/liferay-display.xml index 8ba4a93f7f..c0a3308aa3 100644 --- a/WebContent/WEB-INF/liferay-display.xml +++ b/WebContent/WEB-INF/liferay-display.xml @@ -3,8 +3,8 @@ <display>
<category name="IT Mill Toolkit">
- <portlet id="PortletDemo" />
- <portlet id="Calc" />
- <portlet id="FeatureBrowser" />
+ <portlet id="PortletDemoPortlet" />
+ <portlet id="CalcPortlet" />
+ <portlet id="FeatureBrowserPortlet" />
</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 d445af65a7..d863fdac60 100644 --- a/WebContent/WEB-INF/liferay-portlet.xml +++ b/WebContent/WEB-INF/liferay-portlet.xml @@ -4,17 +4,17 @@ <liferay-portlet-app>
<portlet>
- <portlet-name>PortletDemo</portlet-name>
+ <portlet-name>PortletDemoPortlet</portlet-name>
<instanceable>true</instanceable>
<ajaxable>false</ajaxable>
</portlet>
<portlet>
- <portlet-name>Calc</portlet-name>
+ <portlet-name>CalcPortlet</portlet-name>
<instanceable>true</instanceable>
<ajaxable>false</ajaxable>
</portlet>
<portlet>
- <portlet-name>FeatureBrowser</portlet-name>
+ <portlet-name>FeatureBrowserPortlet</portlet-name>
<instanceable>true</instanceable>
<ajaxable>false</ajaxable>
</portlet>
diff --git a/WebContent/WEB-INF/portlet.xml b/WebContent/WEB-INF/portlet.xml index e0b00b5dae..dc48102bc5 100644 --- a/WebContent/WEB-INF/portlet.xml +++ b/WebContent/WEB-INF/portlet.xml @@ -5,9 +5,9 @@ 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">
<portlet>
- <portlet-name>PortletDemo</portlet-name>
+ <portlet-name>PortletDemoPortlet</portlet-name>
<display-name>IT Mill Toolkit PortletDemo</display-name>
- <portlet-class>com.itmill.toolkit.terminal.gwt.server.ApplicationPortlet</portlet-class>
+ <portlet-class>com.itmill.toolkit.terminal.gwt.server.ITMillApplicationPortlet</portlet-class>
<init-param>
<name>application</name>
<value>PortletDemo</value>
@@ -37,9 +37,9 @@ </security-role-ref>
</portlet>
<portlet>
- <portlet-name>FeatureBrowser</portlet-name>
+ <portlet-name>FeatureBrowserPortlet</portlet-name>
<display-name>IT Mill Toolkit FeatureBrowser</display-name>
- <portlet-class>com.itmill.toolkit.terminal.gwt.server.ApplicationPortlet</portlet-class>
+ <portlet-class>com.itmill.toolkit.terminal.gwt.server.ITMillApplicationPortlet</portlet-class>
<init-param>
<name>application</name>
<value>FeatureBrowser</value>
@@ -69,9 +69,9 @@ </security-role-ref>
</portlet>
<portlet>
- <portlet-name>Calc</portlet-name>
+ <portlet-name>CalcPortlet</portlet-name>
<display-name>IT Mill Toolkit Calc</display-name>
- <portlet-class>com.itmill.toolkit.terminal.gwt.server.ApplicationPortlet</portlet-class>
+ <portlet-class>com.itmill.toolkit.terminal.gwt.server.ITMillApplicationPortlet</portlet-class>
<init-param>
<name>application</name>
<value>Calc</value>
diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 78508e6b67..02817d0816 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -20,7 +20,7 @@ <context-param> <param-name>testingToolsServerUri</param-name> - <param-value>http://192.168.1.120:8099/TestingToolsServer</param-value> + <param-value>http://192.168.1.242:8099/TestingToolsServer</param-value> <description>IT Mill Testing Tools URI</description> </context-param> @@ -383,6 +383,19 @@ <param-value>com.itmill.toolkit.demo.WindowedDemos</param-value>
</init-param>
</servlet> +
+ <servlet>
+ <servlet-name>PortletDemo</servlet-name>
+ <servlet-class>com.itmill.toolkit.terminal.gwt.server.ApplicationServlet</servlet-class>
+ <init-param>
+ <param-name>application</param-name>
+ <param-value>com.itmill.toolkit.demo.PortletDemo</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>PortletDemo</servlet-name>
+ <url-pattern>/PortletDemo/*</url-pattern>
+ </servlet-mapping>
<servlet-mapping> <servlet-name>ITMillToolkitApplicationRunner</servlet-name> diff --git a/portlet-src/com/itmill/toolkit/demo/PortletDemo.java b/portlet-src/com/itmill/toolkit/demo/PortletDemo.java index d519874812..98859653f0 100644 --- a/portlet-src/com/itmill/toolkit/demo/PortletDemo.java +++ b/portlet-src/com/itmill/toolkit/demo/PortletDemo.java @@ -37,10 +37,8 @@ public class PortletDemo extends Application { tf.setEnabled(false);
main.addComponent(tf);
- portletEdit.setCaption("Portlet edit/view");
portletEdit.setEnabled(false);
main.addComponent(portletEdit);
- portletMax.setCaption("Maximize/normal portlet");
portletMax.setEnabled(false);
main.addComponent(portletMax);
@@ -48,7 +46,8 @@ public class PortletDemo extends Application { PortletApplicationContext ctx = (PortletApplicationContext) getContext();
ctx.addPortletListener(this, new DemoPortletListener());
} else {
- getMainWindow().showNotification("Not inited via Portal!");
+ getMainWindow().showNotification("Not inited via Portal!",
+ Notification.TYPE_ERROR_MESSAGE);
}
}
@@ -64,11 +63,15 @@ public class PortletDemo extends Application { public void handleRenderRequest(RenderRequest request,
RenderResponse response) {
+ portletEdit.setEnabled(true);
+ portletMax.setEnabled(true);
+ tf.setEnabled((request.getPortletMode() == PortletMode.EDIT));
+
getMainWindow().showNotification(
"Portlet status",
- "mode: " + request.getPortletMode() + "<br/> state: "
+ "Mode: " + request.getPortletMode() + " State: "
+ request.getWindowState(),
- Notification.TYPE_TRAY_NOTIFICATION);
+ Notification.TYPE_WARNING_MESSAGE);
PortletURL url = response.createActionURL();
try {
@@ -76,6 +79,9 @@ public class PortletDemo extends Application { .setPortletMode((request.getPortletMode() == PortletMode.VIEW ? PortletMode.EDIT
: PortletMode.VIEW));
portletEdit.setResource(new ExternalResource(url.toString()));
+ portletEdit
+ .setCaption((request.getPortletMode() == PortletMode.VIEW ? "Edit"
+ : "Done"));
} catch (Exception e) {
portletEdit.setEnabled(false);
}
@@ -85,9 +91,12 @@ public class PortletDemo extends Application { url
.setWindowState((request.getWindowState() == WindowState.NORMAL ? WindowState.MAXIMIZED
: WindowState.NORMAL));
- portletEdit.setResource(new ExternalResource(url.toString()));
+ portletMax.setResource(new ExternalResource(url.toString()));
+ portletMax
+ .setCaption((request.getWindowState() == WindowState.NORMAL ? "Maximize"
+ : "Back to normal"));
} catch (Exception e) {
- portletEdit.setEnabled(false);
+ portletMax.setEnabled(false);
}
}
diff --git a/portlet-src/com/itmill/toolkit/terminal/gwt/server/ApplicationPortlet.java b/portlet-src/com/itmill/toolkit/terminal/gwt/server/ITMillApplicationPortlet.java index 5a924cd41a..7c744dc4c2 100644 --- a/portlet-src/com/itmill/toolkit/terminal/gwt/server/ApplicationPortlet.java +++ b/portlet-src/com/itmill/toolkit/terminal/gwt/server/ITMillApplicationPortlet.java @@ -15,7 +15,7 @@ import javax.portlet.RenderResponse; import com.itmill.toolkit.Application;
-public class ApplicationPortlet implements Portlet {
+public class ITMillApplicationPortlet implements Portlet {
// The application to show
protected String app = "Calc";
// some applications might require that the height is specified
@@ -61,10 +61,7 @@ public class ApplicationPortlet implements Portlet { response.setContentType("text/html");
PrintWriter out = response.getWriter();
- out.println("<h1>WTF?</h1>");
-
if (app != null) {
- System.err.println("WTFFF???");
PortletSession sess = request.getPortletSession();
PortletApplicationContext ctx = PortletApplicationContext
.getApplicationContext(sess);
@@ -78,8 +75,7 @@ public class ApplicationPortlet implements Portlet { -*/
PortletRequestDispatcher dispatcher = sess.getPortletContext()
- .getRequestDispatcher(
- "/" + request.getContextPath() + "/" + app);
+ .getRequestDispatcher("/" + app);
try {
// TODO remove:
|