Author: julien(a)jboss.com
Date: 2007-03-16 10:48:40 -0400 (Fri, 16 Mar 2007)
New Revision: 6713
Added:
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
Removed:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/ValueTrimmingFilter.java
trunk/server/src/main/org/jboss/portal/server/impl/AbstractSessionAttributeResolver.java
trunk/server/src/main/org/jboss/portal/server/impl/MapAttributeResolver.java
trunk/server/src/main/org/jboss/portal/server/impl/PrincipalAttributeResolver.java
trunk/server/src/main/org/jboss/portal/server/impl/RequestAttributeResolver.java
trunk/server/src/main/org/jboss/portal/server/impl/SessionAttributeResolver.java
Modified:
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java
trunk/common/build.xml
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java
Log:
more decoupling from portlet to server
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java 2007-03-16
13:20:08 UTC (rev 6712)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -24,7 +24,7 @@
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.common.invocation.AbstractInvocationContext;
-import org.jboss.portal.server.impl.MapAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import org.jboss.portal.common.invocation.Scope;
import javax.jcr.Session;
Modified: trunk/common/build.xml
===================================================================
--- trunk/common/build.xml 2007-03-16 13:20:08 UTC (rev 6712)
+++ trunk/common/build.xml 2007-03-16 14:48:40 UTC (rev 6713)
@@ -66,6 +66,7 @@
&libraries;
<path id="library.classpath">
<path refid="sun.jaf.classpath"/>
+ <path refid="sun.servlet.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
<path refid="apache.ant.classpath"/>
Copied:
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/server/impl/AbstractSessionAttributeResolver.java)
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/AbstractSessionAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * 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.common.invocation.resolver;
+
+import org.jboss.portal.common.invocation.AttributeResolver;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractSessionAttributeResolver implements AttributeResolver
+{
+
+ /** . */
+ protected final HttpServletRequest req;
+
+ public AbstractSessionAttributeResolver(HttpServletRequest req)
+ {
+ if (req == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.req = req;
+ }
+
+
+ public Set getKeys()
+ {
+ Map map = getMap(false);
+
+ //
+ if (map != null)
+ {
+ return map.keySet();
+ }
+ else
+ {
+ return Collections.EMPTY_SET;
+ }
+ }
+
+ public Object getAttribute(Object attrKey) throws IllegalArgumentException
+ {
+ if (attrKey == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ Object value = null;
+ Map map = getMap(false);
+ if (map != null)
+ {
+ value = map.get(attrKey);
+ }
+ return value;
+ }
+
+ public void setAttribute(Object attrKey, Object attrValue) throws
IllegalArgumentException
+ {
+ if (attrKey == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ Map map = getMap(false);
+ if (map != null)
+ {
+ if (attrValue != null)
+ {
+ map.put(attrKey, attrValue);
+ }
+ else
+ {
+ map.remove(attrKey);
+ }
+ }
+ else
+ {
+ if (attrValue != null)
+ {
+ map = getMap(true);
+ map.put(attrKey, attrValue);
+ }
+ }
+ }
+
+ protected abstract String getMapKey();
+
+ protected Map createMap(String mapKey)
+ {
+ return new HashMap();
+ }
+
+ private Map getMap(boolean create)
+ {
+ HttpSession session = req.getSession(create);
+ if (session != null)
+ {
+ String mapKey = getMapKey();
+ Map map = (Map)session.getAttribute(mapKey);
+ if (map == null)
+ {
+ map = createMap(mapKey);
+ session.setAttribute(mapKey, map);
+ }
+ return map;
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
Copied:
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/server/impl/MapAttributeResolver.java)
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/MapAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * 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.common.invocation.resolver;
+
+import org.jboss.portal.common.invocation.AttributeResolver;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MapAttributeResolver implements AttributeResolver
+{
+
+ /** . */
+ private final Map attributes;
+
+ public MapAttributeResolver(Map attributes)
+ {
+ if (attributes == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.attributes = attributes;
+ }
+
+ public MapAttributeResolver()
+ {
+ this(new HashMap());
+ }
+
+
+ public Set getKeys()
+ {
+ return attributes.keySet();
+ }
+
+ public Object getAttribute(Object attrKey) throws IllegalArgumentException
+ {
+ if (attrKey == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return attributes.get(attrKey);
+ }
+
+ public void setAttribute(Object attrKey, Object attrValue) throws
IllegalArgumentException
+ {
+ if (attrKey == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (attrValue != null)
+ {
+ attributes.put(attrKey, attrValue);
+ }
+ else
+ {
+ attributes.remove(attrKey);
+ }
+ }
+}
Copied:
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/server/impl/PrincipalAttributeResolver.java)
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/PrincipalAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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.common.invocation.resolver;
+
+import javax.servlet.http.HttpServletRequest;
+import java.security.Principal;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrincipalAttributeResolver extends AbstractSessionAttributeResolver
+{
+
+ /** . */
+ private String cachedPrincipalName;
+
+ /** . */
+ private String cachedMapKey;
+
+ public PrincipalAttributeResolver(HttpServletRequest req)
+ {
+ super(req);
+ }
+
+ protected String getMapKey()
+ {
+ Principal principal = req.getUserPrincipal();
+
+ //
+ if (cachedMapKey != null)
+ {
+ if (cachedPrincipalName == null)
+ {
+ if (principal != null)
+ {
+ cachedMapKey = null;
+ }
+ }
+ else
+ {
+ if (principal == null || (cachedPrincipalName.equals(principal.getName()) ==
false))
+ {
+ cachedMapKey = null;
+ }
+ }
+ }
+
+ //
+ if (cachedMapKey == null)
+ {
+ if (principal == null)
+ {
+ cachedMapKey = "portal.principal";
+ cachedPrincipalName = null;
+ }
+ else
+ {
+ cachedMapKey = "portal.principal." + principal.getName();
+ cachedPrincipalName = principal.getName();
+ }
+ }
+
+ //
+ return cachedMapKey;
+ }
+}
Copied:
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/server/impl/RequestAttributeResolver.java)
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/RequestAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * 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.common.invocation.resolver;
+
+import org.jboss.portal.common.invocation.AttributeResolver;
+import org.jboss.portal.common.util.Tools;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RequestAttributeResolver implements AttributeResolver
+{
+
+ /** . */
+ private final HttpServletRequest req;
+
+ public RequestAttributeResolver(HttpServletRequest req)
+ {
+ if (req == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.req = req;
+ }
+
+
+ public Set getKeys()
+ {
+ return Tools.toSet(req.getAttributeNames());
+ }
+
+ public Object getAttribute(Object attrKey) throws IllegalArgumentException
+ {
+ if (attrKey == null)
+ {
+ throw new IllegalArgumentException("No null attribute key accepted");
+ }
+ if (attrKey instanceof String == false)
+ {
+ throw new IllegalArgumentException("Attribute key must be a string");
+ }
+
+ //
+ return req.getAttribute((String)attrKey);
+ }
+
+ public void setAttribute(Object attrKey, Object attrValue) throws
IllegalArgumentException
+ {
+ if (attrKey == null)
+ {
+ throw new IllegalArgumentException("No null attribute key accepted");
+ }
+ if (attrKey instanceof String == false)
+ {
+ throw new IllegalArgumentException("Attribute key must be a string");
+ }
+
+ //
+ if (attrValue != null)
+ {
+ req.setAttribute((String)attrKey, attrValue);
+ }
+ else
+ {
+ req.removeAttribute((String)attrKey);
+ }
+ }
+}
Copied:
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/server/impl/SessionAttributeResolver.java)
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/invocation/resolver/SessionAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.common.invocation.resolver;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SessionAttributeResolver extends AbstractSessionAttributeResolver
+{
+
+ /** . */
+ private final String mapKey;
+
+ public SessionAttributeResolver(HttpServletRequest req, String mapKey)
+ {
+ super(req);
+
+ //
+ if (mapKey == null)
+ {
+ throw new IllegalArgumentException("No null map key allowed");
+ }
+
+ //
+ this.mapKey = mapKey;
+ }
+
+ protected String getMapKey()
+ {
+ return mapKey;
+ }
+}
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -43,8 +43,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.server.impl.MapAttributeResolver;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -29,11 +29,10 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
-import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.server.impl.RequestAttributeResolver;
-import org.jboss.portal.server.impl.PrincipalAttributeResolver;
-import org.jboss.portal.server.impl.MapAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.RequestAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -30,10 +30,10 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.RequestAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.server.impl.MapAttributeResolver;
-import org.jboss.portal.server.impl.PrincipalAttributeResolver;
-import org.jboss.portal.server.impl.RequestAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.session.SubSession;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.server.ServerInvocation;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletRequest;
@@ -85,7 +84,7 @@
// Set the sub session for the portlet synchronization
if (ss != null && ss.isActivated())
{
- invocation.setAttribute(ServerInvocation.REQUEST_SCOPE,
"subsession", ss);
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
"subsession", ss);
}
//
@@ -93,13 +92,13 @@
}
finally
{
- List modifications =
(List)invocation.getAttribute(ServerInvocation.REQUEST_SCOPE, "subsession");
+ List modifications =
(List)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "subsession");
// If we have any modifications propagate them
if (modifications != null)
{
//
- invocation.removeAttribute(ServerInvocation.REQUEST_SCOPE,
"subsession");
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
"subsession");
//
if (ss == null)
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -29,7 +29,6 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.session.SessionListener;
import org.jboss.portal.portlet.session.SubSession;
-import org.jboss.portal.server.ServerInvocation;
import java.util.List;
@@ -46,7 +45,7 @@
if (sessionInfo != null &&
Boolean.TRUE.equals(sessionInfo.getDistributed()))
{
- SubSession ss =
(SubSession)invocation.getAttribute(ServerInvocation.REQUEST_SCOPE,
"subsession");
+ SubSession ss =
(SubSession)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
"subsession");
// If we detect an activation then we copy the content in the dispatched
session
if (ss != null)
@@ -70,7 +69,7 @@
List modifications = SessionListener.desactivate();
// Set modifications for portal session synchronization
- invocation.setAttribute(ServerInvocation.REQUEST_SCOPE,
"subsession", modifications);
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
"subsession", modifications);
}
}
else
Copied:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java (from
rev 6712,
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/ValueTrimmingFilter.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
(rev 0)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.deployment;
+
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * Filter <code>setValue</code> method by doing a trimming before calling the
next model.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ValueTrimmingFilter implements GenericObjectModelFactory
+{
+
+ private final GenericObjectModelFactory next;
+
+ public ValueTrimmingFilter(GenericObjectModelFactory next) throws
IllegalArgumentException
+ {
+ if (next == null)
+ {
+ throw new IllegalArgumentException("Cannot be null");
+ }
+ this.next = next;
+ }
+
+ public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return next.newChild(object, nav, nsURI, localName, attrs);
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
+ {
+ next.addChild(parent, child, nav, nsURI, localName);
+ }
+
+ public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
+ {
+ value = value.trim();
+ next.setValue(object, nav, nsURI, localName, value);
+ }
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return next.newRoot(root, nav, nsURI, localName, attrs);
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName)
+ {
+ return next.completeRoot(root, nav, nsURI, localName);
+ }
+
+}
Property changes on:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -37,6 +37,7 @@
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
import org.jboss.portal.portlet.deployment.PortletApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
import org.jboss.portal.portlet.impl.jsr168.APIFactory;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -26,6 +26,7 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
import org.jboss.portal.portlet.impl.jsr168.APIFactory;
import org.jboss.portal.portlet.impl.jsr168.APIFactoryImpl;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/ValueTrimmingFilter.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/ValueTrimmingFilter.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/ValueTrimmingFilter.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -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.deployment.jboss;
-
-import org.jboss.xb.binding.GenericObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * Filter <code>setValue</code> method by doing a trimming before calling the
next model.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ValueTrimmingFilter implements GenericObjectModelFactory
-{
-
- private final GenericObjectModelFactory next;
-
- public ValueTrimmingFilter(GenericObjectModelFactory next) throws
IllegalArgumentException
- {
- if (next == null)
- {
- throw new IllegalArgumentException("Cannot be null");
- }
- this.next = next;
- }
-
- public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
- {
- return next.newChild(object, nav, nsURI, localName, attrs);
- }
-
- public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
- {
- next.addChild(parent, child, nav, nsURI, localName);
- }
-
- public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
- {
- value = value.trim();
- next.setValue(object, nav, nsURI, localName, value);
- }
-
- public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
- {
- return next.newRoot(root, nav, nsURI, localName, attrs);
- }
-
- public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName)
- {
- return next.completeRoot(root, nav, nsURI, localName);
- }
-
-}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
-import org.jboss.portal.server.PortalConstants;
-
import javax.portlet.PortletContext;
import javax.portlet.PortletRequestDispatcher;
import javax.servlet.RequestDispatcher;
@@ -50,7 +48,7 @@
public String getServerInfo()
{
- return "JBossPortal/" + PortalConstants.VERSION.getMajor() +
"." + PortalConstants.VERSION.getMinor();
+ return "JBossPortal/" + 1 + "." + 0;
}
public PortletRequestDispatcher getRequestDispatcher(String path)
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java 2007-03-16
13:20:08 UTC (rev 6712)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -23,9 +23,9 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.Mode;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.support.spi.ActionContextSupport;
-import org.jboss.portal.server.impl.MapAttributeResolver;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-16
13:20:08 UTC (rev 6712)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -26,6 +26,7 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.common.util.MarkupInfo;
@@ -67,7 +68,6 @@
import org.jboss.portal.server.RequestController;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.impl.MapAttributeResolver;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.logging.Logger;
Deleted:
trunk/server/src/main/org/jboss/portal/server/impl/AbstractSessionAttributeResolver.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/AbstractSessionAttributeResolver.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/server/src/main/org/jboss/portal/server/impl/AbstractSessionAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -1,142 +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.server.impl;
-
-import org.jboss.portal.common.invocation.AttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractSessionAttributeResolver implements AttributeResolver
-{
-
- /** . */
- protected final HttpServletRequest req;
-
- public AbstractSessionAttributeResolver(HttpServletRequest req)
- {
- if (req == null)
- {
- throw new IllegalArgumentException();
- }
- this.req = req;
- }
-
-
- public Set getKeys()
- {
- Map map = getMap(false);
-
- //
- if (map != null)
- {
- return map.keySet();
- }
- else
- {
- return Collections.EMPTY_SET;
- }
- }
-
- public Object getAttribute(Object attrKey) throws IllegalArgumentException
- {
- if (attrKey == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- Object value = null;
- Map map = getMap(false);
- if (map != null)
- {
- value = map.get(attrKey);
- }
- return value;
- }
-
- public void setAttribute(Object attrKey, Object attrValue) throws
IllegalArgumentException
- {
- if (attrKey == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- Map map = getMap(false);
- if (map != null)
- {
- if (attrValue != null)
- {
- map.put(attrKey, attrValue);
- }
- else
- {
- map.remove(attrKey);
- }
- }
- else
- {
- if (attrValue != null)
- {
- map = getMap(true);
- map.put(attrKey, attrValue);
- }
- }
- }
-
- protected abstract String getMapKey();
-
- protected Map createMap(String mapKey)
- {
- return new HashMap();
- }
-
- private Map getMap(boolean create)
- {
- HttpSession session = req.getSession(create);
- if (session != null)
- {
- String mapKey = getMapKey();
- Map map = (Map)session.getAttribute(mapKey);
- if (map == null)
- {
- map = createMap(mapKey);
- session.setAttribute(mapKey, map);
- }
- return map;
- }
- else
- {
- return null;
- }
- }
-}
Deleted: trunk/server/src/main/org/jboss/portal/server/impl/MapAttributeResolver.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/MapAttributeResolver.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/server/src/main/org/jboss/portal/server/impl/MapAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -1,85 +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.server.impl;
-
-import org.jboss.portal.common.invocation.AttributeResolver;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class MapAttributeResolver implements AttributeResolver
-{
-
- /** . */
- private final Map attributes;
-
- public MapAttributeResolver(Map attributes)
- {
- if (attributes == null)
- {
- throw new IllegalArgumentException();
- }
- this.attributes = attributes;
- }
-
- public MapAttributeResolver()
- {
- this(new HashMap());
- }
-
-
- public Set getKeys()
- {
- return attributes.keySet();
- }
-
- public Object getAttribute(Object attrKey) throws IllegalArgumentException
- {
- if (attrKey == null)
- {
- throw new IllegalArgumentException();
- }
- return attributes.get(attrKey);
- }
-
- public void setAttribute(Object attrKey, Object attrValue) throws
IllegalArgumentException
- {
- if (attrKey == null)
- {
- throw new IllegalArgumentException();
- }
- if (attrValue != null)
- {
- attributes.put(attrKey, attrValue);
- }
- else
- {
- attributes.remove(attrKey);
- }
- }
-}
Deleted:
trunk/server/src/main/org/jboss/portal/server/impl/PrincipalAttributeResolver.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/PrincipalAttributeResolver.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/server/src/main/org/jboss/portal/server/impl/PrincipalAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -1,87 +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.server.impl;
-
-import javax.servlet.http.HttpServletRequest;
-import java.security.Principal;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PrincipalAttributeResolver extends AbstractSessionAttributeResolver
-{
-
- /** . */
- private String cachedPrincipalName;
-
- /** . */
- private String cachedMapKey;
-
- public PrincipalAttributeResolver(HttpServletRequest req)
- {
- super(req);
- }
-
- protected String getMapKey()
- {
- Principal principal = req.getUserPrincipal();
-
- //
- if (cachedMapKey != null)
- {
- if (cachedPrincipalName == null)
- {
- if (principal != null)
- {
- cachedMapKey = null;
- }
- }
- else
- {
- if (principal == null || (cachedPrincipalName.equals(principal.getName()) ==
false))
- {
- cachedMapKey = null;
- }
- }
- }
-
- //
- if (cachedMapKey == null)
- {
- if (principal == null)
- {
- cachedMapKey = "portal.principal";
- cachedPrincipalName = null;
- }
- else
- {
- cachedMapKey = "portal.principal." + principal.getName();
- cachedPrincipalName = principal.getName();
- }
- }
-
- //
- return cachedMapKey;
- }
-}
Deleted: trunk/server/src/main/org/jboss/portal/server/impl/RequestAttributeResolver.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/RequestAttributeResolver.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/server/src/main/org/jboss/portal/server/impl/RequestAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -1,92 +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.server.impl;
-
-import org.jboss.portal.common.invocation.AttributeResolver;
-import org.jboss.portal.common.util.Tools;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class RequestAttributeResolver implements AttributeResolver
-{
-
- /** . */
- private final HttpServletRequest req;
-
- public RequestAttributeResolver(HttpServletRequest req)
- {
- if (req == null)
- {
- throw new IllegalArgumentException();
- }
- this.req = req;
- }
-
-
- public Set getKeys()
- {
- return Tools.toSet(req.getAttributeNames());
- }
-
- public Object getAttribute(Object attrKey) throws IllegalArgumentException
- {
- if (attrKey == null)
- {
- throw new IllegalArgumentException("No null attribute key accepted");
- }
- if (attrKey instanceof String == false)
- {
- throw new IllegalArgumentException("Attribute key must be a string");
- }
-
- //
- return req.getAttribute((String)attrKey);
- }
-
- public void setAttribute(Object attrKey, Object attrValue) throws
IllegalArgumentException
- {
- if (attrKey == null)
- {
- throw new IllegalArgumentException("No null attribute key accepted");
- }
- if (attrKey instanceof String == false)
- {
- throw new IllegalArgumentException("Attribute key must be a string");
- }
-
- //
- if (attrValue != null)
- {
- req.setAttribute((String)attrKey, attrValue);
- }
- else
- {
- req.removeAttribute((String)attrKey);
- }
- }
-}
Modified:
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -23,6 +23,9 @@
package org.jboss.portal.server.impl;
import org.jboss.portal.common.invocation.AbstractInvocationContext;
+import org.jboss.portal.common.invocation.resolver.RequestAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.SessionAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
import org.jboss.portal.common.text.CharBuffer;
import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.common.util.ParameterMap;
Deleted: trunk/server/src/main/org/jboss/portal/server/impl/SessionAttributeResolver.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/impl/SessionAttributeResolver.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/server/src/main/org/jboss/portal/server/impl/SessionAttributeResolver.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -1,55 +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.server.impl;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class SessionAttributeResolver extends AbstractSessionAttributeResolver
-{
-
- /** . */
- private final String mapKey;
-
- public SessionAttributeResolver(HttpServletRequest req, String mapKey)
- {
- super(req);
-
- //
- if (mapKey == null)
- {
- throw new IllegalArgumentException("No null map key allowed");
- }
-
- //
- this.mapKey = mapKey;
- }
-
- protected String getMapKey()
- {
- return mapKey;
- }
-}
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/TestPortletInvocationContext.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -34,7 +34,7 @@
import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.spi.RenderContext;
-import org.jboss.portal.server.impl.RequestAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.RequestAttributeResolver;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.wsrp.WSRPConstants;
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java 2007-03-16
13:20:08 UTC (rev 6712)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java 2007-03-16
14:48:40 UTC (rev 6713)
@@ -26,7 +26,6 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
import org.jboss.portal.common.util.URLTools;
-import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.PortletURL;
import org.jboss.portal.portlet.StateString;
@@ -39,8 +38,8 @@
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.server.impl.MapAttributeResolver;
-import org.jboss.portal.server.impl.RequestAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.RequestAttributeResolver;
import org.jboss.portal.wsrp.WSRPPortletURL;
import org.jboss.portal.wsrp.WSRPRewritingConstants;
import org.jboss.portal.wsrp.servlet.ServletAccess;