Author: chris.laprun(a)jboss.com
Date: 2007-02-22 21:38:30 -0500 (Thu, 22 Feb 2007)
New Revision: 6382
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/WSRPPortlet.java
Log:
- Integrated Julien's patch to remove ccpsMap since it led to incorrect initial
state.
- ProducerInfo.getPortlet will now deal with clones as well.
- Use PortletContext instead of portlet handle where it makes more sense.
- Added testDestroyClones implementation and supporting classes.
- Modified BasicPMB.getPortletDescription to correctly handle request for a CCP.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java 2007-02-22
23:13:40 UTC (rev 6381)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/BehaviorRegistry.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -23,6 +23,7 @@
package org.jboss.portal.test.wsrp.framework;
+import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.InvalidHandleFault;
import java.util.HashMap;
@@ -64,8 +65,8 @@
{
return (MarkupBehavior)behaviors.get(handle);
}
- System.out.println("There is no registered MarkupBehavior for handle
'" + handle + "'");
- throw new InvalidHandleFault();
+ throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ new IllegalArgumentException("There is no registered MarkupBehavior for
handle '" + handle + "'"));
}
public void registerMarkupBehavior(MarkupBehavior behavior)
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestCase.java 2007-02-22
23:13:40 UTC (rev 6381)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestCase.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -27,12 +27,19 @@
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicMarkupBehavior;
import org.jboss.portal.test.wsrp.v1.consumer.behaviors.BasicPortletManagementBehavior;
+import
org.jboss.portal.test.wsrp.v1.consumer.behaviors.DestroyClonesPortletManagementBehavior;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
@@ -64,7 +71,7 @@
ExtendedAssert.assertEquals(originalInfo.getMetaValue(MetaInfo.DESCRIPTION),
cloneInfo.getMetaValue(MetaInfo.DESCRIPTION));
}
- public void testGetProperties() throws Exception
+ public void testGetSetProperties() throws Exception
{
PortletContext original =
PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE);
PropertyMap props = consumer.getProperties(original);
@@ -98,7 +105,46 @@
public void testDestroyClones() throws Exception
{
+ // switch the behavior for portlet management
+ BehaviorRegistry behaviorRegistry = producer.getBehaviorRegistry();
+ behaviorRegistry.setPortletManagementBehavior(new
DestroyClonesPortletManagementBehavior(behaviorRegistry));
+ PortletContext original =
PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE);
+ PortletContext clone = consumer.createClone(original);
+ ExtendedAssert.assertNotNull(clone);
+ Portlet portlet = consumer.getPortlet(clone);
+ ExtendedAssert.assertNotNull(portlet);
+ ExtendedAssert.assertEquals(BasicPortletManagementBehavior.CLONED_HANDLE,
portlet.getContext().getId());
+
+ List clones = new ArrayList(1);
+ clones.add(clone);
+ List result = consumer.destroyClones(clones);
+ ExtendedAssert.assertTrue(result.isEmpty());
+ try
+ {
+ consumer.getPortlet(clone);
+ ExtendedAssert.fail("Should have failed: clone should not exist
anymore!");
+ }
+ catch (PortletInvokerException expected)
+ {
+ }
+
+ // re-create clone and try again with an added invalid portlet context
+ clone = consumer.createClone(original);
+ PortletContext invalidContext =
PortletContext.createPortletContext("invalid");
+ clones.add(invalidContext);
+ result = consumer.destroyClones(clones);
+ ExtendedAssert.assertEquals(1, result.size());
+ DestroyCloneFailure failure = (DestroyCloneFailure)result.get(0);
+ ExtendedAssert.assertEquals("invalid", failure.getPortletId());
+ try
+ {
+ consumer.getPortlet(clone);
+ ExtendedAssert.fail("Should have failed: clone should not exist
anymore!");
+ }
+ catch (PortletInvokerException expected)
+ {
+ }
}
public void testInvalidSetProperties() throws Exception
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java 2007-02-22
23:13:40 UTC (rev 6381)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -30,6 +30,9 @@
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.ClonePortlet;
+import org.jboss.portal.wsrp.core.DestroyFailed;
+import org.jboss.portal.wsrp.core.DestroyPortlets;
+import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
import org.jboss.portal.wsrp.core.GetPortletDescription;
import org.jboss.portal.wsrp.core.GetPortletProperties;
import org.jboss.portal.wsrp.core.InconsistentParametersFault;
@@ -39,12 +42,15 @@
import org.jboss.portal.wsrp.core.MissingParametersFault;
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PortletContext;
+import org.jboss.portal.wsrp.core.PortletDescription;
import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.SetPortletProperties;
import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -89,8 +95,24 @@
WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletDescription,
"GetPortletDescription");
String handle = getHandleFrom(getPortletDescription.getPortletContext(),
"GetPortletDescription");
+ // need to fake that the clone exists... so remove suffix to get the description of
the POP
+ int index = handle.indexOf(CLONE_SUFFIX);
+ if (index != -1)
+ {
+ handle = handle.substring(0, index);
+ }
+
+ // get the POP description...
MarkupBehavior markupBehaviorFor = registry.getMarkupBehaviorFor(handle);
- return
WSRPTypeFactory.createPortletDescriptionResponse(markupBehaviorFor.getPortletDescriptionFor(handle));
+ PortletDescription description =
markupBehaviorFor.getPortletDescriptionFor(handle);
+
+ // if it was a clone, add the suffix back to the handle.
+ if (index != -1)
+ {
+ description.setPortletHandle(handle + CLONE_SUFFIX);
+ }
+
+ return WSRPTypeFactory.createPortletDescriptionResponse(description);
}
public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault,
AccessDeniedFault, OperationFailedFault, InconsistentParametersFault,
InvalidUserCategoryFault, RemoteException
@@ -151,4 +173,33 @@
return handle;
}
+
+
+ public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws
InconsistentParametersFault, MissingParametersFault, InvalidRegistrationFault,
OperationFailedFault, RemoteException
+ {
+ WSRPUtils.throwOperationFailedFaultIfValueIsMissing(destroyPortlets,
"DestroyPortlets");
+ String[] handles = destroyPortlets.getPortletHandles();
+ WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handles, "portlet
handles", "DestroyPortlets");
+ if (handles.length == 0)
+ {
+ WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handles, "portlet
handles", "DestroyPortlets");
+ }
+
+ List failures = new ArrayList();
+ for (int i = 0; i < handles.length; i++)
+ {
+ String handle = handles[i];
+ if (!CLONED_HANDLE.equals(handle))
+ {
+ failures.add(WSRPTypeFactory.createDestroyFailed(handle, "Handle
'" + handle + "' doesn't exist"));
+ }
+ }
+
+ DestroyFailed[] failed = null;
+ if (!failures.isEmpty())
+ {
+ failed = (DestroyFailed[])failures.toArray(new DestroyFailed[0]);
+ }
+ return WSRPTypeFactory.createDestroyPortletsResponse(failed);
+ }
}
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java
(rev 0)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.test.wsrp.v1.consumer.behaviors;
+
+import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
+import org.jboss.portal.wsrp.WSRPUtils;
+import org.jboss.portal.wsrp.core.AccessDeniedFault;
+import org.jboss.portal.wsrp.core.GetPortletDescription;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
+
+import java.rmi.RemoteException;
+
+/**
+ * Specific behavior used in PortletManagementCase.testDestroyClones.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class DestroyClonesPortletManagementBehavior extends
BasicPortletManagementBehavior
+{
+ int callCount = 0;
+
+ public DestroyClonesPortletManagementBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ }
+
+
+ public PortletDescriptionResponse getPortletDescription(GetPortletDescription
getPortletDescription)
+ throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
+ {
+ // only return the portlet description the first time the method is called since
all other calls happen after
+ // the clone has been destroyed...
+ if (callCount++ == 0)
+ {
+ return super.getPortletDescription(getPortletDescription);
+ }
+ else
+ {
+ throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class,
+ new IllegalArgumentException("Invalid portlet handle: "
+ + getPortletDescription.getPortletContext().getPortletHandle()));
+ }
+ }
+}
Property changes on:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/DestroyClonesPortletManagementBehavior.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2007-02-22 23:13:40 UTC
(rev 6381)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2007-02-23 02:38:30 UTC
(rev 6382)
@@ -180,6 +180,20 @@
}
/**
+ * @param registrationContext
+ * @param portletContext
+ * @return
+ * @since 2.6
+ */
+ public static GetPortletDescription createGetPortletDescription(RegistrationContext
registrationContext,
+
org.jboss.portal.portlet.PortletContext portletContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "portlet
context");
+ PortletContext wsrpPC = createPortletContext(portletContext.getId(),
portletContext.getState());
+ return new GetPortletDescription(registrationContext, wsrpPC, null, null);
+ }
+
+ /**
* registrationContext(RegistrationContext)?, portletContext(PortletContext),
userContext(UserContext)?,
* desiredLocales(xsd:string)*
*
@@ -341,7 +355,21 @@
return portletContext;
}
+
/**
+ * @param portletHandle
+ * @param portletState
+ * @return
+ * @since 2.6
+ */
+ public static PortletContext createPortletContext(String portletHandle, byte[]
portletState)
+ {
+ PortletContext pc = createPortletContext(portletHandle);
+ pc.setPortletState(portletState);
+ return pc;
+ }
+
+ /**
* Same as createInteractionParams(StateChange.readOnly)
*
* @return
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-02-22
23:13:40 UTC (rev 6381)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -364,22 +364,32 @@
return wsrpPortlet;
}
- public Portlet getPortlet(String portletId) throws PortletInvokerException
+ public Portlet getPortlet(PortletContext portletContext) throws
PortletInvokerException
{
boolean justRefreshed = refresh(false);
- // if cache is still valid or we just refreshed, use information from cached
service description
+ String portletHandle = portletContext.getId();
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle,
"Portlet handle", "getPortlet");
+
+ Portlet portlet = null;
+ // First try POP cache if cache is still valid or we just refreshed
if (justRefreshed || (useCache() && !isCacheExpired()))
{
- log.debug("getPortlet from cached service description");
+ log.debug("Retrieving portlet '" + portletHandle + "'
from cached service description");
- return (Portlet)popsMap.get(portletId);
+ portlet = (Portlet)popsMap.get(portletHandle);
}
+
+
+ if (portlet != null) // we had a match on a POP, return it
+ {
+ return portlet;
+ }
else // otherwise, retrieve just the information for the appropriate portlet
{
- log.debug("getPortlet via getPortletDescription");
+ log.debug("Retrieving portlet '" + portletHandle + "' via
getPortletDescription");
- GetPortletDescription gpd =
WSRPTypeFactory.createGetPortletDescription(getRegistrationContext(), portletId);
+ GetPortletDescription gpd =
WSRPTypeFactory.createGetPortletDescription(getRegistrationContext(), portletContext);
gpd.setUserContext(null); // todo: deal with user context!!
try
{
@@ -389,7 +399,7 @@
}
catch (InvalidHandleFault invalidHandleFault)
{
- throw new NoSuchPortletException(invalidHandleFault, portletId);
+ throw new NoSuchPortletException(invalidHandleFault, portletHandle);
}
catch (Exception e)
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-02-22
23:13:40 UTC (rev 6381)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -73,7 +73,6 @@
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
@@ -94,9 +93,6 @@
private RenderHandler renderHandler;
private SessionHandler sessionHandler;
- /** Consumer-Configured Portlets (handle -> WSRPPortlet) */
- private Map ccpsMap = new HashMap();
-
private ProducerInfo producerInfo;
/** A registration data element used to indicate when no registration was required by
the producer */
@@ -145,7 +141,8 @@
{
try
{
- return new LinkedHashSet(getPortletMap().values());
+ Map portletMap = producerInfo.getPortletMap();
+ return new LinkedHashSet(portletMap.values());
}
catch (Exception e)
{
@@ -156,26 +153,13 @@
public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
- return getPortlet(portletContext.getId());
- }
- private Portlet getPortlet(String portletId) throws PortletInvokerException
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletId, "portlet
id", "PortletContext");
+ Portlet portlet = producerInfo.getPortlet(portletContext);
- // first try to see if we want a cloned portlet
- Portlet portlet = (Portlet)ccpsMap.get(portletId);
-
- // the portlet is not cloned, so try POP ones...
if (portlet == null)
{
- portlet = producerInfo.getPortlet(portletId);
+ throw new NoSuchPortletException(portletContext.getId());
}
-
- if (portlet == null)
- {
- throw new NoSuchPortletException(portletId);
- }
else
{
return portlet;
@@ -206,7 +190,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
- WSRPPortlet original = getWSRPPortlet(portletContext.getId());
+ WSRPPortlet original = getWSRPPortlet(portletContext);
if (original == null)
{
throw new PortletInvokerException("No portlet '" +
portletContext.getId() + "' to clone!");
@@ -218,11 +202,6 @@
try
{
PortletContext newPortletContext =
WSRPUtils.convertToPortalPortletContext(getPortletManagementService().clonePortlet(clonePortlet));
- if (newPortletContext != null)
- {
- ccpsMap.put(newPortletContext.getId(),
WSRPPortlet.createClone(newPortletContext, original.getWSRPInfo()));
- }
-
return newPortletContext;
}
catch (Exception e)
@@ -247,10 +226,6 @@
{
PortletContext context = (PortletContext)contexts.next();
String id = context.getId();
- if (getPortlet(id) == null)
- {
- result.add(new DestroyCloneFailure(id, "Couldn't destroy clone
'" + id + "' because there is no such clone!"));
- }
handles.add(id);
}
@@ -272,13 +247,6 @@
result.add(new DestroyCloneFailure(handle, failure.getReason()));
successfullyDestroyed.remove(handle);
}
-
- // remove from the CCP map the clones that were sucessfully destroyed
- for (Iterator clonesToRemove = successfullyDestroyed.iterator();
clonesToRemove.hasNext();)
- {
- ccpsMap.remove(clonesToRemove.next());
- }
-
return result;
}
else
@@ -349,7 +317,7 @@
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(changes, "Property
changes");
- WSRPPortlet portlet = getWSRPPortlet(portletContext.getId());
+ WSRPPortlet portlet = getWSRPPortlet(portletContext);
if (portlet == null)
{
throw new PortletInvokerException("Cannot set properties on portlet
'" + portletContext.getId()
@@ -388,12 +356,6 @@
{
PortletContext newPortletContext =
WSRPUtils.convertToPortalPortletContext(getPortletManagementService().setPortletProperties(setPortletProperties));
portlet.setPortletContext(newPortletContext);
- // if the portlet was cloned, add to the CCP map
- if (!newPortletContext.getId().equals(portletContext.getId()))
- {
- ccpsMap.put(newPortletContext, portlet);
- }
-
return newPortletContext;
}
catch (Exception e)
@@ -438,29 +400,14 @@
WSRPPortletInfo getPortletInfo(PortletInvocation invocation) throws
PortletInvokerException
{
- return (WSRPPortletInfo)getWSRPPortlet(getPortletHandle(invocation)).getInfo();
+ return (WSRPPortletInfo)getWSRPPortlet(getPortletContext(invocation)).getInfo();
}
- WSRPPortlet getWSRPPortlet(String portletId) throws PortletInvokerException
+ WSRPPortlet getWSRPPortlet(PortletContext portletContext) throws
PortletInvokerException
{
- return (WSRPPortlet)getPortlet(portletId);
+ return (WSRPPortlet)getPortlet(portletContext);
}
- private Map getPortletMap() throws PortletInvokerException
- {
- Map portletMap = producerInfo.getPortletMap();
- if (ccpsMap.isEmpty())
- {
- return portletMap;
- }
- else
- {
- Map all = new HashMap(portletMap);
- all.putAll(ccpsMap);
- return all;
- }
- }
-
public Set getSupportedUserScopes()
{
return Collections.unmodifiableSet(supportedUserScopes);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/WSRPPortlet.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/WSRPPortlet.java 2007-02-22
23:13:40 UTC (rev 6381)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/WSRPPortlet.java 2007-02-23
02:38:30 UTC (rev 6382)
@@ -44,9 +44,13 @@
{
}
+ /**
+ *
+ */
public WSRPPortlet(PortletContext context, PortletInfo info)
{
ParameterValidation.throwIllegalArgExceptionIfNull(context,
"PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(info, "PortletInfo");
this.portletContext = context;
this.info = info;
}
@@ -66,6 +70,10 @@
public PortletInfo getInfo()
{
+ if (info == null)
+ {
+ throw new IllegalStateException("No PortletInfo was set for WSRPPortler
'" + portletContext.getId() + "'");
+ }
return info;
}