From portal-commits at lists.jboss.org Wed Feb 13 19:37:37 2008 Content-Type: multipart/mixed; boundary="===============2218655657928598068==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9958 - in modules/portlet/trunk/test/src: test/resources/simple-portal-war/css and 2 other directories. Date: Wed, 13 Feb 2008 19:37:37 -0500 Message-ID: --===============2218655657928598068== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: wesleyhales Date: 2008-02-13 19:37:37 -0500 (Wed, 13 Feb 2008) New Revision: 9958 Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal= /samples/basic/HeaderPortlet.java modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mast= er.css modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/dem= o3.jsp modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/= header.jsp Log: partial refresh portlet updates Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet= /portal/samples/basic/HeaderPortlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/porta= l/samples/basic/HeaderPortlet.java 2008-02-14 00:37:37 UTC (rev 9958) @@ -23,7 +23,10 @@ package org.jboss.portal.portlet.portal.samples.basic; = import org.w3c.dom.Element; +import org.jboss.portal.portlet.ActionURL; +import org.jboss.portal.portlet.RenderURL; = + import javax.portlet.GenericPortlet; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; @@ -31,6 +34,14 @@ import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; import javax.portlet.ResourceURL; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletSecurityException; +import javax.portlet.PortletURL; +import javax.portlet.PortletPreferences; +import javax.portlet.PortletMode; import java.io.IOException; import java.io.PrintWriter; = @@ -40,11 +51,29 @@ */ public class HeaderPortlet extends GenericPortlet { + public final static int TITANIUM =3D 0; + public final static int PLATINUM =3D 1; + public final static int GOLD =3D 2; + public final static int SILVER =3D 3; + public final static int TIN =3D 4; + + public void processAction(ActionRequest req, ActionResponse resp) throw= s PortletException, PortletSecurityException, IOException + { + + String repeatText =3D req.getParameter("repeat"); + // set zip as render parameter + if (repeatText !=3D null){ + resp.setRenderParameter("repeat", repeatText); + } + // request view + resp.setPortletMode(PortletMode.VIEW); + + } public void render(RenderRequest req, RenderResponse resp) throws Portl= etException, IOException { ResourceURL resourceURL =3D resp.createResourceURL(); - - // + PortletURL actionURL =3D resp.createActionURL(); + // // Element elt =3D resp.createElement("script"); // elt.setAttribute("type", "text/javascript"); // elt.setAttribute("src", resourceURL.toString()); @@ -52,44 +81,109 @@ // resp.addProperty("script", elt); = // + resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); writer.print("" + "" + - "
"); + + ""); + + writer.print("" + + "
" + + "

Partial Refresh Repeater Demo

"); + writer.print("" + + "
" + + "
\n" + + " Repeat Demo:
\n= " + + " \n" + + " \n" + + "
\n" + + "
" + + ""); + writer.print("
"); // "" + // "Cl= ick me to trigger script" + + writer.print("


" + + "

Partial Refresh Product Catalog

" + + "
" + + ""); + writer.print("
"); resourceURL.setParameter("prodId","1"); - writer.print("Product 1
"); + writer.print("Product 1
"); = resourceURL.setParameter("prodId","2"); - writer.print("Product 2
"); + writer.print("Product 2
"); = resourceURL.setParameter("prodId","3"); - writer.print("Product 3
"); + writer.print("Product 3
"); = - writer.print("
" + - "
" + - "
Product Details
"); + writer.print("
"); + writer.print("
" + + "

Product Details

" + + "
" + + ""); + writer.print("
"); + writer.print("
"); + writer.print("
"); + + + + // writer.print(""); } = public void serveResource(ResourceRequest req, ResourceResponse resp) t= hrows PortletException, IOException { + String repeatText =3D req.getParameter("repeat"); + String prodId =3D req.getParameter("prodId"); + String namespace =3Dresp.getNamespace(); //resp.setContentType("application/json"); resp.setContentType("text/html"); PrintWriter writer =3D resp.getWriter(); + if (repeatText !=3D null){ + writer.print("
"+ req.getPrivateParamete= rMap().get("repeat")[0] +"
"); + } + if (prodId !=3D null){ + if (prodId.equals("1")){ + writer.print("
Product ID: "+ prodId= +"" + + "
" + + " B BY BURTON ALPHA
" + + "Sale Price: $314.96 " + + "
"); + } + if (prodId.equals("2")){ + writer.print("
Product ID: "+ prodId= +"" + + "
" + + "FORUM DESTROYER LTD
" + + "$319.99 " + + "
"); + } + if (prodId.equals("3")){ + writer.print("
Product ID: "+ prodId= +"" + + "
" + + "\n" + + "SANTA CRUZ ALLSTAR
" + + "$256.00 " + + "
"); + } = - writer.print("
" + req.getParameter("prodId") +"
"); + } = + + + writer.close(); } } Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/c= ss/master.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/css/mas= ter.css 2008-02-14 00:37:37 UTC (rev 9958) @@ -1,4 +1,5 @@ -body { +body, +div.container { font: normal 12px Lucida Sans, Trebuchet, tahoma, sans-serif; } = @@ -81,6 +82,12 @@ border: 0; } = +.zero { + margin: 0; + padding: 0; + border: 0; +} + body, div, form, Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/d= emo/demo3.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/de= mo3.jsp 2008-02-14 00:37:37 UTC (rev 9958) @@ -8,6 +8,7 @@ = + = Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/l= ayouts/header.jsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-13 21:05:27 UTC (rev 9957) +++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts= /header.jsp 2008-02-14 00:37:37 UTC (rev 9958) @@ -3,7 +3,7 @@ - + Portlet Container 2.0 --===============2218655657928598068==--