Author: julien(a)jboss.com
Date: 2007-03-15 13:08:49 -0400 (Thu, 15 Mar 2007)
New Revision: 6691
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
Log:
moved the target of the portlet invocation as an portlet invocation attribute rather than
an attribute of the request scope
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -41,7 +41,6 @@
import java.util.Arrays;
import java.util.Set;
import java.util.List;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -226,8 +225,8 @@
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.INSTANCE_ID_ATTRIBUTE, getInstanceId());
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, INSTANCE_ID_ATTRIBUTE,
getInstanceId());
+ invocation.setTarget(portletContext);
invocation.setInstanceContext(instanceContext);
// Perform invocation
@@ -273,8 +272,8 @@
finally
{
// Reset state before invocation
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.INSTANCE_ID_ATTRIBUTE);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
INSTANCE_ID_ATTRIBUTE);
+ invocation.setTarget(null);
invocation.setInstanceContext(null);
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2007-03-15
16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -39,6 +39,9 @@
*/
public interface Instance
{
+ /** The attribute name under which the instance id can be accessed. */
+ String INSTANCE_ID_ATTRIBUTE = "instanceid";
+
/**
* Return the id.
*
Modified:
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -61,7 +61,7 @@
{
try
{
- String instanceid =
(String)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.INSTANCE_ID_ATTRIBUTE);
+ String instanceid =
(String)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
Instance.INSTANCE_ID_ATTRIBUTE);
PortalAuthorizationManager pam = pamf.getManager();
InstancePermission perm = new InstancePermission(instanceid,
InstancePermission.VIEW_MASK);
boolean authorized = pam.checkPermission(perm);
Modified:
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -64,6 +64,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
import org.jboss.portal.portlet.test.ActionContextImpl;
import org.jboss.portal.portlet.test.UserContextImpl;
@@ -142,7 +143,7 @@
public void setProperty(String key, String value) throws IllegalStateException
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate(key, new
StringValue(value))});
}
}
Modified: trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -53,6 +53,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.state.producer.PortletState;
import org.jboss.portal.portlet.state.producer.PortletStateContext;
import org.jboss.portal.portlet.test.ActionContextImpl;
@@ -221,7 +222,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc",
new StringValue("_def"))});
return null;
}
@@ -232,7 +233,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc",
new StringValue("_def"))});
return null;
}
@@ -245,7 +246,7 @@
{
try
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new
PropertyChange[]{PropertyChange.newUpdate("_abc", new
StringValue("_def"))});
fail("Was expecting an IllegalStateException");
}
@@ -261,7 +262,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc",
new StringValue("_def"))});
throw new RuntimeException("custom_message");
}
@@ -496,7 +497,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
PortletContext.createPortletContext("CloningPortlet"));
+ action.setTarget(PortletContext.createPortletContext("CloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
@@ -528,10 +529,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(
- PortletInvocation.REQUEST_SCOPE,
- PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext("CloneFailedCloningPortlet"));
+
action.setTarget(PortletContext.createPortletContext("CloneFailedCloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_WRITE);
action.setInstanceContext(instanceContext);
@@ -549,8 +547,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext("CloneFailedCloningPortlet"));
+
action.setTarget(PortletContext.createPortletContext("CloneFailedCloningPortlet"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_ONLY);
action.setInstanceContext(instanceContext);
@@ -581,7 +578,7 @@
//
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloningPortletId);
+ action.setTarget(cloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
@@ -618,7 +615,7 @@
//
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloningPortletId);
+ action.setTarget(cloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_WRITE);
action.setInstanceContext(instanceContext);
@@ -648,7 +645,7 @@
//
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, cloneFailedCloningPortletId);
+ action.setTarget(cloneFailedCloningPortletId);
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.READ_ONLY);
action.setInstanceContext(instanceContext);
@@ -665,8 +662,7 @@
{
beginRegistrationScopedTX();
PortletInvocation action = new ActionInvocation(new ActionContextImpl(Mode.VIEW));
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
-
PortletContext.createPortletContext("CloningPortletThrowingRuntimeException"));
+
action.setTarget(PortletContext.createPortletContext("CloningPortletThrowingRuntimeException"));
action.setUserContext(new UserContextImpl("julien"));
InstanceContextImpl instanceContext = new InstanceContextImpl("whatever",
AccessMode.CLONE_BEFORE_WRITE);
action.setInstanceContext(instanceContext);
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -98,7 +98,7 @@
{
throw new IllegalArgumentException();
}
- PortletContext portletContext =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new InvocationException("No portlet context provided");
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -191,7 +191,7 @@
invocation.setWindowContext(windowContext);
//
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portlet.getContext());
+ invocation.setTarget(portlet.getContext());
PortletInvoker invoker = uiportlet.getPortletInvoker();
return invoker.invoke(invocation);
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -73,7 +73,7 @@
}
catch (NumberFormatException e)
{
- log.warn("Portlet " +
invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE) +
+ log.warn("Portlet " + invocation.getTarget() +
" set a non integer cache value override during render
" + portletValue, e);
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestImpl.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -112,7 +112,7 @@
//
int mode = this instanceof RenderRequest ? PortletPreferencesImpl.RENDER :
PortletPreferencesImpl.ACTION;
- PropertyContext prefs =
(PropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ PropertyContext prefs =
(PropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
PreferencesValidator validator = container.getPreferencesValidator();
ContainerPreferencesInfo containerPrefs =
(ContainerPreferencesInfo)container.getInfo().getPreferences();
this.preferences = new PortletPreferencesImpl(prefs, containerPrefs, validator,
mode);
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -33,6 +33,7 @@
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.portlet.PortletContext;
import org.jboss.portal.server.ServerInvocation;
import javax.servlet.http.HttpServletRequest;
@@ -59,18 +60,9 @@
/** The response properties. */
public static final Scope RESPONSE_PROPERTIES_SCOPE = new
Scope("response_properties");
- /** The attribute name under which the portlet id can be accessed. */
- public static final String PORTLET_CONTEXT_ATTRIBUTE = "portletcontext";
+ /** The target portlet. */
+ protected PortletContext target;
- /** The attribute name under which the registry can be accessed. */
- public static final String PORTLET_INVOKER = "portletinvoker";
-
- /** The attribute name under which the preferences can be accessed. */
- public static final String PREFERENCES_ATTRIBUTE = "preferences";
-
- /** The attribute name under which the instance id can be accessed. */
- public static final String INSTANCE_ID_ATTRIBUTE = "instanceid";
-
/** The portal context. */
protected PortalContext portalContext;
@@ -133,6 +125,16 @@
return ctx;
}
+ public PortletContext getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget(PortletContext target)
+ {
+ this.target = target;
+ }
+
public Set getSupportedWindowStates()
{
return supportedWindowStates;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -46,7 +46,7 @@
// Correctness is not insured.
protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
{
- PortletContext portlet =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portlet = invocation.getTarget();
String portletName = portlet.getId();
boolean error = false;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-03-15
16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -34,6 +34,9 @@
*/
public interface PropertyContext
{
+ /** The attribute name under which the preferences can be accessed. */
+ String PREFERENCES_ATTRIBUTE = "preferences";
+
/**
* Return the key set.
*
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -139,7 +139,7 @@
throw new IllegalArgumentException();
}
- PortletContext portletContext =
(PortletContext)resolver.getAttribute(PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new IllegalArgumentException();
@@ -154,7 +154,7 @@
try
{
- resolver.setAttribute(PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
consumerContext.portletContext);
+ invocation.setTarget(consumerContext.portletContext);
invocation.setInstanceContext(pictx);
//
@@ -211,7 +211,7 @@
}
finally
{
- resolver.setAttribute(PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
portletContext);
+ invocation.setTarget(portletContext);
invocation.setInstanceContext(cictx);
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -51,6 +51,7 @@
import org.jboss.portal.portlet.state.StateConversionException;
import org.jboss.portal.portlet.state.StateConverter;
import org.jboss.portal.portlet.state.StateManagementPolicy;
+import org.jboss.portal.portlet.state.PropertyContext;
import java.util.ArrayList;
import java.util.Iterator;
@@ -185,7 +186,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
{
// Get the context of the portlet that the client want to use
- final PortletContext portletContext =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ final PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
throw new InvocationException("No portlet context provided");
@@ -220,8 +221,8 @@
PortletInvocationResponse response;
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, context.getPortletContext());
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE, prefs);
+ invocation.setTarget(context.getPortletContext());
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
invocation.setInfo(info);
// Invoke
@@ -229,8 +230,8 @@
}
finally
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ invocation.setTarget(portletContext);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
invocation.setInfo(null);
}
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-15
16:23:28 UTC (rev 6690)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -152,7 +152,7 @@
decoder.getForm());
ActionInvocation action = createAction(invocation, actionContext);
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
+
action.setTarget(((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
PortletInvocationResponse response = portletInvoker.invoke(action);
if (response instanceof RenderResponse)
{
@@ -286,7 +286,7 @@
//
writer.write("<div>");
RenderInvocation render = createRender(invocation, renderContext);
- render.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
+
render.setTarget(((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
PortletInvocationResponse response = portletInvoker.invoke(render);
//
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -58,7 +58,7 @@
try
{
PortalAuthorizationManager authMgr = pamf.getManager();
- PortletContext portletContext =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
String portletId = portletContext.getId();
PortletPermission perm = new PortletPermission(portletId,
PortletPermission.VIEW_MASK);
boolean authorized = authMgr.checkPermission(perm);
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -123,7 +123,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
{
- PortletContext portletContext =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext portletContext = invocation.getTarget();
InternalPortlet portlet = internalGetPortlet(portletContext);
return portlet.support.invoke(invocation);
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -43,6 +43,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.test.ValueMapAssert;
import org.jboss.portal.portlet.test.support.PortletSupport;
@@ -714,7 +715,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc",
new StringValue("_def"))});
return null;
}
@@ -748,7 +749,7 @@
{
try
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new
PropertyChange[]{PropertyChange.newUpdate("abc", new
StringValue("_def"))});
return null;
}
@@ -779,7 +780,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc",
new StringValue("_def"))});
return null;
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -208,7 +208,7 @@
//
ActionInvocation action = new ActionInvocation(actionCtx);
action.setInstanceContext(instanceCtx);
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletRef);
+ action.setTarget(portletRef);
return action;
}
@@ -220,7 +220,7 @@
protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
- return (PortletContext)action.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return action.getTarget();
}
private Portlet getSinglePOP() throws PortletInvokerException
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -23,7 +23,6 @@
package org.jboss.portal.test.portlet.state;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.PortletContext;
/**
@@ -39,6 +38,6 @@
protected PortletContext getModifiedPortletRef(ActionInvocation action)
{
- return (PortletContext)action.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return action.getTarget();
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -200,7 +200,7 @@
//
ActionInvocation action = new ActionInvocation(actionCtx);
action.setInstanceContext(instanceCtx);
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletRef);
+ action.setTarget(portletRef);
return action;
}
Modified:
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
===================================================================
---
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -138,18 +138,18 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
InvocationException, PortletInvokerException
{
- PortletContext compoundPortletContext =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext compoundPortletContext = invocation.getTarget();
PortletContext portletContext = dereference(compoundPortletContext);
InstanceContext instanceContext = invocation.getInstanceContext();
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
+ invocation.setTarget(portletContext);
invocation.setInstanceContext(new FederatedInstanceContext(instanceContext));
return portletInvoker.invoke(invocation);
}
finally
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, compoundPortletContext);
+ invocation.setTarget(compoundPortletContext);
invocation.setInstanceContext(instanceContext);
}
}
Modified:
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
===================================================================
---
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -144,7 +144,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
{
- PortletContext compoundPortletContext =
(PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ PortletContext compoundPortletContext = invocation.getTarget();
FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
return federated.invoke(invocation);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -29,7 +29,6 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
@@ -196,8 +195,7 @@
TestPortletInvocationContext rc = new TestPortletInvocationContext(mode, state,
navigationalState);
RenderInvocation render = new RenderInvocation(rc);
- render.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext(portletHandle));
+ render.setTarget(PortletContext.createPortletContext(portletHandle));
render.setInstanceContext(new BasicInstanceContext(portletHandle));
render.setSecurityContext(new BasicSecurityContext());
@@ -219,8 +217,7 @@
action.setInstanceContext(new BasicInstanceContext(portletHandle));
action.setSecurityContext(new BasicSecurityContext());
action.setUserContext(new BasicUserContext());
- action.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE,
- PortletContext.createPortletContext(portletHandle));
+ action.setTarget(PortletContext.createPortletContext(portletHandle));
return action;
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-15
16:23:28 UTC (rev 6690)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -402,7 +402,7 @@
*/
static PortletContext getPortletContext(PortletInvocation invocation)
{
- return (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
+ return invocation.getTarget();
}
WSRPPortletInfo getPortletInfo(PortletInvocation invocation) throws
PortletInvokerException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ActionRequestProcessor.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -26,7 +26,6 @@
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.RenderResponse;
@@ -164,7 +163,7 @@
markupRequest.getCharacterSet(), markupRequest.getMimeType());
setInvocation(new ActionInvocation(actionContext));
actionContext.contextualize(invocation);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portlet.getContext());
+ invocation.setTarget(portlet.getContext());
}
Object processResponse(PortletInvocationResponse response)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-03-15
16:23:28 UTC (rev 6690)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RenderRequestProcessor.java 2007-03-15
17:08:49 UTC (rev 6691)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.info.CacheInfo;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -124,7 +123,7 @@
setInvocation(new RenderInvocation(renderContext));
renderContext.contextualize(invocation);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portlet.getContext());
+ invocation.setTarget(portlet.getContext());
}
Object processResponse(PortletInvocationResponse response)