JBoss Portal SVN: r9768 - branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-02-05 08:17:15 -0500 (Tue, 05 Feb 2008)
New Revision: 9768
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java
Log:
Update folder last modified timestamp
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java 2008-02-05 11:38:38 UTC (rev 9767)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java 2008-02-05 13:17:15 UTC (rev 9768)
@@ -59,6 +59,7 @@
Node parentNode = (Node)context.getSession().getItem(parentPath);
Node fileNode = parentNode.addNode(nodeName, "portalcms:file");
parentNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
+ parentNode.setProperty("portalcms:lastmodified", new DateValue(Calendar.getInstance()));
fileNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
parentNode.save();
}
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 11:38:38 UTC (rev 9767)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 13:17:15 UTC (rev 9768)
@@ -84,7 +84,6 @@
contentNode.setProperty("jcr:mimeType", "application/octet-stream");
}
}
- contentNode.save();
//make a new version live version
Node versionNode = (Node)context.getSession().getItem(mFile.getContent().getBasePath());
@@ -93,7 +92,12 @@
//Update the lastModified Property of the FileNode of this content
Node fileNode = (Node)context.getSession().getItem(mFile.getBasePath());
fileNode.setProperty("jcr:lastModified", timestamp);
- fileNode.save();
+
+ // Update the folder modified date
+ fileNode.getParent().setProperty("portalcms:lastmodified", timestamp);
+
+ contentNode.getSession().save();
+
}
catch (Exception e)
{
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java 2008-02-05 11:38:38 UTC (rev 9767)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java 2008-02-05 13:17:15 UTC (rev 9768)
@@ -29,6 +29,7 @@
import org.jboss.portal.cms.model.File;
import javax.jcr.Node;
+
import java.util.Calendar;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
@@ -82,12 +83,15 @@
contentNode.setProperty("jcr:mimeType", "application/octet-stream");
}
}
- contentNode.save();
//Update the lastModified Property of the FileNode of this content
Node fileNode = (Node)context.getSession().getItem(mFile.getBasePath());
fileNode.setProperty("jcr:lastModified", timestamp);
- fileNode.save();
+
+ // Update the folder modified date
+ fileNode.getParent().setProperty("portalcms:lastmodified", timestamp);
+
+ contentNode.getSession().save();
}
catch (Exception e)
{
@@ -95,4 +99,5 @@
}
return null;
}
+
}
16 years, 4 months
JBoss Portal SVN: r9767 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-05 06:38:38 -0500 (Tue, 05 Feb 2008)
New Revision: 9767
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/WindowNavigationalState.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
- actually delegate to the PortletControllerContext the createion of hte PortalInvocationContext, this way the controller does not care about context managmeent
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -23,8 +23,8 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
import org.jboss.portal.common.util.MarkupInfo;
@@ -42,7 +42,7 @@
{
/** . */
- private final PortletControllerContext controllerContext;
+ private final PortletURLRenderer urlRenderer;
/** . */
private final String windowId;
@@ -50,8 +50,15 @@
/** . */
private final PageNavigationalState pageState;
+ /** . */
+ private final HttpServletRequest clientRequest;
+
+ /** . */
+ private final HttpServletResponse clientResponse;
+
public TestPortletInvocationContext(
- PortletControllerContext controllerContext,
+ HttpServletRequest clientRequest,
+ HttpServletResponse clientResponse,
String windowId,
PageNavigationalState pageState,
MarkupInfo markupInfo)
@@ -59,12 +66,14 @@
super(markupInfo);
//
+ this.clientRequest = clientRequest;
+ this.clientResponse = clientResponse;
this.windowId = windowId;
this.pageState = pageState;
- this.controllerContext = controllerContext;
+ this.urlRenderer = new PortletURLRenderer(pageState, windowId, clientRequest, clientResponse);
//
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(controllerContext.getClientRequest()));
+ addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(clientRequest));
addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
@@ -73,16 +82,16 @@
public HttpServletRequest getClientRequest() throws IllegalStateException
{
- return controllerContext.getClientRequest();
+ return clientRequest;
}
public HttpServletResponse getClientResponse() throws IllegalStateException
{
- return controllerContext.getClientResponse();
+ return clientResponse;
}
public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
{
- return controllerContext.renderURL(windowId, pageState, containerURL, wantSecure, wantAuthenticated, relative);
+ return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
}
}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/WindowNavigationalState.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/WindowNavigationalState.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/WindowNavigationalState.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -1,75 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.portlet.StateString;
-
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WindowNavigationalState implements Serializable
-{
-
- /** . */
- private final StateString portletNavigationalState;
-
- /** . */
- private final Mode mode;
-
- /** . */
- private final WindowState windowState;
-
- public WindowNavigationalState()
- {
- this.portletNavigationalState = null;
- this.mode = Mode.VIEW;
- this.windowState = WindowState.NORMAL;
- }
-
- public WindowNavigationalState(StateString portletNavigationalState, Mode mode, WindowState windowState)
- {
- this.portletNavigationalState = portletNavigationalState;
- this.mode = mode;
- this.windowState = windowState;
- }
-
- public StateString getPortletNavigationalState()
- {
- return portletNavigationalState;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public WindowState getWindowState()
- {
- return windowState;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -38,10 +38,6 @@
*/
public class PortletController
{
-
- /** . */
- public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML, "UTF8");
-
public ControllerResponse process(ControllerRequest controllerRequest) throws IOException, PortletInvokerException
{
RequestHandler handler;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -22,9 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller;
-import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -55,6 +54,8 @@
PortletInfo getPortletInfo(String windowId) throws PortletInvokerException;
+ PortletInvocationContext createPortletInvocationContext(String windowId, PageNavigationalState pageState);
+
PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException;
PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException;
@@ -63,15 +64,6 @@
EventControllerContext getEventControllerContext();
- String renderURL(
- String windowId,
- PageNavigationalState pageState,
- ContainerURL containerURL,
- Boolean wantSecure,
- Boolean wantAuthenticated,
- boolean relative);
-
-
// To be removed, now only used in controller2
PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -9,6 +9,7 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.info.NavigationInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -205,11 +206,7 @@
//
ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
- TestPortletInvocationContext portletInvocationContext = new TestPortletInvocationContext(
- context,
- portletRequest.getWindowId(),
- pageState,
- MARKUP_INFO);
+ PortletInvocationContext portletInvocationContext = context.createPortletInvocationContext(portletRequest.getWindowId(), pageState);
ActionInvocation actionInvocation = new ActionInvocation(portletInvocationContext);
//
@@ -244,12 +241,8 @@
ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
//
- TestPortletInvocationContext actionContext = new TestPortletInvocationContext(
- context,
- event.getWindowId(),
- pageState,
- MARKUP_INFO);
- EventInvocation eventInvocation = new EventInvocation(actionContext);
+ PortletInvocationContext portletInvocationContext = context.createPortletInvocationContext(event.getWindowId(), pageState);
+ EventInvocation eventInvocation = new EventInvocation(portletInvocationContext);
//
eventInvocation.setMode(windowNS.getMode());
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -28,14 +28,13 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.cache.CacheLevel;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.test.TestPortletInvocationContext;
-import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
import org.jboss.portal.portlet.test.controller.request.PageScopedFullPortletResourceRequest;
import org.jboss.portal.portlet.test.controller.request.PortletResourceRequest;
@@ -82,7 +81,7 @@
//
Mode mode = null;
WindowState windowState = null;
- PageNavigationalState pageNS = null;
+ PageNavigationalState pageState = null;
ParameterMap publicNS = null;
StateString portletNS = null;
CacheLevel cacheability;
@@ -104,13 +103,13 @@
if (portletResourceRequest instanceof PageScopedFullPortletResourceRequest)
{
PageScopedFullPortletResourceRequest pageScopedRequest = (PageScopedFullPortletResourceRequest)portletResourceRequest;
- pageNS = pageScopedRequest.getPageState();
+ pageState = pageScopedRequest.getPageState();
cacheability = CacheLevel.PAGE;
//
- if (pageNS != null)
+ if (pageState != null)
{
- publicNS = pageNS.getPublicNavigationalState(portlet);
+ publicNS = pageState.getPublicNavigationalState(portlet);
}
}
else
@@ -134,12 +133,8 @@
}
//
- TestPortletInvocationContext resourceInvocationContext = new TestPortletInvocationContext(
- context,
- portletResourceRequest.getWindowId(),
- pageNS,
- MARKUP_INFO);
- ResourceInvocation resourceInvocation = new ResourceInvocation(resourceInvocationContext);
+ PortletInvocationContext portletInvocationContext = context.createPortletInvocationContext(portletResourceRequest.getWindowId(), pageState);
+ ResourceInvocation resourceInvocation = new ResourceInvocation(portletInvocationContext);
//
resourceInvocation.setResourceId(portletResourceRequest.getResourceId());
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -31,6 +31,7 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
@@ -44,10 +45,8 @@
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
-import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import org.w3c.dom.Element;
@@ -229,11 +228,7 @@
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
- TestPortletInvocationContext renderContext = new TestPortletInvocationContext(
- context,
- portlet.getContext().getId(),
- pageNS,
- PortletController.MARKUP_INFO);
+ PortletInvocationContext renderContext = context.createPortletInvocationContext(portlet.getContext().getId(), pageNS);
//
RenderInvocation render = new RenderInvocation(renderContext);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 11:29:47 UTC (rev 9766)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 11:38:38 UTC (rev 9767)
@@ -27,6 +27,8 @@
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
@@ -34,6 +36,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
@@ -50,7 +53,7 @@
import org.jboss.portal.portlet.test.StringCodec;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.TestPortalContext;
-import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
+import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
@@ -84,6 +87,9 @@
{
/** . */
+ public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML, "UTF8");
+
+ /** . */
public static final int NAV_SCOPE = 0;
/** . */
@@ -368,4 +374,9 @@
return invoke(resourceInvocation);
}
+
+ public PortletInvocationContext createPortletInvocationContext(String windowId, PageNavigationalState pageState)
+ {
+ return new TestPortletInvocationContext(req, resp, windowId, pageState, MARKUP_INFO);
+ }
}
16 years, 4 months
JBoss Portal SVN: r9766 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-05 06:29:47 -0500 (Tue, 05 Feb 2008)
New Revision: 9766
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
Log:
revising 3.1. Changing the Port
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2008-02-05 06:44:48 UTC (rev 9765)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2008-02-05 11:29:47 UTC (rev 9766)
@@ -14,12 +14,12 @@
</chapterinfo>
<title>Customizing your Installation</title>
<para>
- This chapter describes how to customize a default installation of JBoss Portal. This includes the listening port, email and proxy settings, and database dialect settings. For further configuration details, please see <xref linkend="portaldescriptors"/> and <xref linkend="troubleshooting"/>.
+ This chapter describes how to customize the default installation. This includes the JBoss EAP or JBoss AS listening port, email and proxy settings, and database dialect settings. For further configuration details, please see <xref linkend="portaldescriptors"/> and <xref linkend="troubleshooting"/>.
</para>
<sect1>
<title>Changing the Port</title>
<para>
- It is common for web services to run on port 80, instead of the JBoss EAP and JBoss AS default port of 8080. If you can not use <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingPortForwardingWithJBoss">port forwarding</ulink>, it is recommended to change the default port in <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename>. To change the default port, open the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename> file, and edit the <computeroutput>Connector port</computeroutput> value for the <computeroutput>jboss.web</computeroutput> service:
+ It is common for web services to run on port 80. By default, JBoss EAP and JBoss AS use port 8080. If you can not use <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingPortForwardingWithJBoss">port forwarding</ulink>, it is recommended to change the port JBoss EAP or JBoss AS listens on. To change the default port, open the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename> file, and edit the <computeroutput>Connector port</computeroutput> value for the <computeroutput>jboss.web</computeroutput> service:
</para>
<para>
<screen>
@@ -31,19 +31,19 @@
This example changes the default port to port 8088. The JBoss EAP or JBoss AS server must be restarted before the new port settings will take affect.
</para>
<para>
- The default SSL port is 8843. To enable HTTPS support, refer to <ulink url="ttp://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">JBoss AS Guide</ulink>. For further information, please see the <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat's SSL configuration how-to</ulink>.
- </para>
- <para>
+ The default SSL port is 8843. To enable HTTPS support, refer to the <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">JBoss AS Guide</ulink>. For further information, please see the <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat's SSL configuration how-to</ulink>.
+ </para>
+ <para>
+ Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
+ </para>
+ <para>
<warning>
- <title>root user priviliges</title>
+ <title>Root user Privileges</title>
<para>
Linux systems require root user privileges to run a server on a port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-privileged user will not work. Running JBoss EAP or JBoss AS as the root user could lead to security breaches.
</para>
</warning>
</para>
- <para>
- Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
- </para>
</sect1>
<sect1 id="configuration-contextroot">
<title>Changing the context path</title>
16 years, 4 months
JBoss Portal SVN: r9765 - branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-02-05 01:44:48 -0500 (Tue, 05 Feb 2008)
New Revision: 9765
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java
Log:
JBPORTAL-1801 - CMS content shows incorrect 'Created' and 'Modified' timestamps
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 06:12:30 UTC (rev 9764)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java 2008-02-05 06:44:48 UTC (rev 9765)
@@ -58,12 +58,14 @@
Node contentNode = (Node)context.getSession().getItem(mFile.getContent().getBasePath());
contentNode.checkout();
+ DateValue timestamp = new DateValue(Calendar.getInstance());
+
contentNode.setProperty("portalcms:description", mFile.getContent().getDescription());
contentNode.setProperty("portalcms:title", mFile.getContent().getTitle());
contentNode.setProperty("portalcms:language", mFile.getContent().getLocale().getLanguage());
contentNode.setProperty("jcr:encoding", "UTF-8");
contentNode.setProperty("jcr:data", new BinaryValue(mFile.getContent().getBytes()));
- contentNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
+ contentNode.setProperty("jcr:lastModified", timestamp);
if (mFile.getContent().getMimeType() != null)
{
@@ -87,6 +89,11 @@
//make a new version live version
Node versionNode = (Node)context.getSession().getItem(mFile.getContent().getBasePath());
VersionUtil.createVersion(versionNode, this.bMakeLive);
+
+ //Update the lastModified Property of the FileNode of this content
+ Node fileNode = (Node)context.getSession().getItem(mFile.getBasePath());
+ fileNode.setProperty("jcr:lastModified", timestamp);
+ fileNode.save();
}
catch (Exception e)
{
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java 2008-02-05 06:12:30 UTC (rev 9764)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java 2008-02-05 06:44:48 UTC (rev 9765)
@@ -55,13 +55,15 @@
{
Node contentNode = (Node)context.getSession().getItem(mFile.getContent().getBasePath());
contentNode.checkout();
+
+ DateValue timestamp = new DateValue(Calendar.getInstance());
contentNode.setProperty("portalcms:description", mFile.getContent().getDescription());
contentNode.setProperty("portalcms:title", mFile.getContent().getTitle());
contentNode.setProperty("portalcms:language", mFile.getContent().getLocale().getLanguage());
contentNode.setProperty("jcr:encoding", "UTF-8");
contentNode.setProperty("jcr:data", new BinaryValue(mFile.getContent().getBytes()));
- contentNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
+ contentNode.setProperty("jcr:lastModified", timestamp);
if (mFile.getContent().getMimeType() != null)
{
@@ -81,6 +83,11 @@
}
}
contentNode.save();
+
+ //Update the lastModified Property of the FileNode of this content
+ Node fileNode = (Node)context.getSession().getItem(mFile.getBasePath());
+ fileNode.setProperty("jcr:lastModified", timestamp);
+ fileNode.save();
}
catch (Exception e)
{
16 years, 4 months
JBoss Portal SVN: r9764 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/controller2 and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-02-05 01:12:30 -0500 (Tue, 05 Feb 2008)
New Revision: 9764
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
modules/portlet/trunk/test/src/test/build.xml
Log:
- Removed extra PageUpdate class.
- Fixed deployment of simple portal.
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java 2008-02-05 04:28:33 UTC (rev 9763)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java 2008-02-05 06:12:30 UTC (rev 9764)
@@ -1,56 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.controller;
-
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PageUpdate extends ControllerResponse
-{
-
- /** . */
- private ResponseProperties properties;
-
- /** . */
- private PageNavigationalState pageState;
-
- public PageUpdate(ResponseProperties properties, PageNavigationalState pageState)
- {
- this.properties = properties;
- this.pageState = pageState;
- }
-
- public ResponseProperties getProperties()
- {
- return properties;
- }
-
- public PageNavigationalState getPageState()
- {
- return pageState;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-05 04:28:33 UTC (rev 9763)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-05 06:12:30 UTC (rev 9764)
@@ -23,9 +23,9 @@
package org.jboss.portal.portlet.test.controller2;
import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import org.jboss.portal.portlet.test.controller.response.RedirectControllerResponse;
-import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
import org.jboss.portal.portlet.test.controller.response.ResourceControllerResponse;
/**
@@ -54,6 +54,6 @@
}
//
- return null;
+ throw new IllegalArgumentException("Unknown response type: " + response);
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05 04:28:33 UTC (rev 9763)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05 06:12:30 UTC (rev 9764)
@@ -22,11 +22,14 @@
******************************************************************************/
package org.jboss.portal.simple;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
-import org.jboss.portal.portlet.test.controller.PortletController;
-import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import org.jboss.portal.portlet.test.controller2.ControllerResponseRenderer;
import org.jboss.portal.portlet.test.controller2.ControllerResponseRendererFactory;
+import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -72,13 +75,26 @@
//
PortletController controller = new PortletController();
- //
- ControllerResponse response = controller.process(context.getRequest());
+ if (context.getRequest() != null)
+ {
+ //
+ ControllerResponse response = controller.process(context.getRequest());
- //
- ControllerResponseRenderer renderer = ControllerResponseRendererFactory.getRenderer(response);
+ //
+ ControllerResponseRenderer renderer = ControllerResponseRendererFactory.getRenderer(response);
- //
- renderer.render(context);
+ //
+ renderer.render(context);
+ }
+ else
+ {
+ PageUpdate pageUpdate = new PageUpdate(new ResponseProperties(), new PageNavigationalState());
+
+ //
+ ControllerResponseRenderer renderer = ControllerResponseRendererFactory.getRenderer(pageUpdate);
+
+ //
+ renderer.render(context);
+ }
}
}
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-05 04:28:33 UTC (rev 9763)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-05 06:12:30 UTC (rev 9764)
@@ -626,8 +626,7 @@
home="${test.tomcat-6.home}"
log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
action="stop">
- <configuration>
- </configuration>
+ <configuration/>
</cargo>
</target>
@@ -639,8 +638,7 @@
<antcall target="tests.remote">
<param name="test.server.name" value="RemoteTomcat_6_0"/>
</antcall>
- <antcall target="cargo.tomcat-6.stop">
- </antcall>
+ <antcall target="cargo.tomcat-6.stop"/>
</target>
<target name="tests.tomcat-6">
@@ -653,8 +651,7 @@
</target>
<target name="tests.tomcat">
- <antcall target="tests.tomcat-6">
- </antcall>
+ <antcall target="tests.tomcat-6"/>
</target>
<target name="tests.remote">
@@ -687,11 +684,17 @@
<target name="package-simple-portal" depends="prepare_env">
+ <delete dir="${target}/simple-portal"/>
+
<jar jarfile="${target}/portlet-test-lib.jar">
<!--<fileset dir="${target}/test-classes"/>-->
<fileset dir="${target}/classes"/>
</jar>
+ <copy todir="${test.temp.dir}/simple-portal-war">
+ <fileset dir="src/test/resources/simple-portal-war"/>
+ </copy>
+
<!-- simple-portal.war -->
<copy todir="${test.temp.dir}/simple-portal-war/WEB-INF/lib" flatten="true">
@@ -730,12 +733,26 @@
</copy>
- <jar jarfile="${target}/simple-portal.war">
+ <mkdir dir="${target}/simple-portal"/>
+
+ <jar jarfile="${target}/simple-portal/simple-portal.war">
<fileset dir="${test.temp.dir}/simple-portal-war"/>
- </jar>
+ </jar>
+ <copy todir="${target}/simple-portal" flatten="true">
+ <path>
+ <pathelement path="${dependency.portal-common.jar}"/>
+ <pathelement path="${dependency.portal-web.jar}"/>
+ <pathelement path="${dependency.jsr168api.jar}"/>
+ </path>
+ </copy>
+
<delete file="${target}/portlet-test-lib.jar"/>
</target>
+ <!--<target name="package-demo-portlets" depends="prepare_env">
+ <copy
+ </target>-->
+
</project>
\ No newline at end of file
16 years, 4 months
JBoss Portal SVN: r9763 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-04 23:28:33 -0500 (Mon, 04 Feb 2008)
New Revision: 9763
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
revising content for
3.1. Changing the Port
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2008-02-05 03:19:46 UTC (rev 9762)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2008-02-05 04:28:33 UTC (rev 9763)
@@ -12,41 +12,38 @@
<email>roy at jboss dot org</email>
</author>
</chapterinfo>
- <title>Customizing your installation</title>
- <para>This section is intended to describe some customization features available in JBoss
- Portal. If it is not covered here, please view the FAQ chapter at the end of this document or the descriptor
- chapter (
- <xref linkend="portaldescriptors"/>
- ) for further documentation on configuration and tuning JBoss Portal.
+ <title>Customizing your Installation</title>
+ <para>
+ This chapter describes how to customize a default installation of JBoss Portal. This includes the listening port, email and proxy settings, and database dialect settings. For further configuration details, please see <xref linkend="portaldescriptors"/> and <xref linkend="troubleshooting"/>.
</para>
<sect1>
- <title>Changing the port</title>
- <para>It is common to have a server running on the port 80 instead of the default port 8080.</para>
- <para>It might be easier to use
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossOnPort80">port forwarding</ulink>
- than to change the
- port manually. Since port forwarding is not always possible, below are the instructions to change the port
- number manually.
+ <title>Changing the Port</title>
+ <para>
+ It is common for web services to run on port 80, instead of the JBoss EAP and JBoss AS default port of 8080. If you can not use <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingPortForwardingWithJBoss">port forwarding</ulink>, it is recommended to change the default port in <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename>. To change the default port, open the <filename>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</filename> file, and edit the <computeroutput>Connector port</computeroutput> value for the <computeroutput>jboss.web</computeroutput> service:
</para>
- <para>To change it, you need to edit the file <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal>
- and change the port value of the HTTP Connector.
+ <para>
+<screen>
+<Service name="jboss.web">
+<Connector port="8088" address="${jboss.bind.address}"
+</screen>
+ </para>
+ <para>
+ This example changes the default port to port 8088. The JBoss EAP or JBoss AS server must be restarted before the new port settings will take affect.
+ </para>
+ <para>
+ The default SSL port is 8843. To enable HTTPS support, refer to <ulink url="ttp://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">JBoss AS Guide</ulink>. For further information, please see the <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat's SSL configuration how-to</ulink>.
</para>
<para>
- You can also change the value of the SSL port, by default it is set to 8443. To activate support for HTTPS,
- please refer to the appropriate
- <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">chapter</ulink> of the
- JBoss AS guide. You might also want to refer to
- <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat's SSL configuration how-to</ulink>
- for more details.
+ <warning>
+ <title>root user priviliges</title>
+ <para>
+ Linux systems require root user privileges to run a server on a port less than 1024. Starting JBoss EAP or JBoss AS on port 80 as a non-privileged user will not work. Running JBoss EAP or JBoss AS as the root user could lead to security breaches.
+ </para>
+ </warning>
</para>
<para>
Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
</para>
- <para>Now you can restart JBoss and use the new port that you defined. On systems like Linux,
- you need privileges to be able to run a server on a port lower than 1000, starting JBoss on
- the port 80 as a regular user will not work. For testing purposes, you can start JBoss AS as root but this
- setup is not recommended if the server is public as it could lead to security breaches of your system.
- </para>
</sect1>
<sect1 id="configuration-contextroot">
<title>Changing the context path</title>
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-05 03:19:46 UTC (rev 9762)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-05 04:28:33 UTC (rev 9763)
@@ -125,7 +125,7 @@
</imageobject>
</mediaobject>
<para>
- Copy the Datasource descriptor that matches your database into the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/</filename> directory, where <replaceable>configuration</replaceable> is either all, default, minimal, or production. For example, if you are using the production configuration, copy the Datasource descriptor into the <filename>$JBOSS_HOME/server/production/deploy/</filename> directory.
+ Copy the Datasource descriptor that matches your database into the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/</filename> directory, where <replaceable>configuration</replaceable> is either all, default or minimal. For example, if you are using the all configuration, copy the Datasource descriptor into the <filename>$JBOSS_HOME/server/all/deploy/</filename> directory.
</para>
<para>
After the Datasource descriptor has been copied into the <filename>deploy</filename> directory, make sure the username, password, connection-url, and driver-class are correct for your chosen database. Datasource descriptor files can be deployed to test before being used in production. The following is an example Datasource descriptor for the PostgreSQL database:
16 years, 4 months
JBoss Portal SVN: r9762 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 22:19:46 -0500 (Mon, 04 Feb 2008)
New Revision: 9762
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/PageUpdate.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
Log:
moved responses to response package
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -23,9 +23,9 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
-import org.jboss.portal.portlet.test.controller.PageUpdate;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller2.ControllerResponseRendererFactory;
import org.jboss.portal.portlet.test.controller2.ControllerResponseRenderer;
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -1,38 +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.test.controller;
-
-/**
- * Must be used as base class for high level response provided by the controller that will be translated into something
- * at the portal level. The goal is to avoid to manipulate the HTTP response directly.
- * <p/>
- * The test bed will of course use the HTTP response but the Presentation Framework will work differently.
- * <p/>
- * So we really need to abstract everything done with the HttpServletResponse and *never* use it in the controller.
- * <p/>
- * Typical usage should be : ControllerResponse response = controller.invoker(ControllerRequest request);
- */
-public abstract class ControllerResponse
-{
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -1,44 +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.test.controller;
-
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class ErrorControllerResponse extends ControllerResponse
-{
-
- /** . */
- public ErrorResponse error;
-
-
- public ErrorControllerResponse(ErrorResponse error)
- {
- this.error = error;
- }
-
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -30,6 +30,7 @@
import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
import org.jboss.portal.portlet.test.controller.response.RedirectControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -1,42 +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.test.controller;
-
-import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class RedirectControllerResponse extends ControllerResponse
-{
-
- /** . */
- public HTTPRedirectionResponse redirection;
-
- public RedirectControllerResponse(HTTPRedirectionResponse redirection)
- {
- this.redirection = redirection;
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -1,42 +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.test.controller;
-
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class ResourceControllerResponse extends ControllerResponse
-{
-
- /** . */
- public FragmentResponse fragment;
-
- public ResourceControllerResponse(FragmentResponse fragment)
- {
- this.fragment = fragment;
- }
-}
\ No newline at end of file
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/PageUpdate.java (from rev 9761, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/PageUpdate.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/PageUpdate.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.test.controller.response;
+
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageUpdate extends ControllerResponse
+{
+
+ /** . */
+ private ResponseProperties properties;
+
+ /** . */
+ private PageNavigationalState pageState;
+
+ public PageUpdate(ResponseProperties properties, PageNavigationalState pageState)
+ {
+ this.properties = properties;
+ this.pageState = pageState;
+ }
+
+ public ResponseProperties getProperties()
+ {
+ return properties;
+ }
+
+ public PageNavigationalState getPageState()
+ {
+ return pageState;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.test.controller2;
import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
-import org.jboss.portal.portlet.test.controller.PageUpdate;
+import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import org.jboss.portal.portlet.test.controller.response.RedirectControllerResponse;
import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
import org.jboss.portal.portlet.test.controller.response.ResourceControllerResponse;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 03:19:00 UTC (rev 9761)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 03:19:46 UTC (rev 9762)
@@ -41,7 +41,6 @@
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
@@ -49,7 +48,7 @@
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PortletController;
-import org.jboss.portal.portlet.test.controller.PageUpdate;
+import org.jboss.portal.portlet.test.controller.response.PageUpdate;
import org.w3c.dom.Element;
import javax.servlet.http.HttpServletRequest;
16 years, 4 months
JBoss Portal SVN: r9761 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal: portlet/test/controller and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 22:19:00 -0500 (Mon, 04 Feb 2008)
New Revision: 9761
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ErrorControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/RedirectControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ResourceControllerResponse.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
Log:
moved responses to response package
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.test;
-import org.jboss.portal.portlet.test.controller.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
import org.jboss.portal.portlet.test.controller.PageUpdate;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.test.controller;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -28,6 +28,7 @@
import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
import org.jboss.portal.portlet.test.controller.request.PortletRequest;
import org.jboss.portal.portlet.test.controller.request.PortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
import java.io.IOException;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -27,6 +27,9 @@
import org.jboss.portal.portlet.test.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.test.controller.request.PortletRenderRequest;
import org.jboss.portal.portlet.test.controller.request.PortletRequest;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.RedirectControllerResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -40,6 +40,9 @@
import org.jboss.portal.portlet.test.controller.request.PageScopedFullPortletResourceRequest;
import org.jboss.portal.portlet.test.controller.request.PortletResourceRequest;
import org.jboss.portal.portlet.test.controller.request.PortletScopedPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ResourceControllerResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -7,6 +7,7 @@
import org.apache.log4j.Logger;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import java.io.IOException;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ControllerResponse.java (from rev 9754, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ControllerResponse.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.test.controller.response;
+
+/**
+ * Must be used as base class for high level response provided by the controller that will be translated into something
+ * at the portal level. The goal is to avoid to manipulate the HTTP response directly.
+ * <p/>
+ * The test bed will of course use the HTTP response but the Presentation Framework will work differently.
+ * <p/>
+ * So we really need to abstract everything done with the HttpServletResponse and *never* use it in the controller.
+ * <p/>
+ * Typical usage should be : ControllerResponse response = controller.invoker(ControllerRequest request);
+ */
+public abstract class ControllerResponse
+{
+}
Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ControllerResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ErrorControllerResponse.java (from rev 9754, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ErrorControllerResponse.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ErrorControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.test.controller.response;
+
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class ErrorControllerResponse extends ControllerResponse
+{
+
+ /** . */
+ public ErrorResponse error;
+
+
+ public ErrorControllerResponse(ErrorResponse error)
+ {
+ this.error = error;
+ }
+
+}
Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ErrorControllerResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/RedirectControllerResponse.java (from rev 9754, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/RedirectControllerResponse.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/RedirectControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.test.controller.response;
+
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class RedirectControllerResponse extends ControllerResponse
+{
+
+ /** . */
+ public HTTPRedirectionResponse redirection;
+
+ public RedirectControllerResponse(HTTPRedirectionResponse redirection)
+ {
+ this.redirection = redirection;
+ }
+}
Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/RedirectControllerResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ResourceControllerResponse.java (from rev 9754, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ResourceControllerResponse.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ResourceControllerResponse.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.test.controller.response;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class ResourceControllerResponse extends ControllerResponse
+{
+
+ /** . */
+ public FragmentResponse fragment;
+
+ public ResourceControllerResponse(FragmentResponse fragment)
+ {
+ this.fragment = fragment;
+ }
+}
\ No newline at end of file
Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/response/ResourceControllerResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller2;
-import org.jboss.portal.portlet.test.controller.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
import org.jboss.portal.portlet.test.controller.PageUpdate;
-import org.jboss.portal.portlet.test.controller.RedirectControllerResponse;
-import org.jboss.portal.portlet.test.controller.ErrorControllerResponse;
-import org.jboss.portal.portlet.test.controller.ResourceControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.RedirectControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ResourceControllerResponse;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller2;
-import org.jboss.portal.portlet.test.controller.ErrorControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ErrorControllerResponse;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.apache.log4j.Logger;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -23,7 +23,8 @@
package org.jboss.portal.portlet.test.controller2;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.test.controller.RedirectControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.RedirectControllerResponse;
+
import java.io.IOException;
/**
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.test.controller2;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.test.controller.ResourceControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ResourceControllerResponse;
import org.jboss.portal.common.io.IOTools;
import javax.servlet.http.HttpServletResponse;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05 03:17:08 UTC (rev 9760)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-05 03:19:00 UTC (rev 9761)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.simple;
-import org.jboss.portal.portlet.test.controller.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.response.ControllerResponse;
import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
import org.jboss.portal.portlet.test.controller2.ControllerResponseRenderer;
16 years, 4 months
JBoss Portal SVN: r9760 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 22:17:08 -0500 (Mon, 04 Feb 2008)
New Revision: 9760
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRenderer.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
- moved url creation to PortletControllerContext interface
- moved the PortletURLRenderer class to controller2 package (along with the PortletControllerContextImpl since those 2 classes are associated)
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -1,245 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test;
-
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.text.CharBuffer;
-import org.jboss.portal.common.text.FastURLEncoder;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletURL;
-import org.jboss.portal.portlet.RenderURL;
-import org.jboss.portal.portlet.ResourceURL;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletURLRenderer
-{
-
- /** . */
- final String windowId;
-
- /** . */
- final HttpServletRequest clientReq;
-
- /** . */
- final HttpServletResponse clientResp;
-
- /** . */
- final PageNavigationalState pageNS;
-
- public PortletURLRenderer(
- PageNavigationalState pageNS,
- String windowId,
- HttpServletRequest clientReq,
- HttpServletResponse clientResp)
- {
- this.pageNS = pageNS;
- this.windowId = windowId;
- this.clientReq = clientReq;
- this.clientResp = clientResp;
- }
-
- String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
- {
- CharBuffer buffer = new CharBuffer();
- buffer.append(clientReq.getScheme());
- buffer.append("://");
- buffer.append(clientReq.getServerName());
- buffer.append(':');
- buffer.append(Integer.toString(clientReq.getServerPort()));
- buffer.append(clientReq.getContextPath());
- buffer.append('/');
- buffer.append(StringCodec.encode(windowId));
-
- //
- Map<String, String> parameters = new HashMap<String, String>();
-
- //
- String type;
- if (containerURL instanceof ActionURL)
- {
- type = ACTION_LIFECYCLE;
- }
- else if (containerURL instanceof RenderURL)
- {
- type = RENDER_LIFECYCLE;
- }
- else if (containerURL instanceof ResourceURL)
- {
- type = RESOURCE_LIFECYCLE;
- }
- else
- {
- throw new Error();
- }
- parameters.put(LIFECYCLE_TYPE, type);
-
- //
- String pageState;
- try
- {
- byte[] bytes = PageNavigationalState.serialize(pageNS);
- pageState = Tools.toHexString(bytes);
- }
- catch (IOException e)
- {
- throw new Error(e); //
- }
-
- //
- if (containerURL instanceof PortletURL)
- {
- PortletURL portletURL = (PortletURL)containerURL;
-
- if (portletURL.getMode() != null)
- {
- parameters.put(MODE, portletURL.getMode().toString());
- }
-
- //
- if (portletURL.getWindowState() != null)
- {
- parameters.put(WINDOW_STATE, portletURL.getWindowState().toString());
- }
-
- //
- parameters.put(PAGE_STATE, pageState);
-
- //
- if (containerURL instanceof ActionURL)
- {
- ActionURL actionURL = (ActionURL)containerURL;
-
- //
- if (actionURL.getNavigationalState() != null)
- {
- parameters.put(NAVIGATIONAL_STATE, actionURL.getNavigationalState().getStringValue());
- }
-
- //
- StateString interactionState = actionURL.getInteractionState();
- parameters.put(INTERACTION_STATE, interactionState.getStringValue());
- }
- else
- {
- RenderURL renderURL = (RenderURL)containerURL;
-
- //
- try
- {
- Map<String, String[]> changes = renderURL.getPublicNavigationalStateChanges();
- HashMap<String, String[]> serialiableChanges = new HashMap<String, String[]>(changes);
- byte[] bytes = IOTools.serialize(serialiableChanges);
- String ns = Tools.toHexString(bytes);
- parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns);
- }
- catch (IOException e)
- {
- throw new Error(e);
- }
-
- //
- StateString navigationalState = renderURL.getNavigationalState();
- parameters.put(NAVIGATIONAL_STATE, navigationalState.getStringValue());
- }
- }
- else
- {
- ResourceURL resourceURL = (ResourceURL)containerURL;
-
- //
- StateString resourceState = resourceURL.getResourceState();
- parameters.put(RESOURCE_STATE, resourceState.getStringValue());
-
- //
- String resourceId = resourceURL.getResourceId();
- if (resourceId != null)
- {
- parameters.put(RESOURCE_ID, resourceId);
- }
-
- //
- CacheLevel cacheability = resourceURL.getCacheability();
- parameters.put(RESOURCE_CACHEABILITY, cacheability.name());
-
- //
- if (cacheability != CacheLevel.FULL)
- {
- if (resourceURL.getNavigationalState() != null)
- {
- parameters.put(NAVIGATIONAL_STATE, resourceURL.getNavigationalState().getStringValue());
- }
-
- //
- if (resourceURL.getMode() != null)
- {
- parameters.put(MODE, resourceURL.getMode().toString());
- }
-
- //
- if (resourceURL.getWindowState() != null)
- {
- parameters.put(WINDOW_STATE, resourceURL.getWindowState().toString());
- }
-
- if (cacheability == CacheLevel.PAGE)
- {
- parameters.put(PAGE_STATE, pageState);
- }
- }
- }
-
- //
- boolean first = true;
- for (Map.Entry<String, String> entry : parameters.entrySet())
- {
- String name = entry.getKey();
- String value = entry.getValue();
- buffer.append(first ? '?' : '&');
- buffer.append(name, FastURLEncoder.getUTF8Instance());
- buffer.append('=');
- buffer.append(value, FastURLEncoder.getUTF8Instance());
- first = false;
- }
-
- //
- String url = buffer.asString();
- return clientResp.encodeURL(url);
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -23,6 +23,8 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
import org.jboss.portal.common.util.MarkupInfo;
@@ -40,17 +42,29 @@
{
/** . */
- private final PortletURLRenderer urlRenderer;
+ private final PortletControllerContext controllerContext;
- public TestPortletInvocationContext(PortletURLRenderer urlRenderer, MarkupInfo markupInfo)
+ /** . */
+ private final String windowId;
+
+ /** . */
+ private final PageNavigationalState pageState;
+
+ public TestPortletInvocationContext(
+ PortletControllerContext controllerContext,
+ String windowId,
+ PageNavigationalState pageState,
+ MarkupInfo markupInfo)
{
super(markupInfo);
//
- this.urlRenderer = urlRenderer;
+ this.windowId = windowId;
+ this.pageState = pageState;
+ this.controllerContext = controllerContext;
//
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(urlRenderer.clientReq));
+ addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(controllerContext.getClientRequest()));
addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
@@ -59,16 +73,16 @@
public HttpServletRequest getClientRequest() throws IllegalStateException
{
- return urlRenderer.clientReq;
+ return controllerContext.getClientRequest();
}
public HttpServletResponse getClientResponse() throws IllegalStateException
{
- return urlRenderer.clientResp;
+ return controllerContext.getClientResponse();
}
public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
{
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
+ return controllerContext.renderURL(windowId, pageState, containerURL, wantSecure, wantAuthenticated, relative);
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -54,9 +55,6 @@
PortletInfo getPortletInfo(String windowId) throws PortletInvokerException;
- // To be removed
- PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
-
PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException;
PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException;
@@ -65,4 +63,15 @@
EventControllerContext getEventControllerContext();
+ String renderURL(
+ String windowId,
+ PageNavigationalState pageState,
+ ContainerURL containerURL,
+ Boolean wantSecure,
+ Boolean wantAuthenticated,
+ boolean relative);
+
+
+ // To be removed, now only used in controller2
+ PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -19,7 +19,6 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
-import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.event.Event;
@@ -184,7 +183,7 @@
PortletActionRequest portletActionRequest = (PortletActionRequest)portletRequest;
//
- PageNavigationalState pageNS = portletActionRequest.getPageState();
+ PageNavigationalState pageState = portletActionRequest.getPageState();
//
Mode mode = portletActionRequest.getWindowNavigationalState().getMode();
@@ -201,9 +200,12 @@
}
//
- ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletRequest.getWindowId(), req, resp);
- TestPortletInvocationContext portletInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
+ ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
+ TestPortletInvocationContext portletInvocationContext = new TestPortletInvocationContext(
+ context,
+ portletRequest.getWindowId(),
+ pageState,
+ MARKUP_INFO);
ActionInvocation actionInvocation = new ActionInvocation(portletInvocationContext);
//
@@ -220,14 +222,13 @@
}
private PortletInvocationResponse deliverEvent(PortletControllerContext context, Event event,
- PageNavigationalState pageNS, List<Cookie> requestCookies)
+ PageNavigationalState pageState, List<Cookie> requestCookies)
throws PortletInvokerException
{
PortletInfo portlet = context.getPortletInfo(event.getWindowId());
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
- WindowNavigationalState windowNS = pageNS.getWindowNavigationalState(event.getWindowId());
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, event.getWindowId(), req, resp);
+ WindowNavigationalState windowNS = pageState.getWindowNavigationalState(event.getWindowId());
//
if (windowNS == null)
@@ -236,10 +237,14 @@
}
//
- ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
+ ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
//
- TestPortletInvocationContext actionContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
+ TestPortletInvocationContext actionContext = new TestPortletInvocationContext(
+ context,
+ event.getWindowId(),
+ pageState,
+ MARKUP_INFO);
EventInvocation eventInvocation = new EventInvocation(actionContext);
//
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -26,7 +26,6 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -35,7 +34,6 @@
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
@@ -133,10 +131,11 @@
}
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletResourceRequest.getWindowId(), req, resp);
-
- //
- TestPortletInvocationContext resourceInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
+ TestPortletInvocationContext resourceInvocationContext = new TestPortletInvocationContext(
+ context,
+ portletResourceRequest.getWindowId(),
+ pageNS,
+ MARKUP_INFO);
ResourceInvocation resourceInvocation = new ResourceInvocation(resourceInvocationContext);
//
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -41,7 +41,7 @@
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.test.PortletURLRenderer;
+import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
@@ -228,11 +228,13 @@
HttpServletResponse resp = context.getClientResponse();
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet.getContext().getId(), req, resp);
- //
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
- TestPortletInvocationContext renderContext = new TestPortletInvocationContext(renderer, PortletController.MARKUP_INFO);
+ TestPortletInvocationContext renderContext = new TestPortletInvocationContext(
+ context,
+ portlet.getContext().getId(),
+ pageNS,
+ PortletController.MARKUP_INFO);
//
RenderInvocation render = new RenderInvocation(renderContext);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 02:56:52 UTC (rev 9759)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -33,6 +33,7 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
@@ -49,6 +50,7 @@
import org.jboss.portal.portlet.test.StringCodec;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.TestPortalContext;
+import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
@@ -302,6 +304,14 @@
return eventControllerContext;
}
+ public String renderURL(String windowId, PageNavigationalState pageState, ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
+ {
+ PortletURLRenderer renderer = new PortletURLRenderer(pageState, windowId, req, resp);
+
+ //
+ return renderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
+ }
+
public PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException
{
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRenderer.java (from rev 9758, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletURLRenderer.java 2008-02-05 03:17:08 UTC (rev 9760)
@@ -0,0 +1,246 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.test.controller2;
+
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.text.CharBuffer;
+import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.ActionURL;
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.ResourceURL;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.cache.CacheLevel;
+import static org.jboss.portal.portlet.test.URLParameterConstants.*;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.StringCodec;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletURLRenderer
+{
+
+ /** . */
+ final String windowId;
+
+ /** . */
+ final HttpServletRequest clientReq;
+
+ /** . */
+ final HttpServletResponse clientResp;
+
+ /** . */
+ final PageNavigationalState pageNS;
+
+ public PortletURLRenderer(
+ PageNavigationalState pageNS,
+ String windowId,
+ HttpServletRequest clientReq,
+ HttpServletResponse clientResp)
+ {
+ this.pageNS = pageNS;
+ this.windowId = windowId;
+ this.clientReq = clientReq;
+ this.clientResp = clientResp;
+ }
+
+ public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
+ {
+ CharBuffer buffer = new CharBuffer();
+ buffer.append(clientReq.getScheme());
+ buffer.append("://");
+ buffer.append(clientReq.getServerName());
+ buffer.append(':');
+ buffer.append(Integer.toString(clientReq.getServerPort()));
+ buffer.append(clientReq.getContextPath());
+ buffer.append('/');
+ buffer.append(StringCodec.encode(windowId));
+
+ //
+ Map<String, String> parameters = new HashMap<String, String>();
+
+ //
+ String type;
+ if (containerURL instanceof ActionURL)
+ {
+ type = ACTION_LIFECYCLE;
+ }
+ else if (containerURL instanceof RenderURL)
+ {
+ type = RENDER_LIFECYCLE;
+ }
+ else if (containerURL instanceof ResourceURL)
+ {
+ type = RESOURCE_LIFECYCLE;
+ }
+ else
+ {
+ throw new Error();
+ }
+ parameters.put(LIFECYCLE_TYPE, type);
+
+ //
+ String pageState;
+ try
+ {
+ byte[] bytes = PageNavigationalState.serialize(pageNS);
+ pageState = Tools.toHexString(bytes);
+ }
+ catch (IOException e)
+ {
+ throw new Error(e); //
+ }
+
+ //
+ if (containerURL instanceof PortletURL)
+ {
+ PortletURL portletURL = (PortletURL)containerURL;
+
+ if (portletURL.getMode() != null)
+ {
+ parameters.put(MODE, portletURL.getMode().toString());
+ }
+
+ //
+ if (portletURL.getWindowState() != null)
+ {
+ parameters.put(WINDOW_STATE, portletURL.getWindowState().toString());
+ }
+
+ //
+ parameters.put(PAGE_STATE, pageState);
+
+ //
+ if (containerURL instanceof ActionURL)
+ {
+ ActionURL actionURL = (ActionURL)containerURL;
+
+ //
+ if (actionURL.getNavigationalState() != null)
+ {
+ parameters.put(NAVIGATIONAL_STATE, actionURL.getNavigationalState().getStringValue());
+ }
+
+ //
+ StateString interactionState = actionURL.getInteractionState();
+ parameters.put(INTERACTION_STATE, interactionState.getStringValue());
+ }
+ else
+ {
+ RenderURL renderURL = (RenderURL)containerURL;
+
+ //
+ try
+ {
+ Map<String, String[]> changes = renderURL.getPublicNavigationalStateChanges();
+ HashMap<String, String[]> serialiableChanges = new HashMap<String, String[]>(changes);
+ byte[] bytes = IOTools.serialize(serialiableChanges);
+ String ns = Tools.toHexString(bytes);
+ parameters.put(PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns);
+ }
+ catch (IOException e)
+ {
+ throw new Error(e);
+ }
+
+ //
+ StateString navigationalState = renderURL.getNavigationalState();
+ parameters.put(NAVIGATIONAL_STATE, navigationalState.getStringValue());
+ }
+ }
+ else
+ {
+ ResourceURL resourceURL = (ResourceURL)containerURL;
+
+ //
+ StateString resourceState = resourceURL.getResourceState();
+ parameters.put(RESOURCE_STATE, resourceState.getStringValue());
+
+ //
+ String resourceId = resourceURL.getResourceId();
+ if (resourceId != null)
+ {
+ parameters.put(RESOURCE_ID, resourceId);
+ }
+
+ //
+ CacheLevel cacheability = resourceURL.getCacheability();
+ parameters.put(RESOURCE_CACHEABILITY, cacheability.name());
+
+ //
+ if (cacheability != CacheLevel.FULL)
+ {
+ if (resourceURL.getNavigationalState() != null)
+ {
+ parameters.put(NAVIGATIONAL_STATE, resourceURL.getNavigationalState().getStringValue());
+ }
+
+ //
+ if (resourceURL.getMode() != null)
+ {
+ parameters.put(MODE, resourceURL.getMode().toString());
+ }
+
+ //
+ if (resourceURL.getWindowState() != null)
+ {
+ parameters.put(WINDOW_STATE, resourceURL.getWindowState().toString());
+ }
+
+ if (cacheability == CacheLevel.PAGE)
+ {
+ parameters.put(PAGE_STATE, pageState);
+ }
+ }
+ }
+
+ //
+ boolean first = true;
+ for (Map.Entry<String, String> entry : parameters.entrySet())
+ {
+ String name = entry.getKey();
+ String value = entry.getValue();
+ buffer.append(first ? '?' : '&');
+ buffer.append(name, FastURLEncoder.getUTF8Instance());
+ buffer.append('=');
+ buffer.append(value, FastURLEncoder.getUTF8Instance());
+ first = false;
+ }
+
+ //
+ String url = buffer.asString();
+ return clientResp.encodeURL(url);
+ }
+}
16 years, 4 months
JBoss Portal SVN: r9759 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 21:56:52 -0500 (Mon, 04 Feb 2008)
New Revision: 9759
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
Log:
fix a bug in the event distribution (but it could not be harmful for now as the event window id source is not used in the distribution).
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 02:52:01 UTC (rev 9758)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 02:56:52 UTC (rev 9759)
@@ -122,7 +122,7 @@
// Add events if any
for (UpdateNavigationalStateResponse.Event portletEvent : eventStateResponse.getEvents())
{
- Event producedEvent = new Event(portletEvent.getName(), portletEvent.getPayload(), portletRequest.getWindowId());
+ Event producedEvent = new Event(portletEvent.getName(), portletEvent.getPayload(), event.getWindowId());
List<Event> consumedEvents = eventCC.getConsumedEvents(producedEvent);
eventQueue.addAll(consumedEvents);
}
16 years, 4 months