JBoss Portal SVN: r6765 - in trunk: common/src/main/org/jboss/portal/common/invocation and 17 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-19 22:05:40 -0400 (Mon, 19 Mar 2007)
New Revision: 6765
Modified:
trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java
trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.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/core/src/main/org/jboss/portlet/JBossActionRequest.java
trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java
trunk/core/src/main/org/jboss/portlet/JBossRenderRequest.java
trunk/core/src/main/org/jboss/portlet/JBossRenderResponse.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-server/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.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/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.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/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java
Log:
rather use a scope for portlet invocation that does not use the servlet request attributes as it leads to collision when using nested portlet invocation (which is the case with the JSF component that shows a portlet when used in a portlet bridge).
Modified: trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java
===================================================================
--- trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -123,7 +123,7 @@
public BridgeInfo(PortletInvocation invocation)
{
- ContainerPortletInfo info = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ ContainerPortletInfo info = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
//
this.invocation = invocation;
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/Scope.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -43,6 +43,9 @@
/** Session scope. */
public static final Scope SESSION_SCOPE = new Scope("session");
+ /** Invocation scope. */
+ public static final Scope INVOCATION_SCOPE = new Scope("invocation");
+
/** The value. */
private final String value;
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -59,7 +59,7 @@
// Add declaratively injected header content here (get it via the component)
String headerChars = fragment.getHeader(); // Chris' modif: note that the header might to be re-written...
- PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
JBossPortletMetaData portletMD = (JBossPortletMetaData)container.getJBossMetaData();
if (portletMD != null)
{
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -44,7 +44,7 @@
Transactions.Type txType = Transactions.TYPE_NOT_SUPPORTED;
// Override tx type if found
- ContainerPortletInfo portlet = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ ContainerPortletInfo portlet = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
JBossPortletMetaData portletMD = portlet.getContainer().getJBossMetaData();
if (portletMD != null)
{
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-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -113,7 +113,7 @@
ActionInvocation action = new ActionInvocation(ctx);
//
- action.setAttribute(PortletInvocation.REQUEST_SCOPE, "controller_context", controllerContext);
+ action.setAttribute(PortletInvocation.INVOCATION_SCOPE, "controller_context", controllerContext);
// Contextualize
action.setSecurityContext(cf.createSecurityContext());
@@ -149,7 +149,7 @@
RenderInvocation render = new RenderInvocation(ctx);
//
- render.setAttribute(PortletInvocation.REQUEST_SCOPE, "controller_context", controllerContext);
+ render.setAttribute(PortletInvocation.INVOCATION_SCOPE, "controller_context", controllerContext);
// Contextualize
render.setSecurityContext(cf.createSecurityContext());
@@ -175,6 +175,7 @@
this.controllerContext = controllerContext;
//
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_SCOPE, controllerContext);
addResolver(PortletInvocation.PRINCIPAL_SCOPE, controllerContext);
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, EmptyAttributeResolver.getInstance());
@@ -207,6 +208,7 @@
this.controllerContext = controllerContext;
//
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_SCOPE, controllerContext);
addResolver(PortletInvocation.PRINCIPAL_SCOPE, controllerContext);
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
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-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -225,7 +225,7 @@
try
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, INSTANCE_ID_ATTRIBUTE, getInstanceId());
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, INSTANCE_ID_ATTRIBUTE, getInstanceId());
invocation.setTarget(portletContext);
invocation.setInstanceContext(instanceContext);
@@ -272,7 +272,7 @@
finally
{
// Reset state before invocation
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, INSTANCE_ID_ATTRIBUTE);
+ invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE, INSTANCE_ID_ATTRIBUTE);
invocation.setTarget(null);
invocation.setInstanceContext(null);
}
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-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -61,7 +61,7 @@
{
try
{
- String instanceid = (String)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, Instance.INSTANCE_ID_ATTRIBUTE);
+ String instanceid = (String)invocation.getAttribute(PortletInvocation.INVOCATION_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-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -143,7 +143,7 @@
public void setProperty(String key, String value) throws IllegalStateException
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_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-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -222,7 +222,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
return null;
}
@@ -233,7 +233,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
return null;
}
@@ -246,7 +246,7 @@
{
try
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
fail("Was expecting an IllegalStateException");
}
@@ -262,7 +262,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
throw new RuntimeException("custom_message");
}
Modified: trunk/core/src/main/org/jboss/portlet/JBossActionRequest.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossActionRequest.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portlet/JBossActionRequest.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -52,7 +52,7 @@
super(invocation);
//
- this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "controller_context");
+ this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, "controller_context");
this.blah = null;
}
Modified: trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -51,7 +51,7 @@
super(invocation, preq);
//
- this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "controller_context");
+ this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, "controller_context");
}
// /**
Modified: trunk/core/src/main/org/jboss/portlet/JBossRenderRequest.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossRenderRequest.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portlet/JBossRenderRequest.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -54,7 +54,7 @@
super(invocation);
//
- this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "controller_context");
+ this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, "controller_context");
}
public ControllerContext getControllerContext()
Modified: trunk/core/src/main/org/jboss/portlet/JBossRenderResponse.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossRenderResponse.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/core/src/main/org/jboss/portlet/JBossRenderResponse.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -47,7 +47,7 @@
super(invocation, preq);
//
- this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "controller_context");
+ this.controllerContext = (ControllerContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, "controller_context");
}
public PortalNodeURL createActionURL(PortalNode node) throws IllegalArgumentException, IllegalStateException
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-20 01:52:19 UTC (rev 6764)
+++ trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFActionContext.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -60,6 +60,7 @@
this.invocation = invocation;
//
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeResolver(invocation.clientRequest));
addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(invocation.clientRequest));
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, EmptyAttributeResolver.getInstance());
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-20 01:52:19 UTC (rev 6764)
+++ trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFRenderContext.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -61,6 +61,7 @@
this.invocation = invocation;
//
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeResolver(invocation.clientRequest));
addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(invocation.clientRequest));
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, EmptyAttributeResolver.getInstance());
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -65,7 +65,7 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
PortletApplication portletApplication = container.getApplication();
RequestContext reqCtx = invocation.getRequestContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -69,7 +69,7 @@
String contentType = si.getContentType().toString();
// Get the modes for this content type
- PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
CapabilitiesInfo capabilities = containerInfo.getCapabilities();
// Add all the modes
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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -84,7 +84,7 @@
// Set the sub session for the portlet synchronization
if (ss != null && ss.isActivated())
{
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, "subsession", ss);
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, "subsession", ss);
}
//
@@ -92,13 +92,13 @@
}
finally
{
- List modifications = (List)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "subsession");
+ List modifications = (List)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, "subsession");
// If we have any modifications propagate them
if (modifications != null)
{
//
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, "subsession");
+ invocation.removeAttribute(PortletInvocation.INVOCATION_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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -41,12 +41,12 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletInfo portletInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletInfo portletInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
SessionInfo sessionInfo = portletInfo.getSession();
if (sessionInfo != null && Boolean.TRUE.equals(sessionInfo.getDistributed()))
{
- SubSession ss = (SubSession)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, "subsession");
+ SubSession ss = (SubSession)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, "subsession");
// If we detect an activation then we copy the content in the dispatched session
if (ss != null)
@@ -70,7 +70,7 @@
List modifications = SessionListener.desactivate();
// Set modifications for portal session synchronization
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, "subsession", modifications);
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, "subsession", modifications);
}
}
else
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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -62,7 +62,7 @@
FragmentResponse fragmentResult = (FragmentResponse)response;
// Get config
- PortletInfo info = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletInfo info = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
CacheInfo cacheInfo = info.getCache();
// Update the fragment cache info from the meta info
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -43,7 +43,7 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
SecurityInfo securityInfo = containerInfo.getSecurity();
SecurityContext securityContext = invocation.getSecurityContext();
boolean invoke = true;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -49,7 +49,7 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
Valve valve = container.getValve();
// Try to aquire the valve
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -82,7 +82,7 @@
portletInvocation.setHandler(null);
//
- ContainerPortletInfo info = (ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
+ ContainerPortletInfo info = (ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
PortletContainer container = info.getContainer();
return container.dispatch(portletInvocation);
}
@@ -194,7 +194,7 @@
{
invocation.setHandler(handler);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO, info);
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, PORTLET_CONTAINER_INFO, info);
return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
@@ -215,7 +215,7 @@
finally
{
invocation.setHandler(prevHandler);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO);
+ invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE, PORTLET_CONTAINER_INFO);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -107,7 +107,7 @@
this.securityContext = invocation.getSecurityContext();
this.requestContext = invocation.getRequestContext();
this.instanceContext = invocation.getInstanceContext();
- this.container = (PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ this.container = (PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
this.contentTypes = container.getContentTypes();
this.dreq = invocation.getDispatchedRequest();
this.portalContext = new PortalContextImpl(invocation.getPortalContext());
@@ -115,7 +115,7 @@
//
int mode = this instanceof RenderRequest ? PortletPreferencesImpl.RENDER : PortletPreferencesImpl.ACTION;
- PropertyContext prefs = (PropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ PropertyContext prefs = (PropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
PreferencesValidator validator = container.getPreferencesValidator();
ContainerPreferencesInfo containerPrefs = (ContainerPreferencesInfo)container.getInfo().getPreferences();
this.preferences = new PortletPreferencesImpl(prefs, containerPrefs, validator, mode);
@@ -400,7 +400,7 @@
public boolean isUserInRole(String roleName)
{
// Get the map role name to role link
- Map securityRoleRefsMap = ((PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer()).getSecurityRoleRefsMap();
+ Map securityRoleRefsMap = ((PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer()).getSecurityRoleRefsMap();
// Process the role link
String roleLink = (String)securityRoleRefsMap.get(roleName);
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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -52,6 +52,9 @@
/** The request scope. */
public static final Scope REQUEST_SCOPE = Scope.REQUEST_SCOPE;
+ /** The request scope. */
+ public static final Scope INVOCATION_SCOPE = Scope.INVOCATION_SCOPE;
+
/** The request properties . */
public static final Scope REQUEST_PROPERTIES_SCOPE = new Scope("request_properties");
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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -23,7 +23,6 @@
package org.jboss.portal.portlet.state.consumer;
import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.invocation.AttributeResolver;
import org.jboss.portal.portlet.InvalidPortletIdException;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
@@ -133,12 +132,6 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
- AttributeResolver resolver = invocation.getContext().getAttributeResolver(PortletInvocation.REQUEST_SCOPE);
- if (resolver == null)
- {
- throw new IllegalArgumentException();
- }
-
PortletContext portletContext = invocation.getTarget();
if (portletContext == null)
{
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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -227,7 +227,7 @@
try
{
invocation.setTarget(context.getPortletContext());
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
// Invoke
response = portletInvoker.invoke(invocation);
@@ -235,7 +235,7 @@
finally
{
invocation.setTarget(portletContext);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
}
//
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-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -715,7 +715,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
return null;
}
@@ -749,7 +749,7 @@
{
try
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
return null;
}
@@ -780,7 +780,7 @@
{
public PortletInvocationResponse invoke(PortletInvocation invocation)
{
- AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
+ AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
return null;
}
Modified: trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-20 01:52:19 UTC (rev 6764)
+++ trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -612,6 +612,7 @@
this.invocation = invocation;
//
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(ServerInvocation.REQUEST_SCOPE, invocation.getContext());
addResolver(ServerInvocation.PRINCIPAL_SCOPE, invocation.getContext());
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, EmptyAttributeResolver.getInstance());
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-20 01:52:19 UTC (rev 6764)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/invocation/WSRPPortletInvocationContext.java 2007-03-20 02:05:40 UTC (rev 6765)
@@ -83,6 +83,7 @@
this.requestContext = new WSRPRequestContext();
//
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
addResolver(PortletInvocation.REQUEST_SCOPE, new RequestAttributeResolver(ServletAccess.getRequest()));
addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, EmptyAttributeResolver.getInstance());
addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
17 years, 3 months
JBoss Portal SVN: r6764 - trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-19 21:52:19 -0400 (Mon, 19 Mar 2007)
New Revision: 6764
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
Log:
- Only set the URL on the serviceFactory if it already exists...
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-03-20 01:44:13 UTC (rev 6763)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-03-20 01:52:19 UTC (rev 6764)
@@ -181,7 +181,7 @@
this.wsdlDefinitionURL = wsdlDefinitionURL;
// WSDL url is optional so can be null (and in particular, it is when loaded from Hibernate most of the time)
- if (wsdlDefinitionURL != null)
+ if (wsdlDefinitionURL != null && serviceFactory != null)
{
if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
{
17 years, 3 months
JBoss Portal SVN: r6763 - trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-19 21:44:13 -0400 (Mon, 19 Mar 2007)
New Revision: 6763
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
Log:
- Do not attempt to unregister consumers that are not active.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-20 01:37:29 UTC (rev 6762)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-20 01:44:13 UTC (rev 6763)
@@ -217,7 +217,14 @@
for (Iterator consumersIt = consumers.values().iterator(); consumersIt.hasNext();)
{
WSRPConsumer consumer = (WSRPConsumer)consumersIt.next();
- federatingPortletInvoker.unregisterInvoker(consumer.getProducerId());
+
+ // if producer is not active, it shouldn't be registered with the federating portlet invoker, hence do not
+ // unregister it.
+ if (consumer.getProducerInfo().isActive())
+ {
+ federatingPortletInvoker.unregisterInvoker(consumer.getProducerId());
+ }
+
consumer.stop();
}
17 years, 3 months
JBoss Portal SVN: r6762 - in trunk: portlet/src/main/org/jboss/portal/portlet/aspects/portlet and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-19 21:37:29 -0400 (Mon, 19 Mar 2007)
New Revision: 6762
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
Log:
fixing bad timing for setting the portlet container info on portlet invocation
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-20 00:31:30 UTC (rev 6761)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-20 01:37:29 UTC (rev 6762)
@@ -59,7 +59,7 @@
// Add declaratively injected header content here (get it via the component)
String headerChars = fragment.getHeader(); // Chris' modif: note that the header might to be re-written...
- PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
JBossPortletMetaData portletMD = (JBossPortletMetaData)container.getJBossMetaData();
if (portletMD != null)
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-20 00:31:30 UTC (rev 6761)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-20 01:37:29 UTC (rev 6762)
@@ -49,7 +49,7 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
Valve valve = container.getValve();
// Try to aquire the valve
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-20 00:31:30 UTC (rev 6761)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-20 01:37:29 UTC (rev 6762)
@@ -75,24 +75,20 @@
public Object invoke(Invocation invocation) throws Exception, org.jboss.portal.common.invocation.InvocationException
{
PortletInvocation portletInvocation = (PortletInvocation)invocation;
- PortletContext ctx = portletInvocation.getTarget();
- Portlet portlet = getPortlet(ctx);
- ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
//
try
{
portletInvocation.setHandler(null);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO, info);
//
+ ContainerPortletInfo info = (ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
PortletContainer container = info.getContainer();
return container.dispatch(portletInvocation);
}
finally
{
portletInvocation.setHandler(this);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO);
}
}
};
@@ -188,10 +184,17 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
+ PortletContext ctx = invocation.getTarget();
+ Portlet portlet = getPortlet(ctx);
+ ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
+
+ //
InvocationHandler prevHandler = invocation.getHandler();
try
{
+
invocation.setHandler(handler);
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO, info);
return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
@@ -212,6 +215,7 @@
finally
{
invocation.setHandler(prevHandler);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO);
}
}
17 years, 3 months
JBoss Portal SVN: r6761 - trunk/core/src/main/org/jboss/portal/core/servlet/jsp/taglib.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-03-19 20:31:30 -0400 (Mon, 19 Mar 2007)
New Revision: 6761
Modified:
trunk/core/src/main/org/jboss/portal/core/servlet/jsp/taglib/PortalLib.java
Log:
Convert < to < and > to > on n:out
Modified: trunk/core/src/main/org/jboss/portal/core/servlet/jsp/taglib/PortalLib.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/servlet/jsp/taglib/PortalLib.java 2007-03-20 00:07:16 UTC (rev 6760)
+++ trunk/core/src/main/org/jboss/portal/core/servlet/jsp/taglib/PortalLib.java 2007-03-20 00:31:30 UTC (rev 6761)
@@ -123,7 +123,7 @@
if (contextStack.get(i) != null)
{
NamedContext ctx = (NamedContext)contextStack.get(i);
- return ((Context)ctx.getContext()).get(ctxNames[ctxNames.length - 1]);
+ return convert(((Context)ctx.getContext()).get(ctxNames[ctxNames.length - 1]));
}
else
{
@@ -131,4 +131,15 @@
return "";
}
}
+
+ private static String convert(String toto)
+ {
+ if (toto != null)
+ {
+ toto = toto.replace("<", "<");
+ toto = toto.replace(">", ">");
+ }
+ return toto;
+ }
+
}
17 years, 3 months
JBoss Portal SVN: r6760 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-03-19 20:07:16 -0400 (Mon, 19 Mar 2007)
New Revision: 6760
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
Log:
Removed form inside form
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml 2007-03-19 23:14:00 UTC (rev 6759)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml 2007-03-20 00:07:16 UTC (rev 6760)
@@ -9,12 +9,10 @@
<ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
<ui:param name="auth" value="#{portalobjectmgr.auth}"/>
<ui:define name="form_submit">
- <h:form>
- <h:commandButton value="Update" action="#{auth.execute}" styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button" immediate="true">
- <f:param name="id" value="#{node.id}"/>
- </h:commandButton>
- </h:form>
+ <h:commandButton value="Update" action="#{auth.execute}" styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button" immediate="true">
+ <f:param name="id" value="#{node.id}"/>
+ </h:commandButton>
</ui:define>
</ui:decorate>
</ui:define>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml 2007-03-19 23:14:00 UTC (rev 6759)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml 2007-03-20 00:07:16 UTC (rev 6760)
@@ -10,12 +10,10 @@
<ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
<ui:param name="auth" value="#{portalobjectmgr.auth}"/>
<ui:define name="form_submit">
- <h:form>
- <h:commandButton value="Update" action="#{auth.execute}" styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button" immediate="true">
- <f:param name="id" value="#{node.id}"/>
- </h:commandButton>
- </h:form>
+ <h:commandButton value="Update" action="#{auth.execute}" styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button" immediate="true">
+ <f:param name="id" value="#{node.id}"/>
+ </h:commandButton>
</ui:define>
</ui:decorate>
</ui:define>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-03-19 23:14:00 UTC (rev 6759)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-03-20 00:07:16 UTC (rev 6760)
@@ -105,10 +105,8 @@
<ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
<ui:param name="auth" value="#{instancemgr.auth}"/>
<ui:define name="form_submit">
- <h:form>
- <h:commandButton value="Update" action="#{auth.execute}" styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel" action="instances" styleClass="portlet-form-button" immediate="true"/>
- </h:form>
+ <h:commandButton value="Update" action="#{auth.execute}" styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel" action="instances" styleClass="portlet-form-button" immediate="true"/>
</ui:define>
</ui:decorate>
</c:if>
17 years, 3 months
JBoss Portal SVN: r6759 - in trunk: core/src/main/org/jboss/portal/core/aspects/portlet and 5 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-19 19:14:00 -0400 (Mon, 19 Mar 2007)
New Revision: 6759
Modified:
trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
Log:
improved attribute management on the portlet invocation for the portlet container info attribute
Modified: trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java
===================================================================
--- trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/bridge/src/main/org/jboss/portal/bridge/JBossServletContextProvider.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -25,6 +25,8 @@
import org.apache.portals.bridges.common.ServletContextProvider;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletRequest;
@@ -121,7 +123,7 @@
public BridgeInfo(PortletInvocation invocation)
{
- ContainerPortletInfo info = (ContainerPortletInfo)invocation.getInfo();
+ ContainerPortletInfo info = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
//
this.invocation = invocation;
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -28,11 +28,13 @@
import org.jboss.portal.core.metadata.portlet.JBossPortletMetaData;
import org.jboss.portal.core.metadata.portlet.ElementMetaData;
import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.info.PortletInfo;
import java.io.StringWriter;
import java.util.Iterator;
@@ -57,7 +59,7 @@
// Add declaratively injected header content here (get it via the component)
String headerChars = fragment.getHeader(); // Chris' modif: note that the header might to be re-written...
- PortletContainer container = ((ContainerPortletInfo)invocation.getInfo()).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
JBossPortletMetaData portletMD = (JBossPortletMetaData)container.getJBossMetaData();
if (portletMD != null)
{
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -28,6 +28,8 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,7 +44,7 @@
Transactions.Type txType = Transactions.TYPE_NOT_SUPPORTED;
// Override tx type if found
- ContainerPortletInfo portlet = (ContainerPortletInfo)invocation.getInfo();
+ ContainerPortletInfo portlet = (ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
JBossPortletMetaData portletMD = portlet.getContainer().getJBossMetaData();
if (portletMD != null)
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -25,12 +25,14 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.web.spi.ServletContainerContext;
import org.jboss.portal.web.spi.RequestDispatchCallback;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.info.PortletInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -63,7 +65,7 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)invocation.getInfo()).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
PortletApplication portletApplication = container.getApplication();
RequestContext reqCtx = invocation.getRequestContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -28,6 +28,7 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.common.util.ContentInfo;
import java.util.HashSet;
@@ -68,7 +69,7 @@
String contentType = si.getContentType().toString();
// Get the modes for this content type
- PortletInfo containerInfo = invocation.getInfo();
+ PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
CapabilitiesInfo capabilities = containerInfo.getCapabilities();
// Add all the modes
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-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -29,6 +29,7 @@
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.portlet.container.PortletContainerInvoker;
import java.util.List;
@@ -40,7 +41,7 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletInfo portletInfo = invocation.getInfo();
+ PortletInfo portletInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
SessionInfo sessionInfo = portletInfo.getSession();
if (sessionInfo != null && Boolean.TRUE.equals(sessionInfo.getDistributed()))
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-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -31,6 +31,7 @@
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.apache.log4j.Logger;
/**
@@ -61,7 +62,7 @@
FragmentResponse fragmentResult = (FragmentResponse)response;
// Get config
- PortletInfo info = invocation.getInfo();
+ PortletInfo info = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
CacheInfo cacheInfo = info.getCache();
// Update the fragment cache info from the meta info
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -24,6 +24,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
@@ -42,7 +43,7 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletInfo containerInfo = invocation.getInfo();
+ PortletInfo containerInfo = (PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO);
SecurityInfo securityInfo = containerInfo.getSecurity();
SecurityContext securityContext = invocation.getSecurityContext();
boolean invoke = true;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -24,15 +24,16 @@
import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
+import org.jboss.portal.portlet.info.PortletInfo;
/**
* This aspect has two responsabilities :<br/> <ul> <li>continue the request only if the portlet container valve is
@@ -48,7 +49,7 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)invocation.getInfo()).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
Valve valve = container.getValve();
// Try to aquire the valve
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -57,6 +57,9 @@
public class PortletContainerInvoker implements PortletInvoker, PortletApplicationRegistryListener
{
+ /** The key under which the portlet container info are stored in the request scope of the invocation. */
+ public static final String PORTLET_CONTAINER_INFO = "PORTLET_CONTAINER_INFO";
+
/** . */
private PortletApplicationRegistry registry;
@@ -72,16 +75,24 @@
public Object invoke(Invocation invocation) throws Exception, org.jboss.portal.common.invocation.InvocationException
{
PortletInvocation portletInvocation = (PortletInvocation)invocation;
+ PortletContext ctx = portletInvocation.getTarget();
+ Portlet portlet = getPortlet(ctx);
+ ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
+
+ //
try
{
portletInvocation.setHandler(null);
- ContainerPortletInfo info = (ContainerPortletInfo)portletInvocation.getInfo();
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO, info);
+
+ //
PortletContainer container = info.getContainer();
return container.dispatch(portletInvocation);
}
finally
{
portletInvocation.setHandler(this);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO);
}
}
};
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-03-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -25,6 +25,8 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
@@ -105,7 +107,7 @@
this.securityContext = invocation.getSecurityContext();
this.requestContext = invocation.getRequestContext();
this.instanceContext = invocation.getInstanceContext();
- this.container = (PortletContainerImpl)((ContainerPortletInfo)invocation.getInfo()).getContainer();
+ this.container = (PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
this.contentTypes = container.getContentTypes();
this.dreq = invocation.getDispatchedRequest();
this.portalContext = new PortalContextImpl(invocation.getPortalContext());
@@ -398,7 +400,7 @@
public boolean isUserInRole(String roleName)
{
// Get the map role name to role link
- Map securityRoleRefsMap = ((PortletContainerImpl)((ContainerPortletInfo)invocation.getInfo()).getContainer()).getSecurityRoleRefsMap();
+ Map securityRoleRefsMap = ((PortletContainerImpl)((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer()).getSecurityRoleRefsMap();
// Process the role link
String roleLink = (String)securityRoleRefsMap.get(roleName);
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-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -25,7 +25,6 @@
import org.jboss.portal.common.invocation.Invocation;
import org.jboss.portal.common.invocation.InvocationContext;
import org.jboss.portal.common.invocation.Scope;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
@@ -80,9 +79,6 @@
/** The window context. */
protected WindowContext windowContext;
- /** The portlet info we want to invoke. */
- protected PortletInfo info;
-
/** The window states this portlet can accept. */
protected Set supportedWindowStates;
@@ -154,16 +150,6 @@
this.supportedModes = supportedModes;
}
- public PortletInfo getInfo()
- {
- return info;
- }
-
- public void setInfo(PortletInfo info)
- {
- this.info = info;
- }
-
/** Return the dispatched http servlet request. */
public HttpServletResponse getDispatchedResponse()
{
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-19 22:13:35 UTC (rev 6758)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-19 23:14:00 UTC (rev 6759)
@@ -217,7 +217,6 @@
}
// Create prefs
- PortletInfo info = portlet.getInfo();
AbstractPropertyContext prefs = new AbstractPropertyContext(
access,
context.isStateful() ? ((StatefulContext)context).getProperties() : null,
@@ -229,7 +228,6 @@
{
invocation.setTarget(context.getPortletContext());
invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
- invocation.setInfo(info);
// Invoke
response = portletInvoker.invoke(invocation);
@@ -238,7 +236,6 @@
{
invocation.setTarget(portletContext);
invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
- invocation.setInfo(null);
}
//
17 years, 3 months
JBoss Portal SVN: r6758 - trunk/core/src/main/org/jboss/portal/core/model/portal.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-19 18:13:35 -0400 (Mon, 19 Mar 2007)
New Revision: 6758
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectId.java
Log:
correct impl of PortalObjectId.getLength()
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectId.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectId.java 2007-03-19 22:13:03 UTC (rev 6757)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectId.java 2007-03-19 22:13:35 UTC (rev 6758)
@@ -131,7 +131,7 @@
public int getLength()
{
- return from - to;
+ return to - from;
}
public String getName(int index)
17 years, 3 months
JBoss Portal SVN: r6757 - in trunk: portlet/src/main/org/jboss/portal/portlet/state and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-19 18:13:03 -0400 (Mon, 19 Mar 2007)
New Revision: 6757
Modified:
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java
Log:
better implementation of portlet preferences
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java 2007-03-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -29,6 +29,7 @@
import org.jboss.portal.portlet.state.PropertyContext;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferenceInfo;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
+import org.jboss.portal.portlet.info.PreferenceInfo;
import javax.portlet.PortletPreferences;
import javax.portlet.PreferencesValidator;
@@ -97,7 +98,7 @@
public Enumeration getNames()
{
// Clone the system names
- Set names = new HashSet(prefs.getPortletKeys());
+ Set names = new HashSet(containerPrefs.getKeys());
// Add the user
names.addAll(prefs.getKeys());
@@ -145,7 +146,7 @@
value = prefs.getValue(key);
// If does not exist or read only use what the default one
- if (value == null || isReadOnly(key))
+ if (value == null || isDDReadOnly(key))
{
ContainerPreferenceInfo containerPref = containerPrefs.getContainerPreference(key);
if (containerPref != null)
@@ -157,6 +158,24 @@
return value;
}
+ /**
+ * Return true if the preferences is marked as read only in the portlet.xml deployment
+ * descriptor.
+ *
+ * @param key the preference key
+ * @return the read only value
+ */
+ private boolean isDDReadOnly(String key)
+ {
+ PreferenceInfo pref = containerPrefs.getPreference(key);
+ if (pref != null)
+ {
+ return Boolean.TRUE.equals(pref.isReadOnly());
+ }
+ return false;
+ }
+
+
public String getValue(String key, String def) throws IllegalArgumentException
{
if (key == null)
@@ -200,13 +219,13 @@
if (mode == ACTION)
{
// The accurate value is to combine what the portlet developer and the consumer specifies
- return prefs.isReadOnly() || prefs.isReadOnly(key);
+ return prefs.isReadOnly() || isDDReadOnly(key);
}
else
{
// During render we cannot be aware of the consumer
// intent with respect to the access mode of the current state
- return prefs.isReadOnly(key);
+ return isDDReadOnly(key);
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java 2007-03-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -23,8 +23,6 @@
package org.jboss.portal.portlet.state;
import org.jboss.portal.common.value.Value;
-import org.jboss.portal.portlet.info.PreferenceInfo;
-import org.jboss.portal.portlet.info.PreferencesInfo;
import java.util.Collections;
import java.util.Set;
@@ -45,39 +43,37 @@
/** The state has been succesfully updated. */
public static final int UPDATE_SUCCESSFUL = 2;
+ /** True if render phase. */
+ private final boolean render;
+
/** The user prefs. */
private PropertyMap prefs;
- /** The runtime preferences info for the system. */
- private PreferencesInfo portletPrefs;
-
/** The access mode. */
- private AccessMode access;
+ private final AccessMode access;
/** State change status. */
private int status;
/**
- * Create a new object. If the userPrefs argument is null then the object is considered as globally read only.
+ * Create a new object.
*
- * @param userPrefs the user prefs
- * @param portletPrefs the portlet prefs
+ * @param prefs the user prefs
* @throws IllegalArgumentException if the portletPrefs are null
*/
- public AbstractPropertyContext(AccessMode access, PropertyMap userPrefs, PreferencesInfo portletPrefs) throws IllegalArgumentException
+ public AbstractPropertyContext(
+ AccessMode access,
+ PropertyMap prefs,
+ boolean render) throws IllegalArgumentException
{
if (access == null)
{
throw new IllegalArgumentException("No access mode provided");
}
- if (portletPrefs == null)
- {
- throw new IllegalArgumentException("No null portlet prefs can be provided");
- }
this.access = access;
- this.prefs = userPrefs;
- this.portletPrefs = portletPrefs;
+ this.prefs = prefs;
this.status = NO_CHANGE;
+ this.render = render;
}
public void update(PropertyChange[] changes) throws IllegalStateException
@@ -129,23 +125,12 @@
return prefs.getProperty(key);
}
- public Set getPortletKeys() throws IllegalArgumentException
+ public boolean isReadOnly()
{
- return portletPrefs.getKeys();
- }
-
- public boolean isReadOnly(String key) throws IllegalArgumentException
- {
- PreferenceInfo pref = portletPrefs.getPreference(key);
- if (pref != null)
+ if (render)
{
- return Boolean.TRUE.equals(pref.isReadOnly());
+ throw new IllegalStateException("Not authorized to call this method during the render phase");
}
- return false;
- }
-
- public boolean isReadOnly()
- {
return access == AccessMode.READ_ONLY;
}
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-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -59,8 +59,9 @@
* during the render request will produce a non accurate value.
*
* @return true if the preferences are read only
+ * @throws IllegalStateException if this is called during render phase
*/
- boolean isReadOnly();
+ boolean isReadOnly() throws IllegalStateException;
/**
* Update the preferences.
@@ -69,21 +70,4 @@
* @throws IllegalArgumentException if any change is not valid
*/
void update(PropertyChange[] changes) throws IllegalStateException;
-
- /**
- * Return the key set.
- *
- * @return the system key set
- * @throws IllegalArgumentException if the array is null
- */
- Set getPortletKeys() throws IllegalArgumentException;
-
- /**
- * Say if the property key is marked as read only or not.
- *
- * @param key the requested key
- * @return the read only value
- * @throws IllegalArgumentException if the key or the array is null
- */
- boolean isReadOnly(String key) throws IllegalArgumentException;
}
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-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -37,6 +37,7 @@
import org.jboss.portal.portlet.info.PreferencesInfo;
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.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AbstractPropertyContext;
@@ -217,8 +218,10 @@
// Create prefs
PortletInfo info = portlet.getInfo();
- PreferencesInfo prefsInfo = info.getPreferences();
- AbstractPropertyContext prefs = new AbstractPropertyContext(access, context.isStateful() ? ((StatefulContext)context).getProperties() : null, prefsInfo);
+ AbstractPropertyContext prefs = new AbstractPropertyContext(
+ access,
+ context.isStateful() ? ((StatefulContext)context).getProperties() : null,
+ invocation instanceof RenderInvocation);
//
PortletInvocationResponse response;
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java 2007-03-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -62,4 +62,13 @@
{
return httpTestContext.rewriteURLForNode(url, nodeId);
}
+
+ public String getParameter(String parameterName)
+ {
+ if (parameterName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return (String)httpTestContext.getParametrization().getParameterValue(parameterName).get();
+ }
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java 2007-03-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -35,7 +35,8 @@
* The "mutable" literal means that the portal will allow the portlet container to modify
* the state and take in account any clone operation done during the request. The "immutable"
* literal means that the portal will call the portlet container without allowing him to
- * perform cloning operations.
+ * perform cloning operations. When the parameter is not specific explicitely the default
+ * behavior should be to treat the value a mutable.
*/
public static final String PORTAL_PORTLET_STATE_MANAGEMENT = "portal.portlet_state_management";
Modified: trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-19 20:58:40 UTC (rev 6756)
+++ trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-19 22:13:03 UTC (rev 6757)
@@ -24,6 +24,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestParameters;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.invocation.EmptyAttributeResolver;
import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
@@ -123,9 +125,6 @@
public void handle(ServerInvocation invocation) throws ServerException
{
-
-// PortletTestDriver.getInstance().
-
try
{
String requestPath = invocation.getServerContext().getPortalRequestPath();
@@ -389,22 +388,47 @@
writer.close();
}
- /** An instance context implementation that stores */
+ /**
+ * An instance context implementation that stores the cloned context in the HTTP session of the user.
+ */
protected class InstanceContextImpl implements InstanceContext
{
+ /** . */
+ private static final String CLONE_OF = "clone_of_";
+
+ /** . */
+ private boolean anonymous;
+
+ /** . */
private HttpServletRequest req;
+
+ /** . */
private AccessMode accessMode;
+
+ /** . */
private PortletContext portletContext;
+
+ /** . */
private PortletContext cloneContext;
- private static final String CLONE_OF = "clone_of_";
- public InstanceContextImpl(Portlet portlet, HttpServletRequest req)
+ public InstanceContextImpl(Portlet portlet, HttpServletRequest req, boolean anonymous)
{
this.portletContext = portlet.getContext();
this.req = req;
- this.cloneContext = (PortletContext)req.getSession().getAttribute(CLONE_OF + portlet.getContext().getId());
- this.accessMode = cloneContext == null ? AccessMode.CLONE_BEFORE_WRITE : AccessMode.READ_WRITE;
+ this.anonymous = anonymous;
+
+ //
+ if (anonymous)
+ {
+ this.accessMode = AccessMode.READ_ONLY;
+ this.cloneContext = null;
+ }
+ else
+ {
+ this.accessMode = cloneContext == null ? AccessMode.CLONE_BEFORE_WRITE : AccessMode.READ_WRITE;
+ this.cloneContext = (PortletContext)req.getSession().getAttribute(CLONE_OF + portlet.getContext().getId());
+ }
}
public String getId()
@@ -414,6 +438,10 @@
public void onStateEvent(StateEvent event)
{
+ if (anonymous)
+ {
+ throw new IllegalStateException("The portal should not receive event callbacks in anonymous mode");
+ }
req.getSession().setAttribute(CLONE_OF + this.portletContext.getId(), event.getPortletContext());
}
@@ -515,11 +543,13 @@
public void update(final ServerInvocation serverInvocation, PortletInvocation invocation)
{
+ String ppsm = PortletTestDriver.getPortletTestContext().getParameter(PortletTestParameters.PORTAL_PORTLET_STATE_MANAGEMENT);
+ boolean anonymous = "immutable".equals(ppsm);
final PortletInvocationContextImpl invocationContext = (PortletInvocationContextImpl)invocation.getPortletContext();
PortalContext portalContext = new TestPortalContext();
SecurityContext securityContext = new AbstractSecurityContext(invocationContext.getClientRequest());
RequestContext requestContext = new AbstractRequestContext(invocationContext.getClientRequest(), invocationContext.getClientResponse());
- InstanceContext instanceContext = new InstanceContextImpl(invocationContext.portlet, invocationContext.getClientRequest());
+ InstanceContext instanceContext = new InstanceContextImpl(invocationContext.portlet, invocationContext.getClientRequest(), anonymous);
//
WindowContext windowContext = new WindowContext()
17 years, 3 months
JBoss Portal SVN: r6756 - trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-19 16:58:40 -0400 (Mon, 19 Mar 2007)
New Revision: 6756
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
Log:
- Now properly reset useWSDL status.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-19 18:35:29 UTC (rev 6755)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-19 20:58:40 UTC (rev 6756)
@@ -124,6 +124,8 @@
public String listConsumers()
{
+ useWSDL = null;
+ selectedId = null;
return "index";
}
17 years, 3 months