Author: david.borruat
Date: 2010-05-04 06:55:07 -0400 (Tue, 04 May 2010)
New Revision: 2972
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp
Log:
portlets examples ok
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java 2010-05-04
10:07:45 UTC (rev 2971)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/java/org/jboss/portal/portlet/samples/JSPAutoChangeSkin.java 2010-05-04
10:55:07 UTC (rev 2972)
@@ -23,12 +23,14 @@
package org.jboss.portal.portlet.samples;
import java.io.IOException;
+import java.io.PrintWriter;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.UnavailableException;
@@ -38,17 +40,30 @@
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);
- }
+/*
+ String sIsIPhone = (String) request.getParameter("iPhone");
+ if (sIsIPhone.equals("true")) {
+ PortletURL newUrl = response.createRenderURL();
+ //editUrl.setPortletMode(PortletMode.EDIT);
+ newUrl.setParameter("portal:componentId",
"UISkinSelector");
+ newUrl.setParameter("portal:action", "Save");
+ newUrl.setParameter("skin", "iPhoneSkin");
+
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.write("<a
href=\""+newUrl.toString()+"\"> Cliquer ici </a>");
+ writer.close();
+
+
+ }
+ else{
+*/
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
+ prd.include(request, response);
+
+ // }
+
+
}
protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException,
@@ -70,8 +85,9 @@
public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws
PortletException, IOException,
UnavailableException
{
- String sYourname = (String) aRequest.getParameter("yourname");
- aResponse.setRenderParameter("yourname", sYourname);
+ //String sYourname = (String) aRequest.getParameter("yourname");
+ aResponse.setRenderParameter("iPhone", "true");
+
}
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
10:07:45 UTC (rev 2971)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jspautochangeskin/src/main/webapp/jsp/welcome.jsp 2010-05-04
10:55:07 UTC (rev 2972)
@@ -12,4 +12,9 @@
</SCRIPT>
<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
+<div onclick="javascript:changeSkin()">Click to change skin to
iPhone</div>
+<br/>
+<portlet:actionURL var="myActionURL"/>
+<form action="<%= myActionURL %>" method="POST">
+ <input class="portlet-form-button" type="Submit"
value="Change Skin"/>
+</form>
\ No newline at end of file
Show replies by date