Author: julien(a)jboss.com
Date: 2008-06-11 05:28:59 -0400 (Wed, 11 Jun 2008)
New Revision: 10983
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionDecoderContext.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionEncoderContext.java
Log:
move the protocol codec in the presentation-presentation module
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionDecoderContext.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionDecoderContext.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionDecoderContext.java 2008-06-11
09:28:59 UTC (rev 10983)
@@ -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.presentation.classic.protocol;
+
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.Body;
+import org.jboss.portal.presentation.protocol.codec.ActionDecoderContext;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ClassicActionDecoderContext implements ActionDecoderContext
+{
+
+ /** . */
+ private final WebRequest.Verb verb;
+
+ /** . */
+ private final String path;
+
+ /** . */
+ private final Map<String, String[]> queryParameterMap;
+
+ /** . */
+ private final Body body;
+
+ public ClassicActionDecoderContext(WebRequest.Verb verb, String path, Map<String,
String[]> queryParameterMap, Body body)
+ {
+ this.verb = verb;
+ this.path = path;
+ this.queryParameterMap = queryParameterMap;
+ this.body = body;
+ }
+
+ public WebRequest.Verb getVerb()
+ {
+ return verb;
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public Map<String, String[]> getQueryParameterMap()
+ {
+ return queryParameterMap;
+ }
+
+ public Body getBody()
+ {
+ return body;
+ }
+
+}
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionEncoderContext.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionEncoderContext.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ClassicActionEncoderContext.java 2008-06-11
09:28:59 UTC (rev 10983)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.presentation.classic.protocol;
+
+import org.jboss.portal.web.WebResponse;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoderContext;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ClassicActionEncoderContext implements ActionEncoderContext
+{
+
+ /** . */
+ private final String navigationalState;
+
+ /** . */
+ private final WebResponse webResponse;
+
+ public ClassicActionEncoderContext(String navigationalState, WebResponse webResponse)
+ {
+ this.navigationalState = navigationalState;
+ this.webResponse = webResponse;
+ }
+
+ public String getNavigationalState()
+ {
+ return navigationalState;
+ }
+
+ public String renderURL(String path, Map<String, String[]> parameters) throws
IllegalArgumentException
+ {
+ return webResponse.renderURL(path, parameters, null);
+ }
+}