Author: chris.laprun(a)jboss.com
Date: 2010-06-10 12:21:34 -0400 (Thu, 10 Jun 2010)
New Revision: 3294
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java
Log:
- Started implementing PortletManagement support.
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-10
08:41:09 UTC (rev 3293)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-10
16:21:34 UTC (rev 3294)
@@ -25,7 +25,6 @@
import com.google.common.base.Function;
import com.google.common.collect.Lists;
-import org.gatein.common.NotYetImplemented;
import org.gatein.pc.api.OpaqueStateString;
import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPTypeFactory;
@@ -54,7 +53,6 @@
import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.V1ResourceValue;
import org.oasis.wsrp.v1.V1RuntimeContext;
-import org.oasis.wsrp.v1.V1ServiceDescription;
import org.oasis.wsrp.v1.V1StateChange;
import org.oasis.wsrp.v1.V1Telecom;
import org.oasis.wsrp.v1.V1TelephoneNum;
@@ -86,7 +84,6 @@
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceValue;
import org.oasis.wsrp.v2.RuntimeContext;
-import org.oasis.wsrp.v2.ServiceDescription;
import org.oasis.wsrp.v2.SessionParams;
import org.oasis.wsrp.v2.StateChange;
import org.oasis.wsrp.v2.Telecom;
@@ -494,11 +491,6 @@
}
}
- public static ServiceDescription toV2ServiceDescription(V1ServiceDescription
v1ServiceDescription)
- {
- throw new NotYetImplemented();
- }
-
public static <E extends Exception> E toV2Exception(Class<E>
v2ExceptionClass, Exception v1Exception)
{
if
(!"org.oasis.wsrp.v2".equals(v2ExceptionClass.getPackage().getName()))
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-10
08:41:09 UTC (rev 3293)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-10
16:21:34 UTC (rev 3294)
@@ -9,7 +9,7 @@
* 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
@@ -25,7 +25,6 @@
import com.google.common.base.Function;
import com.google.common.collect.Lists;
-import org.gatein.common.NotYetImplemented;
import org.gatein.wsrp.WSRPUtils;
import org.oasis.wsrp.v1.V1CacheControl;
import org.oasis.wsrp.v1.V1ClientData;
@@ -47,8 +46,10 @@
import org.oasis.wsrp.v1.V1PortletContext;
import org.oasis.wsrp.v1.V1PortletDescription;
import org.oasis.wsrp.v1.V1Postal;
+import org.oasis.wsrp.v1.V1Property;
import org.oasis.wsrp.v1.V1PropertyDescription;
import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1ResetProperty;
import org.oasis.wsrp.v1.V1Resource;
import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.V1ResourceValue;
@@ -82,8 +83,10 @@
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescription;
import org.oasis.wsrp.v2.Postal;
+import org.oasis.wsrp.v2.Property;
import org.oasis.wsrp.v2.PropertyDescription;
import org.oasis.wsrp.v2.RegistrationContext;
+import org.oasis.wsrp.v2.ResetProperty;
import org.oasis.wsrp.v2.Resource;
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceValue;
@@ -117,13 +120,10 @@
public static final V2ToV1ResourceValue RESOURCEVALUE = new V2ToV1ResourceValue();
public static final V2ToV1NamedString NAMEDSTRING = new V2ToV1NamedString();
public static final V2ToV1UploadContext UPLOADCONTEXT = new V2ToV1UploadContext();
+ public static final V2ToV1Property PROPERTY = new V2ToV1Property();
+ public static final V2ToV1ResetProperty RESETPROPERTY = new V2ToV1ResetProperty();
- public static V1PortletDescription toV1PortletDescription(PortletDescription
portletDescription)
- {
- throw new NotYetImplemented();
- }
-
public static V1PortletContext toV1PortletContext(PortletContext portletContext)
{
if (portletContext != null)
@@ -723,6 +723,11 @@
}
}
+ public static V1PortletDescription toV1PortletDescription(PortletDescription
description)
+ {
+ return PORTLETDESCRIPTION.apply(description);
+ }
+
private static class V2ToV1Extension implements Function<Extension,
V1Extension>
{
public V1Extension apply(Extension from)
@@ -978,4 +983,59 @@
}
}
+ private static class V2ToV1Property implements Function<Property, V1Property>
+ {
+ public V1Property apply(Property from)
+ {
+ if (from != null)
+ {
+ V1Property result =
WSRP1TypeFactory.createProperty(from.getName().toString(), from.getLang(),
from.getStringValue());
+ List<Object> any = from.getAny();
+ if (any != null)
+ {
+ result.getAny().addAll(any);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
+
+ private static class V2ToV1ResetProperty implements Function<ResetProperty,
V1ResetProperty>
+ {
+ public V1Property apply(Property from)
+ {
+ if (from != null)
+ {
+ V1Property result =
WSRP1TypeFactory.createProperty(from.getName().toString(), from.getLang(),
from.getStringValue());
+ List<Object> any = from.getAny();
+ if (any != null)
+ {
+ result.getAny().addAll(any);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public V1ResetProperty apply(ResetProperty from)
+ {
+ if (from != null)
+ {
+ return WSRP1TypeFactory.createResetProperty(from.getName().toString());
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
}
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java 2010-06-10
08:41:09 UTC (rev 3293)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1PortletManagementService.java 2010-06-10
16:21:34 UTC (rev 3294)
@@ -1,29 +1,43 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, 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.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.services.v1;
import org.gatein.common.NotYetImplemented;
+import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.services.PortletManagementService;
+import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.CopiedPortlet;
@@ -74,7 +88,45 @@
@Override
public void getPortletDescription(RegistrationContext registrationContext,
PortletContext portletContext, UserContext userContext, List<String> desiredLocales,
Holder<PortletDescription> portletDescription, Holder<ResourceList>
resourceList, Holder<List<Extension>> extensions) throws AccessDenied,
InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
ResourceSuspended
{
- throw new NotYetImplemented();
+ try
+ {
+ service.getPortletDescription(
+ V2ToV1Converter.toV1RegistrationContext(registrationContext),
+ V2ToV1Converter.toV1PortletContext(portletContext),
+ V2ToV1Converter.toV1UserContext(userContext),
+ desiredLocales,
+ new
Holder<V1PortletDescription>(V2ToV1Converter.toV1PortletDescription(portletDescription.value)),
+ new
Holder<V1ResourceList>(V2ToV1Converter.toV1ResourceList(resourceList.value)),
+ new
Holder<List<V1Extension>>(WSRPUtils.transform(extensions.value,
V2ToV1Converter.EXTENSION)));
+ }
+ catch (V1AccessDenied v1AccessDenied)
+ {
+ WSRPExceptionFactory.throwWSException(AccessDenied.class,
v1AccessDenied.getMessage(), v1AccessDenied);
+ }
+ catch (V1InconsistentParameters v1InconsistentParameters)
+ {
+ WSRPExceptionFactory.throwWSException(InconsistentParameters.class,
v1InconsistentParameters.getMessage(), v1InconsistentParameters);
+ }
+ catch (V1InvalidHandle v1InvalidHandle)
+ {
+ WSRPExceptionFactory.throwWSException(InvalidHandle.class,
v1InvalidHandle.getMessage(), v1InvalidHandle);
+ }
+ catch (V1InvalidRegistration v1InvalidRegistration)
+ {
+ WSRPExceptionFactory.throwWSException(InvalidRegistration.class,
v1InvalidRegistration.getMessage(), v1InvalidRegistration);
+ }
+ catch (V1InvalidUserCategory v1InvalidUserCategory)
+ {
+ WSRPExceptionFactory.throwWSException(InvalidUserCategory.class,
v1InvalidUserCategory.getMessage(), v1InvalidUserCategory);
+ }
+ catch (V1MissingParameters v1MissingParameters)
+ {
+ WSRPExceptionFactory.throwWSException(MissingParameters.class,
v1MissingParameters.getMessage(), v1MissingParameters);
+ }
+ catch (V1OperationFailed v1OperationFailed)
+ {
+ WSRPExceptionFactory.throwWSException(OperationFailed.class,
v1OperationFailed.getMessage(), v1OperationFailed);
+ }
}
@Override
@@ -92,43 +144,43 @@
@Override
public void getPortletsLifetime(RegistrationContext registrationContext,
List<PortletContext> portletContext, UserContext userContext,
Holder<List<PortletLifetime>> portletLifetime,
Holder<List<FailedPortlets>> failedPortlets, Holder<ResourceList>
resourceList, Holder<List<Extension>> extensions) throws AccessDenied,
InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
OperationFailed, OperationNotSupported, ResourceSuspended
{
- throw new NotYetImplemented();
+ WSRPExceptionFactory.throwWSException(OperationNotSupported.class,
"getPortletsLifetime not supported in WSRP 1", null);
}
@Override
public void setPortletsLifetime(RegistrationContext registrationContext,
List<PortletContext> portletContext, UserContext userContext, Lifetime lifetime,
Holder<List<PortletLifetime>> updatedPortlet,
Holder<List<FailedPortlets>> failedPortlets, Holder<ResourceList>
resourceList, Holder<List<Extension>> extensions) throws AccessDenied,
InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
OperationFailed, OperationNotSupported, ResourceSuspended
{
- throw new NotYetImplemented();
+ WSRPExceptionFactory.throwWSException(OperationNotSupported.class,
"setPortletsLifetime not supported in WSRP 1", null);
}
@Override
public void copyPortlets(RegistrationContext toRegistrationContext, UserContext
toUserContext, RegistrationContext fromRegistrationContext, UserContext fromUserContext,
List<PortletContext> fromPortletContexts, Lifetime lifetime,
Holder<List<CopiedPortlet>> copiedPortlets,
Holder<List<FailedPortlets>> failedPortlets, Holder<ResourceList>
resourceList, Holder<List<Extension>> extensions) throws AccessDenied,
InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
ResourceSuspended
{
- throw new NotYetImplemented();
+ WSRPExceptionFactory.throwWSException(OperationNotSupported.class,
"copyPortlets not supported in WSRP 1", null);
}
@Override
public void exportPortlets(RegistrationContext registrationContext,
List<PortletContext> portletContext, UserContext userContext, Holder<Lifetime>
lifetime, Boolean exportByValueRequired, Holder<byte[]> exportContext,
Holder<List<ExportedPortlet>> exportedPortlet,
Holder<List<FailedPortlets>> failedPortlets, Holder<ResourceList>
resourceList, Holder<List<Extension>> extensions) throws AccessDenied,
ExportByValueNotSupported, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed,
OperationNotSupported, ResourceSuspended
{
- throw new NotYetImplemented();
+ WSRPExceptionFactory.throwWSException(OperationNotSupported.class,
"exportPortlets not supported in WSRP 1", null);
}
@Override
public void importPortlets(RegistrationContext registrationContext, byte[]
importContext, List<ImportPortlet> importPortlet, UserContext userContext, Lifetime
lifetime, Holder<List<ImportedPortlet>> importedPortlets,
Holder<List<ImportPortletsFailed>> importFailed, Holder<ResourceList>
resourceList, Holder<List<Extension>> extensions) throws AccessDenied,
ExportNoLongerValid, InconsistentParameters, InvalidRegistration, InvalidUserCategory,
MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
ResourceSuspended
{
- throw new NotYetImplemented();
+ WSRPExceptionFactory.throwWSException(OperationNotSupported.class,
"importPortlets not supported in WSRP 1", null);
}
@Override
public List<Extension> releaseExport(RegistrationContext registrationContext,
byte[] exportContext, UserContext userContext)
{
- throw new NotYetImplemented();
+ throw new NotYetImplemented(); // WFT? this operation cannot fail? :)
}
@Override
public Lifetime setExportLifetime(SetExportLifetime setExportLifetime) throws
AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
OperationFailed, OperationNotSupported, ResourceSuspended
{
- throw new NotYetImplemented();
+ throw WSRPExceptionFactory.throwWSException(OperationNotSupported.class,
"setExportLifetime not supported in WSRP 1", null);
}
@Override
Modified:
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java 2010-06-10
08:41:09 UTC (rev 3293)
+++
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java 2010-06-10
16:21:34 UTC (rev 3294)
@@ -24,16 +24,14 @@
package org.gatein.wsrp.endpoints.v1;
import org.gatein.common.NotYetImplemented;
+import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
+import org.gatein.wsrp.spec.v1.V1ToV2Converter;
+import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1AccessDenied;
-import org.oasis.wsrp.v1.V1ClonePortlet;
import org.oasis.wsrp.v1.V1DestroyFailed;
-import org.oasis.wsrp.v1.V1DestroyPortlets;
-import org.oasis.wsrp.v1.V1DestroyPortletsResponse;
import org.oasis.wsrp.v1.V1Extension;
-import org.oasis.wsrp.v1.V1GetPortletDescription;
-import org.oasis.wsrp.v1.V1GetPortletProperties;
-import org.oasis.wsrp.v1.V1GetPortletPropertyDescription;
import org.oasis.wsrp.v1.V1InconsistentParameters;
import org.oasis.wsrp.v1.V1InvalidHandle;
import org.oasis.wsrp.v1.V1InvalidRegistration;
@@ -43,16 +41,24 @@
import org.oasis.wsrp.v1.V1OperationFailed;
import org.oasis.wsrp.v1.V1PortletContext;
import org.oasis.wsrp.v1.V1PortletDescription;
-import org.oasis.wsrp.v1.V1PortletDescriptionResponse;
-import org.oasis.wsrp.v1.V1PortletPropertyDescriptionResponse;
import org.oasis.wsrp.v1.V1Property;
import org.oasis.wsrp.v1.V1PropertyList;
import org.oasis.wsrp.v1.V1RegistrationContext;
import org.oasis.wsrp.v1.V1ResetProperty;
import org.oasis.wsrp.v1.V1ResourceList;
-import org.oasis.wsrp.v1.V1SetPortletProperties;
import org.oasis.wsrp.v1.V1UserContext;
import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
+import org.oasis.wsrp.v2.AccessDenied;
+import org.oasis.wsrp.v2.GetPortletDescription;
+import org.oasis.wsrp.v2.GetPortletProperties;
+import org.oasis.wsrp.v2.InconsistentParameters;
+import org.oasis.wsrp.v2.InvalidHandle;
+import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.InvalidUserCategory;
+import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.PortletDescriptionResponse;
+import org.oasis.wsrp.v2.PropertyList;
import javax.jws.HandlerChain;
import javax.jws.WebParam;
@@ -158,19 +164,48 @@
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>>
extensions
) throws V1MissingParameters, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
- /*GetPortletDescription getPortletDescription = new GetPortletDescription();
- getPortletDescription.setRegistrationContext(registrationContext);
- getPortletDescription.setPortletContext(portletContext);
- getPortletDescription.setUserContext(userContext);
+ GetPortletDescription getPortletDescription = new GetPortletDescription();
+
getPortletDescription.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
+
getPortletDescription.setPortletContext(V1ToV2Converter.toV2PortletContext(portletContext));
+
getPortletDescription.setUserContext(V1ToV2Converter.toV2UserContext(userContext));
getPortletDescription.getDesiredLocales().addAll(desiredLocales);
- PortletDescriptionResponse description =
producer.getPortletDescription(getPortletDescription);
+ try
+ {
+ PortletDescriptionResponse description =
producer.getPortletDescription(getPortletDescription);
- portletDescription.value = description.getPortletDescription();
- resourceList.value = description.getResourceList();
- extensions.value = description.getExtensions();*/
-
- throw new NotYetImplemented();
+ portletDescription.value =
V2ToV1Converter.toV1PortletDescription(description.getPortletDescription());
+ resourceList.value =
V2ToV1Converter.toV1ResourceList(description.getResourceList());
+ extensions.value = WSRPUtils.transform(description.getExtensions(),
V2ToV1Converter.EXTENSION);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ WSRP1ExceptionFactory.throwWSException(accessDenied.getClass(),
accessDenied.getMessage(), accessDenied);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ WSRP1ExceptionFactory.throwWSException(invalidHandle.getClass(),
invalidHandle.getMessage(), invalidHandle);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ WSRP1ExceptionFactory.throwWSException(invalidUserCategory.getClass(),
invalidUserCategory.getMessage(), invalidUserCategory);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ WSRP1ExceptionFactory.throwWSException(inconsistentParameters.getClass(),
inconsistentParameters.getMessage(), inconsistentParameters);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ WSRP1ExceptionFactory.throwWSException(missingParameters.getClass(),
missingParameters.getMessage(), missingParameters);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ WSRP1ExceptionFactory.throwWSException(invalidRegistration.getClass(),
invalidRegistration.getMessage(), invalidRegistration);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ WSRP1ExceptionFactory.throwWSException(operationFailed.getClass(),
operationFailed.getMessage(), operationFailed);
+ }
}
public void getPortletProperties(
@@ -183,19 +218,49 @@
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>>
extensions
) throws V1MissingParameters, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
- /*GetPortletProperties getPortletProperties = new GetPortletProperties();
- getPortletProperties.setRegistrationContext(registrationContext);
- getPortletProperties.setPortletContext(portletContext);
- getPortletProperties.setUserContext(userContext);
+ GetPortletProperties getPortletProperties = new GetPortletProperties();
+
getPortletProperties.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
+
getPortletProperties.setPortletContext(V1ToV2Converter.toV2PortletContext(portletContext));
+ getPortletProperties.setUserContext(V1ToV2Converter.toV2UserContext(userContext));
getPortletProperties.getNames().addAll(names);
- PropertyList result = producer.getPortletProperties(getPortletProperties);
+ try
+ {
+ PropertyList result = producer.getPortletProperties(getPortletProperties);
- properties.value = result.getProperties();
- resetProperties.value = result.getResetProperties();
- extensions.value = result.getExtensions();*/
+ properties.value = WSRPUtils.transform(result.getProperties(),
V2ToV1Converter.PROPERTY);
+ resetProperties.value = WSRPUtils.transform(result.getResetProperties(),
V2ToV1Converter.RESETPROPERTY);
+ extensions.value = WSRPUtils.transform(result.getExtensions(),
V2ToV1Converter.EXTENSION);
- throw new NotYetImplemented();
+ }
+ catch (AccessDenied accessDenied)
+ {
+ WSRP1ExceptionFactory.throwWSException(accessDenied.getClass(),
accessDenied.getMessage(), accessDenied);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ WSRP1ExceptionFactory.throwWSException(invalidHandle.getClass(),
invalidHandle.getMessage(), invalidHandle);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ WSRP1ExceptionFactory.throwWSException(invalidUserCategory.getClass(),
invalidUserCategory.getMessage(), invalidUserCategory);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ WSRP1ExceptionFactory.throwWSException(inconsistentParameters.getClass(),
inconsistentParameters.getMessage(), inconsistentParameters);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ WSRP1ExceptionFactory.throwWSException(missingParameters.getClass(),
missingParameters.getMessage(), missingParameters);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ WSRP1ExceptionFactory.throwWSException(invalidRegistration.getClass(),
invalidRegistration.getMessage(), invalidRegistration);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ WSRP1ExceptionFactory.throwWSException(operationFailed.getClass(),
operationFailed.getMessage(), operationFailed);
+ }
}
public void destroyPortlets(