From portal-commits at lists.jboss.org Tue Nov 20 17:02:54 2007 Content-Type: multipart/mixed; boundary="===============1071626022194856574==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9053 - in branches/presentation: core-presentation/src/main/org/jboss/portal/core/presentation/server/content/portlet and 2 other directories. Date: Tue, 20 Nov 2007 17:02:54 -0500 Message-ID: --===============1071626022194856574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-11-20 17:02:54 -0500 (Tue, 20 Nov 2007) New Revision: 9053 Modified: branches/presentation/core-presentation/src/main/org/jboss/portal/core/p= resentation/server/MainProcessor.java branches/presentation/core-presentation/src/main/org/jboss/portal/core/p= resentation/server/content/portlet/PresentationPortletInvocationContext.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/client/controller/UIController.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/protocol/PostActivation.java Log: - basic support for URL encoding Modified: branches/presentation/core-presentation/src/main/org/jboss/portal= /core/presentation/server/MainProcessor.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 --- branches/presentation/core-presentation/src/main/org/jboss/portal/core/= presentation/server/MainProcessor.java 2007-11-20 21:37:13 UTC (rev 9052) +++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/= presentation/server/MainProcessor.java 2007-11-20 22:02:54 UTC (rev 9053) @@ -48,6 +48,7 @@ import org.jboss.portal.presentation.model.UIWindow; import org.jboss.portal.presentation.protocol.ErrorResponse; import org.jboss.portal.presentation.protocol.LinkActivation; +import org.jboss.portal.presentation.protocol.PostActivation; import org.jboss.portal.presentation.protocol.ServerAction; import org.jboss.portal.presentation.protocol.ServerResponse; import org.jboss.portal.presentation.protocol.ShowUIObjectResponse; @@ -56,7 +57,10 @@ import org.jboss.portal.presentation.server.ProcessorRequest; import org.jboss.portal.presentation.server.ProcessorResponse; import org.jboss.portal.server.ServerException; +import org.jboss.portal.web.Body; = +import java.util.Map; + /** * @author Sohil Shah * @@ -168,8 +172,21 @@ PortalObjectId poid =3D PortalObjectId.parse(id, PortalObjectP= ath.CANONICAL_FORMAT); Window window =3D (Window)portalObjectContainer.getObject(poid= ); PortletRequestDecoder decoder =3D new PortletRequestDecoder(); - decoder.decode(getActivation.getQueryParameters(), null); = + // Get form parameters if any + Map formParameters =3D null; + if (serverAction instanceof PostActivation) + { + PostActivation post =3D (PostActivation)serverAction; + Body body =3D post.getBody(); + if (body instanceof Body.Form) + { + formParameters =3D ((Body.Form)body).getParameters(); + } + } + + decoder.decode(getActivation.getQueryParameters(), formParamet= ers); + // We assume that for now UIWindow uiWindow =3D (UIWindow)presentationContext.getUIConte= xt().getObject(id); = Modified: branches/presentation/core-presentation/src/main/org/jboss/portal= /core/presentation/server/content/portlet/PresentationPortletInvocationCont= ext.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 --- branches/presentation/core-presentation/src/main/org/jboss/portal/core/= presentation/server/content/portlet/PresentationPortletInvocationContext.ja= va 2007-11-20 21:37:13 UTC (rev 9052) +++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/= presentation/server/content/portlet/PresentationPortletInvocationContext.ja= va 2007-11-20 22:02:54 UTC (rev 9053) @@ -96,7 +96,8 @@ = public String encodeResourceURL(String url) throws IllegalArgumentExcep= tion { - return "todo"; + // Todo improve that + return url; } = public String renderURL(PortletURL portletURL, Boolean wantSecure, Bool= ean wantAuthenticated, boolean relative) Modified: branches/presentation/presentation/src/main/org/jboss/portal/pres= entation/client/controller/UIController.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 --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/client/controller/UIController.java 2007-11-20 21:37:13 UTC (rev 9052) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/client/controller/UIController.java 2007-11-20 22:02:54 UTC (rev 9053) @@ -22,35 +22,35 @@ *************************************************************************= *****/ package org.jboss.portal.presentation.client.controller; = -import java.io.PrintWriter; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.jboss.portal.presentation.client.PresentationContext; -import org.jboss.portal.presentation.protocol.ShowUIObjectResponse; import org.jboss.portal.presentation.impl.PresentationContextImpl; -import org.jboss.portal.presentation.server.ProcessorRequest; -import org.jboss.portal.presentation.server.ProcessorResponse; -import org.jboss.portal.presentation.server.PresentationServer; -import org.jboss.portal.presentation.protocol.ServerAction; -import org.jboss.portal.presentation.protocol.ServerResponse; -import org.jboss.portal.presentation.protocol.ViewUIObjectAction; -import org.jboss.portal.presentation.protocol.GetActivation; -import org.jboss.portal.presentation.protocol.PostActivation; import org.jboss.portal.presentation.model.UIContext; import org.jboss.portal.presentation.model.UIObject; import org.jboss.portal.presentation.model.UIPage; import org.jboss.portal.presentation.model.UIWindow; import org.jboss.portal.presentation.model.content.WindowContent; - +import org.jboss.portal.presentation.protocol.GetActivation; +import org.jboss.portal.presentation.protocol.PostActivation; +import org.jboss.portal.presentation.protocol.ServerAction; +import org.jboss.portal.presentation.protocol.ServerResponse; +import org.jboss.portal.presentation.protocol.ShowUIObjectResponse; +import org.jboss.portal.presentation.protocol.ViewUIObjectAction; +import org.jboss.portal.presentation.server.PresentationServer; +import org.jboss.portal.presentation.server.ProcessorRequest; +import org.jboss.portal.presentation.server.ProcessorResponse; import org.jboss.portal.server.RequestController; import org.jboss.portal.server.ServerException; import org.jboss.portal.server.ServerInvocation; import org.jboss.portal.server.ServerInvocationContext; +import org.jboss.portal.server.impl.ServerInvocationContextImpl; +import org.jboss.portal.web.WebRequest; = +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.List; +import java.util.Map; + /** * The UIServer is responsible for generating the output that is sent back= to the client based on the Portal state of a particular Portal Request * = @@ -240,18 +240,19 @@ from =3D pos + 1; } = + // I know but it will go away later when we remove dependency on = server module + WebRequest webReq =3D ((ServerInvocationContextImpl)invocation.ge= tContext()).getWebRequest(); + // if (target !=3D null) { - Map queryParameters =3D invocationContext.getQueryParameterMap= (); - Map bodyParameters =3D invocationContext.getBodyParameterMap(); - if (bodyParameters !=3D null) + if ("GET".equals(webReq.getMethod())) { - return new PostActivation(target.getId(), queryParameters, = bodyParameters); + return new GetActivation(target.getId(), webReq.getQueryPar= ameterMap()); } - else + else if ("POST".equals(webReq.getMethod())) { - return new GetActivation(target.getId(), queryParameters); + return new PostActivation(target.getId(), webReq.getQueryPa= rameterMap(), webReq.getBody()); } } } Modified: branches/presentation/presentation/src/main/org/jboss/portal/pres= entation/protocol/PostActivation.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 --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/protocol/PostActivation.java 2007-11-20 21:37:13 UTC (rev 9052) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/protocol/PostActivation.java 2007-11-20 22:02:54 UTC (rev 9053) @@ -22,7 +22,7 @@ *************************************************************************= *****/ package org.jboss.portal.presentation.protocol; = -import org.jboss.portal.presentation.model.UIObject; +import org.jboss.portal.web.Body; = import java.util.Map; = @@ -34,22 +34,22 @@ { = /** . */ - private final Map bodyParameters; + private final Body body; = - public PostActivation(String targetId, Map queryParameters, Map bodyPar= ameters) + public PostActivation(String targetId, Map queryParameters, Body body) { super(targetId, queryParameters); = // - this.bodyParameters =3D bodyParameters; + this.body =3D body; } = /** * = * @return */ - public Map getBodyParameters() + public Body getBody() { - return bodyParameters; + return body; } } --===============1071626022194856574==--