JBoss Portal SVN: r5899 - in trunk/core/src/main/org/jboss/portal/core: impl/model/instance model/instance
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-19 09:01:49 -0500 (Tue, 19 Dec 2006)
New Revision: 5899
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
Log:
minor javadoc update
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 2006-12-19 04:24:10 UTC (rev 5898)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2006-12-19 14:01:49 UTC (rev 5899)
@@ -207,10 +207,6 @@
PersistentInstanceContainer container = this.containerContext.container;
//
-// UserContext ctx = invocation.getUserContext();
-// String userId = ctx.getId();
-
- //
InstanceImpl instance = this;
AccessMode accessMode = getAccessMode();
@@ -298,5 +294,4 @@
{
this.containerContext = (ContainerContext)context;
}
-
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2006-12-19 04:24:10 UTC (rev 5898)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2006-12-19 14:01:49 UTC (rev 5899)
@@ -88,6 +88,10 @@
*/
void setProperties(PropertyChange[] changes) throws PortletInvokerException;
- /** Return a customization. */
+ /**
+ * Return a customization of this instance related to the provided customization id.
+ *
+ * @return an instance customization
+ */
InstanceCustomization getCustomization(String customizationId);
}
19 years, 7 months
JBoss Portal SVN: r5898 - in trunk/wsrp/src/main/org/jboss/portal: test/wsrp/v1/producer wsrp wsrp/producer
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-18 23:24:10 -0500 (Mon, 18 Dec 2006)
New Revision: 5898
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
Log:
- Implemented clonePortlet, destroyPortlets and setPortletProperties on Producer.
- Added associated test cases (don't currently pass because some behavior need to be fixed wrt POPs).
- Added creation methods in WSRPTypeFactory.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java 2006-12-19 00:58:22 UTC (rev 5897)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestCase.java 2006-12-19 04:24:10 UTC (rev 5898)
@@ -26,15 +26,23 @@
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
+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.GetPortletPropertyDescription;
+import org.jboss.portal.wsrp.core.GetServiceDescription;
import org.jboss.portal.wsrp.core.ModelDescription;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.PortletContext;
import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
import org.jboss.portal.wsrp.core.PortletPropertyDescriptionResponse;
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.PropertyList;
+import org.jboss.portal.wsrp.core.SetPortletProperties;
import javax.xml.soap.SOAPElement;
import java.util.Arrays;
@@ -54,16 +62,57 @@
super("PortletManagementTestCase", TEST_BASIC_PORTLET_WAR);
}
- public void testClonePortlet()
+ public void testClonePortlet() throws Exception
{
- // todo: implement
+ String handle = getDefaultHandle();
+ // first check that we get a new PortletContext
+ PortletContext portletContext = clonePortlet(handle);
+ ExtendedAssert.assertNotNull(portletContext);
+ ExtendedAssert.assertFalse(WSRPTypeFactory.createPortletContext(handle).equals(portletContext));
+
+ // then check that the initial state is identical
+ GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(null, portletContext.getPortletHandle());
+ Property[] result = portletManagementService.getPortletProperties(getPortletProperties).getProperties();
+ getPortletProperties = WSRPTypeFactory.createGetPortletProperties(null, handle);
+ checkGetPropertiesResponse(portletManagementService.getPortletProperties(getPortletProperties), result);
+
+ // check that new clone is not listed in service description
+ GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ checkServiceDescriptionWithOnlyBasicPortlet(gs);
}
- public void testDestroyPortlets()
+ public void testDestroyPortlets() throws Exception
{
- // todo: implement
+ // first try to destroy POP, should fail
+ String handle = getDefaultHandle();
+ DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(null, new String[]{handle});
+ DestroyPortletsResponse response = portletManagementService.destroyPortlets(destroyPortlets);
+ ExtendedAssert.assertNotNull(response);
+ DestroyFailed[] failures = response.getDestroyFailed();
+ ExtendedAssert.assertNotNull(failures);
+ ExtendedAssert.assertEquals(1, failures.length);
+ DestroyFailed failure = failures[0];
+ ExtendedAssert.assertNotNull(failure);
+ ExtendedAssert.assertEquals(handle, failure.getPortletHandle());
+ ExtendedAssert.assertNotNull(failure.getReason());
+
+ // clone portlet and try to destroy it
+ PortletContext portletContext = clonePortlet(handle);
+ destroyPortlets = WSRPTypeFactory.createDestroyPortlets(null, new String[]{portletContext.getPortletHandle()});
+ response = portletManagementService.destroyPortlets(destroyPortlets);
+ ExtendedAssert.assertNotNull(response);
+ failures = response.getDestroyFailed();
+ ExtendedAssert.assertNull(failures);
}
+ private PortletContext clonePortlet(String handle)
+ throws org.jboss.portal.wsrp.core.InvalidUserCategoryFault, org.jboss.portal.wsrp.core.AccessDeniedFault, org.jboss.portal.wsrp.core.OperationFailedFault, org.jboss.portal.wsrp.core.InvalidHandleFault, org.jboss.portal.wsrp.core.InvalidRegistrationFault, org.jboss.portal.wsrp.core.InconsistentParametersFault, org.jboss.portal.wsrp.core.MissingParametersFault, java.rmi.RemoteException
+ {
+ ClonePortlet clonePortlet = WSRPTypeFactory.createSimpleClonePortlet(handle);
+ PortletContext portletContext = portletManagementService.clonePortlet(clonePortlet);
+ return portletContext;
+ }
+
public void testGetPortletDescription() throws Exception
{
String handle = getDefaultHandle();
@@ -98,14 +147,6 @@
checkGetPropertiesResponse(response, expected);
}
- private Property[] checkGetPropertiesResponse(PropertyList response, Property[] expected)
- {
- ExtendedAssert.assertNotNull(response);
- Property[] properties = response.getProperties();
- ExtendedAssert.assertEquals(expected, properties, false, "Didn't receive expected properties!", new PropertyDecorator());
- return properties;
- }
-
public void testGetPortletPropertyDescription() throws Exception
{
String handle = getDefaultHandle();
@@ -126,7 +167,48 @@
expected[1].setHint(WSRPTypeFactory.createLocalizedString("prefName2"));
expected[1].setLabel(WSRPTypeFactory.createLocalizedString("prefName2"));
- ExtendedAssert.assertEquals(2, propertyDescriptions.length);
+ checkPropertyDescriptions(expected, propertyDescriptions);
+ }
+
+ public void testSetPortletProperties() throws Exception
+ {
+ String handle = getDefaultHandle();
+
+ PortletContext portletContext = clonePortlet(handle);
+ PropertyList propertyList = WSRPTypeFactory.createPropertyList();
+ Property[] properties = new Property[]{
+ WSRPTypeFactory.createProperty("prefName1", "en", "newPrefValue1"),
+ WSRPTypeFactory.createProperty("prefName2", "en", "newPrefValue2")
+ };
+ propertyList.setProperties(properties);
+ SetPortletProperties setPortletProperties = WSRPTypeFactory.createSetPortletProperties(portletContext, propertyList);
+
+ PortletContext response = portletManagementService.setPortletProperties(setPortletProperties);
+ GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(null, portletContext.getPortletHandle());
+ checkGetPropertiesResponse(portletManagementService.getPortletProperties(getPortletProperties), properties);
+
+ portletContext = WSRPTypeFactory.createPortletContext(handle);
+ try
+ {
+ response = portletManagementService.setPortletProperties(setPortletProperties);
+ ExtendedAssert.fail("Setting properties on Producer-Offered Portlet should fail...");
+ }
+ catch (OperationFailedFault expected)
+ {
+ }
+ }
+
+ private Property[] checkGetPropertiesResponse(PropertyList response, Property[] expected)
+ {
+ ExtendedAssert.assertNotNull(response);
+ Property[] properties = response.getProperties();
+ ExtendedAssert.assertEquals(expected, properties, false, "Didn't receive expected properties!", new PropertyDecorator());
+ return properties;
+ }
+
+ private void checkPropertyDescriptions(PropertyDescription[] expected, PropertyDescription[] propertyDescriptions)
+ {
+ ExtendedAssert.assertEquals(expected.length, propertyDescriptions.length);
PropertyDescription propDesc = propertyDescriptions[0];
ExtendedAssert.assertNotNull(propDesc);
String name = propDesc.getName();
@@ -146,11 +228,6 @@
}
}
- public void testSetPortletProperties()
- {
- // todo: implement
- }
-
protected String getMostUsedPortletWARFileName()
{
return TEST_BASIC_PORTLET_WAR;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2006-12-19 00:58:22 UTC (rev 5897)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2006-12-19 04:24:10 UTC (rev 5898)
@@ -35,6 +35,10 @@
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.CacheControl;
import org.jboss.portal.wsrp.core.ClientData;
+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.GetMarkup;
import org.jboss.portal.wsrp.core.GetPortletDescription;
import org.jboss.portal.wsrp.core.GetPortletProperties;
@@ -55,11 +59,13 @@
import org.jboss.portal.wsrp.core.PortletPropertyDescriptionResponse;
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyDescription;
+import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
import org.jboss.portal.wsrp.core.RuntimeContext;
import org.jboss.portal.wsrp.core.ServiceDescription;
import org.jboss.portal.wsrp.core.SessionContext;
+import org.jboss.portal.wsrp.core.SetPortletProperties;
import org.jboss.portal.wsrp.core.StateChange;
import org.jboss.portal.wsrp.core.Templates;
import org.jboss.portal.wsrp.core.UpdateResponse;
@@ -738,4 +744,97 @@
{
return createGetPortletPropertyDescription(null, createPortletContext(portletHandle), null, null);
}
+
+
+ /**
+ * portletHandle(xsd:string), reason(xsd:string)
+ *
+ * @param portletHandle
+ * @param reason
+ * @return
+ * @since 2.6
+ */
+ public static DestroyFailed createDestroyFailed(String portletHandle, String reason)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "Portlet handle", "DestroyFailed");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(reason, "Reason for failure", "DestroyFailed");
+ // todo: check reason should be a fault code from Section 13 of spec but this is not clear...
+ return new DestroyFailed(portletHandle, reason);
+ }
+
+ /**
+ * destroyFailed(DestroyFailed)*, extensions(Extension)*
+ *
+ * @param destroyFailed
+ * @return
+ * @since 2.6
+ */
+ public static DestroyPortletsResponse createDestroyPortletsResponse(DestroyFailed[] destroyFailed)
+ {
+ return new DestroyPortletsResponse(destroyFailed, null);
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext), userContext(UserContext)?,
+ * propertyList(PropertyList)
+ *
+ * @param portletContext
+ * @param propertyList
+ * @return
+ * @since 2.6
+ */
+ public static SetPortletProperties createSetPortletProperties(PortletContext portletContext, PropertyList propertyList)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(propertyList, "PropertyList");
+
+ return new SetPortletProperties(null, portletContext, null, propertyList);
+ }
+
+ /**
+ * same as createClonePortlet(null, createPortletContext(portletHandle), null)
+ *
+ * @param portletHandle
+ * @return
+ * @since 2.6
+ */
+ public static ClonePortlet createSimpleClonePortlet(String portletHandle)
+ {
+ return createClonePortlet(null, createPortletContext(portletHandle), null);
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext), userContext(UserContext)?
+ *
+ * @return
+ * @since 2.6
+ */
+ public static ClonePortlet createClonePortlet(RegistrationContext registrationContext, PortletContext portletContext, UserContext userContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
+ return new ClonePortlet(registrationContext, portletContext, userContext);
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletHandles(xsd:string)+
+ *
+ * @return
+ * @since 2.6
+ */
+ public static DestroyPortlets createDestroyPortlets(RegistrationContext registrationContext, String[] portletHandles)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandles, "Portlet handles");
+ return new DestroyPortlets(registrationContext, portletHandles);
+ }
+
+ /**
+ * properties(Property)*, resetProperties(ResetProperty)*, extensions(Extension)*
+ *
+ * @return
+ * @since 2.6
+ */
+ public static PropertyList createPropertyList()
+ {
+ return new PropertyList();
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2006-12-19 00:58:22 UTC (rev 5897)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2006-12-19 04:24:10 UTC (rev 5898)
@@ -222,7 +222,7 @@
return desiredLocales;
}
- public static PortletContext convertWSRPPortletContextToPortalPortletContext(org.jboss.portal.wsrp.core.PortletContext portletContext)
+ public static PortletContext convertToPortalPortletContext(org.jboss.portal.wsrp.core.PortletContext portletContext)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
String handle = portletContext.getPortletHandle();
@@ -236,6 +236,21 @@
}
/**
+ * @param portletContext
+ * @return Since 2.6
+ */
+ public static org.jboss.portal.wsrp.core.PortletContext convertToWSRPPortletContext(PortletContext portletContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
+ String id = portletContext.getId();
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "portlet id", "PortletContext");
+
+ org.jboss.portal.wsrp.core.PortletContext result = WSRPTypeFactory.createPortletContext(id);
+ result.setPortletState(portletContext.getState());
+ return result;
+ }
+
+ /**
* Create a new OperationFailedFault based on the specified cause.
*
* @param cause the cause why the operation failed
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2006-12-19 00:58:22 UTC (rev 5897)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2006-12-19 04:24:10 UTC (rev 5898)
@@ -27,18 +27,24 @@
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.LocalizedString;
import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.InvalidPortletIdException;
+import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.PreferenceInfo;
import org.jboss.portal.portlet.info.PreferencesInfo;
+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.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
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;
@@ -56,13 +62,17 @@
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.PropertyList;
+import org.jboss.portal.wsrp.core.ResetProperty;
import org.jboss.portal.wsrp.core.SetPortletProperties;
import org.jboss.portal.wsrp.core.UserContext;
import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
+import javax.xml.soap.SOAPElement;
import java.rmi.RemoteException;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -136,6 +146,7 @@
if (!prefInfo.isReadOnly().booleanValue())
{
//todo: check what we should use key
+ //todo: right now we only support String properties
PropertyDescription desc = WSRPTypeFactory.createPropertyDescription(prefInfo.getKey(), WSRPConstants.XSD_STRING);
desc.setLabel(WSRPUtils.convertToWSRPLocalizedString(prefInfo.getDisplayName(), desiredLocales));
desc.setHint(WSRPUtils.convertToWSRPLocalizedString(prefInfo.getDescription(), desiredLocales));
@@ -147,22 +158,167 @@
return WSRPTypeFactory.createPortletPropertyDescriptionResponse(descs);
}
- public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategoryFault, AccessDeniedFault, OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault, InconsistentParametersFault, MissingParametersFault, RemoteException
+ public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategoryFault, AccessDeniedFault,
+ OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault, InconsistentParametersFault,
+ MissingParametersFault, RemoteException
{
- return null; // todo: implement
+ WSRPUtils.throwOperationFailedFaultIfValueIsMissing(clonePortlet, "ClonePortlet");
+
+ PortletContext portletContext = clonePortlet.getPortletContext();
+ WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext, "PortletContext", "ClonePortlet");
+
+ producer.checkRegistration(clonePortlet.getRegistrationContext());
+
+ UserContext userContext = clonePortlet.getUserContext();
+ checkUserAuthorization(userContext);
+
+ org.jboss.portal.portlet.PortletContext portalPC = WSRPUtils.convertToPortalPortletContext(portletContext);
+ try
+ {
+ org.jboss.portal.portlet.PortletContext response = producer.getInvoker().createClone(portalPC);
+ return WSRPUtils.convertToWSRPPortletContext(response);
+ }
+ catch (InvalidPortletIdException e)
+ {
+ throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class, e);
+ }
+ catch (NoSuchPortletException e)
+ {
+ throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class, e);
+ }
+ catch (PortletInvokerException e)
+ {
+ throw WSRPUtils.createOperationFailedFault(e);
+ }
}
- public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParametersFault, MissingParametersFault, InvalidRegistrationFault, OperationFailedFault, RemoteException
+ public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParametersFault,
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault, RemoteException
{
- return null; // todo: implement
+ WSRPUtils.throwOperationFailedFaultIfValueIsMissing(destroyPortlets, "DestroyPortlets");
+
+ String[] handles = destroyPortlets.getPortletHandles();
+ WSRPUtils.throwMissingParametersFaultIfValueIsMissing(handles, "portlet handles to be destroyed", "DestroyPortlets");
+
+ producer.checkRegistration(destroyPortlets.getRegistrationContext());
+
+ List portletContexts = new ArrayList(handles.length);
+ for (int i = 0; i < handles.length; i++)
+ {
+ portletContexts.add(org.jboss.portal.portlet.PortletContext.createPortletContext(handles[i]));
+ }
+
+ try
+ {
+ List failuresList = producer.getInvoker().destroyClones(portletContexts);
+ int failuresNumber = failuresList.size();
+ DestroyFailed[] destroyFailed;
+ if (failuresNumber > 0)
+ {
+ destroyFailed = new DestroyFailed[failuresNumber];
+ int i = 0;
+ for (Iterator failures = failuresList.iterator(); failures.hasNext();)
+ {
+ DestroyCloneFailure failure = (DestroyCloneFailure)failures.next();
+ destroyFailed[i++] = WSRPTypeFactory.createDestroyFailed(failure.getPortletId(), failure.getMessage());
+ }
+ }
+ else
+ {
+ destroyFailed = null;
+ }
+
+ return WSRPTypeFactory.createDestroyPortletsResponse(destroyFailed);
+ }
+ catch (PortletInvokerException e)
+ {
+ throw WSRPUtils.createOperationFailedFault(e);
+ }
}
- public PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailedFault, InvalidHandleFault, MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault, AccessDeniedFault, InvalidRegistrationFault, RemoteException
+ public PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailedFault,
+ InvalidHandleFault, MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault,
+ AccessDeniedFault, InvalidRegistrationFault, RemoteException
{
- return null; // todo: implement
+ WSRPUtils.throwOperationFailedFaultIfValueIsMissing(setPortletProperties, "SetPortletProperties");
+
+ PortletContext portletContext = setPortletProperties.getPortletContext();
+ WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletContext, "PortletContext", "SetPortletProperties");
+
+ PropertyList propertyList = setPortletProperties.getPropertyList();
+ WSRPUtils.throwMissingParametersFaultIfValueIsMissing(propertyList, "PropertyList", "SetPortletProperties");
+
+ producer.checkRegistration(setPortletProperties.getRegistrationContext());
+
+ checkUserAuthorization(setPortletProperties.getUserContext());
+
+ Property[] properties = propertyList.getProperties();
+ ResetProperty[] resetProperties = propertyList.getResetProperties();
+ int changesCount = 0;
+ if (properties != null)
+ {
+ changesCount += properties.length;
+ }
+ if (resetProperties != null)
+ {
+ changesCount += resetProperties.length;
+ }
+
+ if (changesCount > 0)
+ {
+ List changes = new ArrayList(changesCount);
+
+ if (properties != null)
+ {
+ for (int i = 0; i < properties.length; i++)
+ {
+ Property property = properties[i];
+ String value = property.getStringValue();
+
+ // todo: deal with XML values...
+ SOAPElement[] values = property.get_any();
+ String lang = property.getLang(); // todo: deal with language?
+
+ changes.add(PropertyChange.newUpdate(property.getName(), new StringValue(value)));
+ }
+ }
+
+ if (resetProperties != null)
+ {
+ for (int i = 0; i < resetProperties.length; i++)
+ {
+ ResetProperty resetProperty = resetProperties[i];
+ changes.add(PropertyChange.newReset(resetProperty.getName()));
+ }
+ }
+
+ try
+ {
+ org.jboss.portal.portlet.PortletContext resultContext =
+ producer.getInvoker().setProperties(WSRPUtils.convertToPortalPortletContext(portletContext),
+ (PropertyChange[])changes.toArray(new PropertyChange[0]));
+ return WSRPUtils.convertToWSRPPortletContext(resultContext);
+ }
+ catch (InvalidPortletIdException e)
+ {
+ throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class, e);
+ }
+ catch (NoSuchPortletException e)
+ {
+ throw (InvalidHandleFault)WSRPUtils.createFaultFrom(InvalidHandleFault.class, e);
+ }
+ catch (PortletInvokerException e)
+ {
+ throw WSRPUtils.createOperationFailedFault(e);
+ }
+ }
+
+ return portletContext;
}
- public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault, OperationFailedFault, InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
+ public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandleFault,
+ MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault, OperationFailedFault,
+ InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
{
WSRPUtils.throwOperationFailedFaultIfValueIsMissing(getPortletProperties, GET_PORTLET_PROPERTIES);
@@ -180,8 +336,7 @@
try
{
PropertyMap properties;
- org.jboss.portal.portlet.PortletContext jbpContext =
- WSRPUtils.convertWSRPPortletContextToPortalPortletContext(portletContext);
+ org.jboss.portal.portlet.PortletContext jbpContext = WSRPUtils.convertToPortalPortletContext(portletContext);
if (keys != null)
{
@@ -192,10 +347,11 @@
properties = producer.getInvoker().getProperties(jbpContext);
}
+ //todo: we need to check that the user can actually modify the properties
Portlet portlet = getPortletFrom(portletContext);
PortletInfo info = portlet.getInfo();
- PropertyList result = new PropertyList();
+ PropertyList result = WSRPTypeFactory.createPropertyList();
int propertyNb = properties.size();
if (propertyNb > 0)
@@ -273,7 +429,7 @@
Portlet portlet;
try
{
- portlet = producer.getInvoker().getPortlet(WSRPUtils.convertWSRPPortletContextToPortalPortletContext(portletContext));
+ portlet = producer.getInvoker().getPortlet(WSRPUtils.convertToPortalPortletContext(portletContext));
}
catch (PortletInvokerException e)
{
19 years, 7 months
JBoss Portal SVN: r5897 - docs/tags
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-18 19:58:22 -0500 (Mon, 18 Dec 2006)
New Revision: 5897
Added:
docs/tags/JBoss_Portal_2_4_1_SP1/
Log:
2.4.1 sp1
Copied: docs/tags/JBoss_Portal_2_4_1_SP1 (from rev 5896, docs/branches/JBoss_Portal_Branch_2_4)
19 years, 7 months
JBoss Portal SVN: r5896 - tags
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-18 19:58:00 -0500 (Mon, 18 Dec 2006)
New Revision: 5896
Added:
tags/JBoss_Portal_2_4_1_SP1/
Log:
2.4.1 sp1
Copied: tags/JBoss_Portal_2_4_1_SP1 (from rev 5895, branches/JBoss_Portal_Branch_2_4)
19 years, 7 months
JBoss Portal SVN: r5895 - in trunk: registration/src/main/org/jboss/portal/registration wsrp/src/main/org/jboss/portal/wsrp/producer
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-18 14:14:55 -0500 (Mon, 18 Dec 2006)
New Revision: 5895
Modified:
trunk/registration/src/main/org/jboss/portal/registration/RegistrationLocal.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
Log:
Implemented support for downstream transmission of Registration information.
Modified: trunk/registration/src/main/org/jboss/portal/registration/RegistrationLocal.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/registration/RegistrationLocal.java 2006-12-18 19:06:44 UTC (rev 5894)
+++ trunk/registration/src/main/org/jboss/portal/registration/RegistrationLocal.java 2006-12-18 19:14:55 UTC (rev 5895)
@@ -28,6 +28,7 @@
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
+ * @since 2.6
*/
public class RegistrationLocal
{
@@ -35,6 +36,12 @@
/** The thread local to keep track of the registration associated with the current thread of execution. */
private static final ThreadLocal registrationLocal = new ThreadLocal();
+ /**
+ * Sets the current registration for the Consumer for the current invocation.
+ *
+ * @param registration the Registration associated with the Consumer. Set to <code>null</code> if no Registration
+ * exists for the current Consumer.
+ */
public static void setRegistration(Registration registration)
{
registrationLocal.set(registration);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2006-12-18 19:06:44 UTC (rev 5894)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2006-12-18 19:14:55 UTC (rev 5895)
@@ -30,6 +30,7 @@
import org.jboss.portal.registration.NoSuchRegistrationException;
import org.jboss.portal.registration.Registration;
import org.jboss.portal.registration.RegistrationException;
+import org.jboss.portal.registration.RegistrationLocal;
import org.jboss.portal.registration.RegistrationStatus;
import org.jboss.portal.registration.RegistrationUtils;
import org.jboss.portal.wsrp.WSRPTypeFactory;
@@ -133,6 +134,9 @@
capabilities.setSupportedUserProfileData(getListFromArray(registrationData.getCustomUserProfileData(), false));
capabilities.setSupportedUserScopes(getListFromArray(registrationData.getConsumerUserScopes(), false));
capabilities.setSupportsGetMethod(registrationData.isMethodGetSupported());
+
+ // update RegistrationLocal for downstream use of Registration data
+ RegistrationLocal.setRegistration(registration);
}
public ReturnAny deregister(RegistrationContext deregister) throws OperationFailedFault, InvalidRegistrationFault,
@@ -151,6 +155,7 @@
try
{
producer.getRegistrationManager().removeRegistration(registrationHandle);
+ RegistrationLocal.setRegistration(null);
}
catch (NoSuchRegistrationException e)
{
@@ -246,6 +251,7 @@
}
log.debug("registration is valid!");
+ RegistrationLocal.setRegistration(reg); // set the current registration for downstream use
return true;
}
else
19 years, 7 months
JBoss Portal SVN: r5894 - trunk/portlet/src/main/org/jboss/portal/portlet
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-18 14:06:44 -0500 (Mon, 18 Dec 2006)
New Revision: 5894
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
Log:
Fixed incorrect javadoc.
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java 2006-12-18 19:06:20 UTC (rev 5893)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java 2006-12-18 19:06:44 UTC (rev 5894)
@@ -74,7 +74,8 @@
* Destroy a cloned portlet.
*
* @param portletContexts a list of portlet contexts to destroy
- * @return a list of portlet ids that were not destroyed during the operation
+ * @return a list of {@link org.jboss.portal.portlet.state.DestroyCloneFailure}, one per clone that couldn't be
+ * destroyed
* @throws IllegalArgumentException if the portletId is null
* @throws UnsupportedOperationException if the invoker does not support this operation
*/
19 years, 7 months
JBoss Portal SVN: r5893 - trunk/portlet/src/main/org/jboss/portal/portlet/state
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-18 14:06:20 -0500 (Mon, 18 Dec 2006)
New Revision: 5893
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java
Log:
Added getMessage method to be able to retrieve the failure reason.
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java 2006-12-18 18:50:28 UTC (rev 5892)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java 2006-12-18 19:06:20 UTC (rev 5893)
@@ -55,6 +55,11 @@
return portletId;
}
+ public String getMessage()
+ {
+ return message;
+ }
+
public String toString()
{
return "DestroyCloneFailure[" + portletId + "," + message + "]";
19 years, 7 months
JBoss Portal SVN: r5892 - in docs/trunk: referenceGuide/en userGuide/en userGuide/en/images/admincms userGuide/en/modules
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2006-12-18 13:50:28 -0500 (Mon, 18 Dec 2006)
New Revision: 5892
Added:
docs/trunk/userGuide/en/images/admincms/secure_menu.gif
docs/trunk/userGuide/en/images/admincms/secure_node.gif
Modified:
docs/trunk/referenceGuide/en/master.xml
docs/trunk/userGuide/en/master.xml
docs/trunk/userGuide/en/modules/admincmsPortlet.xml
Log:
JBPORTAL-1165 - Document CMS Security in User Guide
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2006-12-18 17:44:48 UTC (rev 5891)
+++ docs/trunk/referenceGuide/en/master.xml 2006-12-18 18:50:28 UTC (rev 5892)
@@ -23,9 +23,9 @@
]>
<book lang="en">
<bookinfo>
- <title>JBoss Portal 2.6DR</title>
+ <title>JBoss Portal 2.6Alpha</title>
<subtitle>Reference Guide</subtitle>
- <releaseinfo>Release 2.6DR "Ninja"</releaseinfo>
+ <releaseinfo>Release 2.6Alpha "Ninja"</releaseinfo>
<releaseinfo>October 2006</releaseinfo>
<author>
<firstname>Thomas</firstname>
Added: docs/trunk/userGuide/en/images/admincms/secure_menu.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/admincms/secure_menu.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/userGuide/en/images/admincms/secure_node.gif
===================================================================
(Binary files differ)
Property changes on: docs/trunk/userGuide/en/images/admincms/secure_node.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/trunk/userGuide/en/master.xml
===================================================================
--- docs/trunk/userGuide/en/master.xml 2006-12-18 17:44:48 UTC (rev 5891)
+++ docs/trunk/userGuide/en/master.xml 2006-12-18 18:50:28 UTC (rev 5892)
@@ -13,9 +13,9 @@
]>
<book lang="en">
<bookinfo>
- <title>JBoss Portal 2.6DR</title>
+ <title>JBoss Portal 2.6Alpha</title>
<subtitle>User Guide</subtitle>
- <releaseinfo>Release 2.6DR "Ninja"</releaseinfo>
+ <releaseinfo>Release 2.6Alpha "Ninja"</releaseinfo>
<releaseinfo>October 2006</releaseinfo>
<author>
<firstname>Roy</firstname>
Modified: docs/trunk/userGuide/en/modules/admincmsPortlet.xml
===================================================================
--- docs/trunk/userGuide/en/modules/admincmsPortlet.xml 2006-12-18 17:44:48 UTC (rev 5891)
+++ docs/trunk/userGuide/en/modules/admincmsPortlet.xml 2006-12-18 18:50:28 UTC (rev 5892)
@@ -323,7 +323,46 @@
</sect2>
<sect2 id="secure">
<title>Securing Resources</title>
- <para>TODO</para>
+ <para>Administrators are able to apply permissions settings to any folder or file in the CMS. These permissions
+ on a specific node, can be applied on a per-Role and/or per-User basis.
+ </para>
+ <para>
+ The security dialogue is accessed by navigating to the node you want to secure and selecting
+ <emphasis>Secure</emphasis>
+ .
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/admincms/secure_menu.gif" format="gif" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ You should then be presented with a screen that allows you to assign read, write, and manage priviledges on
+ the selected node for selected Roles or specific Users.
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/admincms/secure_node.gif" format="gif" align="center" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ There are three main security settings for every node in the CMS.
+ <itemizedlist>
+ <listitem>
+ <emphasis roled="bold">Read Permissions:</emphasis>
+ Assigned roles/users can view the resource.
+ </listitem>
+ <listitem>
+ <emphasis roled="bold">Write Permissions:</emphasis>
+ Assigned roles/users are able to edit the resource, or create nodes within it (as is the case for
+ folders)
+ </listitem>
+ <listitem>
+ <emphasis roled="bold">Manage Permissions:</emphasis>
+ These permissions include: copy, move, delete, and exporting.
+ </listitem>
+ </itemizedlist>
+ Adminsitrating and assigning permissions on a selected node is as simple as selecting which Roles and/or
+ Users you want to allow to have a specific permission.
+ </para>
</sect2>
</sect1>
</chapter>
19 years, 7 months
JBoss Portal SVN: r5891 - trunk/core/src/main/org/jboss/portal/core/impl/model/portal
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-18 12:44:48 -0500 (Mon, 18 Dec 2006)
New Revision: 5891
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
Log:
bug in portal object property aggregation.
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2006-12-18 17:41:50 UTC (rev 5890)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2006-12-18 17:44:48 UTC (rev 5891)
@@ -300,16 +300,21 @@
public Map getProperties()
{
+ // Lazy compute properties
if (properties == null)
{
- Map properties = new HashMap();
- ObjectNode node = objectNode;
- while (node != null)
+ ObjectNode parent = objectNode.getParent();
+ if (parent == null)
{
- properties.putAll(node.getObject().declaredPropertyMap);
- node = node.getParent();
+ properties = Collections.unmodifiableMap(declaredPropertyMap);
}
- this.properties = Collections.unmodifiableMap(properties);
+ else
+ {
+ Map properties = new HashMap();
+ properties.putAll(parent.getObject().getProperties());
+ properties.putAll(declaredPropertyMap);
+ this.properties = Collections.unmodifiableMap(properties);
+ }
}
return properties;
}
19 years, 7 months
JBoss Portal SVN: r5890 - trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2006-12-18 12:41:50 -0500 (Mon, 18 Dec 2006)
New Revision: 5890
Modified:
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/menu.jsp
Log:
- commented logout
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/menu.jsp
===================================================================
(Binary files differ)
19 years, 7 months