Author: david.borruat
Date: 2010-05-04 05:30:47 -0400 (Tue, 04 May 2010)
New Revision: 2968
Added:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/
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/webapp/jsp/welcome.jsp
Removed:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/pom.xml
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/WEB-INF/portlet.xml
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/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:
new portlet auto change skin
Modified: sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/pom.xml
===================================================================
--- sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/pom.xml 2010-05-04
09:20:08 UTC (rev 2967)
+++ sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/pom.xml 2010-05-04
09:30:47 UTC (rev 2968)
@@ -13,10 +13,10 @@
</parent>
-->
<groupId>org.gatein.portal.examples.portlets</groupId>
- <artifactId>gatein-jsp-hellouser</artifactId>
+ <artifactId>gatein-jsp-cssinjection</artifactId>
<version>3.0.0-unine-SNAPSHOT</version>
<packaging>war</packaging>
- <name>GateIn Portal Examples - JSP Hello User Portlet</name>
+ <name>GateIn Portlet Examples - CSS injection portlet</name>
<build>
<plugins>
Copied:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
(from rev 2937,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/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/JSPCSSInjection.java
(rev 0)
+++
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java 2010-05-04
09:30:47 UTC (rev 2968)
@@ -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 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);
+ }
+
+
+}
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/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-04
09:20:08 UTC (rev 2967)
+++
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-05-04
09:30:47 UTC (rev 2968)
@@ -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);
- }
-
-
-}
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:20:08 UTC (rev 2967)
+++
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:30:47 UTC (rev 2968)
@@ -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>JSPHelloUserPortlet</portlet-name>
-
<portlet-class>org.jboss.portal.portlet.samples.JSPHelloUserPortlet</portlet-class>
+ <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>
@@ -14,7 +14,7 @@
<portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>JSP Hello User Portlet</title>
+ <title>JSP CSS Injection Portlet</title>
</portlet-info>
</portlet>
</portlet-app>
\ No newline at end of file
Copied: sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin (from rev 2937,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet)
Modified: sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/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/jspautochangeskin/pom.xml 2010-05-04
09:30:47 UTC (rev 2968)
@@ -13,10 +13,10 @@
</parent>
-->
<groupId>org.gatein.portal.examples.portlets</groupId>
- <artifactId>gatein-jsp-hellouser</artifactId>
+ <artifactId>gatein-jsp-cssinjection</artifactId>
<version>3.0.0-unine-SNAPSHOT</version>
<packaging>war</packaging>
- <name>GateIn Portal Examples - JSP Hello User Portlet</name>
+ <name>GateIn Portlet Examples - CSS injection portlet</name>
<build>
<plugins>
Copied:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
(from rev 2937,
sandbox/mobile_delivery/trunk/examples/portlets/davidportlet/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java)
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPCSSInjection.java
(rev 0)
+++
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)
@@ -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 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);
+ }
+
+
+}
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/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/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-05-04
09:30:47 UTC (rev 2968)
@@ -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);
- }
-
-
-}
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/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/jspautochangeskin/src/main/webapp/WEB-INF/portlet.xml 2010-05-04
09:30:47 UTC (rev 2968)
@@ -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>JSPHelloUserPortlet</portlet-name>
-
<portlet-class>org.jboss.portal.portlet.samples.JSPHelloUserPortlet</portlet-class>
+ <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>
@@ -14,7 +14,7 @@
<portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>JSP Hello User Portlet</title>
+ <title>JSP CSS Injection Portlet</title>
</portlet-info>
</portlet>
</portlet-app>
\ No newline at end of file
Deleted:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/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/jspautochangeskin/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:30:47 UTC (rev 2968)
@@ -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/jspautochangeskin/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/jspautochangeskin/src/main/webapp/jsp/welcome.jsp
(rev 0)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:30:47 UTC (rev 2968)
@@ -0,0 +1,37 @@
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+
+<div class="portlet-section-header">Welcome !</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>
\ No newline at end of file
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:20:08 UTC (rev 2967)
+++
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)
@@ -39,17 +39,10 @@
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:20:08 UTC (rev 2967)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp 2010-05-04
09:30:47 UTC (rev 2968)
@@ -1,32 +1,56 @@
<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
-<style type="text/css">
- .Default { background:navy }
- /* .UIWorkingWorkspace { width: 500px } */
+ <style type="text/css">
+ .Default { background:navy }
+ /* .UIWorkingWorkspace { width: 500px } */
</style>
<SCRIPT type="text/javascript">
<!--
-function change()
+function changeContent()
{
-
document.getElementById('SITEBODY-VIEW-BLOCK').innerHTML="la_valeur_que_tu_veux_�crire";
-
+ document.getElementById('SITEBODY-VIEW-BLOCK').innerHTML="Bad element by
ID but it works !";
}
-function addHTML()
+function writeHTML()
{
- //
- //document.write("<style type='text/css'> .UIWorkingWorkspace {
width: 500px } </style>");
- // document.write("hello you");
//document.open();
- document.write("User-agent header: " + navigator.userAgent);
- document.write("<style type=\"text/css\"> .UIWorkingWorkspace {
width: 500px } </style>");
+ 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;
}
+function changeSkin()
+{
+
+
location.href="http://localhost:8080/portal/private/iPhone_with_skin/home?portal:componentId=UISkinSelector&portal:action=Save&skin=iPhoneSkin";
+
+}
+
//-->
</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:change()"> Change content by ID </div>
-<div onclick="javascript:addHTML()"> Insert HTML in the code
</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