Author: david.borruat
Date: 2010-05-04 05:53:33 -0400 (Tue, 04 May 2010)
New Revision: 2969
Added:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp
Removed:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/pom.xml
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/WEB-INF/portlet.xml
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp
Log:
rename davidportlet in jspcssinjection
Modified: sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/pom.xml
===================================================================
--- sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/pom.xml 2010-05-04
09:30:47 UTC (rev 2968)
+++ sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/pom.xml 2010-05-04
09:53:33 UTC (rev 2969)
@@ -13,10 +13,10 @@
</parent>
-->
<groupId>org.gatein.portal.examples.portlets</groupId>
- <artifactId>gatein-jsp-cssinjection</artifactId>
+ <artifactId>gatein-jsp-autochangeskin</artifactId>
<version>3.0.0-unine-SNAPSHOT</version>
<packaging>war</packaging>
- <name>GateIn Portlet Examples - CSS injection portlet</name>
+ <name>GateIn Portlet Examples - Auto Change Skin portlet</name>
<build>
<plugins>
Copied:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java
(from rev 2968,
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java)
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java
(rev 0)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java 2010-05-04
09:53:33 UTC (rev 2969)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.UnavailableException;
+
+public class JSPAutoChangeSkin extends GenericPortlet
+{
+
+ public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ String sYourName = (String) request.getParameter("yourname");
+ if (sYourName != null)
+ {
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
+ prd.include(request, response);
+ }
+ else
+ {
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
+ prd.include(request, response);
+ }
+ }
+
+ protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/help.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws
PortletException, IOException,
+ UnavailableException
+ {
+ String sYourname = (String) aRequest.getParameter("yourname");
+ aResponse.setRenderParameter("yourname", sYourname);
+ }
+
+
+}
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java 2010-05-04
09:30:47 UTC (rev 2968)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,78 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.samples;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.UnavailableException;
-
-public class JSPCSSInjection extends GenericPortlet
-{
-
- public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
- {
- String sYourName = (String) request.getParameter("yourname");
- if (sYourName != null)
- {
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
- prd.include(request, response);
- }
- else
- {
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
- prd.include(request, response);
- }
- }
-
- protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/help.jsp");
- prd.include(rRequest, rResponse);
- }
-
- protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
- prd.include(rRequest, rResponse);
- }
-
- public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws
PortletException, IOException,
- UnavailableException
- {
- String sYourname = (String) aRequest.getParameter("yourname");
- aResponse.setRenderParameter("yourname", sYourname);
- }
-
-
-}
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:30:47 UTC (rev 2968)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:53:33 UTC (rev 2969)
@@ -5,8 +5,8 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
<portlet>
- <portlet-name>JSPCSSInjection</portlet-name>
-
<portlet-class>org.jboss.portal.portlet.samples.JSPCSSInjection</portlet-class>
+ <portlet-name>JSPAutoChangeSkin</portlet-name>
+
<portlet-class>org.jboss.portal.portlet.samples.JSPAutoChangeSkin</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
@@ -14,7 +14,7 @@
<portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>JSP CSS Injection Portlet</title>
+ <title>JSP Auto Change Skin Portlet</title>
</portlet-info>
</portlet>
</portlet-app>
\ No newline at end of file
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:30:47 UTC (rev 2968)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,37 +1,15 @@
<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
-<div class="portlet-section-header">Welcome !</div>
+<SCRIPT type="text/javascript">
+<!--
-<br/>
+function changeSkin()
+{
+
location.href="http://localhost:8080/portal/private/iPhone_with_skin/home?portal:componentId=UISkinSelector&portal:action=Save&skin=iPhoneSkin";
+}
-<div class="portlet-font">
+//-->
+</SCRIPT>
- Welcome on the JSP Hello User portlet,
-my name is JBoss Portal. What's yours ?</div>
-
-<br/>
-
-<div class="portlet-font">Method 1: We simply pass the parameter to the
render phase:<br/>
-<a href="<portlet:renderURL><portlet:param name="yourname"
value="John Doe"/></portlet:renderURL>">John
Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 2: We pass the parameter to the render
phase, using valid markup:
-Please check the source code to see the difference with Method 1.
-<portlet:renderURL var="myRenderURL">
- <portlet:param name="yourname" value='John Doe'/>
-</portlet:renderURL>
-<br/>
-<a href="<%= myRenderURL %>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 3: We use a form:<br/>
-
-<portlet:actionURL var="myActionURL"/>
-<form action="<%= myActionURL %>" method="POST">
- <span class="portlet-form-field-label">Name:</span>
- <input class="portlet-form-input-field" type="text"
name="yourname"/>
- <input class="portlet-form-button" type="Submit"/>
-</form>
-</div>
\ No newline at end of file
+<div class="portlet-section-header">Hidden portlet</div>
+<div onclick="javascript:changeSkin()">Click to change skin to
iPhone</div>
\ No newline at end of file
Copied: sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection (from rev 2937,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet)
Deleted: sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml
===================================================================
--- sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/pom.xml 2010-05-03
11:45:49 UTC (rev 2937)
+++ sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <!--
- the parent isn't required, you can drop it if you add a groupId
- and version
- -->
- <!-- <parent>
- <groupId>org.gatein.portal.examples.portlets</groupId>
- <artifactId>parent</artifactId>
- <version>3.0.0-unine-SNAPSHOT</version>
- </parent>
--->
- <groupId>org.gatein.portal.examples.portlets</groupId>
- <artifactId>gatein-jsp-hellouser</artifactId>
- <version>3.0.0-unine-SNAPSHOT</version>
- <packaging>war</packaging>
- <name>GateIn Portal Examples - JSP Hello User Portlet</name>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml (from rev
2968, sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/pom.xml)
===================================================================
--- sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml
(rev 0)
+++ sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/pom.xml 2010-05-04
09:53:33 UTC (rev 2969)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <!--
+ the parent isn't required, you can drop it if you add a groupId
+ and version
+ -->
+ <!-- <parent>
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>parent</artifactId>
+ <version>3.0.0-unine-SNAPSHOT</version>
+ </parent>
+-->
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>gatein-jsp-cssinjection</artifactId>
+ <version>3.0.0-unine-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>GateIn Portlet Examples - CSS injection portlet</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Copied:
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
(from rev 2968,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java)
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
(rev 0)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java 2010-05-04
09:53:33 UTC (rev 2969)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.UnavailableException;
+
+public class JSPCSSInjection extends GenericPortlet
+{
+
+ public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
+ prd.include(request, response);
+ }
+
+ protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/help.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws
PortletException, IOException,
+ UnavailableException
+ {
+ String sYourname = (String) aRequest.getParameter("yourname");
+ aResponse.setRenderParameter("yourname", sYourname);
+ }
+
+
+}
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-05-03
11:45:49 UTC (rev 2937)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,78 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.samples;
-
-import java.io.IOException;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.UnavailableException;
-
-public class JSPHelloUserPortlet extends GenericPortlet
-{
-
- public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
- {
- String sYourName = (String) request.getParameter("yourname");
- if (sYourName != null)
- {
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
- prd.include(request, response);
- }
- else
- {
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
- prd.include(request, response);
- }
- }
-
- protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/help.jsp");
- prd.include(rRequest, rResponse);
- }
-
- protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
- UnavailableException
- {
- rResponse.setContentType("text/html");
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
- prd.include(rRequest, rResponse);
- }
-
- public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws
PortletException, IOException,
- UnavailableException
- {
- String sYourname = (String) aRequest.getParameter("yourname");
- aResponse.setRenderParameter("yourname", sYourname);
- }
-
-
-}
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/WEB-INF/portlet.xml 2010-05-03
11:45:49 UTC (rev 2937)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
-version="2.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
-
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
- <portlet>
- <portlet-name>JSPHelloUserPortlet</portlet-name>
-
<portlet-class>org.jboss.portal.portlet.samples.JSPHelloUserPortlet</portlet-class>
- <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>JSP Hello User Portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>
\ No newline at end of file
Copied:
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml
(from rev 2968,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/WEB-INF/portlet.xml)
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml
(rev 0)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:53:33 UTC (rev 2969)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+version="2.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
+
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+ <portlet>
+ <portlet-name>JSPCSSInjection</portlet-name>
+
<portlet-class>org.jboss.portal.portlet.samples.JSPCSSInjection</portlet-class>
+ <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>JSP CSS Injection Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/jsp/welcome.jsp 2010-05-03
11:45:49 UTC (rev 2937)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,45 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
-
- <style type="text/css">
- h1 { color: navy; }
- h2 { color: blue; }
- .portlet-font { font-style: italic }
- .Default { width: 300px }
- body { background: #dedf00; font-size: 15px}
- </style>
-
-<div class="portlet-section-header"><h1>Welcome
!</h1></div>
-
-<br/>
-
-<div class="portlet-font">
-
- Welcome on the JSP Hello User portlet,
-my name is JBoss Portal. What's yours ?</div>
-
-<br/>
-
-<div class="portlet-font">Method 1: We simply pass the parameter to the
render phase:<br/>
-<a href="<portlet:renderURL><portlet:param name="yourname"
value="John Doe"/></portlet:renderURL>">John
Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 2: We pass the parameter to the render
phase, using valid markup:
-Please check the source code to see the difference with Method 1.
-<portlet:renderURL var="myRenderURL">
- <portlet:param name="yourname" value='John Doe'/>
-</portlet:renderURL>
-<br/>
-<a href="<%= myRenderURL %>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 3: We use a form:<br/>
-
-<portlet:actionURL var="myActionURL"/>
-<form action="<%= myActionURL %>" method="POST">
- <span class="portlet-form-field-label">Name:</span>
- <input class="portlet-form-input-field" type="text"
name="yourname"/>
- <input class="portlet-form-button" type="Submit"/>
-</form>
-</div>
Copied:
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp
(from rev 2945,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/jsp/welcome.jsp)
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp
(rev 0)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspcssinjection/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:53:33 UTC (rev 2969)
@@ -0,0 +1,48 @@
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+
+ <style type="text/css">
+ .Default { background:navy }
+ /* .UIWorkingWorkspace { width: 500px } */
+ </style>
+
+<SCRIPT type="text/javascript">
+<!--
+function changeContent()
+{
+ document.getElementById('SITEBODY-VIEW-BLOCK').innerHTML="Bad element by
ID but it works !";
+}
+
+function writeHTML()
+{
+ //document.open();
+ document.write("User-agent header: " + navigator.userAgent);
+ document.close();
+}
+
+function isIPhone()
+{
+ var userAgent = navigator.userAgent;
+ if (userAgent.indexOf("iPhone",0) > -1){
+ return true;
+ }
+ return false;
+}
+
+
+//-->
+</SCRIPT>
+
+
+ <div>
+ <script type="text/javascript">
+ var userAgent = navigator.userAgent;
+ if (userAgent.indexOf("iPhone",0) > -1){
+ document.write("<h1>User Agent is iPhone</h1>");
+ document.write("<style type=\"text/css\">
.UIWorkingWorkspace { width: 500px } </style> ");
+ }
+ </script>
+ </div>
+
+<div class="portlet-section-header">Hidden portlet</div>
+<div onclick="javascript:changeContent()">Click to change content by ID
</div>
+<div onclick="javascript:writeHTML()">Click to insert HTML in the code
</div>
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-05-04
09:30:47 UTC (rev 2968)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-05-04
09:53:33 UTC (rev 2969)
@@ -35,14 +35,20 @@
public class JSPHelloUserPortlet extends GenericPortlet
{
-
+
public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
{
-
+ String sYourName = (String) request.getParameter("yourname");
+ if (sYourName != null)
+ {
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
+ prd.include(request, response);
+ }
+ else
+ {
PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
prd.include(request, response);
-
-
+ }
}
protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:30:47 UTC (rev 2968)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:53:33 UTC (rev 2969)
@@ -1,56 +1,37 @@
<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
- <style type="text/css">
- .Default { background:navy }
- /* .UIWorkingWorkspace { width: 500px } */
- </style>
+<div class="portlet-section-header">Welcome !</div>
-<SCRIPT type="text/javascript">
-<!--
-function changeContent()
-{
- document.getElementById('SITEBODY-VIEW-BLOCK').innerHTML="Bad element by
ID but it works !";
-}
+<br/>
-function writeHTML()
-{
- //document.open();
- document.write("User-agent header: " + navigator.userAgent);
- document.close();
-}
+<div class="portlet-font">
-function isIPhone()
-{
- var userAgent = navigator.userAgent;
- if (userAgent.indexOf("iPhone",0) > -1){
- return true;
- }
- return false;
-}
+ Welcome on the JSP Hello User portlet,
+my name is JBoss Portal. What's yours ?</div>
-function changeSkin()
-{
+<br/>
-
location.href="http://localhost:8080/portal/private/iPhone_with_skin/home?portal:componentId=UISkinSelector&portal:action=Save&skin=iPhoneSkin";
+<div class="portlet-font">Method 1: We simply pass the parameter to the
render phase:<br/>
+<a href="<portlet:renderURL><portlet:param name="yourname"
value="John Doe"/></portlet:renderURL>">John
Doe</a></div>
-}
+<br/>
-//-->
-</SCRIPT>
+<div class="portlet-font">Method 2: We pass the parameter to the render
phase, using valid markup:
+Please check the source code to see the difference with Method 1.
+<portlet:renderURL var="myRenderURL">
+ <portlet:param name="yourname" value='John Doe'/>
+</portlet:renderURL>
+<br/>
+<a href="<%= myRenderURL %>">John Doe</a></div>
-<!--
- <div>
- <script type="text/javascript">
- var userAgent = navigator.userAgent;
- if (userAgent.indexOf("iPhone",0) > -1){
- document.write("<h1>User Agent is iPhone</h1>");
- document.write("<style type=\"text/css\">
.UIWorkingWorkspace { width: 500px } </style> ");
- }
- </script>
- </div>
--->
+<br/>
-<div class="portlet-section-header">Hidden portlet</div>
-<div onclick="javascript:changeContent()">Click to change content by ID
</div>
-<div onclick="javascript:writeHTML()">Click to insert HTML in the code
</div>
-<div onclick="javascript:changeSkin()">Click to change skin to
iPhone</div>
\ No newline at end of file
+<div class="portlet-font">Method 3: We use a form:<br/>
+
+<portlet:actionURL var="myActionURL"/>
+<form action="<%= myActionURL %>" method="POST">
+ <span class="portlet-form-field-label">Name:</span>
+ <input class="portlet-form-input-field" type="text"
name="yourname"/>
+ <input class="portlet-form-button" type="Submit"/>
+</form>
+</div>
\ No newline at end of file