Author: chris.laprun(a)jboss.com
Date: 2010-05-26 12:33:07 -0400 (Wed, 26 May 2010)
New Revision: 3203
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2V1Converter.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1ExceptionFactory.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1TypeFactory.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1MarkupInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1PortletManagementInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1RegistrationInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1ServiceDescriptionInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java
Removed:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
Modified:
components/wsrp/trunk/common/pom.xml
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRewritingConstants.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ProducerHolder.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/NeedPortletHandleTest.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ReleaseSessionTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/WSRPBaseEndpoint.java
Log:
- Second pass at supporting both WSRP 1 and 2: everything should compile now, albeit
should not work at all since a lot of code is missing.
Modified: components/wsrp/trunk/common/pom.xml
===================================================================
--- components/wsrp/trunk/common/pom.xml 2010-05-26 11:24:50 UTC (rev 3202)
+++ components/wsrp/trunk/common/pom.xml 2010-05-26 16:33:07 UTC (rev 3203)
@@ -35,6 +35,10 @@
<dependencies>
<dependency>
<groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wsrp1-ws</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wsrp2-ws</artifactId>
</dependency>
<dependency>
@@ -61,6 +65,11 @@
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.collections</groupId>
+ <artifactId>google-collections</artifactId>
+ <version>1.0</version>
+ </dependency>
<!-- tests -->
<dependency>
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRewritingConstants.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRewritingConstants.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRewritingConstants.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -173,10 +173,10 @@
public static final String REWRITE_PARAMETER_CLOSE = "}";
/** Encoded version of REWRITE_PARAMETER_OPEN */
- static final String ENC_OPEN = "%7B";
+ public static final String ENC_OPEN = "%7B";
/** Encoded version of REWRITE_PARAMETER_CLOSE */
- static final String ENC_CLOSE = "%7D";
+ public static final String ENC_CLOSE = "%7D";
/* Constants for Resource URL processing todo: remove? */
public static final String RESOURCE_URL_DELIMITER = "*";
Deleted:
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-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,33 +0,0 @@
-/*
- * 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.spec.v1;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class V2ToV1Converter
-{
-
-}
Copied:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2V1Converter.java
(from rev 3168,
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/V2V1Converter.java
(rev 0)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2V1Converter.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,139 @@
+/*
+ * 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.spec.v1;
+
+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.WSRPTypeFactory;
+import org.oasis.wsrp.v1.V1ClientData;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1MarkupContext;
+import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1ServiceDescription;
+import org.oasis.wsrp.v1.V1UserContext;
+import org.oasis.wsrp.v2.ClientData;
+import org.oasis.wsrp.v2.Extension;
+import org.oasis.wsrp.v2.MarkupContext;
+import org.oasis.wsrp.v2.MarkupParams;
+import org.oasis.wsrp.v2.PortletContext;
+import org.oasis.wsrp.v2.PortletDescription;
+import org.oasis.wsrp.v2.RegistrationContext;
+import org.oasis.wsrp.v2.RuntimeContext;
+import org.oasis.wsrp.v2.ServiceDescription;
+import org.oasis.wsrp.v2.UserContext;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class V2V1Converter
+{
+ private static final V1ToV2ExtensionFunction V1_TO_V2_EXTENSION_FUNCTION = new
V1ToV2ExtensionFunction();
+
+ public static V1PortletDescription toV1PortletDescription(PortletDescription
portletDescription)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static V1PortletContext toV1PortletContext(PortletContext portletContext)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static MarkupParams toV2MarkupParams(V1MarkupParams v1MarkupParams)
+ {
+ MarkupParams markupParams =
WSRPTypeFactory.createMarkupParams(v1MarkupParams.isSecureClientCommunication(),
+ v1MarkupParams.getLocales(), v1MarkupParams.getMimeTypes(),
v1MarkupParams.getMode(),
+ v1MarkupParams.getWindowState());
+ markupParams.setClientData(toV2ClientData(v1MarkupParams.getClientData()));
+
markupParams.setNavigationalContext(WSRPTypeFactory.createNavigationalContextOrNull(
+ new OpaqueStateString(v1MarkupParams.getNavigationalState()), null));
+ markupParams.setValidateTag(v1MarkupParams.getValidateTag());
+
+
markupParams.getMarkupCharacterSets().addAll(v1MarkupParams.getMarkupCharacterSets());
+ markupParams.getValidNewModes().addAll(v1MarkupParams.getValidNewModes());
+
markupParams.getValidNewWindowStates().addAll(v1MarkupParams.getValidNewWindowStates());
+
+ markupParams.getExtensions().addAll(Lists.transform(v1MarkupParams.getExtensions(),
V1_TO_V2_EXTENSION_FUNCTION));
+ return markupParams;
+ }
+
+ private static ClientData toV2ClientData(V1ClientData clientData)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static PortletContext toV2PortletContext(V1PortletContext portletContext)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static RegistrationContext toV2RegistrationContext(V1RegistrationContext
registrationContext)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static RuntimeContext toV2RuntimeContext(V1RuntimeContext runtimeContext)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static UserContext toV2UserContext(V1UserContext userContext)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static V1MarkupContext toV1MarkupContext(MarkupContext markupContext)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public static ServiceDescription toV2ServiceDescription(V1ServiceDescription
v1ServiceDescription)
+ {
+ throw new NotYetImplemented();
+ }
+
+ private static class V1ToV2ExtensionFunction implements Function<V1Extension,
Extension>
+ {
+ public Extension apply(V1Extension from)
+ {
+ if (from == null)
+ {
+ return null;
+ }
+ else
+ {
+ Extension extension = new Extension();
+ extension.setAny(from.getAny());
+ return extension;
+ }
+ }
+ }
+}
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1ExceptionFactory.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1ExceptionFactory.java
(rev 0)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1ExceptionFactory.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,202 @@
+/*
+ * 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.spec.v1;
+
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1AccessDeniedFault;
+import org.oasis.wsrp.v1.V1Fault;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InconsistentParametersFault;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidCookieFault;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidHandleFault;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidRegistrationFault;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidSessionFault;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1InvalidUserCategoryFault;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1MissingParametersFault;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequiredFault;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedLocaleFault;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMimeTypeFault;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedModeFault;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v1.V1UnsupportedWindowStateFault;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.ParameterizedType;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class WSRP1ExceptionFactory
+{
+ private static final Logger log =
LoggerFactory.getLogger(WSRP1ExceptionFactory.class);
+
+ public static final String ACCESS_DENIED = "AccessDenied";
+ public static final String INCONSISTENT_PARAMETERS =
"InconsistentParameters";
+ public static final String INVALID_REGISTRATION = "InvalidRegistration";
+ public static final String INVALID_COOKIE = "InvalidCookie";
+ public static final String INVALID_HANDLE = "InvalidHandle";
+ public static final String INVALID_SESSION = "InvalidSession";
+ public static final String INVALID_USER_CATEGORY = "InvalidUserCategory";
+ public static final String MISSING_PARAMETERS = "MissingParameters";
+ public static final String OPERATION_FAILED = "OperationFailed";
+ public static final String PORTLET_STATE_CHANGE_REQUIRED =
"PortletStateChangeRequired";
+ public static final String UNSUPPORTED_LOCALE = "UnsupportedLocale";
+ public static final String UNSUPPORTED_MIME_TYPE = "UnsupportedMimeType";
+ public static final String UNSUPPORTED_MODE = "UnsupportedMode";
+ public static final String UNSUPPORTED_WINDOW_STATE =
"UnsupportedWindowState";
+
+ private static final Map<String, ExceptionFactory<? extends Exception, ? extends
V1Fault>> errorCodeToExceptions =
+ new HashMap<String, ExceptionFactory<? extends Exception, ? extends
V1Fault>>(17);
+
+ static
+ {
+ try
+ {
+ errorCodeToExceptions.put(ACCESS_DENIED, new ExceptionFactory<V1AccessDenied,
V1AccessDeniedFault>()
+ {
+ });
+ errorCodeToExceptions.put(INCONSISTENT_PARAMETERS, new
ExceptionFactory<V1InconsistentParameters, V1InconsistentParametersFault>()
+ {
+ });
+ errorCodeToExceptions.put(INVALID_COOKIE, new
ExceptionFactory<V1InvalidCookie, V1InvalidCookieFault>()
+ {
+ });
+ errorCodeToExceptions.put(INVALID_HANDLE, new
ExceptionFactory<V1InvalidHandle, V1InvalidHandleFault>()
+ {
+ });
+ errorCodeToExceptions.put(INVALID_REGISTRATION, new
ExceptionFactory<V1InvalidRegistration, V1InvalidRegistrationFault>()
+ {
+ });
+ errorCodeToExceptions.put(INVALID_SESSION, new
ExceptionFactory<V1InvalidSession, V1InvalidSessionFault>()
+ {
+ });
+ errorCodeToExceptions.put(INVALID_USER_CATEGORY, new
ExceptionFactory<V1InvalidUserCategory, V1InvalidUserCategoryFault>()
+ {
+ });
+ errorCodeToExceptions.put(MISSING_PARAMETERS, new
ExceptionFactory<V1MissingParameters, V1MissingParametersFault>()
+ {
+ });
+ errorCodeToExceptions.put(OPERATION_FAILED, new
ExceptionFactory<V1OperationFailed, V1OperationFailedFault>()
+ {
+ });
+ errorCodeToExceptions.put(PORTLET_STATE_CHANGE_REQUIRED, new
ExceptionFactory<V1PortletStateChangeRequired, V1PortletStateChangeRequiredFault>()
+ {
+ });
+ errorCodeToExceptions.put(UNSUPPORTED_LOCALE, new
ExceptionFactory<V1UnsupportedLocale, V1UnsupportedLocaleFault>()
+ {
+ });
+ errorCodeToExceptions.put(UNSUPPORTED_MIME_TYPE, new
ExceptionFactory<V1UnsupportedMimeType, V1UnsupportedMimeTypeFault>()
+ {
+ });
+ errorCodeToExceptions.put(UNSUPPORTED_MODE, new
ExceptionFactory<V1UnsupportedMode, V1UnsupportedModeFault>()
+ {
+ });
+ errorCodeToExceptions.put(UNSUPPORTED_WINDOW_STATE, new
ExceptionFactory<V1UnsupportedWindowState, V1UnsupportedWindowStateFault>()
+ {
+ });
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error initializing WSRP1ExceptionFactory",
e);
+ }
+ }
+
+ private WSRP1ExceptionFactory()
+ {
+ }
+
+ public static void throwMissingParametersIfValueIsMissing(Object valueToCheck, String
valueName, String context)
+ throws V1MissingParameters
+ {
+ if (valueToCheck == null)
+ {
+ throw new V1MissingParameters("Missing required " + valueName +
(context != null ? " in " + context : ""), new
V1MissingParametersFault());
+ }
+ }
+
+ public static void throwOperationFailedIfValueIsMissing(Object valueToCheck, String
valueName) throws V1OperationFailed
+ {
+ if (valueToCheck == null)
+ {
+ throw new V1OperationFailed("Missing required " + valueName, new
V1OperationFailedFault());
+ }
+ }
+
+ public static <E extends Exception, F extends V1Fault> E throwWSException(String
errorCode, String message, Throwable cause) throws E
+ {
+ ExceptionFactory<E, F> exceptionFactory = (ExceptionFactory<E,
F>)errorCodeToExceptions.get(errorCode);
+ if (exceptionFactory == null)
+ {
+ throw new IllegalArgumentException("Unknown error code: " +
errorCode);
+ }
+
+ throw exceptionFactory.newInstance(message, cause);
+ }
+
+ private abstract static class ExceptionFactory<E extends Exception, F extends
V1Fault>
+ {
+ private final Constructor<E> exceptionConstructor;
+ private final V1Fault fault;
+
+ public ExceptionFactory() throws NoSuchMethodException, IllegalAccessException,
InstantiationException
+ {
+ ParameterizedType pt = (ParameterizedType)getClass().getGenericSuperclass();
+ Class<E> exceptionClass = (Class<E>)pt.getActualTypeArguments()[0];
+ Class<F> faultClass = (Class<F>)pt.getActualTypeArguments()[1];
+ exceptionConstructor = exceptionClass.getConstructor(String.class, faultClass,
Throwable.class);
+ fault = faultClass.newInstance();
+ }
+
+ public E newInstance(String message, Throwable cause)
+ {
+ try
+ {
+ return exceptionConstructor.newInstance(message, fault, cause);
+ }
+ catch (Exception e)
+ {
+ log.debug("Couldn't instantiate Exception associated with " +
fault.getClass().getSimpleName()
+ + ", message: " + message + ", cause: " + cause);
+ return null;
+ }
+ }
+ }
+}
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1TypeFactory.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1TypeFactory.java
(rev 0)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/WSRP1TypeFactory.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,1190 @@
+/*
+ * 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.spec.v1;
+
+import org.gatein.common.text.TextTools;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.ActionURL;
+import org.gatein.pc.api.ContainerURL;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.OpaqueStateString;
+import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.RenderURL;
+import org.gatein.pc.api.ResourceURL;
+import org.gatein.pc.api.StateString;
+import org.gatein.pc.api.StatefulPortletContext;
+import org.gatein.pc.api.URLFormat;
+import org.gatein.pc.api.WindowState;
+import org.gatein.pc.api.cache.CacheLevel;
+import org.gatein.pc.api.spi.PortletInvocationContext;
+import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPResourceURL;
+import org.gatein.wsrp.WSRPRewritingConstants;
+import org.gatein.wsrp.WSRPUtils;
+import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
+import org.oasis.wsrp.v1.V1CacheControl;
+import org.oasis.wsrp.v1.V1ClientData;
+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.V1GetMarkup;
+import org.oasis.wsrp.v1.V1GetPortletDescription;
+import org.oasis.wsrp.v1.V1GetPortletProperties;
+import org.oasis.wsrp.v1.V1GetPortletPropertyDescription;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1InitCookie;
+import org.oasis.wsrp.v1.V1InteractionParams;
+import org.oasis.wsrp.v1.V1LocalizedString;
+import org.oasis.wsrp.v1.V1MarkupContext;
+import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1MarkupType;
+import org.oasis.wsrp.v1.V1ModelDescription;
+import org.oasis.wsrp.v1.V1ModifyRegistration;
+import org.oasis.wsrp.v1.V1PerformBlockingInteraction;
+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.V1PropertyDescription;
+import org.oasis.wsrp.v1.V1PropertyList;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1ReleaseSessions;
+import org.oasis.wsrp.v1.V1ResetProperty;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1ServiceDescription;
+import org.oasis.wsrp.v1.V1SessionContext;
+import org.oasis.wsrp.v1.V1SetPortletProperties;
+import org.oasis.wsrp.v1.V1StateChange;
+import org.oasis.wsrp.v1.V1Templates;
+import org.oasis.wsrp.v1.V1UpdateResponse;
+import org.oasis.wsrp.v1.V1UploadContext;
+import org.oasis.wsrp.v1.V1UserContext;
+
+import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.Map;
+
+import static org.gatein.wsrp.WSRPRewritingConstants.*;
+
+/**
+ * Creates minimally valid instances of WSRP types, populated with default values where
possible, as per
+ * wsrp_v1_types.xsd. See <a
href="http://jira.jboss.com/jira/browse/JBPORTAL-808">JBPORT...
for more
+ * information.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 11317 $
+ * @since 2.4
+ */
+public class WSRP1TypeFactory
+{
+ private static final String REQUIRE_REWRITE_URL_PARAM = "&" +
WSRPRewritingConstants.RESOURCE_REQUIRES_REWRITE + "=" +
WSRPRewritingConstants.WSRP_REQUIRES_REWRITE;
+
+ private WSRP1TypeFactory()
+ {
+ }
+
+ /** ====== WSRP request objects ====== **/
+ /**
+ * registrationContext(RegistrationContext)?, desiredLocales(xsd:string)*
+ *
+ * @return
+ */
+ public static V1GetServiceDescription createGetServiceDescription()
+ {
+ return new V1GetServiceDescription();
+ }
+
+ /**
+ * Same as createMarkupRequest(handle, createDefaultRuntimeContext(),
createDefaultMarkupParams())
+ *
+ * @param handle
+ * @return
+ */
+ public static V1GetMarkup createDefaultMarkupRequest(String handle)
+ {
+ return createMarkupRequest(createPortletContext(handle),
createDefaultRuntimeContext(), createDefaultMarkupParams());
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext),
runtimeContext(RuntimeContext),
+ * userContext(UserContext)?, markupParams(MarkupParams)
+ *
+ * @param portletContext
+ * @param runtimeContext
+ * @param markupParams
+ * @return
+ * @throws IllegalArgumentException if one of the required parameters is
<code>null</code>
+ */
+ public static V1GetMarkup createMarkupRequest(V1PortletContext portletContext,
V1RuntimeContext runtimeContext, V1MarkupParams markupParams)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(runtimeContext,
"RuntimeContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(markupParams,
"MarkupParams");
+
+ V1GetMarkup getMarkup = new V1GetMarkup();
+ getMarkup.setPortletContext(portletContext);
+ getMarkup.setRuntimeContext(runtimeContext);
+ getMarkup.setMarkupParams(markupParams);
+ return getMarkup;
+ }
+
+ /**
+ * Same as createPerformBlockingInteraction(portletHandle, {@link
#createDefaultRuntimeContext}(), {@link
+ * #createDefaultMarkupParams}(), {@link #createDefaultInteractionParams}());
+ *
+ * @param portletHandle
+ * @return
+ */
+ public static V1PerformBlockingInteraction
createDefaultPerformBlockingInteraction(String portletHandle)
+ {
+ return createPerformBlockingInteraction(createPortletContext(portletHandle),
createDefaultRuntimeContext(), createDefaultMarkupParams(),
+ createDefaultInteractionParams());
+ }
+
+ /**
+ * {@link V1RegistrationContext}?, {@link V1PortletContext}, {@link V1RuntimeContext},
{@link V1UserContext}?, {@link
+ * V1MarkupParams}, {@link V1InteractionParams}
+ *
+ * @param portletContext
+ * @param runtimeContext
+ * @param markupParams
+ * @param interactionParams
+ * @return
+ */
+ public static V1PerformBlockingInteraction createPerformBlockingInteraction(
+ V1PortletContext portletContext, V1RuntimeContext runtimeContext,
+ V1MarkupParams markupParams,
+ V1InteractionParams interactionParams)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
+
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletContext.getPortletHandle(),
"portlet handle", "PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(runtimeContext,
"RuntimeContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(markupParams,
"MarkupParams");
+ ParameterValidation.throwIllegalArgExceptionIfNull(interactionParams,
"InteractionParams");
+
+ V1PerformBlockingInteraction performBlockingInteraction = new
V1PerformBlockingInteraction();
+ performBlockingInteraction.setPortletContext(portletContext);
+ performBlockingInteraction.setRuntimeContext(runtimeContext);
+ performBlockingInteraction.setMarkupParams(markupParams);
+ performBlockingInteraction.setInteractionParams(interactionParams);
+ return performBlockingInteraction;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext),
userContext(UserContext)?,
+ * desiredLocales(xsd:string)*
+ *
+ * @param registrationContext
+ * @param portletHandle handle for the PortletContext
+ * @return
+ * @since 2.4.1
+ */
+ public static V1GetPortletDescription
createGetPortletDescription(V1RegistrationContext registrationContext, String
portletHandle)
+ {
+ V1GetPortletDescription description = new V1GetPortletDescription();
+ description.setPortletContext(createPortletContext(portletHandle));
+ description.setRegistrationContext(registrationContext);
+ return description;
+ }
+
+ /**
+ * @param registrationContext
+ * @param portletContext
+ * @return
+ * @since 2.6
+ */
+ public static V1GetPortletDescription
createGetPortletDescription(V1RegistrationContext registrationContext,
+
org.gatein.pc.api.PortletContext portletContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "portlet
context");
+
+ V1PortletContext wsrpPC = createPortletContext(portletContext.getId());
+ if (portletContext instanceof StatefulPortletContext)
+ {
+ StatefulPortletContext context = (StatefulPortletContext)portletContext;
+ if (PortletStateType.OPAQUE.equals(context.getType()))
+ {
+
wsrpPC.setPortletState(((StatefulPortletContext<byte[]>)context).getState());
+ }
+ }
+
+ V1GetPortletDescription getPortletDescription = new V1GetPortletDescription();
+ getPortletDescription.setRegistrationContext(registrationContext);
+ getPortletDescription.setPortletContext(wsrpPC);
+ return getPortletDescription;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext),
userContext(UserContext)?,
+ * desiredLocales(xsd:string)*
+ *
+ * @param registrationContext
+ * @param portletContext
+ * @return
+ * @since 2.4.1
+ */
+ public static V1GetPortletProperties createGetPortletProperties(V1RegistrationContext
registrationContext, V1PortletContext portletContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
+ V1GetPortletProperties properties = new V1GetPortletProperties();
+ properties.setRegistrationContext(registrationContext);
+ properties.setPortletContext(portletContext);
+ return properties;
+ }
+
+ /** ====== WSRP Response objects ====== **/
+
+ /**
+ * ( updateResponse(UpdateResponse) | redirectURL(xsd:string) ),
extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1BlockingInteractionResponse
createBlockingInteractionResponse(V1UpdateResponse updateResponse)
+ {
+ if (updateResponse == null)
+ {
+ throw new IllegalArgumentException("BlockingInteractionResponse requires
either an UpdateResponse or a redirect URL.");
+ }
+ V1BlockingInteractionResponse interactionResponse = new
V1BlockingInteractionResponse();
+ interactionResponse.setUpdateResponse(updateResponse);
+ return interactionResponse;
+ }
+
+ /**
+ * ( updateResponse(UpdateResponse) | redirectURL(xsd:string) ),
extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1BlockingInteractionResponse createBlockingInteractionResponse(String
redirectURL)
+ {
+ if (redirectURL == null || redirectURL.length() == 0)
+ {
+ throw new IllegalArgumentException("BlockingInteractionResponse requires
either an UpdateResponse or a redirect URL.");
+ }
+ V1BlockingInteractionResponse interactionResponse = new
V1BlockingInteractionResponse();
+ interactionResponse.setRedirectURL(redirectURL);
+ return interactionResponse;
+ }
+
+ /**
+ * sessionContext(SessionContext)?, portletContext(PortletContext)?,
markupContext(MarkupContext)?,
+ * navigationalState(xsd:string)? newWindowState(xsd:string)?, newMode(xsd:string)?
+ *
+ * @return
+ */
+ public static V1UpdateResponse createUpdateResponse()
+ {
+ return new V1UpdateResponse();
+ }
+
+ /**
+ * portletHandle(xsd:string), markupTypes(MarkupType)+, groupID(xsd:string)?,
description(LocalizedString)?,
+ * shortTitle(LocalizedString)?, title(LocalizedString)?,
displayName(LocalizedString)?, keywords(LocalizedString)*,
+ * userCategories(xsd:string)*, userProfileItems(xsd:string)*,
usesMethodGet(xsd:boolean[false])?,
+ * defaultMarkupSecure(xsd:boolean[false])?, onlySecure(xsd:boolean[false])?,
userContextStoredInSession(xsd:boolean[false])?,
+ * templatesStoredInSession(xsd:boolean[false])?,
hasUserSpecificState(xsd:boolean[false])?,
+ * doesUrlTemplateProcessing(xsd:boolean[false])?, extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1PortletDescription
createPortletDescription(org.gatein.pc.api.PortletContext portletContext,
List<V1MarkupType> markupTypes)
+ {
+ V1PortletContext context =
V2V1Converter.toV1PortletContext(WSRPUtils.convertToWSRPPortletContext(portletContext));
+
+ ParameterValidation.throwIllegalArgExceptionIfNull(markupTypes,
"MarkupType");
+ if (markupTypes.isEmpty())
+ {
+ throw new IllegalArgumentException("Cannot create a PortletDescription with
an empty list of MarkupTypes!");
+ }
+
+ V1PortletDescription portletDescription = new V1PortletDescription();
+ portletDescription.setPortletHandle(context.getPortletHandle());
+ portletDescription.getMarkupTypes().addAll(markupTypes);
+ return portletDescription;
+ }
+
+ private static void checkPortletHandle(String portletHandle)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle,
"portlet handle", "PortletDescription");
+ if (portletHandle.length() > 255)
+ {
+ throw new IllegalArgumentException("Portlet handles must be less than 255
characters long. Was "
+ + portletHandle.length() + " long.");
+ }
+ }
+
+ /**
+ * Same as createMarkupParams(false, {@link WSRPConstants#getDefaultLocales()},
{@link
+ * WSRPConstants#getDefaultMimeTypes()}, {@link WSRPConstants#VIEW_MODE}, {@link
WSRPConstants#NORMAL_WINDOW_STATE})
+ *
+ * @return
+ */
+ public static V1MarkupParams createDefaultMarkupParams()
+ {
+ return createMarkupParams(false, WSRPConstants.getDefaultLocales(),
WSRPConstants.getDefaultMimeTypes(),
+ WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE);
+ }
+
+ /**
+ * secureClientCommunication(xsd:boolean), locales(xsd:string)+,
mimeTypes(xsd:string)+, mode(xsd:string),
+ * windowState(xsd:string), clientData({@link V1ClientData})?,
navigationalState(xsd:string)?,
+ * markupCharacterSets(xsd:string)*, validateTag(xsd:string)?,
validNewModes(xsd:string)*,
+ * validNewWindowStates(xsd:string)*, extensions({@link V1Extension})*
+ *
+ * @return
+ */
+ public static V1MarkupParams createMarkupParams(boolean secureClientCommunication,
List<String> locales,
+ List<String> mimeTypes, String
mode, String windowState)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(locales, "locales");
+ if (locales.isEmpty())
+ {
+ throw new IllegalArgumentException("Cannot create a MarkupParams with an
empty list of locales!");
+ }
+
+ ParameterValidation.throwIllegalArgExceptionIfNull(mimeTypes, "MIME
types");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mode, "mode",
"MarkupParams");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(windowState, "window
state", "MarkupParams");
+
+ V1MarkupParams markupParams = new V1MarkupParams();
+ markupParams.setSecureClientCommunication(secureClientCommunication);
+ markupParams.setMode(mode);
+ markupParams.setWindowState(windowState);
+ if (ParameterValidation.existsAndIsNotEmpty(locales))
+ {
+ markupParams.getLocales().addAll(locales);
+ }
+ if (ParameterValidation.existsAndIsNotEmpty(mimeTypes))
+ {
+ markupParams.getMimeTypes().addAll(mimeTypes);
+ }
+ return markupParams;
+ }
+
+ /**
+ * Same as createRuntimeContext({@link WSRPConstants#NONE_USER_AUTHENTICATION})
+ *
+ * @return
+ */
+ public static V1RuntimeContext createDefaultRuntimeContext()
+ {
+ return createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION);
+ }
+
+ /**
+ * userAuthentication(xsd:string), portletInstanceKey(xsd:string)?,
namespacePrefix(xsd:string)?,
+ * templates(Templates)?, sessionID(xsd:string)?, extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1RuntimeContext createRuntimeContext(String userAuthentication)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userAuthentication,
"user authentication", "RuntimeContext");
+
+ V1RuntimeContext runtimeContext = new V1RuntimeContext();
+ runtimeContext.setUserAuthentication(userAuthentication);
+ return runtimeContext;
+ }
+
+ /**
+ * portletHandle(xsd:string), portletState(xsd:base64Binary)?, extensions({@link
V1Extension})*
+ *
+ * @param portletHandle
+ * @return
+ */
+ public static V1PortletContext createPortletContext(String portletHandle)
+ {
+ checkPortletHandle(portletHandle);
+
+ V1PortletContext portletContext = new V1PortletContext();
+ portletContext.setPortletHandle(portletHandle);
+ return portletContext;
+ }
+
+
+ /**
+ * @param portletHandle
+ * @param portletState
+ * @return
+ * @since 2.6
+ */
+ public static V1PortletContext createPortletContext(String portletHandle, byte[]
portletState)
+ {
+ V1PortletContext pc = createPortletContext(portletHandle);
+ pc.setPortletState(portletState);
+ return pc;
+ }
+
+ /**
+ * Same as createInteractionParams(StateChange.readOnly)
+ *
+ * @return
+ */
+ public static V1InteractionParams createDefaultInteractionParams()
+ {
+ return createInteractionParams(V1StateChange.READ_ONLY);
+ }
+
+ /**
+ * portletStateChange({@link V1StateChange}), interactionState(xsd:string)?,
formParameters(NamedString)*,
+ * uploadContexts(UploadContext)*, extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1InteractionParams createInteractionParams(V1StateChange
portletStateChange)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletStateChange,
"portletStateChange");
+
+ V1InteractionParams interactionParams = new V1InteractionParams();
+ interactionParams.setPortletStateChange(portletStateChange);
+ return interactionParams;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?
+ *
+ * @param registrationContext
+ * @return
+ */
+ public static V1InitCookie createInitCookie(V1RegistrationContext
registrationContext)
+ {
+ V1InitCookie initCookie = new V1InitCookie();
+ initCookie.setRegistrationContext(registrationContext);
+ return initCookie;
+ }
+
+ /**
+ * requiresRegistration(xsd:boolean), offeredPortlets(PortletDescription)*,
userCategoryDescriptions(ItemDescription)*,
+ * customUserProfileItemDescriptions(ItemDescription)*,
customWindowStateDescriptions(ItemDescription)*,
+ * customModeDescriptions(ItemDescription)*,
requiresInitCookie(CookieProtocol[none])?,
+ * registrationPropertyDescription(ModelDescription)?, locales(xsd:string)*,
resourceList(ResourceList)?,
+ * extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1ServiceDescription createServiceDescription(boolean
requiresRegistration)
+ {
+ V1ServiceDescription serviceDescription = new V1ServiceDescription();
+ serviceDescription.setRequiresRegistration(requiresRegistration);
+ return serviceDescription;
+ }
+
+ /**
+ * markupContext(MarkupContext), sessionContext(SessionContext)?,
extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1MarkupResponse createMarkupResponse(V1MarkupContext markupContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(markupContext,
"MarkupContext");
+
+ V1MarkupResponse markupResponse = new V1MarkupResponse();
+ markupResponse.setMarkupContext(markupContext);
+ return markupResponse;
+ }
+
+ /**
+ * mimeType: The mime type of the returned markup. The mimeType field MUST be
specified whenever markup is returned,
+ * and if the markupBinary field is used to return the markup, the mime type MUST
include the character set for
+ * textual mime types using the syntax specified in RFC1522[14] (e.g. "text/html;
charset=UTF-8"). In this particular
+ * case this character set MAY be different than the response message.
+ * <p/>
+ * useCachedMarkup(xsd:boolean[false])?, mimeType(xsd:string)?,
(markupString(xsd:string) |
+ * markupBinary(xsd:base64Binary)), locale(xsd:string)?,
requiresUrlRewriting(xsd:boolean[false])?,
+ * cacheControl(CacheControl)?, preferredTitle(xsd:string)?, extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1MarkupContext createMarkupContext(String mediaType, String
markupString)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mediaType, "Media
type", "MarkupContext");
+ if (markupString == null)
+ {
+ throw new IllegalArgumentException("MarkupContext requires either a
non-null markup string or binary markup.");
+ }
+ V1MarkupContext markupContext = new V1MarkupContext();
+ markupContext.setMimeType(mediaType);
+ markupContext.setMarkupString(markupString);
+ return markupContext;
+ }
+
+ /**
+ * useCachedMarkup(xsd:boolean[false])?, mimeType(xsd:string)?,
(markupString(xsd:string) |
+ * markupBinary(xsd:base64Binary)), locale(xsd:string)?,
requiresUrlRewriting(xsd:boolean[false])?,
+ * cacheControl(CacheControl)?, preferredTitle(xsd:string)?, extensions(Extension)*
+ *
+ * @param mediaType The mime type of the returned markup. The mimeType field MUST be
specified whenever markup is
+ * returned, and if the markupBinary field is used to return the
markup, the mime type MUST include
+ * the character set for textual mime types using the syntax
specified in RFC1522[14] (e.g.
+ * "text/html; charset=UTF-8"). In this particular case
this character set MAY be different than the
+ * response message.
+ * @return a new MarkupContext
+ */
+ public static V1MarkupContext createMarkupContext(String mediaType, byte[]
markupBinary)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mediaType, "MIME
type", "MarkupContext");
+ if (markupBinary == null || markupBinary.length == 0)
+ {
+ throw new IllegalArgumentException("MarkupContext requires either a
non-null markup string or binary markup.");
+ }
+ V1MarkupContext markupContext = new V1MarkupContext();
+ markupContext.setMimeType(mediaType);
+ markupContext.setMarkupBinary(markupBinary);
+ return markupContext;
+ }
+
+ /**
+ * sessionID(xsd:string), expires(xsd:int), extensions(Extension)*
+ *
+ * @param sessionID An opaque string the Portlet defines for referencing state that is
stored locally on the
+ * Producer. The maximum length of a sessionID is 4096 characters,
+ * @param expires Maximum number of seconds between invocations referencing the
sessionID before the Producer will
+ * schedule releasing the related resources. A value of -1 indicates
that the sessionID will never
+ * expire.
+ * @return a new SessionContext
+ */
+ public static V1SessionContext createSessionContext(String sessionID, int expires)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(sessionID, "session
Id", "SessionContext");
+ if (expires < 0)
+ {
+ throw new IllegalArgumentException("SessionContext requires a positive
expiration time.");
+ }
+ V1SessionContext sessionContext = new V1SessionContext();
+ sessionContext.setSessionID(sessionID);
+ sessionContext.setExpires(expires);
+ return sessionContext;
+ }
+
+ /**
+ * For UserProfile and related classes, everything is optional so no need to have
factory methods.
+ * <p/>
+ * userContextKey(xsd:string), userCategories(xsd:string)*, profile(UserProfile)?,
extensions(Extension)*
+ *
+ * @return
+ */
+ public static V1UserContext createUserContext(String userContextKey)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userContextKey,
"user context key", "UserContext");
+ V1UserContext userContext = new V1UserContext();
+ userContext.setUserContextKey(userContextKey);
+ return userContext;
+ }
+
+ /**
+ * consumerName(xsd:string), consumerAgent(xsd:string),
methodGetSupported(xsd:boolean), consumerModes(xsd:string)*,
+ * consumerWindowStates(xsd:string)*, consumerUserScopes(xsd:string)*,
customUserProfileData(xsd:string)*,
+ * registrationProperties(Property)*, extensions(Extension)*
+ *
+ * @param consumerName A name (preferably unique) that identifies the Consumer
[R355] An example of such a name
+ * would be the Consumer's URL.
+ * @param methodGetSupported A flag that tells the Producer whether the Consumer has
implemented portlet URLs
+ * (regardless of whether they are written through Consumer
URL rewriting or Producer URL
+ * writing, see [Section 10.2]) in a manner that supports
HTML markup containing forms with
+ * method="get".
+ * @return
+ */
+ public static V1RegistrationData createRegistrationData(String consumerName, boolean
methodGetSupported)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName,
"consumer name", "RegistrationData");
+ V1RegistrationData regData = createDefaultRegistrationData();
+ regData.setConsumerName(consumerName);
+ regData.setMethodGetSupported(methodGetSupported);
+ return regData;
+ }
+
+ /**
+ * Same as createRegistrationData({@link WSRPConstants#DEFAULT_CONSUMER_NAME}, false)
using {@link
+ * WSRPConstants#CONSUMER_AGENT} for the consumer agent.
+ *
+ * @return
+ * @since 2.4.1
+ */
+ public static V1RegistrationData createDefaultRegistrationData()
+ {
+ V1RegistrationData registrationData = new V1RegistrationData();
+ registrationData.setConsumerName(WSRPConstants.DEFAULT_CONSUMER_NAME);
+ registrationData.setConsumerAgent(WSRPConstants.CONSUMER_AGENT);
+ registrationData.setMethodGetSupported(false);
+ return registrationData;
+ }
+
+ /**
+ * ( stringValue(xsd:string) | any* ), @name(xsd:string), @xml:lang
+ *
+ * @return
+ */
+ public static V1Property createProperty(String name, String lang, String stringValue)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "name",
"Property");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang,
"language", "Property");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(stringValue, "String
value", "Property");
+
+ V1Property property = new V1Property();
+ property.setName(name);
+ property.setLang(lang);
+ property.setStringValue(stringValue);
+ return property;
+ }
+
+ private static final ActionURL ACTION_URL = new ActionURL()
+ {
+ public StateString getInteractionState()
+ {
+ return new OpaqueStateString(REWRITE_PARAMETER_OPEN + INTERACTION_STATE +
REWRITE_PARAMETER_CLOSE);
+ }
+
+ public StateString getNavigationalState()
+ {
+ return getTemplateNS();
+ }
+
+ public Mode getMode()
+ {
+ return getTemplateMode();
+ }
+
+ public WindowState getWindowState()
+ {
+ return getTemplateWindowState();
+ }
+ };
+
+ private static final RenderURL RENDER_URL = new RenderURL()
+ {
+ public StateString getNavigationalState()
+ {
+ return getTemplateNS();
+ }
+
+ public Map<String, String[]> getPublicNavigationalStateChanges()
+ {
+ // todo: implement properly
+ return null;
+ }
+
+ public Mode getMode()
+ {
+ return getTemplateMode();
+ }
+
+ public WindowState getWindowState()
+ {
+ return getTemplateWindowState();
+ }
+ };
+
+ private static ResourceURL RESOURCE_URL = new WSRPResourceURL()
+ {
+ public String getResourceId()
+ {
+ return REWRITE_PARAMETER_OPEN + WSRPRewritingConstants.RESOURCE_URL +
REWRITE_PARAMETER_CLOSE;
+ }
+
+ public StateString getResourceState()
+ {
+ // todo: fix-me
+ return null;
+ }
+
+ public CacheLevel getCacheability()
+ {
+ // todo: fix-me
+ return null;
+ }
+
+ public Mode getMode()
+ {
+ return getTemplateMode();
+ }
+
+ public WindowState getWindowState()
+ {
+ return getTemplateWindowState();
+ }
+
+ public StateString getNavigationalState()
+ {
+ return getTemplateNS();
+ }
+ };
+
+ private static StateString getTemplateNS()
+ {
+ return new OpaqueStateString(REWRITE_PARAMETER_OPEN + NAVIGATIONAL_STATE +
REWRITE_PARAMETER_CLOSE);
+ }
+
+ private static WindowState getTemplateWindowState()
+ {
+ return WindowState.create(REWRITE_PARAMETER_OPEN + WINDOW_STATE +
REWRITE_PARAMETER_CLOSE, true);
+ }
+
+ private static Mode getTemplateMode()
+ {
+ return Mode.create(REWRITE_PARAMETER_OPEN + MODE + REWRITE_PARAMETER_CLOSE, true);
+ }
+
+
+ /**
+ * defaultTemplate(xsd:string)?, blockingActionTemplate(xsd:string)?,
renderTemplate(xsd:string)?,
+ * resourceTemplate(xsd:string)?, secureDefaultTemplate(xsd:string)?,
secureBlockingActionTemplate(xsd:string)?,
+ * secureRenderTemplate(xsd:string)?, secureResourceTemplate(xsd:string)?,
extensions(Extension)*
+ *
+ * @param context
+ * @return
+ */
+ public static V1Templates createTemplates(PortletInvocationContext context)
+ {
+ V1Templates templates = new V1Templates();
+
+ templates.setBlockingActionTemplate(createTemplate(context, ACTION_URL,
Boolean.FALSE));
+ templates.setRenderTemplate(createTemplate(context, RENDER_URL, Boolean.FALSE));
+ templates.setSecureBlockingActionTemplate(createTemplate(context, ACTION_URL,
Boolean.TRUE));
+ templates.setSecureRenderTemplate(createTemplate(context, RENDER_URL,
Boolean.TRUE));
+
+ //fix-me: deal with resources properly, create fake ones for now
+ templates.setResourceTemplate(createTemplate(context, RESOURCE_URL, false));
+ templates.setSecureResourceTemplate(createTemplate(context, RESOURCE_URL, true));
+
+ return templates;
+ }
+
+ private static String createTemplate(PortletInvocationContext context, ContainerURL
url, Boolean secure)
+ {
+ String template = context.renderURL(url, new URLFormat(secure, null, null, true));
+ template = TextTools.replace(template, WSRPRewritingConstants.ENC_OPEN,
WSRPRewritingConstants.REWRITE_PARAMETER_OPEN);
+ template = TextTools.replace(template, WSRPRewritingConstants.ENC_CLOSE,
WSRPRewritingConstants.REWRITE_PARAMETER_CLOSE);
+
+ // fix for GTNWSRP-22
+ if (RESOURCE_URL == url)
+ {
+ template += REQUIRE_REWRITE_URL_PARAM;
+ }
+
+ return template;
+ }
+
+ /**
+ * userAgent(xsd:string)?, extensions(Extension)*
+ *
+ * @param userAgent
+ * @return
+ */
+ public static V1ClientData createClientData(String userAgent)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userAgent, "user
agent", "ClientData");
+ V1ClientData clientData = new V1ClientData();
+ clientData.setUserAgent(userAgent);
+ return clientData;
+ }
+
+ /**
+ * expires(xsd:int), userScope(xsd:string), validateTag(xsd:string)?,
extensions(Extension)*
+ *
+ * @param expires Number of seconds the markup fragment referenced by this cache
control entry remains valid. A
+ * value of -1 indicates that the markup fragment will never expire.
+ * @param userScope
+ * @return
+ */
+ public static V1CacheControl createCacheControl(int expires, String userScope)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userScope, "user
scope", "CacheControl");
+ if (expires < -1)
+ {
+ throw new IllegalArgumentException("Cache expiration time must be greater
than -1, " +
+ "-1 indicating that the cache will never expire.");
+ }
+
+ V1CacheControl cacheControl = new V1CacheControl();
+ cacheControl.setExpires(expires);
+ cacheControl.setUserScope(userScope);
+ return cacheControl;
+ }
+
+ /**
+ * registrationHandle(xsd:string), registrationState(xsd:base64Binary)?,
extensions(Extension)*
+ *
+ * @param registrationHandle
+ * @return
+ * @since 2.4.1
+ */
+ public static V1RegistrationContext createRegistrationContext(String
registrationHandle)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(registrationHandle,
"Registration handle");
+ V1RegistrationContext registrationContext = new V1RegistrationContext();
+ registrationContext.setRegistrationHandle(registrationHandle);
+ return registrationContext;
+ }
+
+ /**
+ * propertyDescriptions(PropertyDescription)*, modelTypes(ModelTypes)?,
extensions(Extension)*
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1ModelDescription
createModelDescription(List<V1PropertyDescription> propertyDescriptions)
+ {
+ V1ModelDescription description = new V1ModelDescription();
+ if (ParameterValidation.existsAndIsNotEmpty(propertyDescriptions))
+ {
+ description.getPropertyDescriptions().addAll(propertyDescriptions);
+ }
+ return description;
+ }
+
+ /**
+ * label(LocalizedString)?, hint(LocalizedString)?, extensions(Extension)*,
@name(xsd:string), @type(xsd:QName)
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1PropertyDescription createPropertyDescription(String name, QName
type)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(name, "PropertyDescription
name");
+ ParameterValidation.throwIllegalArgExceptionIfNull(type, "PropertyDescription
type");
+ V1PropertyDescription description = new V1PropertyDescription();
+ description.setName(name);
+ description.setType(type);
+ return description;
+ }
+
+ /**
+ * value(xsd:string), @xml:lang, @resourceName(xsd:string)?
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1LocalizedString createLocalizedString(String lang, String
resourceName, String value)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(lang, "LocalizedString
language");
+ ParameterValidation.throwIllegalArgExceptionIfNull(value, "LocalizedString
value");
+ V1LocalizedString localizedString = new V1LocalizedString();
+ localizedString.setLang(lang);
+ localizedString.setResourceName(resourceName);
+ localizedString.setValue(value);
+ return localizedString;
+ }
+
+ /**
+ * Same as createLocalizedString("en", null, value)
+ *
+ * @param value
+ * @return
+ * @since 2.6
+ */
+ public static V1LocalizedString createLocalizedString(String value)
+ {
+ return createLocalizedString("en", null, value);
+ }
+
+ /**
+ * portletDescription(PortletDescription), resourceList(ResourceList)?,
extensions(Extension)*
+ *
+ * @param portletDescription
+ * @return
+ * @since 2.6
+ */
+ public static V1PortletDescriptionResponse
createPortletDescriptionResponse(V1PortletDescription portletDescription)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletDescription,
"PortletDescription");
+ V1PortletDescriptionResponse response = new V1PortletDescriptionResponse();
+ response.setPortletDescription(portletDescription);
+ return response;
+ }
+
+ /**
+ * modelDescription(ModelDescription)?, resourceList(ResourceList)?,
extensions(Extension)*
+ *
+ * @param propertyDescriptions
+ * @return
+ * @since 2.6
+ */
+ public static V1PortletPropertyDescriptionResponse
createPortletPropertyDescriptionResponse(List<V1PropertyDescription>
propertyDescriptions)
+ {
+ V1ModelDescription modelDescription = propertyDescriptions == null ? null :
createModelDescription(propertyDescriptions);
+ V1PortletPropertyDescriptionResponse portletPropertyDescriptionResponse = new
V1PortletPropertyDescriptionResponse();
+ portletPropertyDescriptionResponse.setModelDescription(modelDescription);
+ return portletPropertyDescriptionResponse;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext),
userContext(UserContext)?,
+ * desiredLocales(xsd:string)*
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1GetPortletPropertyDescription
createGetPortletPropertyDescription(V1RegistrationContext registrationContext,
+
V1PortletContext portletContext,
+
V1UserContext userContext, List<String> desiredLocales)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
+ V1GetPortletPropertyDescription description = new
V1GetPortletPropertyDescription();
+ description.setRegistrationContext(registrationContext);
+ description.setPortletContext(portletContext);
+ description.setUserContext(userContext);
+ if (ParameterValidation.existsAndIsNotEmpty(desiredLocales))
+ {
+ description.getDesiredLocales().addAll(desiredLocales);
+ }
+ return description;
+ }
+
+ /**
+ * Same as createGetPortletPropertyDescription(null,
createPortletContext(portletHandle), null, null)
+ *
+ * @param portletHandle
+ * @return
+ * @since 2.6
+ */
+ public static V1GetPortletPropertyDescription
createSimpleGetPortletPropertyDescription(String portletHandle)
+ {
+ return createGetPortletPropertyDescription(null,
createPortletContext(portletHandle), null, null);
+ }
+
+
+ /**
+ * portletHandle(xsd:string), reason(xsd:string)
+ *
+ * @param portletHandle
+ * @param reason
+ * @return
+ * @since 2.6
+ */
+ public static V1DestroyFailed 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...
+ V1DestroyFailed destroyFailed = new V1DestroyFailed();
+ destroyFailed.setPortletHandle(portletHandle);
+ destroyFailed.setReason(reason);
+ return destroyFailed;
+ }
+
+ /**
+ * destroyFailed(DestroyFailed)*, extensions(Extension)*
+ *
+ * @param destroyFailed
+ * @return
+ * @since 2.6
+ */
+ public static V1DestroyPortletsResponse
createDestroyPortletsResponse(List<V1DestroyFailed> destroyFailed)
+ {
+ V1DestroyPortletsResponse destroyPortletsResponse = new
V1DestroyPortletsResponse();
+ if (ParameterValidation.existsAndIsNotEmpty(destroyFailed))
+ {
+ destroyPortletsResponse.getDestroyFailed().addAll(destroyFailed);
+ }
+ return destroyPortletsResponse;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext),
userContext(UserContext)?,
+ * propertyList(PropertyList)
+ *
+ * @param portletContext
+ * @param propertyList
+ * @return
+ * @since 2.6
+ */
+ public static V1SetPortletProperties createSetPortletProperties(
+ V1RegistrationContext registrationContext,
+ V1PortletContext portletContext,
+ V1PropertyList propertyList)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNull(propertyList,
"PropertyList");
+
+ V1SetPortletProperties properties = new V1SetPortletProperties();
+ properties.setRegistrationContext(registrationContext);
+ properties.setPortletContext(portletContext);
+ properties.setPropertyList(propertyList);
+ return properties;
+ }
+
+ /**
+ * same as createClonePortlet(null, createPortletContext(portletHandle), null)
+ *
+ * @param portletHandle
+ * @return
+ * @since 2.6
+ */
+ public static V1ClonePortlet createSimpleClonePortlet(String portletHandle)
+ {
+ return createClonePortlet(null, createPortletContext(portletHandle), null);
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletContext(PortletContext),
userContext(UserContext)?
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1ClonePortlet createClonePortlet(V1RegistrationContext
registrationContext, V1PortletContext portletContext, V1UserContext userContext)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
+ V1ClonePortlet clonePortlet = new V1ClonePortlet();
+ clonePortlet.setPortletContext(portletContext);
+ clonePortlet.setRegistrationContext(registrationContext);
+ clonePortlet.setUserContext(userContext);
+ return clonePortlet;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, portletHandles(xsd:string)+
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1DestroyPortlets createDestroyPortlets(V1RegistrationContext
registrationContext, List<String> portletHandles)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletHandles, "Portlet
handles");
+ if (portletHandles.isEmpty())
+ {
+ throw new IllegalArgumentException("Cannot create a DestroyPortlets with an
empty list of portlet handles!");
+ }
+
+ V1DestroyPortlets destroyPortlets = new V1DestroyPortlets();
+ destroyPortlets.setRegistrationContext(registrationContext);
+ if (ParameterValidation.existsAndIsNotEmpty(portletHandles))
+ {
+ destroyPortlets.getPortletHandles().addAll(portletHandles);
+ }
+ return destroyPortlets;
+ }
+
+ /**
+ * properties(Property)*, resetProperties(ResetProperty)*, extensions(Extension)*
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1PropertyList createPropertyList()
+ {
+ return new V1PropertyList();
+ }
+
+ /**
+ * EMPTY, @name(xsd:string)
+ *
+ * @param name
+ * @return
+ * @since 2.6
+ */
+ public static V1ResetProperty createResetProperty(String name)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "Property
name", "ResetProperty");
+
+ V1ResetProperty resetProperty = new V1ResetProperty();
+ resetProperty.setName(name);
+ return resetProperty;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, sessionIDs(xsd:string)*
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1ReleaseSessions createReleaseSessions(V1RegistrationContext
registrationContext, List<String> sessionIDs)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(sessionIDs, "Session
IDs");
+ if (sessionIDs.isEmpty())
+ {
+ throw new IllegalArgumentException("Cannot create a ReleaseSessions with an
empty list of session IDs!");
+ }
+
+ V1ReleaseSessions sessions = new V1ReleaseSessions();
+ sessions.setRegistrationContext(registrationContext);
+ if (ParameterValidation.existsAndIsNotEmpty(sessionIDs))
+ {
+ sessions.getSessionIDs().addAll(sessionIDs);
+ }
+ return sessions;
+ }
+
+ /**
+ * registrationContext(RegistrationContext)?, registrationData(RegistrationData)
+ *
+ * @return
+ * @since 2.6
+ */
+ public static V1ModifyRegistration createModifyRegistration(V1RegistrationContext
registrationContext,
+ V1RegistrationData
registrationData)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(registrationData,
"RegistrationData");
+
+ V1ModifyRegistration registration = new V1ModifyRegistration();
+ registration.setRegistrationContext(registrationContext);
+ registration.setRegistrationData(registrationData);
+ return registration;
+ }
+
+ /**
+ * mimeType(xsd:string), uploadData(xsd:base64Binary), mimeAttributes(NamedString)*,
extensions(Extension)*
+ *
+ * @param mimeType
+ * @param uploadData
+ * @return
+ * @since 2.6.2
+ */
+ public static V1UploadContext createUploadContext(String mimeType, byte[] uploadData)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mimeType, "MIME
Type", "UploadContext");
+ if (uploadData == null || uploadData.length == 0)
+ {
+ throw new IllegalArgumentException("Must pass non-null, non-empty upload
data");
+ }
+
+ V1UploadContext uploadContext = new V1UploadContext();
+ uploadContext.setMimeType(mimeType);
+ uploadContext.setUploadData(uploadData);
+ return uploadContext;
+ }
+
+ public static V1MarkupType createMarkupType(String mimeType, List<String>
modeNames, List<String> windowStateNames, List<String> localeNames)
+ {
+ V1MarkupType markupType = new V1MarkupType();
+ markupType.setMimeType(mimeType);
+
+ if (ParameterValidation.existsAndIsNotEmpty(modeNames))
+ {
+ markupType.getModes().addAll(modeNames);
+ }
+ if (ParameterValidation.existsAndIsNotEmpty(windowStateNames))
+ {
+ markupType.getWindowStates().addAll(windowStateNames);
+ }
+ if (ParameterValidation.existsAndIsNotEmpty(localeNames))
+ {
+ markupType.getLocales().addAll(localeNames);
+ }
+ return markupType;
+ }
+}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, 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.consumer;
@@ -27,28 +27,30 @@
import org.gatein.pc.api.Portlet;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvokerException;
-import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
import org.gatein.wsrp.test.protocol.v1.RegistrationBehavior;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
import org.gatein.wsrp.test.support.BehaviorBackedServiceFactory;
import org.gatein.wsrp.test.support.MockConsumerRegistry;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidRegistrationFault;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.OperationFailedFault;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RegistrationData;
-import org.oasis.wsrp.v1.ResourceList;
-import org.oasis.wsrp.v1.UserContext;
+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.V1InvalidRegistrationFault;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1Property;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v1.V1UserContext;
+import org.oasis.wsrp.v2.RegistrationContext;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -354,7 +356,7 @@
private static class TestPortletManagementBehavior extends PortletManagementBehavior
{
@Override
- public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") org.oasis.wsrp.v1.PortletContext
portletContext, @WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension!
> extensions) throws MissingParameters, InconsistentParameters,
InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void getPortletDescription(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(name = "portletDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<V1PortletDescription> portletDescription, @WebParam(name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<V1ResourceList> resourceList, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<List<V1Extension>> ext!
ensions) throws V1AccessDenied, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1MissingParameters, V1OperationFailed
{
super.getPortletDescription(registrationContext, portletContext, userContext,
desiredLocales, portletDescription, resourceList, extensions);
portletDescription.value = createPortletDescription("test2", null);
@@ -368,9 +370,9 @@
private static final String ORIGINAL_VALUE = "value";
@Override
- public void register(@WebParam(name = "consumerName", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name =
"consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name =
"consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> consumerModes, @WebParam(name = "consumerWindowStates",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes,
@WebParam(name = "customUserProfileData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData,
@WebParam(name = "registrationProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<Property> regist!
rationProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState)
throws MissingParameters, OperationFailed
+ public void register(@WebParam(name = "consumerName", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name =
"consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name =
"consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> consumerModes, @WebParam(name = "consumerWindowStates",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes,
@WebParam(name = "customUserProfileData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData,
@WebParam(name = "registrationProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<V1Property> regi!
strationProperties, @WebParam(name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.INOUT)
Holder<List<V1Extension>> extensions, @WebParam(name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<String> registrationHandle, @WebParam(name = "registrationState",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<byte[]> registrationState) throws V1MissingParameters, V1OperationFailed
{
- Property prop = checkRegistrationData(registrationProperties);
+ V1Property prop = checkRegistrationData(registrationProperties);
String value = prop.getStringValue();
if (ORIGINAL_VALUE.equals(value) && PROP_NAME.equals(prop.getName()))
@@ -379,25 +381,25 @@
return;
}
- throw WSRPExceptionFactory.<OperationFailed,
OperationFailedFault>throwWSException(WSRPExceptionFactory.OPERATION_FAILED,
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
value + " is not a valid value for " + PROP_NAME, null);
}
@Override
- public void modifyRegistration(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "registrationData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationData registrationData,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions) throws MissingParameters, InvalidRegistration, OperationFailed
+ public void modifyRegistration(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "registrationData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationData registrationData,
@WebParam(name = "registrationState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<byte[]> registrationState, @WebParam(name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<List<V1Extension>> extensions) throws V1InvalidRegistration,
V1MissingParameters, V1OperationFailed
{
incrementCallCount();
- WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(registrationContext,
"RegistrationContext", null);
+
WSRP1ExceptionFactory.throwMissingParametersIfValueIsMissing(registrationContext,
"RegistrationContext", null);
if
(!RegistrationBehavior.REGISTRATION_HANDLE.equals(registrationContext.getRegistrationHandle()))
{
- WSRPExceptionFactory.<InvalidRegistration,
InvalidRegistrationFault>throwWSException(WSRPExceptionFactory.INVALID_REGISTRATION,
"Invalid registration", null);
+ WSRP1ExceptionFactory.<V1InvalidRegistration,
V1InvalidRegistrationFault>throwWSException(WSRP1ExceptionFactory.INVALID_REGISTRATION,
"Invalid registration", null);
}
- WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(registrationData,
"RegistrationData", null);
+ WSRP1ExceptionFactory.throwMissingParametersIfValueIsMissing(registrationData,
"RegistrationData", null);
- Property prop =
checkRegistrationData(registrationData.getRegistrationProperties());
+ V1Property prop =
checkRegistrationData(registrationData.getRegistrationProperties());
String value = prop.getStringValue();
if (MODIFIED_VALUE.equals(value) && PROP_NAME.equals(prop.getName()))
@@ -405,16 +407,16 @@
return;
}
- throw WSRPExceptionFactory.<OperationFailed,
OperationFailedFault>throwWSException(WSRPExceptionFactory.OPERATION_FAILED, value
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED, value
+ " is not a valid value for " + PROP_NAME, null);
}
- private Property checkRegistrationData(List<Property> registrationProperties)
throws OperationFailed
+ private V1Property checkRegistrationData(List<V1Property>
registrationProperties) throws V1OperationFailed
{
-
WSRPExceptionFactory.throwOperationFailedIfValueIsMissing(registrationProperties,
"RegistrationData");
+
WSRP1ExceptionFactory.throwOperationFailedIfValueIsMissing(registrationProperties,
"RegistrationData");
- Property prop = registrationProperties.get(0);
- WSRPExceptionFactory.throwOperationFailedIfValueIsMissing(prop,
"Registration property");
+ V1Property prop = registrationProperties.get(0);
+ WSRP1ExceptionFactory.throwOperationFailedIfValueIsMissing(prop,
"Registration property");
return prop;
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -26,12 +26,14 @@
import junit.framework.TestCase;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.V2V1Converter;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RegistrationData;
-import org.oasis.wsrp.v1.ServiceDescription;
+import org.oasis.wsrp.v2.Property;
+import org.oasis.wsrp.v2.RegistrationContext;
+import org.oasis.wsrp.v2.RegistrationData;
+import org.oasis.wsrp.v2.ServiceDescription;
+import javax.xml.namespace.QName;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -146,7 +148,7 @@
public void testSimpleSetGetRegistrationProperty()
{
- String key = "foo";
+ QName key = QName.valueOf("{urn:foo:ns}foo");
info.setRegistrationPropertyValue(key, "bar");
// check status
@@ -505,6 +507,6 @@
private ServiceDescription createServiceDescription(boolean requiresRegistration, int
numberOfProperties)
{
- return ServiceDescriptionBehavior.createServiceDescription(requiresRegistration,
numberOfProperties);
+ return
V2V1Converter.toV2ServiceDescription(ServiceDescriptionBehavior.createServiceDescription(requiresRegistration,
numberOfProperties));
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -58,7 +58,7 @@
{
try
{
- new RegistrationProperty(null, VALUE, "en", listener);
+ new RegistrationProperty((String)null, VALUE, "en", listener);
fail("Should have failed on null name");
}
catch (Exception e)
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.protocol.v1;
@@ -54,15 +54,15 @@
import org.gatein.wsrp.test.protocol.v1.behaviors.SessionMarkupBehavior;
import org.gatein.wsrp.test.support.MockHttpServletRequest;
import org.gatein.wsrp.test.support.TestPortletInvocationContext;
-import org.oasis.wsrp.v1.CookieProtocol;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.ItemDescription;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.V1CookieProtocol;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1ItemDescription;
+import org.oasis.wsrp.v1.V1ModelDescription;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v2.InvalidHandle;
import javax.servlet.http.HttpSession;
import javax.xml.ws.Holder;
@@ -170,7 +170,7 @@
String handle = PerUserInitCookieMarkupBehavior.PER_USER_INIT_COOKIE_HANDLE;
InitCookieMarkupBehavior behavior =
(InitCookieMarkupBehavior)producer.getBehaviorRegistry().getMarkupBehaviorFor(handle);
- ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior,
CookieProtocol.PER_USER);
+ ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior,
V1CookieProtocol.PER_USER.value());
ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
ExtendedAssert.assertTrue(sessionInfo.isInitCookieDone());
@@ -179,23 +179,23 @@
ExtendedAssert.assertEquals(1, behavior.getInitCookieCallCount());
}
- public void testInitCookiePerGroup() throws PortletInvokerException, InvalidHandle,
OperationFailed, InvalidRegistration
+ public void testInitCookiePerGroup() throws PortletInvokerException, InvalidHandle,
V1InvalidRegistration, V1OperationFailed
{
BehaviorRegistry registry = producer.getBehaviorRegistry();
// need to setup with a specific service description behavior: we wrap the current
service description
- Holder<List<PortletDescription>> offeredPortlets = new
Holder<List<PortletDescription>>();
+ Holder<List<V1PortletDescription>> offeredPortlets = new
Holder<List<V1PortletDescription>>();
registry.getServiceDescriptionBehavior().getServiceDescription(null, null, new
Holder<Boolean>(),
- offeredPortlets, new Holder<List<ItemDescription>>(),
- new Holder<List<ItemDescription>>(), new
Holder<List<ItemDescription>>(), new
Holder<List<ItemDescription>>(),
- new Holder<CookieProtocol>(), new Holder<ModelDescription>(), new
Holder<List<String>>(),
- new Holder<ResourceList>(), new Holder<List<Extension>>());
+ offeredPortlets, new Holder<List<V1ItemDescription>>(),
+ new Holder<List<V1ItemDescription>>(), new
Holder<List<V1ItemDescription>>(), new
Holder<List<V1ItemDescription>>(),
+ new Holder<V1CookieProtocol>(), new Holder<V1ModelDescription>(),
new Holder<List<String>>(),
+ new Holder<V1ResourceList>(), new
Holder<List<V1Extension>>());
setServiceDescriptionBehavior(new
GroupedPortletsServiceDescriptionBehavior(offeredPortlets.value));
String handle = PerGroupInitCookieMarkupBehavior.PER_GROUP_INIT_COOKIE_HANDLE;
InitCookieMarkupBehavior behavior =
(InitCookieMarkupBehavior)registry.getMarkupBehaviorFor(handle);
- ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior,
CookieProtocol.PER_GROUP);
+ ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior,
V1CookieProtocol.PER_GROUP.value());
ExtendedAssert.assertTrue(sessionInfo.isPerGroupCookies());
ExtendedAssert.assertTrue(sessionInfo.isInitCookieDone());
ExtendedAssert.assertNull(sessionInfo.getUserCookie());
@@ -211,7 +211,7 @@
checkRenderResult(response, "<img
src='http://localhost:8080/test-resource-portlet/gif/logo.gif'/>");
}
- private ProducerSessionInformation commonInitCookieTest(String handle,
InitCookieMarkupBehavior behavior, CookieProtocol cookieProtocol)
+ private ProducerSessionInformation commonInitCookieTest(String handle,
InitCookieMarkupBehavior behavior, String cookieProtocol)
throws PortletInvokerException
{
RenderInvocation render = createRenderInvocation(handle);
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * 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.test;
@@ -28,8 +28,8 @@
import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
import org.gatein.wsrp.test.protocol.v1.RegistrationBehavior;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidHandleFault;
+import org.oasis.wsrp.v2.InvalidHandle;
+import org.oasis.wsrp.v2.InvalidHandleFault;
import java.util.HashMap;
import java.util.Map;
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,30 +1,28 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test;
-import org.oasis.wsrp.v1.CookieProtocol;
-
/**
* Exposes WSPRProducer test implementation methods - we inject what it returns
*
@@ -46,7 +44,7 @@
*/
void setCurrentMarkupBehaviorHandle(String handle);
- void setRequiresInitCookie(CookieProtocol requiresInitCookie);
+ void setRequiresInitCookie(String cookieProtocolAsString);
void usingStrictModeChangedTo(boolean strictMode);
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,69 +1,73 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.CookieProtocol;
-import org.oasis.wsrp.v1.DestroyFailed;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InteractionParams;
-import org.oasis.wsrp.v1.InvalidCookie;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidSession;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.ItemDescription;
-import org.oasis.wsrp.v1.MarkupContext;
-import org.oasis.wsrp.v1.MarkupParams;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.PortletStateChangeRequired;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.PropertyList;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RegistrationData;
-import org.oasis.wsrp.v1.ResetProperty;
-import org.oasis.wsrp.v1.ResourceList;
-import org.oasis.wsrp.v1.RuntimeContext;
-import org.oasis.wsrp.v1.SessionContext;
-import org.oasis.wsrp.v1.UnsupportedLocale;
-import org.oasis.wsrp.v1.UnsupportedMimeType;
-import org.oasis.wsrp.v1.UnsupportedMode;
-import org.oasis.wsrp.v1.UnsupportedWindowState;
-import org.oasis.wsrp.v1.UpdateResponse;
-import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1CookieProtocol;
+import org.oasis.wsrp.v1.V1DestroyFailed;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InteractionParams;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidHandleFault;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1ItemDescription;
+import org.oasis.wsrp.v1.V1MarkupContext;
+import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1ModelDescription;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1Property;
+import org.oasis.wsrp.v1.V1PropertyList;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1ResetProperty;
+import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1SessionContext;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v1.V1UpdateResponse;
+import org.oasis.wsrp.v1.V1UserContext;
import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
+import org.oasis.wsrp.v2.InvalidHandle;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -82,7 +86,7 @@
{
private int sessionExpirationTime = 600;
- private CookieProtocol requiresInitCookie = CookieProtocol.NONE;
+ private V1CookieProtocol requiresInitCookie = V1CookieProtocol.NONE;
private BehaviorRegistry behaviorRegistry = new BehaviorRegistry();
@@ -114,9 +118,16 @@
behaviorRegistry.clear();
}
- private MarkupBehavior getMarkupBehaviorFor(String portletHandle) throws
InvalidHandle
+ private MarkupBehavior getMarkupBehaviorFor(String portletHandle) throws
V1InvalidHandle
{
- return behaviorRegistry.getMarkupBehaviorFor(portletHandle);
+ try
+ {
+ return behaviorRegistry.getMarkupBehaviorFor(portletHandle);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw WSRP1ExceptionFactory.<V1InvalidHandle,
V1InvalidHandleFault>throwWSException(WSRP1ExceptionFactory.INVALID_HANDLE,
"Invalid handle", null);
+ }
}
private ServiceDescriptionBehavior getServiceDescriptionBehavior()
@@ -132,7 +143,7 @@
// ServiceDescription implementation
********************************************************************************
- public void getServiceDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean>
requiresRegistration, @WebParam(mode = WebParam.Mode.OUT, name =
"offeredPortlets", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<PortletDescription>>
offeredPortlets, @WebParam(mode = WebParam.Mode.OUT, name =
"userCategoryDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
userCategoryDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customUserProfileItemDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customUserProfileItemDescrip!
tions, @WebParam(mode = WebParam.Mode.OUT, name =
"customWindowStateDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customWindowStateDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customModeDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customModeDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"requiresInitCookie", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<CookieProtocol>
requiresInitCookie, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationPropertyDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription>
registrationPropertyDescription, @WebParam(mode = WebParam.Mode.OUT, name =
"locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<String>> locales, @WebParam(mode = WebParam.Mode.OUT, name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<Res!
ourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, n!
ame = "e
xtensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws InvalidRegistration,
OperationFailed
+ public void getServiceDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean>
requiresRegistration, @WebParam(mode = WebParam.Mode.OUT, name =
"offeredPortlets", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1PortletDescription>> offeredPortlets, @WebParam(mode =
WebParam.Mode.OUT, name = "userCategoryDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
userCategoryDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customUserProfileItemDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customUserProfileIte!
mDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customWindowStateDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customWindowStateDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customModeDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customModeDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"requiresInitCookie", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1CookieProtocol>
requiresInitCookie, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationPropertyDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1ModelDescription>
registrationPropertyDescription, @WebParam(mode = WebParam.Mode.OUT, name =
"locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<String>> locales, @WebParam(mode = WebParam.Mode.OUT, name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:ty!
pes") Holder<V1ResourceList> resourceList, @WebParam(mode = We!
bParam.M
ode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>>
extensions) throws V1InvalidRegistration, V1OperationFailed
{
getServiceDescriptionBehavior().getServiceDescription(registrationContext,
desiredLocales, requiresRegistration,
offeredPortlets, userCategoryDescriptions, customUserProfileItemDescriptions,
customWindowStateDescriptions,
@@ -142,99 +153,100 @@
// MarkupService implementation
*************************************************************************************
- public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams,
@WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse,
@WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String>
redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws UnsupportedMimeType,
UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters,
UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle,
InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1MarkupParams markupParams, @WebParam(name = "interactionParams",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1InteractionParams
interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name =
"redir!
ectURL", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1UnsupportedMimeType,
V1UnsupportedMode, V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession,
V1MissingParameters, V1UnsupportedLocale, V1InconsistentParameters,
V1PortletStateChangeRequired, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
getMarkupBehaviorFor(portletContext.getPortletHandle()).performBlockingInteraction(registrationContext,
portletContext, runtimeContext, userContext, markupParams, interactionParams,
updateResponse, redirectURL, extensions);
}
- public List<Extension> releaseSessions(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "sessionIDs", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> sessionIDs) throws
MissingParameters, InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> releaseSessions(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "sessionIDs", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> sessionIDs) throws
V1MissingParameters, V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
return null;
}
- public void getMarkup(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
MarkupParams markupParams, @WebParam(mode = WebParam.Mode.OUT, name =
"markupContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<MarkupContext> markupContext, @WebParam(mode = WebParam.Mode.OUT, name =
"sessionContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<SessionContext> sessionContext,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", t!
argetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws UnsupportedMimeType,
UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters,
UnsupportedLocale, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void getMarkup(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1MarkupParams markupParams, @WebParam(mode = WebParam.Mode.OUT, name =
"markupContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1MarkupContext> markupContext, @WebParam(mode = WebParam.Mode.OUT, name =
"sessionContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1SessionContext>
sessionContext, @WebParam(mode = WebParam.Mode.OUT, name = "!
extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1UnsupportedMimeType,
V1UnsupportedMode, V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession,
V1MissingParameters, V1UnsupportedLocale, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
getMarkupBehaviorFor(portletContext.getPortletHandle()).getMarkup(registrationContext,
portletContext, runtimeContext, userContext, markupParams, markupContext, sessionContext,
extensions);
}
- public List<Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext)
throws InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext)
throws V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
// should only be called if we required cookies to be initialized
- if (requiresInitCookie == null || CookieProtocol.NONE.equals(requiresInitCookie))
+ if (requiresInitCookie == null ||
V1CookieProtocol.NONE.equals(requiresInitCookie))
{
- throw new OperationFailed();
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
"Shouldn't have called initCookie", null);
}
try
{
return
getMarkupBehaviorFor(currentMarkupBehaviorHandle).initCookie(registrationContext);
}
- catch (InvalidHandle invalidHandle)
+ catch (V1InvalidHandle invalidHandle)
{
- throw new OperationFailed("Invalid handle", invalidHandle);
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
"Invalid handle", invalidHandle);
}
}
// Registration implementation
**************************************************************************************
- public void register(@WebParam(name = "consumerName", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name =
"consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name =
"consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> consumerModes, @WebParam(name = "consumerWindowStates",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes,
@WebParam(name = "customUserProfileData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData,
@WebParam(name = "registrationProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<Property> registrat!
ionProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState)
throws MissingParameters, OperationFailed
+ public void register(@WebParam(name = "consumerName", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name =
"consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name =
"consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> consumerModes, @WebParam(name = "consumerWindowStates",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes,
@WebParam(name = "customUserProfileData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData,
@WebParam(name = "registrationProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<V1Property> registr!
ationProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name
= "registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState)
throws V1MissingParameters, V1OperationFailed
{
registrationHandle.value = "registration";
}
- public void modifyRegistration(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "registrationData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationData registrationData,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions) throws MissingParameters, InvalidRegistration, OperationFailed
+ public void modifyRegistration(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "registrationData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationData registrationData,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>>
extensions) throws V1MissingParameters, V1InvalidRegistration, V1OperationFailed
{
// do nothing
}
- public List<Extension> deregister(@WebParam(name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String registrationHandle, @WebParam(name =
"registrationState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") byte[] registrationState, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<Extension> extensions) throws InvalidRegistration, OperationFailed
+ public void deregister(@WebParam(name = "registrationHandle",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String registrationHandle,
@WebParam(name = "registrationState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") byte[] registrationState, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.INOUT) Holder<List<V1Extension>> extensions) throws
V1InvalidRegistration, V1OperationFailed
{
- return null; // do nothing
+ // do nothing
}
// PortletManagement implementation
*********************************************************************************
- public void getPortletPropertyDescription(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "modelDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription>
modelDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) thro!
ws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void getPortletPropertyDescription(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "modelDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1ModelDescription>
modelDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> exte!
nsions) throws V1MissingParameters, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
getPortletManagementBehavior().getPortletPropertyDescription(registrationContext,
portletContext, userContext, desiredLocales, modelDescription, resourceList, extensions);
}
- public void setPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name =
"portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name =
"portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters, InconsistentP!
arameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied,
OperationFailed
+ public void setPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name =
"portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name =
"portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1MissingParameters, V!
1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration, V1InvalidUserCategory,
V1AccessDenied, V1OperationFailed
{
getPortletManagementBehavior().setPortletProperties(registrationContext,
portletContext, userContext, propertyList, portletHandle, portletState, extensions);
}
- public void clonePortlet(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(mode =
WebParam.Mode.OUT, name = "portletHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions) throws MissingParameters, InconsistentParameters, InvalidHandle,
InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void clonePortlet(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(mode =
WebParam.Mode.OUT, name = "portletHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState,
@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
{
getPortletManagementBehavior().clonePortlet(registrationContext, portletContext,
userContext, portletHandle, portletState, extensions);
}
- public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<V1PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extens!
ions) throws V1MissingParameters, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
getPortletManagementBehavior().getPortletDescription(registrationContext,
portletContext, userContext, desiredLocales, portletDescription, resourceList,
extensions);
}
- public void getPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> names, @WebParam(mode = WebParam.Mode.OUT, name =
"properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name =
"resetProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ResetProperty>>
resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters, Incons!
istentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied,
OperationFailed
+ public void getPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> names, @WebParam(mode = WebParam.Mode.OUT, name =
"properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name
= "resetProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ResetProperty>>
resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1MissingPara!
meters, V1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
getPortletManagementBehavior().getPortletProperties(registrationContext,
portletContext, userContext, names, properties, resetProperties, extensions);
}
- public void destroyPortlets(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletHandles", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles,
@WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<DestroyFailed>>
destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters,
InconsistentParameters, InvalidRegistration, OperationFailed
+ public void destroyPortlets(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletHandles", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles,
@WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1DestroyFailed>>
destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1MissingParameters,
V1InconsistentParameters, V1InvalidRegistration, V1OperationFailed
{
getPortletManagementBehavior().destroyPortlets(registrationContext, portletHandles,
destroyFailed, extensions);
}
// Producer implementation
******************************************************************************************
- public CookieProtocol getRequiresInitCookie()
+ public V1CookieProtocol getRequiresInitCookie()
{
return requiresInitCookie;
}
- public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
+ public void setRequiresInitCookie(String cookieProtocolAsString)
{
- this.requiresInitCookie = requiresInitCookie;
+ V1CookieProtocol protocol = V1CookieProtocol.fromValue(cookieProtocolAsString);
+ this.requiresInitCookie = protocol;
getServiceDescriptionBehavior().setRequiresInitCookie(requiresInitCookie);
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,61 +1,61 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1;
import org.gatein.common.net.media.MediaType;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.WindowState;
-import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InteractionParams;
-import org.oasis.wsrp.v1.InvalidCookie;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidSession;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MarkupContext;
-import org.oasis.wsrp.v1.MarkupParams;
-import org.oasis.wsrp.v1.MarkupResponse;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.PortletStateChangeRequired;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RuntimeContext;
-import org.oasis.wsrp.v1.SessionContext;
-import org.oasis.wsrp.v1.UnsupportedLocale;
-import org.oasis.wsrp.v1.UnsupportedMimeType;
-import org.oasis.wsrp.v1.UnsupportedMode;
-import org.oasis.wsrp.v1.UnsupportedWindowState;
-import org.oasis.wsrp.v1.UpdateResponse;
-import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InteractionParams;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MarkupContext;
+import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1SessionContext;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v1.V1UpdateResponse;
+import org.oasis.wsrp.v1.V1UserContext;
import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
import javax.jws.WebParam;
@@ -90,10 +90,10 @@
* @param getMarkup the original GetMarkup request (in case more information
is required by this behavior)
* @return a possibly <code>null</code> markup String
*/
- protected abstract String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
- throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied,
InconsistentParameters, InvalidHandle,
- UnsupportedLocale, UnsupportedMode, OperationFailed, MissingParameters,
InvalidUserCategory, InvalidRegistration,
- UnsupportedMimeType;
+ protected abstract String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup)
+ throws V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession, V1AccessDenied,
V1InconsistentParameters, V1InvalidHandle,
+ V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed, V1MissingParameters,
V1InvalidUserCategory, V1InvalidRegistration,
+ V1UnsupportedMimeType;
/**
* Allows this behavior to modify the response after the markup has been generated.
The default implementation does
@@ -101,7 +101,7 @@
*
* @param markupResponse the response that will be passed on to the consumer
*/
- public void modifyResponseIfNeeded(MarkupResponse markupResponse)
+ public void modifyResponseIfNeeded(V1MarkupResponse markupResponse)
{
// default implementation does not nothing
}
@@ -111,7 +111,7 @@
return handles;
}
- public PortletDescription getPortletDescriptionFor(String handle)
+ public V1PortletDescription getPortletDescriptionFor(String handle)
{
if (handles.contains(handle))
{
@@ -129,58 +129,34 @@
protected void registerHandle(String handle)
{
handles.add(handle);
-
registry.getServiceDescriptionBehavior().addPortletDescription(createPortletDescription(handle,
getSuffixFor(handle)));
+ V1PortletDescription portletDescription = createPortletDescription(handle,
getSuffixFor(handle));
+
registry.getServiceDescriptionBehavior().addPortletDescription(portletDescription);
}
- /**
- * Default implementation doesn't do anything.
- *
- * @param registrationContext
- * @param portletContext
- * @param runtimeContext
- * @param userContext
- * @param markupParams
- * @param interactionParams
- * @param updateResponse
- * @param redirectURL
- * @param extensions
- * @throws UnsupportedMimeType
- * @throws UnsupportedMode
- * @throws UnsupportedWindowState
- * @throws InvalidCookie
- * @throws InvalidSession
- * @throws MissingParameters
- * @throws UnsupportedLocale
- * @throws InconsistentParameters
- * @throws PortletStateChangeRequired
- * @throws InvalidHandle
- * @throws InvalidRegistration
- * @throws InvalidUserCategory
- * @throws AccessDenied
- * @throws OperationFailed
- */
- public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams,
@WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse,
@WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String>
redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws UnsupportedMimeType,
UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters,
UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle,
InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ /** Default implementation doesn't do anything. */
+ public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1MarkupParams markupParams, @WebParam(name = "interactionParams",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1InteractionParams
interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name =
"redir!
ectURL", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions)
+ throws V1UnsupportedMimeType, V1UnsupportedMode, V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1MissingParameters, V1UnsupportedLocale,
V1InconsistentParameters, V1PortletStateChangeRequired, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
// do nothing
}
- public List<Extension> releaseSessions(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "sessionIDs", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> sessionIDs) throws
MissingParameters, InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> releaseSessions(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "sessionIDs", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> sessionIDs) throws
V1MissingParameters, V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
return null;
}
public void getMarkup(
- @WebParam(name = "registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
- @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
- @WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
- @WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext,
- @WebParam(name = "markupParams", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams,
- @WebParam(mode = WebParam.Mode.OUT, name = "markupContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<MarkupContext> markupContext,
- @WebParam(mode = WebParam.Mode.OUT, name = "sessionContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<SessionContext> sessionContext,
- @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions)
- throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie,
InvalidSession, MissingParameters, UnsupportedLocale, InconsistentParameters,
InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ @WebParam(name = "registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
+ @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
+ @WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RuntimeContext runtimeContext,
+ @WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext,
+ @WebParam(name = "markupParams", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1MarkupParams markupParams,
+ @WebParam(mode = WebParam.Mode.OUT, name = "markupContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1MarkupContext> markupContext,
+ @WebParam(mode = WebParam.Mode.OUT, name = "sessionContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1SessionContext> sessionContext,
+ @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>>
extensions)
+ throws V1UnsupportedMimeType, V1UnsupportedMode, V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1MissingParameters, V1UnsupportedLocale,
V1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration, V1InvalidUserCategory,
V1AccessDenied, V1OperationFailed
{
- GetMarkup gm = new GetMarkup();
+ V1GetMarkup gm = new V1GetMarkup();
gm.setMarkupParams(markupParams);
gm.setPortletContext(portletContext);
gm.setRegistrationContext(registrationContext);
@@ -190,15 +166,16 @@
String markupString =
getMarkupString(WSRPUtils.getJSR168PortletModeFromWSRPName(markupParams.getMode()),
WSRPUtils.getJSR168WindowStateFromWSRPName(markupParams.getWindowState()),
markupParams.getNavigationalState(), gm);
- markupContext.value =
WSRPTypeFactory.createMarkupContext(MediaType.TEXT_HTML.getValue(), markupString);
+ V1MarkupContext v2MarkupContext =
WSRP1TypeFactory.createMarkupContext(MediaType.TEXT_HTML.getValue(), markupString);
+ markupContext.value = v2MarkupContext;
markupContext.value.setRequiresUrlRewriting(Boolean.TRUE);
- MarkupResponse markupResponse =
WSRPTypeFactory.createMarkupResponse(markupContext.value);
+ V1MarkupResponse markupResponse =
WSRP1TypeFactory.createMarkupResponse(v2MarkupContext);
modifyResponseIfNeeded(markupResponse);
}
- public List<Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext)
throws InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext)
throws V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
return null;
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,46 +1,46 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.DestroyFailed;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.PropertyList;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.ResetProperty;
-import org.oasis.wsrp.v1.ResourceList;
-import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1DestroyFailed;
+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.V1ModelDescription;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+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.V1UserContext;
import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
import javax.jws.WebParam;
@@ -55,32 +55,32 @@
*/
public class PortletManagementBehavior extends TestProducerBehavior implements
WSRPV1PortletManagementPortType
{
- public void getPortletPropertyDescription(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "modelDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription>
modelDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) thro!
ws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(name = "portletDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<V1PortletDescription> portletDescription, @WebParam(name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<V1ResourceList> resourceList, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<List<V1Extension>> extens!
ions) throws V1AccessDenied, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1MissingParameters, V1OperationFailed
{
incrementCallCount();
}
- public void setPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name =
"portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name =
"portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters, InconsistentP!
arameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied,
OperationFailed
+ public void clonePortlet(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<String> portletHandle, @WebParam(name =
"portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<byte[]> portletState, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<List<V1Extension>> extensions) throws
V1AccessDenied, V1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1MissingParameters, V1OperationFailed
{
incrementCallCount();
}
- public void clonePortlet(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(mode =
WebParam.Mode.OUT, name = "portletHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions) throws MissingParameters, InconsistentParameters, InvalidHandle,
InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void destroyPortlets(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletHandles", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles,
@WebParam(name = "destroyFailed", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<List<V1DestroyFailed>> destroyFailed, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<List<V1Extension>> extensions) throws
V1InconsistentParameters, V1InvalidRegistration, V1MissingParameters, V1OperationFailed
{
incrementCallCount();
}
- public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void setPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1PropertyList propertyList, @WebParam(name = "portletHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<String> portletHandle, @WebParam(name = "portletState",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<byte[]> portletState, @WebParam(name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<List<V1Extension>> extensions) throws V1AccessDenied, V1Inco!
nsistentParameters, V1InvalidHandle, V1InvalidRegistration, V1InvalidUserCategory,
V1MissingParameters, V1OperationFailed
{
incrementCallCount();
}
- public void getPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> names, @WebParam(mode = WebParam.Mode.OUT, name =
"properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name =
"resetProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ResetProperty>>
resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters, Incons!
istentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied,
OperationFailed
+ public void getPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> names, @WebParam(name = "properties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<List<V1Property>> properties, @WebParam(name =
"resetProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<List<V1ResetProperty>> resetProperties, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<List<V1Extension>> extensions) throws
V1AccessDenie!
d, V1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1MissingParameters, V1OperationFailed
{
incrementCallCount();
}
- public void destroyPortlets(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletHandles", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles,
@WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<DestroyFailed>>
destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters,
InconsistentParameters, InvalidRegistration, OperationFailed
+ public void getPortletPropertyDescription(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(name = "modelDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<V1ModelDescription> modelDescription, @WebParam(name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<V1ResourceList> resourceList, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.OUT) Holder<List<V1Extension>> exte!
nsions) throws V1AccessDenied, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1MissingParameters, V1OperationFailed
{
incrementCallCount();
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,35 +1,35 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RegistrationData;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1Property;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
import javax.jws.WebParam;
@@ -45,20 +45,19 @@
{
public static final String REGISTRATION_HANDLE = "registration";
- public void register(@WebParam(name = "consumerName", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name =
"consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name =
"consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> consumerModes, @WebParam(name = "consumerWindowStates",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes,
@WebParam(name = "customUserProfileData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData,
@WebParam(name = "registrationProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<Property> registrat!
ionProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState)
throws MissingParameters, OperationFailed
+ public void register(@WebParam(name = "consumerName", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name =
"consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name =
"consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> consumerModes, @WebParam(name = "consumerWindowStates",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes,
@WebParam(name = "customUserProfileData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData,
@WebParam(name = "registrationProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<V1Property> registr!
ationProperties, @WebParam(name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.INOUT)
Holder<List<V1Extension>> extensions, @WebParam(name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<String> registrationHandle, @WebParam(name = "registrationState",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<byte[]> registrationState) throws V1MissingParameters, V1OperationFailed
{
incrementCallCount();
registrationHandle.value = REGISTRATION_HANDLE;
}
- public void modifyRegistration(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "registrationData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationData registrationData,
@WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions) throws MissingParameters, InvalidRegistration, OperationFailed
+ public void deregister(@WebParam(name = "registrationHandle",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String registrationHandle,
@WebParam(name = "registrationState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") byte[] registrationState, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types",
mode = WebParam.Mode.INOUT) Holder<List<V1Extension>> extensions) throws
V1InvalidRegistration, V1OperationFailed
{
incrementCallCount();
}
- public List<Extension> deregister(@WebParam(name =
"registrationHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") String registrationHandle, @WebParam(name =
"registrationState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") byte[] registrationState, @WebParam(name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<Extension> extensions) throws InvalidRegistration, OperationFailed
+ public void modifyRegistration(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "registrationData", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationData registrationData,
@WebParam(name = "registrationState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<byte[]> registrationState, @WebParam(name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types", mode = WebParam.Mode.OUT)
Holder<List<V1Extension>> extensions) throws V1InvalidRegistration,
V1MissingParameters, V1OperationFailed
{
incrementCallCount();
- return null;
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,41 +1,41 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPTypeFactory;
-import org.oasis.wsrp.v1.CookieProtocol;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.ItemDescription;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.PropertyDescription;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.ResourceList;
-import org.oasis.wsrp.v1.ServiceDescription;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
+import org.oasis.wsrp.v1.V1CookieProtocol;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1ItemDescription;
+import org.oasis.wsrp.v1.V1ModelDescription;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1PropertyDescription;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v1.V1ServiceDescription;
import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
import javax.jws.WebParam;
@@ -54,18 +54,18 @@
*/
public class ServiceDescriptionBehavior extends TestProducerBehavior implements
WSRPV1ServiceDescriptionPortType
{
- protected ServiceDescription serviceDescription;
- private static final ServiceDescription DEFAULT_SERVICE_DESCRIPTION =
WSRPTypeFactory.createServiceDescription(false);
+ protected V1ServiceDescription serviceDescription;
+ private static final V1ServiceDescription DEFAULT_SERVICE_DESCRIPTION =
WSRP1TypeFactory.createServiceDescription(false);
public static final ServiceDescriptionBehavior DEFAULT = new
ServiceDescriptionBehavior();
- protected List<PortletDescription> offeredPortlets;
+ protected List<V1PortletDescription> offeredPortlets;
private boolean requiresRegistration;
- private CookieProtocol cookieProtocol;
- private ModelDescription registrationProperties;
+ private V1CookieProtocol cookieProtocol;
+ private V1ModelDescription registrationProperties;
public ServiceDescriptionBehavior()
{
- offeredPortlets = new LinkedList<PortletDescription>();
+ offeredPortlets = new LinkedList<V1PortletDescription>();
}
public void setRequiresRegistration(boolean requiresRegistration)
@@ -73,25 +73,25 @@
this.requiresRegistration = requiresRegistration;
}
- public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
+ public void setRequiresInitCookie(V1CookieProtocol requiresInitCookie)
{
this.cookieProtocol = requiresInitCookie;
}
public void setServiceDescription(boolean requiresRegistration, int numberOfProps)
{
- ServiceDescription sd = createServiceDescription(requiresRegistration,
numberOfProps);
+ V1ServiceDescription sd = createServiceDescription(requiresRegistration,
numberOfProps);
offeredPortlets = sd.getOfferedPortlets();
this.requiresRegistration = sd.isRequiresRegistration();
registrationProperties = sd.getRegistrationPropertyDescription();
}
- public static ServiceDescription getDefaultServiceDescription()
+ public static V1ServiceDescription getDefaultServiceDescription()
{
return DEFAULT_SERVICE_DESCRIPTION;
}
- public void addPortletDescription(PortletDescription portletDescription)
+ public void addPortletDescription(V1PortletDescription portletDescription)
{
offeredPortlets.add(portletDescription);
}
@@ -100,7 +100,7 @@
{
Set<String> handles = new HashSet<String>(offeredPortlets.size());
- for (PortletDescription description : offeredPortlets)
+ for (V1PortletDescription description : offeredPortlets)
{
handles.add(description.getPortletHandle());
}
@@ -113,37 +113,37 @@
return offeredPortlets.size();
}
- public static ServiceDescription createServiceDescription(boolean
requiresRegistration, int numberOfProperties)
+ public static V1ServiceDescription createServiceDescription(boolean
requiresRegistration, int numberOfProperties)
{
- ServiceDescription sd =
WSRPTypeFactory.createServiceDescription(requiresRegistration);
+ V1ServiceDescription sd =
WSRP1TypeFactory.createServiceDescription(requiresRegistration);
if (requiresRegistration)
{
- List<PropertyDescription> descriptions = new
ArrayList<PropertyDescription>(numberOfProperties);
+ List<V1PropertyDescription> descriptions = new
ArrayList<V1PropertyDescription>(numberOfProperties);
for (int i = 0; i < numberOfProperties; i++)
{
- descriptions.add(WSRPTypeFactory.createPropertyDescription("prop" +
i, WSRPConstants.XSD_STRING));
+ descriptions.add(WSRP1TypeFactory.createPropertyDescription("prop"
+ i, WSRPConstants.XSD_STRING));
}
-
sd.setRegistrationPropertyDescription(WSRPTypeFactory.createModelDescription(descriptions));
+
sd.setRegistrationPropertyDescription(WSRP1TypeFactory.createModelDescription(descriptions));
}
return sd;
}
- public void getServiceDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext,
+ public void getServiceDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext,
@WebParam(name = "desiredLocales",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String>
desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name =
"requiresRegistration", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean> requiresRegistration,
- @WebParam(mode = WebParam.Mode.OUT, name =
"offeredPortlets", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<PortletDescription>>
offeredPortlets,
- @WebParam(mode = WebParam.Mode.OUT, name =
"userCategoryDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
userCategoryDescriptions,
- @WebParam(mode = WebParam.Mode.OUT, name =
"customUserProfileItemDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customUserProfileItemDescriptions,
- @WebParam(mode = WebParam.Mode.OUT, name =
"customWindowStateDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customWindowStateDescriptions,
- @WebParam(mode = WebParam.Mode.OUT, name =
"customModeDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customModeDescriptions,
- @WebParam(mode = WebParam.Mode.OUT, name =
"requiresInitCookie", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<CookieProtocol>
requiresInitCookie,
- @WebParam(mode = WebParam.Mode.OUT, name =
"registrationPropertyDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription>
registrationPropertyDescription,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"offeredPortlets", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1PortletDescription>> offeredPortlets,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"userCategoryDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
userCategoryDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"customUserProfileItemDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customUserProfileItemDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"customWindowStateDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customWindowStateDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"customModeDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customModeDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"requiresInitCookie", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1CookieProtocol>
requiresInitCookie,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"registrationPropertyDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1ModelDescription>
registrationPropertyDescription,
@WebParam(mode = WebParam.Mode.OUT, name =
"locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<String>> locales,
- @WebParam(mode = WebParam.Mode.OUT, name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<ResourceList> resourceList,
- @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions)
- throws InvalidRegistration, OperationFailed
+ @WebParam(mode = WebParam.Mode.OUT, name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1ResourceList> resourceList,
+ @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions)
+ throws V1InvalidRegistration, V1OperationFailed
{
incrementCallCount();
offeredPortlets.value = this.offeredPortlets;
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,34 +1,34 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1;
import org.gatein.common.net.media.MediaType;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPTypeFactory;
-import org.oasis.wsrp.v1.LocalizedString;
-import org.oasis.wsrp.v1.MarkupType;
-import org.oasis.wsrp.v1.PortletDescription;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
+import org.oasis.wsrp.v1.V1LocalizedString;
+import org.oasis.wsrp.v1.V1MarkupType;
+import org.oasis.wsrp.v1.V1PortletDescription;
/**
* Provides a base class for Producer behavior used in Consumer testing.
@@ -60,11 +60,11 @@
return callCount;
}
- public PortletDescription createPortletDescription(String portletHandle, String
suffix)
+ public V1PortletDescription createPortletDescription(String portletHandle, String
suffix)
{
- PortletDescription portletDesc = new PortletDescription();
+ V1PortletDescription portletDesc = new V1PortletDescription();
portletDesc.setPortletHandle(portletHandle);
- MarkupType markupType = new MarkupType();
+ V1MarkupType markupType = new V1MarkupType();
markupType.setMimeType(MediaType.TEXT_HTML.getValue());
markupType.getModes().add(WSRPConstants.VIEW_MODE);
markupType.getWindowStates().add(WSRPConstants.NORMAL_WINDOW_STATE);
@@ -86,9 +86,9 @@
* @param value
* @return
*/
- public static LocalizedString createLocalizedString(String value)
+ public static V1LocalizedString createLocalizedString(String value)
{
- return WSRPTypeFactory.createLocalizedString(value);
+ return WSRP1TypeFactory.createLocalizedString(value);
}
/** Produces String from LocalizedString */
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1.behaviors;
@@ -27,32 +27,33 @@
import org.gatein.pc.api.WindowState;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InteractionParams;
-import org.oasis.wsrp.v1.InvalidCookie;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidSession;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MarkupParams;
-import org.oasis.wsrp.v1.MarkupResponse;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletStateChangeRequired;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RuntimeContext;
-import org.oasis.wsrp.v1.UnsupportedLocale;
-import org.oasis.wsrp.v1.UnsupportedMimeType;
-import org.oasis.wsrp.v1.UnsupportedMode;
-import org.oasis.wsrp.v1.UnsupportedWindowState;
-import org.oasis.wsrp.v1.UpdateResponse;
-import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InteractionParams;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v1.V1UpdateResponse;
+import org.oasis.wsrp.v1.V1UserContext;
+import org.oasis.wsrp.v2.MarkupResponse;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -76,7 +77,8 @@
registerHandle(PORTLET_HANDLE);
}
- public String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ @Override
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup) throws V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1AccessDenied, V1InconsistentParameters,
V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed,
V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration, V1UnsupportedMimeType
{
StringBuffer markupString = new StringBuffer("portlet1:");
@@ -89,14 +91,10 @@
return markupString.toString();
}
-
@Override
- public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams,
@WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse,
@WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String>
redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions)
- throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie,
InvalidSession,
- MissingParameters, UnsupportedLocale, InconsistentParameters,
PortletStateChangeRequired, InvalidHandle,
- InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1MarkupParams markupParams, @WebParam(name = "interactionParams",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1InteractionParams
interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name =
"redir!
ectURL", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1UnsupportedMimeType,
V1UnsupportedMode, V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession,
V1MissingParameters, V1UnsupportedLocale, V1InconsistentParameters,
V1PortletStateChangeRequired, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
- UpdateResponse ur = WSRPTypeFactory.createUpdateResponse();
+ V1UpdateResponse ur = WSRP1TypeFactory.createUpdateResponse();
ur.setNavigationalState(NS);
updateResponse.value = ur;
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,52 +1,53 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1.behaviors;
-import org.gatein.wsrp.WSRPExceptionFactory;
-import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.DestroyFailed;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidHandleFault;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.OperationFailedFault;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.PropertyList;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.ResetProperty;
-import org.oasis.wsrp.v1.ResourceList;
-import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1DestroyFailed;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidHandleFault;
+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.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+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.V1UserContext;
+import org.oasis.wsrp.v2.InvalidHandle;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -74,13 +75,13 @@
}
@Override
- public void clonePortlet(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(mode =
WebParam.Mode.OUT, name = "portletHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState,
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>>
extensions) throws MissingParameters, InconsistentParameters, InvalidHandle,
InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void clonePortlet(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(mode =
WebParam.Mode.OUT, name = "portletHandle", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle,
@WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState,
@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
{
String handle = getHandleFrom(portletContext, "portlet context");
if (!BasicMarkupBehavior.PORTLET_HANDLE.equals(handle))
{
- throw WSRPExceptionFactory.<InvalidHandle,
InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ throw WSRP1ExceptionFactory.<V1InvalidHandle,
V1InvalidHandleFault>throwWSException(WSRP1ExceptionFactory.INVALID_HANDLE,
"Can only clone portlet with handle '" +
BasicMarkupBehavior.PORTLET_HANDLE + "'", null);
}
@@ -88,7 +89,7 @@
}
@Override
- public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<V1PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extens!
ions) throws V1MissingParameters, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
super.getPortletDescription(registrationContext, portletContext, userContext,
desiredLocales, portletDescription, resourceList, extensions);
@@ -102,9 +103,19 @@
}
// get the POP description...
- MarkupBehavior markupBehaviorFor = registry.getMarkupBehaviorFor(handle);
- PortletDescription description =
markupBehaviorFor.getPortletDescriptionFor(handle);
+ MarkupBehavior markupBehaviorFor;
+ try
+ {
+ markupBehaviorFor = registry.getMarkupBehaviorFor(handle);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw WSRP1ExceptionFactory.<V1InvalidHandle,
V1InvalidHandleFault>throwWSException(WSRP1ExceptionFactory.INVALID_HANDLE,
+ "Invalid handle '" + handle + "'",
invalidHandle);
+ }
+ V1PortletDescription description =
markupBehaviorFor.getPortletDescriptionFor(handle);
+
// if it was a clone, add the suffix back to the handle.
if (index != -1)
{
@@ -115,30 +126,30 @@
}
@Override
- public void getPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> names, @WebParam(mode = WebParam.Mode.OUT, name =
"properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name =
"resetProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ResetProperty>>
resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters, Incons!
istentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied,
OperationFailed
+ public void getPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
List<String> names, @WebParam(mode = WebParam.Mode.OUT, name =
"properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name
= "resetProperties", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ResetProperty>>
resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1MissingPara!
meters, V1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
String handle = getHandleFrom(portletContext, "portlet context");
- List<Property> propertyList = new ArrayList<Property>(1);
+ List<V1Property> propertyList = new ArrayList<V1Property>(1);
if (BasicMarkupBehavior.PORTLET_HANDLE.equals(handle))
{
- propertyList.add(WSRPTypeFactory.createProperty(PROPERTY_NAME, "en",
PROPERTY_VALUE));
+ propertyList.add(WSRP1TypeFactory.createProperty(PROPERTY_NAME, "en",
PROPERTY_VALUE));
}
else if (CLONED_HANDLE.equals(handle))
{
if (callCount != 2)
{
- propertyList.add(WSRPTypeFactory.createProperty(PROPERTY_NAME,
"en", PROPERTY_VALUE));
+ propertyList.add(WSRP1TypeFactory.createProperty(PROPERTY_NAME,
"en", PROPERTY_VALUE));
}
else
{
- propertyList.add(WSRPTypeFactory.createProperty(PROPERTY_NAME,
"en", PROPERTY_NEW_VALUE));
+ propertyList.add(WSRP1TypeFactory.createProperty(PROPERTY_NAME,
"en", PROPERTY_NEW_VALUE));
}
}
else
{
- WSRPExceptionFactory.<InvalidHandle,
InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ WSRP1ExceptionFactory.<V1InvalidHandle,
V1InvalidHandleFault>throwWSException(WSRP1ExceptionFactory.INVALID_HANDLE,
"Unknown handle '" + handle + "'", null);
}
@@ -147,27 +158,27 @@
}
@Override
- public void setPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name =
"portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name =
"portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters, InconsistentP!
arameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied,
OperationFailed
+ public void setPortletProperties(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name =
"portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name =
"portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1MissingParameters, V!
1InconsistentParameters, V1InvalidHandle, V1InvalidRegistration, V1InvalidUserCategory,
V1AccessDenied, V1OperationFailed
{
String handle = getHandleFrom(portletContext, "portlet context");
if (!(CLONED_HANDLE).equals(handle))
{
- throw WSRPExceptionFactory.<OperationFailed,
OperationFailedFault>throwWSException(WSRPExceptionFactory.OPERATION_FAILED,
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
"Cannot modify portlet '" + handle + "'", null);
}
portletHandle.value = handle;
}
- private String getHandleFrom(PortletContext portletContext, String context) throws
MissingParameters, InvalidHandle
+ private String getHandleFrom(V1PortletContext portletContext, String context) throws
V1MissingParameters, V1InvalidHandle
{
- WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext,
"portlet context", context);
+ WSRP1ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext,
"portlet context", context);
String handle = portletContext.getPortletHandle();
- WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(handle, "portlet
handle", "PortletContext");
+ WSRP1ExceptionFactory.throwMissingParametersIfValueIsMissing(handle, "portlet
handle", "PortletContext");
if (handle.length() == 0)
{
- throw WSRPExceptionFactory.<InvalidHandle,
InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ throw WSRP1ExceptionFactory.<V1InvalidHandle,
V1InvalidHandleFault>throwWSException(WSRP1ExceptionFactory.INVALID_HANDLE,
"Portlet handle is empty", null);
}
@@ -175,20 +186,20 @@
}
@Override
- public void destroyPortlets(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletHandles", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles,
@WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<DestroyFailed>>
destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws MissingParameters,
InconsistentParameters, InvalidRegistration, OperationFailed
+ public void destroyPortlets(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletHandles", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles,
@WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1DestroyFailed>>
destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1MissingParameters,
V1InconsistentParameters, V1InvalidRegistration, V1OperationFailed
{
super.destroyPortlets(registrationContext, portletHandles, destroyFailed,
extensions);
- WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(portletHandles,
"portlet handles", "destroyPortlets");
+ WSRP1ExceptionFactory.throwMissingParametersIfValueIsMissing(portletHandles,
"portlet handles", "destroyPortlets");
if (portletHandles.isEmpty())
{
- WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(portletHandles,
"portlet handles", "DestroyPortlets");
+ WSRP1ExceptionFactory.throwMissingParametersIfValueIsMissing(portletHandles,
"portlet handles", "DestroyPortlets");
}
for (String handle : portletHandles)
{
if (!CLONED_HANDLE.equals(handle))
{
- destroyFailed.value.add(WSRPTypeFactory.createDestroyFailed(handle,
"Handle '" + handle + "' doesn't exist"));
+ destroyFailed.value.add(WSRP1TypeFactory.createDestroyFailed(handle,
"Handle '" + handle + "' doesn't exist"));
}
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,30 +1,30 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1.behaviors;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
-import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.V1PortletDescription;
/**
* @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.protocol.v1.behaviors.BasicServiceDescriptionBehavior">Chris
@@ -38,8 +38,8 @@
public BasicServiceDescriptionBehavior()
{
//Prepare description of two portlets
- PortletDescription pd1 =
createPortletDescription(BasicMarkupBehavior.PORTLET_HANDLE, "");
- PortletDescription pd2 =
createPortletDescription(SessionMarkupBehavior.PORTLET_HANDLE, "2");
+ V1PortletDescription pd1 =
createPortletDescription(BasicMarkupBehavior.PORTLET_HANDLE, "");
+ V1PortletDescription pd2 =
createPortletDescription(SessionMarkupBehavior.PORTLET_HANDLE, "2");
offeredPortlets.add(pd1);
offeredPortlets.add(pd2);
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,44 +1,44 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * 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.test.protocol.v1.behaviors;
-import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidHandleFault;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.ResourceList;
-import org.oasis.wsrp.v1.UserContext;
+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.V1InvalidHandleFault;
+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.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1ResourceList;
+import org.oasis.wsrp.v1.V1UserContext;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -59,7 +59,7 @@
}
@Override
- public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList>
resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration,
InvalidUserCategory, AccessDenied, OperationFailed
+ public void getPortletDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") Holder<V1PortletDescription>
portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extens!
ions) throws V1MissingParameters, V1InconsistentParameters, V1InvalidHandle,
V1InvalidRegistration, V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
// only return the portlet description the first time the method is called since
all other calls happen after
// the clone has been destroyed...
@@ -70,7 +70,7 @@
}
else
{
- throw WSRPExceptionFactory.<InvalidHandle,
InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ throw WSRP1ExceptionFactory.<V1InvalidHandle,
V1InvalidHandleFault>throwWSException(WSRP1ExceptionFactory.INVALID_HANDLE,
"Invalid portlet handle: " + portletContext.getPortletHandle(),
null);
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1.behaviors;
@@ -27,7 +27,20 @@
import org.gatein.pc.api.WindowState;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
/**
* @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.v1.consumer.producer.EmptyMarkupBehavior">Chris
@@ -46,7 +59,8 @@
registerHandle(PORTLET_HANDLE);
}
- public String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ @Override
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup) throws V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1AccessDenied, V1InconsistentParameters,
V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed,
V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration, V1UnsupportedMimeType
{
return "";
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,37 +1,38 @@
/*
-* 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.test.protocol.v1.behaviors;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
-import org.oasis.wsrp.v1.CookieProtocol;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.ItemDescription;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.V1CookieProtocol;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1ItemDescription;
+import org.oasis.wsrp.v1.V1ModelDescription;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1ResourceList;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -45,16 +46,16 @@
*/
public class GroupedPortletsServiceDescriptionBehavior extends
ServiceDescriptionBehavior
{
- public GroupedPortletsServiceDescriptionBehavior(List<PortletDescription>
offeredPortlets)
+ public GroupedPortletsServiceDescriptionBehavior(List<V1PortletDescription>
offeredPortlets)
{
this.offeredPortlets = offeredPortlets;
}
@Override
- public void getServiceDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext
registrationContext, @WebParam(name = "desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean>
requiresRegistration, @WebParam(mode = WebParam.Mode.OUT, name =
"offeredPortlets", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<PortletDescription>>
offeredPortlets, @WebParam(mode = WebParam.Mode.OUT, name =
"userCategoryDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
userCategoryDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customUserProfileItemDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customUserProfileItemDescrip!
tions, @WebParam(mode = WebParam.Mode.OUT, name =
"customWindowStateDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customWindowStateDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customModeDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>>
customModeDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"requiresInitCookie", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<CookieProtocol>
requiresInitCookie, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationPropertyDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription>
registrationPropertyDescription, @WebParam(mode = WebParam.Mode.OUT, name =
"locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<String>> locales, @WebParam(mode = WebParam.Mode.OUT, name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<Res!
ourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, n!
ame = "e
xtensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws InvalidRegistration,
OperationFailed
+ public void getServiceDescription(@WebParam(name = "registrationContext",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext
registrationContext, @WebParam(name = "desiredLocales", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
@WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean>
requiresRegistration, @WebParam(mode = WebParam.Mode.OUT, name =
"offeredPortlets", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1PortletDescription>> offeredPortlets, @WebParam(mode =
WebParam.Mode.OUT, name = "userCategoryDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
userCategoryDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customUserProfileItemDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customUserProfileIte!
mDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customWindowStateDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customWindowStateDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"customModeDescriptions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1ItemDescription>>
customModeDescriptions, @WebParam(mode = WebParam.Mode.OUT, name =
"requiresInitCookie", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1CookieProtocol>
requiresInitCookie, @WebParam(mode = WebParam.Mode.OUT, name =
"registrationPropertyDescription", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<V1ModelDescription>
registrationPropertyDescription, @WebParam(mode = WebParam.Mode.OUT, name =
"locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<String>> locales, @WebParam(mode = WebParam.Mode.OUT, name =
"resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:ty!
pes") Holder<V1ResourceList> resourceList, @WebParam(mode = We!
bParam.M
ode.OUT, name = "extensions", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>>
extensions) throws V1InvalidRegistration, V1OperationFailed
{
super.getServiceDescription(registrationContext, desiredLocales,
requiresRegistration, offeredPortlets, userCategoryDescriptions,
customUserProfileItemDescriptions, customWindowStateDescriptions, customModeDescriptions,
requiresInitCookie, registrationPropertyDescription, locales, resourceList, extensions);
- List<PortletDescription> portletDescriptions = offeredPortlets.value;
+ List<V1PortletDescription> portletDescriptions = offeredPortlets.value;
for (int i = 0; i < portletDescriptions.size(); i++)
{
portletDescriptions.get(i).setGroupID("group" + i % 3);
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,39 +1,42 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
+/*
+ * 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.test.protocol.v1.behaviors;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.InvalidCookie;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidCookieFault;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1RegistrationContext;
import javax.jws.WebParam;
import java.util.List;
@@ -58,7 +61,7 @@
protected abstract void initPortletHandle();
- protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup) throws OperationFailed, InvalidCookie
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup) throws V1OperationFailed, V1InvalidCookie
{
String handle = getMarkup.getPortletContext().getPortletHandle();
@@ -68,28 +71,28 @@
}
// shouldn't happen
- throw new OperationFailed();
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
"Shouldn't happen", null);
}
- protected String getMarkupString(String handle) throws InvalidCookie, OperationFailed
+ protected String getMarkupString(String handle) throws V1InvalidCookie,
V1OperationFailed
{
switch (callCount++)
{
case 0:
// simulate change of configuration between calls: upon receiving this, the
consumer should invoke initCookie
- throw new InvalidCookie();
+ throw WSRP1ExceptionFactory.<V1InvalidCookie,
V1InvalidCookieFault>throwWSException(WSRP1ExceptionFactory.INVALID_COOKIE,
"Simulate invalid cookie", null);
case 1:
return handle;
default:
// shouldn't be called more than twice
- throw new OperationFailed();
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
"Shouldn't be called more than twice", null);
}
}
@Override
- public List<Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext)
throws InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext)
throws V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
initCookieCallCount++;
return null;
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,33 +1,36 @@
/*
-* 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.test.protocol.v1.behaviors;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1RegistrationContext;
import javax.jws.WebParam;
import java.util.List;
@@ -57,9 +60,9 @@
}
@Override
- public List<Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext)
throws InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext)
throws V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
super.initCookie(registrationContext);
- throw new OperationFailed();
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
"Shouldn't be called", null);
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1.behaviors;
@@ -27,7 +27,20 @@
import org.gatein.pc.api.WindowState;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
/**
* @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.v1.consumer.producer.NullMarkupBehavior">Chris
@@ -46,7 +59,8 @@
registerHandle(PORTLET_HANDLE);
}
- public String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ @Override
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup) throws V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1AccessDenied, V1InconsistentParameters,
V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed,
V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration, V1UnsupportedMimeType
{
return null;
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,33 +1,36 @@
/*
-* 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.test.protocol.v1.behaviors;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1RegistrationContext;
import javax.jws.WebParam;
import java.util.List;
@@ -51,13 +54,14 @@
}
@Override
- public List<Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext)
throws InvalidRegistration, AccessDenied, OperationFailed
+ public List<V1Extension> initCookie(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext)
throws V1InvalidRegistration, V1AccessDenied, V1OperationFailed
{
- List<Extension> extensions = super.initCookie(registrationContext);
+ List<V1Extension> extensions = super.initCookie(registrationContext);
if (initCookieCallCount > 3)
{
- throw new OperationFailed("Service description only defines 3 groups so
initCookie should only be called 3 times!",
+ throw WSRP1ExceptionFactory.<V1OperationFailed,
V1OperationFailedFault>throwWSException(WSRP1ExceptionFactory.OPERATION_FAILED,
+ "Service description only defines 3 groups so initCookie should only be
called 3 times!",
new IllegalStateException("Service description only defines 3 groups so
initCookie should only be called 3 times!"));
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2006, 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.test.protocol.v1.behaviors;
@@ -26,7 +27,20 @@
import org.gatein.pc.api.WindowState;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -44,7 +58,8 @@
registerHandle(PORTLET_HANDLE);
}
- protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ @Override
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup) throws V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1AccessDenied, V1InconsistentParameters,
V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed,
V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration, V1UnsupportedMimeType
{
return "<img
src='wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080"
+
"%2Ftest-resource-portlet%2Fgif%2Flogo.gif&wsrp-requiresRewrite=true/wsrp_rewrite'/>";
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,58 +1,58 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.test.protocol.v1.behaviors;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.WindowState;
-import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.Extension;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InteractionParams;
-import org.oasis.wsrp.v1.InvalidCookie;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidSession;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MarkupParams;
-import org.oasis.wsrp.v1.MarkupResponse;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletStateChangeRequired;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RuntimeContext;
-import org.oasis.wsrp.v1.SessionContext;
-import org.oasis.wsrp.v1.UnsupportedLocale;
-import org.oasis.wsrp.v1.UnsupportedMimeType;
-import org.oasis.wsrp.v1.UnsupportedMode;
-import org.oasis.wsrp.v1.UnsupportedWindowState;
-import org.oasis.wsrp.v1.UpdateResponse;
-import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InteractionParams;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1SessionContext;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v1.V1UpdateResponse;
+import org.oasis.wsrp.v1.V1UserContext;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
@@ -80,7 +80,8 @@
registerHandle(PORTLET_HANDLE);
}
- public String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ @Override
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup) throws V1UnsupportedWindowState,
V1InvalidCookie, V1InvalidSession, V1AccessDenied, V1InconsistentParameters,
V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed,
V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration, V1UnsupportedMimeType
{
StringBuffer markupString = new StringBuffer("portlet2:");
sessionId = getMarkup.getRuntimeContext().getSessionID();
@@ -102,19 +103,19 @@
}
@Override
- public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace
= "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams,
@WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse,
@WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String>
redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<Extension>> extensions) throws UnsupportedMimeType,
UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters,
UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle,
InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ public void performBlockingInteraction(@WebParam(name =
"registrationContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RegistrationContext registrationContext,
@WebParam(name = "portletContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1PortletContext portletContext,
@WebParam(name = "runtimeContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1RuntimeContext runtimeContext,
@WebParam(name = "userContext", targetNamespace =
"urn:oasis:names:tc:wsrp:v1:types") V1UserContext userContext, @WebParam(name =
"markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
V1MarkupParams markupParams, @WebParam(name = "interactionParams",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") V1InteractionParams
interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse",
targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<V1UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name =
"redir!
ectURL", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name =
"extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types")
Holder<List<V1Extension>> extensions) throws V1UnsupportedMimeType,
V1UnsupportedMode, V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession,
V1MissingParameters, V1UnsupportedLocale, V1InconsistentParameters,
V1PortletStateChangeRequired, V1InvalidHandle, V1InvalidRegistration,
V1InvalidUserCategory, V1AccessDenied, V1OperationFailed
{
- UpdateResponse ur = WSRPTypeFactory.createUpdateResponse();
+ V1UpdateResponse ur = WSRP1TypeFactory.createUpdateResponse();
ur.setNavigationalState(NS);
updateResponse.value = ur;
}
- public void modifyResponseIfNeeded(MarkupResponse markupResponse)
+ public void modifyResponseIfNeeded(V1MarkupResponse markupResponse)
{
// fakes creation of a portlet session if not already present
if (count == 0 || SESSION_ID.equals(sessionId))
{
- SessionContext sessionContext = WSRPTypeFactory.createSessionContext(SESSION_ID,
30);
+ V1SessionContext sessionContext =
WSRP1TypeFactory.createSessionContext(SESSION_ID, 30);
markupResponse.setSessionContext(sessionContext);
}
}
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,30 +1,31 @@
/*
-* 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.test.protocol.v1.behaviors.interop;
import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
-import org.oasis.wsrp.v1.LocalizedString;
-import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.V1LocalizedString;
+import org.oasis.wsrp.v1.V1PortletDescription;
/**
* Liferay behavior as exhibited at
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162201#...
@@ -54,9 +55,9 @@
<value>Software Catalog</value>
</title>
*/
- PortletDescription pd = createPortletDescription("98", null);
+ V1PortletDescription pd = createPortletDescription("98", null);
pd.getMarkupTypes().get(0).getLocales().set(0, "en_US");
- LocalizedString locString = pd.getShortTitle();
+ V1LocalizedString locString = pd.getShortTitle();
pd.setGroupID("98");
String lang = "English";
locString.setLang(lang);
@@ -66,7 +67,7 @@
locString.setValue("Software Catalog");
// add another value that checks that we handle null lang properly
- PortletDescription pd2 = createPortletDescription("99", null);
+ V1PortletDescription pd2 = createPortletDescription("99", null);
pd.getMarkupTypes().get(0).getLocales().set(0, "en_US");
locString = pd.getShortTitle();
locString.setLang(null);
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -29,20 +29,20 @@
import org.gatein.wsrp.services.ServiceFactory;
import org.gatein.wsrp.test.BehaviorRegistry;
import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InvalidCookie;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidSession;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.UnsupportedLocale;
-import org.oasis.wsrp.v1.UnsupportedMimeType;
-import org.oasis.wsrp.v1.UnsupportedMode;
-import org.oasis.wsrp.v1.UnsupportedWindowState;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
@@ -218,10 +218,10 @@
}
@Override
- protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
- throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied,
InconsistentParameters,
- InvalidHandle, UnsupportedLocale, UnsupportedMode, OperationFailed,
MissingParameters, InvalidUserCategory,
- InvalidRegistration, UnsupportedMimeType
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, V1GetMarkup getMarkup)
+ throws V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession,
V1AccessDenied, V1InconsistentParameters,
+ V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed,
V1MissingParameters, V1InvalidUserCategory,
+ V1InvalidRegistration, V1UnsupportedMimeType
{
return MARKUP;
}
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ProducerHolder.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ProducerHolder.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ProducerHolder.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -23,6 +23,9 @@
package org.gatein.wsrp.producer;
+import org.gatein.wsrp.producer.v1.WSRP1Producer;
+import org.gatein.wsrp.producer.v2.WSRP2Producer;
+
/**
* Holds the current WSRPProducer as configured for a particular portlet container.
*
@@ -35,13 +38,23 @@
{
}
- public static WSRPProducer getProducer()
+ public static WSRP2Producer getProducer()
{
return getProducer(false);
}
- public static WSRPProducer getProducer(boolean allowUnstartedProducer)
+ public static WSRP1Producer getV1Producer()
{
+ return WSRP1Producer.getInstance();
+ }
+
+ public static WSRP2Producer getV2Producer()
+ {
+ return getProducer();
+ }
+
+ public static WSRP2Producer getProducer(boolean allowUnstartedProducer)
+ {
if (allowUnstartedProducer || WSRPProducerImpl.isProducerStarted())
{
return WSRPProducerImpl.getInstance();
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -33,8 +33,7 @@
* @version $Revision: 12020 $
* @since 2.4
*/
-public interface WSRPProducer extends ServiceDescriptionInterface, MarkupInterface,
PortletManagementInterface,
- RegistrationInterface, ProducerConfigurationChangeListener
+public interface WSRPProducer extends ProducerConfigurationChangeListener
{
/**
* Retrieves the RegistrationManager used by this WSRPProducer.
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -36,6 +36,7 @@
import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.gatein.wsrp.producer.v2.WSRP2Producer;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.BlockingInteractionResponse;
import org.oasis.wsrp.v2.ClonePortlet;
@@ -91,7 +92,7 @@
* @version $Revision: 12286 $
* @since 2.4
*/
-public class WSRPProducerImpl implements WSRPProducer
+public class WSRPProducerImpl implements WSRP2Producer
{
/** logger used for logging ;) */
private static final Logger log = LoggerFactory.getLogger(WSRPProducerImpl.class);
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1MarkupInterface.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1MarkupInterface.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1MarkupInterface.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,71 @@
+/*
+ * 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.producer.v1;
+
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InitCookie;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PerformBlockingInteraction;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1ReleaseSessions;
+import org.oasis.wsrp.v1.V1ReturnAny;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface V1MarkupInterface
+{
+ V1MarkupResponse getMarkup(V1GetMarkup getMarkup)
+ throws V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession,
V1AccessDenied,
+ V1InconsistentParameters, V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode,
+ V1OperationFailed, V1MissingParameters, V1InvalidUserCategory,
V1InvalidRegistration,
+ V1UnsupportedMimeType;
+
+ V1BlockingInteractionResponse performBlockingInteraction(V1PerformBlockingInteraction
performBlockingInteraction)
+ throws V1InvalidSession, V1UnsupportedMode, V1UnsupportedMimeType,
V1OperationFailed,
+ V1UnsupportedWindowState, V1UnsupportedLocale, V1AccessDenied,
V1PortletStateChangeRequired,
+ V1InvalidRegistration, V1MissingParameters, V1InvalidUserCategory,
V1InconsistentParameters,
+ V1InvalidHandle, V1InvalidCookie;
+
+ V1ReturnAny releaseSessions(V1ReleaseSessions releaseSessions)
+ throws V1InvalidRegistration, V1OperationFailed, V1MissingParameters,
V1AccessDenied;
+
+ V1ReturnAny initCookie(V1InitCookie initCookie)
+ throws V1AccessDenied, V1OperationFailed, V1InvalidRegistration;
+}
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1PortletManagementInterface.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1PortletManagementInterface.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1PortletManagementInterface.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,70 @@
+/*
+ * 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.producer.v1;
+
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1ClonePortlet;
+import org.oasis.wsrp.v1.V1DestroyPortlets;
+import org.oasis.wsrp.v1.V1DestroyPortletsResponse;
+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;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescriptionResponse;
+import org.oasis.wsrp.v1.V1PortletPropertyDescriptionResponse;
+import org.oasis.wsrp.v1.V1PropertyList;
+import org.oasis.wsrp.v1.V1SetPortletProperties;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface V1PortletManagementInterface
+{
+ V1PortletDescriptionResponse getPortletDescription(V1GetPortletDescription
getPortletDescription)
+ throws V1AccessDenied, V1InvalidHandle, V1InvalidUserCategory,
V1InconsistentParameters, V1MissingParameters,
+ V1InvalidRegistration, V1OperationFailed;
+
+ V1PortletContext clonePortlet(V1ClonePortlet clonePortlet) throws
V1InvalidUserCategory, V1AccessDenied,
+ V1OperationFailed, V1InvalidHandle, V1InvalidRegistration,
V1InconsistentParameters, V1MissingParameters;
+
+ V1DestroyPortletsResponse destroyPortlets(V1DestroyPortlets destroyPortlets) throws
V1InconsistentParameters,
+ V1MissingParameters, V1InvalidRegistration, V1OperationFailed;
+
+ V1PortletContext setPortletProperties(V1SetPortletProperties setPortletProperties)
throws V1OperationFailed,
+ V1InvalidHandle, V1MissingParameters, V1InconsistentParameters,
V1InvalidUserCategory, V1AccessDenied, V1InvalidRegistration;
+
+ V1PropertyList getPortletProperties(V1GetPortletProperties getPortletProperties)
throws V1InvalidHandle,
+ V1MissingParameters, V1InvalidRegistration, V1AccessDenied, V1OperationFailed,
V1InconsistentParameters, V1InvalidUserCategory;
+
+ V1PortletPropertyDescriptionResponse
getPortletPropertyDescription(V1GetPortletPropertyDescription
getPortletPropertyDescription)
+ throws V1MissingParameters, V1InconsistentParameters, V1InvalidUserCategory,
V1InvalidRegistration, V1AccessDenied,
+ V1InvalidHandle, V1OperationFailed;
+}
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1RegistrationInterface.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1RegistrationInterface.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1RegistrationInterface.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,47 @@
+/*
+ * 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.producer.v1;
+
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1ModifyRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1RegistrationState;
+import org.oasis.wsrp.v1.V1ReturnAny;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface V1RegistrationInterface
+{
+ V1RegistrationContext register(V1RegistrationData register) throws
V1MissingParameters, V1OperationFailed;
+
+ V1ReturnAny deregister(V1RegistrationContext deregister) throws V1OperationFailed,
V1InvalidRegistration;
+
+ V1RegistrationState modifyRegistration(V1ModifyRegistration modifyRegistration) throws
V1MissingParameters,
+ V1OperationFailed, V1InvalidRegistration;
+}
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1ServiceDescriptionInterface.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1ServiceDescriptionInterface.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/V1ServiceDescriptionInterface.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,38 @@
+/*
+ * 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.producer.v1;
+
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1ServiceDescription;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface V1ServiceDescriptionInterface
+{
+ V1ServiceDescription getServiceDescription(V1GetServiceDescription gs) throws
V1InvalidRegistration, V1OperationFailed;
+}
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,211 @@
+/*
+ * 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.producer.v1;
+
+import org.gatein.common.NotYetImplemented;
+import org.gatein.pc.api.PortletInvoker;
+import org.gatein.registration.RegistrationManager;
+import org.gatein.wsrp.producer.ProducerHolder;
+import org.gatein.wsrp.producer.WSRPProducer;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.oasis.wsrp.v1.V1AccessDenied;
+import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
+import org.oasis.wsrp.v1.V1ClonePortlet;
+import org.oasis.wsrp.v1.V1DestroyPortlets;
+import org.oasis.wsrp.v1.V1DestroyPortletsResponse;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1GetPortletDescription;
+import org.oasis.wsrp.v1.V1GetPortletProperties;
+import org.oasis.wsrp.v1.V1GetPortletPropertyDescription;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1InconsistentParameters;
+import org.oasis.wsrp.v1.V1InitCookie;
+import org.oasis.wsrp.v1.V1InvalidCookie;
+import org.oasis.wsrp.v1.V1InvalidHandle;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1InvalidUserCategory;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1ModifyRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PerformBlockingInteraction;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescriptionResponse;
+import org.oasis.wsrp.v1.V1PortletPropertyDescriptionResponse;
+import org.oasis.wsrp.v1.V1PortletStateChangeRequired;
+import org.oasis.wsrp.v1.V1PropertyList;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1RegistrationState;
+import org.oasis.wsrp.v1.V1ReleaseSessions;
+import org.oasis.wsrp.v1.V1ReturnAny;
+import org.oasis.wsrp.v1.V1ServiceDescription;
+import org.oasis.wsrp.v1.V1SetPortletProperties;
+import org.oasis.wsrp.v1.V1UnsupportedLocale;
+import org.oasis.wsrp.v1.V1UnsupportedMimeType;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class WSRP1Producer implements WSRPProducer, V1MarkupInterface,
V1PortletManagementInterface,
+ V1RegistrationInterface, V1ServiceDescriptionInterface
+{
+
+ // On-demand class holder Singleton pattern (multi-thread safe)
+
+ private static final class InstanceHolder
+ {
+ public static final WSRP1Producer producer = new WSRP1Producer();
+ }
+
+ public static WSRP1Producer getInstance()
+ {
+ return InstanceHolder.producer;
+ }
+
+ private WSRP1Producer()
+ {
+ }
+
+ private final WSRPProducer producer = ProducerHolder.getProducer();
+
+ public RegistrationManager getRegistrationManager()
+ {
+ return producer.getRegistrationManager();
+ }
+
+ public void setRegistrationManager(RegistrationManager registrationManager)
+ {
+ producer.setRegistrationManager(registrationManager);
+ }
+
+ public ProducerConfigurationService getConfigurationService()
+ {
+ return producer.getConfigurationService();
+ }
+
+ public void setConfigurationService(ProducerConfigurationService
configurationService)
+ {
+ producer.setConfigurationService(configurationService);
+ }
+
+ public PortletInvoker getPortletInvoker()
+ {
+ return producer.getPortletInvoker();
+ }
+
+ public void setPortletInvoker(PortletInvoker invoker)
+ {
+ producer.setPortletInvoker(invoker);
+ }
+
+ public void start()
+ {
+ producer.start();
+ }
+
+ public void stop()
+ {
+ producer.stop();
+ }
+
+ public void usingStrictModeChangedTo(boolean strictMode)
+ {
+ producer.usingStrictModeChangedTo(strictMode);
+ }
+
+ public V1ServiceDescription getServiceDescription(V1GetServiceDescription gs) throws
V1InvalidRegistration, V1OperationFailed
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1RegistrationContext register(V1RegistrationData register) throws
V1MissingParameters, V1OperationFailed
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1ReturnAny deregister(V1RegistrationContext deregister) throws
V1OperationFailed, V1InvalidRegistration
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1RegistrationState modifyRegistration(V1ModifyRegistration modifyRegistration)
throws V1MissingParameters, V1OperationFailed, V1InvalidRegistration
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1PortletDescriptionResponse getPortletDescription(V1GetPortletDescription
getPortletDescription) throws V1AccessDenied, V1InvalidHandle, V1InvalidUserCategory,
V1InconsistentParameters, V1MissingParameters, V1InvalidRegistration, V1OperationFailed
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1MarkupResponse getMarkup(V1GetMarkup getMarkup) throws
V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession, V1AccessDenied,
V1InconsistentParameters, V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode,
V1OperationFailed, V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration,
V1UnsupportedMimeType
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1PortletContext clonePortlet(V1ClonePortlet clonePortlet) throws
V1InvalidUserCategory, V1AccessDenied, V1OperationFailed, V1InvalidHandle,
V1InvalidRegistration, V1InconsistentParameters, V1MissingParameters
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1BlockingInteractionResponse
performBlockingInteraction(V1PerformBlockingInteraction performBlockingInteraction) throws
V1InvalidSession, V1UnsupportedMode, V1UnsupportedMimeType, V1OperationFailed,
V1UnsupportedWindowState, V1UnsupportedLocale, V1AccessDenied,
V1PortletStateChangeRequired, V1InvalidRegistration, V1MissingParameters,
V1InvalidUserCategory, V1InconsistentParameters, V1InvalidHandle, V1InvalidCookie
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1DestroyPortletsResponse destroyPortlets(V1DestroyPortlets destroyPortlets)
throws V1InconsistentParameters, V1MissingParameters, V1InvalidRegistration,
V1OperationFailed
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1PortletContext setPortletProperties(V1SetPortletProperties
setPortletProperties) throws V1OperationFailed, V1InvalidHandle, V1MissingParameters,
V1InconsistentParameters, V1InvalidUserCategory, V1AccessDenied, V1InvalidRegistration
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1ReturnAny releaseSessions(V1ReleaseSessions releaseSessions) throws
V1InvalidRegistration, V1OperationFailed, V1MissingParameters, V1AccessDenied
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1PropertyList getPortletProperties(V1GetPortletProperties
getPortletProperties) throws V1InvalidHandle, V1MissingParameters, V1InvalidRegistration,
V1AccessDenied, V1OperationFailed, V1InconsistentParameters, V1InvalidUserCategory
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1ReturnAny initCookie(V1InitCookie initCookie) throws V1AccessDenied,
V1OperationFailed, V1InvalidRegistration
+ {
+ throw new NotYetImplemented();
+ }
+
+ public V1PortletPropertyDescriptionResponse
getPortletPropertyDescription(V1GetPortletPropertyDescription
getPortletPropertyDescription) throws V1MissingParameters, V1InconsistentParameters,
V1InvalidUserCategory, V1InvalidRegistration, V1AccessDenied, V1InvalidHandle,
V1OperationFailed
+ {
+ throw new NotYetImplemented();
+ }
+}
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v2/WSRP2Producer.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -0,0 +1,39 @@
+/*
+ * 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.producer.v2;
+
+import org.gatein.wsrp.producer.MarkupInterface;
+import org.gatein.wsrp.producer.PortletManagementInterface;
+import org.gatein.wsrp.producer.RegistrationInterface;
+import org.gatein.wsrp.producer.ServiceDescriptionInterface;
+import org.gatein.wsrp.producer.WSRPProducer;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface WSRP2Producer extends WSRPProducer, MarkupInterface,
PortletManagementInterface,
+ RegistrationInterface, ServiceDescriptionInterface
+{
+}
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.producer;
@@ -32,24 +32,8 @@
*/
public abstract class WSRPProducerBaseTest extends TestCase
{
-
- /** . */
protected WSRPProducerImpl producer = WSRPProducerImpl.getInstance();
- protected RegistrationInterface registrationService;
- protected ServiceDescriptionInterface serviceDescriptionService;
- protected MarkupInterface markupService;
- protected PortletManagementInterface portletManagementService;
-
- @Override
- protected void setUp() throws Exception
- {
- serviceDescriptionService = producer.getServiceDescriptionInterface();
- markupService = producer.getMarkupInterface();
- registrationService = producer.getRegistrationInterface();
- portletManagementService = producer.getPortletManagementInterface();
- }
-
protected WSRPProducerBaseTest(String name) throws Exception
{
super(name);
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, 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.protocol.v1;
@@ -27,25 +27,25 @@
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPPortletURL;
import org.gatein.wsrp.WSRPRenderURL;
-import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.ExtendedAssert;
-import org.oasis.wsrp.v1.BlockingInteractionResponse;
-import org.oasis.wsrp.v1.CacheControl;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.InitCookie;
-import org.oasis.wsrp.v1.InteractionParams;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.MarkupContext;
-import org.oasis.wsrp.v1.MarkupResponse;
-import org.oasis.wsrp.v1.NamedString;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PerformBlockingInteraction;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.RuntimeContext;
-import org.oasis.wsrp.v1.SessionContext;
-import org.oasis.wsrp.v1.StateChange;
-import org.oasis.wsrp.v1.UnsupportedMode;
-import org.oasis.wsrp.v1.UpdateResponse;
+import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
+import org.oasis.wsrp.v1.V1CacheControl;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1InitCookie;
+import org.oasis.wsrp.v1.V1InteractionParams;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1MarkupContext;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1NamedString;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PerformBlockingInteraction;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1SessionContext;
+import org.oasis.wsrp.v1.V1StateChange;
+import org.oasis.wsrp.v1.V1UnsupportedMode;
+import org.oasis.wsrp.v1.V1UpdateResponse;
import java.rmi.RemoteException;
import java.util.List;
@@ -69,24 +69,24 @@
public void testGetMarkupViewNoSession() throws Exception
{
- GetMarkup getMarkup = createMarkupRequest();
+ V1GetMarkup getMarkup = createMarkupRequest();
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, DEFAULT_VIEW_MARKUP);
}
public void testInvalidGetMarkup() throws Exception
{
- GetMarkup getMarkup = createMarkupRequest();
+ V1GetMarkup getMarkup = createMarkupRequest();
getMarkup.getMarkupParams().setMode("invalid mode");
try
{
- markupService.getMarkup(getMarkup);
+ producer.getMarkup(getMarkup);
ExtendedAssert.fail();
}
- catch (UnsupportedMode unsupportedMode)
+ catch (V1UnsupportedMode unsupportedMode)
{
// expected
}
@@ -95,15 +95,15 @@
public void testGetMarkupWithSessionID() throws Exception
{
// The consumer should never have access to or be able to set a sessionID. Sessions
are handled by the Producer using cookies.
- GetMarkup getMarkup = createMarkupRequest();
+ V1GetMarkup getMarkup = createMarkupRequest();
getMarkup.getRuntimeContext().setSessionID("Hello World");
try
{
- markupService.getMarkup(getMarkup);
+ producer.getMarkup(getMarkup);
ExtendedAssert.fail("A sessionID should not be allowed to be passed in
GetMarkup()");
}
- catch (OperationFailed operationFailed)
+ catch (V1OperationFailed operationFailed)
{
// expected
}
@@ -111,10 +111,10 @@
public void testGetMarkupEditNoSession() throws Exception
{
- GetMarkup getMarkup = createMarkupRequest();
+ V1GetMarkup getMarkup = createMarkupRequest();
getMarkup.getMarkupParams().setMode(WSRPConstants.EDIT_MODE);
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, "<form method='post'
action='wsrp_rewrite?wsrp-urlType=blockingAction&wsrp" +
"-interactionState=JBPNS_/wsrp_rewrite'
id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock
symbol</t" +
@@ -129,8 +129,8 @@
try
{
- GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse res = markupService.getMarkup(gm);
+ V1GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1MarkupResponse res = producer.getMarkup(gm);
String markupString = res.getMarkupContext().getMarkupString();
@@ -145,7 +145,7 @@
// We're now trying to get a hello for Julien ;)
gm.getMarkupParams().setNavigationalState(julienRender.getNavigationalState().getStringValue());
- res = markupService.getMarkup(gm);
+ res = producer.getMarkup(gm);
markupString = res.getMarkupContext().getMarkupString();
ExtendedAssert.assertString1ContainsString2(markupString, "Hello,
Julien!");
@@ -155,12 +155,12 @@
WSRPActionURL incrementAction = (WSRPActionURL)incrementURL;
// let's see now if we can increment the counter
- PerformBlockingInteraction performBlockingInteraction =
-
WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
- InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
+ V1PerformBlockingInteraction performBlockingInteraction =
+
WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
+ V1InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
interactionParams.setInteractionState(incrementAction.getInteractionState().getStringValue());
- markupService.performBlockingInteraction(performBlockingInteraction);
- res = markupService.getMarkup(gm);
+ producer.performBlockingInteraction(performBlockingInteraction);
+ res = producer.getMarkup(gm);
markupString = res.getMarkupContext().getMarkupString();
ExtendedAssert.assertString1ContainsString2(markupString, "Counter:
1");
}
@@ -178,6 +178,7 @@
}
// fix-me: add more tests
+
public void testGetMarkupSession() throws Exception
{
undeploy(DEFAULT_MARKUP_PORTLET_WAR);
@@ -188,13 +189,13 @@
try
{
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponseWithSession(response, 0);
- response = markupService.getMarkup(getMarkup);
+ response = producer.getMarkup(getMarkup);
checkMarkupResponseWithSession(response, 1);
// fix-me: try to reuse the old session id: what should happen?
@@ -202,7 +203,7 @@
// getMarkup.setRuntimeContext(runtimeContext);
// try
// {
-// markupService.getMarkup(getMarkup);
+// producer.getMarkup(getMarkup);
// fail("The session should be invalid...");
// }
// catch (InvalidSessionFault expected)
@@ -223,17 +224,17 @@
public void testPerformBlockingInteractionRedirect() throws Exception
{
- PerformBlockingInteraction performBlockingInteraction =
- WSRPTypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
- InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
+ V1PerformBlockingInteraction performBlockingInteraction =
+ WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
+ V1InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
// crappy way but this is a test! ;)
- NamedString namedString = new NamedString();
+ V1NamedString namedString = new V1NamedString();
namedString.setName("symbol");
namedString.setValue("HELP");
interactionParams.getFormParameters().add(namedString);
- BlockingInteractionResponse response =
markupService.performBlockingInteraction(performBlockingInteraction);
+ V1BlockingInteractionResponse response =
producer.performBlockingInteraction(performBlockingInteraction);
ExtendedAssert.assertNotNull(response);
// this is a redirect...
@@ -242,7 +243,7 @@
ExtendedAssert.assertEquals("/WEB-INF/jsp/help.jsp", redirectURL); //
fix-me: handle URL re-writing
// no update response
- UpdateResponse updateResponse = response.getUpdateResponse();
+ V1UpdateResponse updateResponse = response.getUpdateResponse();
ExtendedAssert.assertNull(updateResponse);
}
@@ -252,9 +253,9 @@
String symbol = "AAPL";
String navigationalState = checkPBIAndGetNavigationalState(symbol);
- GetMarkup getMarkup = createMarkupRequest();
+ V1GetMarkup getMarkup = createMarkupRequest();
getMarkup.getMarkupParams().setNavigationalState(navigationalState);
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, "<p>" + symbol + " stock value:
123.45</p>");
}
@@ -262,18 +263,18 @@
public void testPBIWithSessionID() throws Exception
{
String portletHandle = getDefaultHandle();
- PerformBlockingInteraction performBlockingInteraction =
WSRPTypeFactory.createDefaultPerformBlockingInteraction(portletHandle);
+ V1PerformBlockingInteraction performBlockingInteraction =
WSRP1TypeFactory.createDefaultPerformBlockingInteraction(portletHandle);
- RuntimeContext runtimeContext = performBlockingInteraction.getRuntimeContext();
+ V1RuntimeContext runtimeContext = performBlockingInteraction.getRuntimeContext();
//the sessionID should never be set by the consumer. Sessions are handled by
cookies instead
runtimeContext.setSessionID("Hello World");
try
{
- markupService.performBlockingInteraction(performBlockingInteraction);
+ producer.performBlockingInteraction(performBlockingInteraction);
ExtendedAssert.fail("Should not be able to pass a sessionID in a
PerformBlockingInteraction()");
}
- catch (OperationFailed expected)
+ catch (V1OperationFailed expected)
{
// expected
}
@@ -281,11 +282,11 @@
public void testMarkupCaching() throws Exception
{
- GetMarkup getMarkup = createMarkupRequest();
+ V1GetMarkup getMarkup = createMarkupRequest();
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
- CacheControl cacheControl = response.getMarkupContext().getCacheControl();
+ V1CacheControl cacheControl = response.getMarkupContext().getCacheControl();
ExtendedAssert.assertNotNull(cacheControl);
ExtendedAssert.assertEquals(WSRPConstants.CACHE_PER_USER,
cacheControl.getUserScope());
ExtendedAssert.assertEquals(15, cacheControl.getExpires());
@@ -294,7 +295,7 @@
String sessionPortletArchive = "test-session-portlet.war";
deploy(sessionPortletArchive);
- response =
markupService.getMarkup(createMarkupRequestForCurrentlyDeployedPortlet());
+ response = producer.getMarkup(createMarkupRequestForCurrentlyDeployedPortlet());
cacheControl = response.getMarkupContext().getCacheControl();
ExtendedAssert.assertNull(cacheControl);
@@ -311,9 +312,9 @@
try
{
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, "test");
}
finally
@@ -330,9 +331,9 @@
try
{
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, "");
}
finally
@@ -347,12 +348,12 @@
String getLocalesPortletArchive = "test-getlocales-portlet.war";
deploy(getLocalesPortletArchive);
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
getMarkup.getMarkupParams().getLocales().add("en_US");
try
{
- markupService.getMarkup(getMarkup);
+ producer.getMarkup(getMarkup);
//fail("Should have trown an UnsupportetLocaleFault"); // ideally cf
http://jira.jboss.com/jira/browse/JBPORTAL-857
ExtendedAssert.fail("Should have trown an exception"); // right now
}
@@ -373,14 +374,14 @@
String getLocalesPortletArchive = "test-getlocales-portlet.war";
deploy(getLocalesPortletArchive);
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
getMarkup.getMarkupParams().getLocales().add("en_US");
// Use the lenient mode
producer.usingStrictModeChangedTo(false);
// markup should be properly generated
- checkMarkupResponse(markupService.getMarkup(getMarkup), "English (United
States)");
+ checkMarkupResponse(producer.getMarkup(getMarkup), "English (United
States)");
undeploy(getLocalesPortletArchive);
}
@@ -390,11 +391,11 @@
String getLocalesPortletArchive = "test-getlocales-portlet.war";
deploy(getLocalesPortletArchive);
- GetMarkup getMarkup = createMarkupRequest(getPortletHandleFrom("No
Declared"));
+ V1GetMarkup getMarkup = createMarkupRequest(getPortletHandleFrom("No
Declared"));
try
{
- checkMarkupResponse(markupService.getMarkup(getMarkup),
Locale.getDefault().getDisplayName());
+ checkMarkupResponse(producer.getMarkup(getMarkup),
Locale.getDefault().getDisplayName());
}
finally
{
@@ -408,26 +409,26 @@
String getLocalesPortletArchive = "test-getlocales-portlet.war";
deploy(getLocalesPortletArchive);
- GetMarkup getMarkup =
createMarkupRequest(getPortletHandleFrom("Simple"));
+ V1GetMarkup getMarkup =
createMarkupRequest(getPortletHandleFrom("Simple"));
try
{
List<String> locales = getMarkup.getMarkupParams().getLocales();
locales.add("en");
locales.add("fr");
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, Locale.ENGLISH.getDisplayName());
locales.clear();
locales.add("fr");
locales.add("en");
- response = markupService.getMarkup(getMarkup);
+ response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, Locale.FRENCH.getDisplayName());
locales.clear();
locales.add("de");
locales.add("en");
- response = markupService.getMarkup(getMarkup);
+ response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, Locale.ENGLISH.getDisplayName());
}
finally
@@ -444,9 +445,9 @@
try
{
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response,
"wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite\n"
+
"wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite");
}
@@ -464,10 +465,10 @@
try
{
- GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
-
getMarkup.setUserContext(WSRPTypeFactory.createUserContext("johndoe"));
+ V1GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
+
getMarkup.setUserContext(WSRP1TypeFactory.createUserContext("johndoe"));
- MarkupResponse response = markupService.getMarkup(getMarkup);
+ V1MarkupResponse response = producer.getMarkup(getMarkup);
checkMarkupResponse(response, "user: johndoe");
}
finally
@@ -482,34 +483,34 @@
String multiValuedPortletArchive = "test-multivalued-portlet.war";
deploy(multiValuedPortletArchive);
- NamedString namedString = createNamedString("multi",
"value1");
+ V1NamedString namedString = createNamedString("multi",
"value1");
try
{
- PerformBlockingInteraction action =
-
WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
- List<NamedString> formParameters =
action.getInteractionParams().getFormParameters();
+ V1PerformBlockingInteraction action =
+
WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
+ List<V1NamedString> formParameters =
action.getInteractionParams().getFormParameters();
formParameters.add(namedString);
- BlockingInteractionResponse actionResponse =
markupService.performBlockingInteraction(action);
- GetMarkup markupRequest = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1BlockingInteractionResponse actionResponse =
producer.performBlockingInteraction(action);
+ V1GetMarkup markupRequest = createMarkupRequestForCurrentlyDeployedPortlet();
markupRequest.getMarkupParams().setNavigationalState(actionResponse.getUpdateResponse().getNavigationalState());
- MarkupResponse response = markupService.getMarkup(markupRequest);
+ V1MarkupResponse response = producer.getMarkup(markupRequest);
checkMarkupResponse(response, "multi: value1");
formParameters.clear();
formParameters.add(namedString);
formParameters.add(createNamedString("multi", "value2"));
- actionResponse = markupService.performBlockingInteraction(action);
+ actionResponse = producer.performBlockingInteraction(action);
markupRequest = createMarkupRequestForCurrentlyDeployedPortlet();
markupRequest.getMarkupParams().setNavigationalState(actionResponse.getUpdateResponse().getNavigationalState());
- response = markupService.getMarkup(markupRequest);
+ response = producer.getMarkup(markupRequest);
checkMarkupResponse(response, "multi: value1, value2");
formParameters.clear();
- formParameters.add(new NamedString());
- actionResponse = markupService.performBlockingInteraction(action);
+ formParameters.add(new V1NamedString());
+ actionResponse = producer.performBlockingInteraction(action);
markupRequest = createMarkupRequestForCurrentlyDeployedPortlet();
markupRequest.getMarkupParams().setNavigationalState(actionResponse.getUpdateResponse().getNavigationalState());
- response = markupService.getMarkup(markupRequest);
+ response = producer.getMarkup(markupRequest);
checkMarkupResponse(response, "multi: ");
}
finally
@@ -527,31 +528,31 @@
try
{
// check the initial value
- GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse res = markupService.getMarkup(gm);
+ V1GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1MarkupResponse res = producer.getMarkup(gm);
String markupString = res.getMarkupContext().getMarkupString();
ExtendedAssert.assertEquals("initial", markupString);
// modify the preference value
- PerformBlockingInteraction pbi =
WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
-
pbi.getInteractionParams().setPortletStateChange(StateChange.CLONE_BEFORE_WRITE); //
request cloning if needed
+ V1PerformBlockingInteraction pbi =
WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
+
pbi.getInteractionParams().setPortletStateChange(V1StateChange.CLONE_BEFORE_WRITE); //
request cloning if needed
String value = "new value";
pbi.getInteractionParams().getFormParameters().add(createNamedString("value",
value));
- BlockingInteractionResponse response =
markupService.performBlockingInteraction(pbi);
+ V1BlockingInteractionResponse response =
producer.performBlockingInteraction(pbi);
ExtendedAssert.assertNotNull(response);
// check that we got a new portlet context
- PortletContext pc = response.getUpdateResponse().getPortletContext();
+ V1PortletContext pc = response.getUpdateResponse().getPortletContext();
ExtendedAssert.assertNotNull(pc);
// get the markup again and check that we still get the initial value with the
initial portlet context
- res = markupService.getMarkup(gm);
+ res = producer.getMarkup(gm);
markupString = res.getMarkupContext().getMarkupString();
ExtendedAssert.assertEquals("initial", markupString);
// retrieving the markup with the new portlet context should return the new
value
gm.setPortletContext(pc);
- res = markupService.getMarkup(gm);
+ res = producer.getMarkup(gm);
markupString = res.getMarkupContext().getMarkupString();
ExtendedAssert.assertEquals(value, markupString);
}
@@ -561,9 +562,9 @@
}
}
- private NamedString createNamedString(String name, String value)
+ private V1NamedString createNamedString(String name, String value)
{
- NamedString namedString = new NamedString();
+ V1NamedString namedString = new V1NamedString();
namedString.setName(name);
namedString.setValue(value);
return namedString;
@@ -577,8 +578,8 @@
try
{
- GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse res = markupService.getMarkup(gm);
+ V1GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1MarkupResponse res = producer.getMarkup(gm);
String markupString = res.getMarkupContext().getMarkupString();
// accept either localhost or 127.0.0.1 for the host part of the generated
markup
@@ -603,8 +604,8 @@
try
{
- GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
- MarkupResponse res = markupService.getMarkup(gm);
+ V1GetMarkup gm = createMarkupRequestForCurrentlyDeployedPortlet();
+ V1MarkupResponse res = producer.getMarkup(gm);
String markupString = res.getMarkupContext().getMarkupString();
// accept either localhost or 127.0.0.1 for the host part of the generated
markup
@@ -630,13 +631,13 @@
try
{
// set appVar to value in the application scope by the first portlet
- PerformBlockingInteraction pbi =
WSRPTypeFactory.createDefaultPerformBlockingInteraction(getPortletHandleFrom("Set"));
+ V1PerformBlockingInteraction pbi =
WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getPortletHandleFrom("Set"));
pbi.getInteractionParams().getFormParameters().add(createNamedString("appVar",
"value"));
- markupService.performBlockingInteraction(pbi);
+ producer.performBlockingInteraction(pbi);
// the second portlet reads the appVar value and outputs it
- GetMarkup gm = createMarkupRequest(getPortletHandleFrom("Get"));
- MarkupResponse res = markupService.getMarkup(gm);
+ V1GetMarkup gm = createMarkupRequest(getPortletHandleFrom("Get"));
+ V1MarkupResponse res = producer.getMarkup(gm);
checkMarkupResponse(res, "appVar=value");
}
finally
@@ -649,13 +650,13 @@
{
configureRegistrationSettings(true, false);
- GetMarkup gm = createMarkupRequest();
+ V1GetMarkup gm = createMarkupRequest();
try
{
- markupService.getMarkup(gm);
+ producer.getMarkup(gm);
ExtendedAssert.fail("Should have thrown InvalidRegistration!");
}
- catch (InvalidRegistration invalidRegistration)
+ catch (V1InvalidRegistration invalidRegistration)
{
// expected
}
@@ -669,13 +670,13 @@
{
configureRegistrationSettings(true, false);
- PerformBlockingInteraction pbi =
WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
+ V1PerformBlockingInteraction pbi =
WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
try
{
- markupService.performBlockingInteraction(pbi);
+ producer.performBlockingInteraction(pbi);
ExtendedAssert.fail("Should have thrown InvalidRegistration!");
}
- catch (InvalidRegistration invalidRegistration)
+ catch (V1InvalidRegistration invalidRegistration)
{
// expected
}
@@ -689,13 +690,13 @@
{
configureRegistrationSettings(true, false);
- InitCookie initCookie = WSRPTypeFactory.createInitCookie(null);
+ V1InitCookie initCookie = WSRP1TypeFactory.createInitCookie(null);
try
{
- markupService.initCookie(initCookie);
+ producer.initCookie(initCookie);
ExtendedAssert.fail("Should have thrown InvalidRegistration!");
}
- catch (InvalidRegistration invalidRegistration)
+ catch (V1InvalidRegistration invalidRegistration)
{
// expected
}
@@ -707,19 +708,19 @@
private String checkPBIAndGetNavigationalState(String symbol) throws Exception
{
- PerformBlockingInteraction performBlockingInteraction =
- WSRPTypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
- InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
+ V1PerformBlockingInteraction performBlockingInteraction =
+ WSRP1TypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
+ V1InteractionParams interactionParams =
performBlockingInteraction.getInteractionParams();
interactionParams.getFormParameters().add(createNamedString("symbol",
symbol));
- BlockingInteractionResponse response =
markupService.performBlockingInteraction(performBlockingInteraction);
+ V1BlockingInteractionResponse response =
producer.performBlockingInteraction(performBlockingInteraction);
ExtendedAssert.assertNotNull(response);
// this is not a redirect...
ExtendedAssert.assertNull(response.getRedirectURL());
// check update response
- UpdateResponse updateResponse = response.getUpdateResponse();
+ V1UpdateResponse updateResponse = response.getUpdateResponse();
ExtendedAssert.assertNotNull(updateResponse);
// request was readOnly so no updated portlet context
ExtendedAssert.assertNull(updateResponse.getPortletContext());
@@ -729,18 +730,18 @@
String navigationalState = updateResponse.getNavigationalState();
ExtendedAssert.assertNotNull(navigationalState);
ExtendedAssert.assertEquals(updateResponse.getNewMode(), WSRPConstants.VIEW_MODE);
- MarkupContext markupContext = updateResponse.getMarkupContext();
+ V1MarkupContext markupContext = updateResponse.getMarkupContext();
ExtendedAssert.assertNull(markupContext); // we don't return markup for now
return navigationalState;
}
- private void checkMarkupResponseWithSession(MarkupResponse response, int count) throws
RemoteException, InvalidRegistration, OperationFailed
+ private void checkMarkupResponseWithSession(V1MarkupResponse response, int count)
throws RemoteException, V1InvalidRegistration, V1OperationFailed
{
ExtendedAssert.assertNotNull(response);
// Markup context
- MarkupContext markupContext = response.getMarkupContext();
+ V1MarkupContext markupContext = response.getMarkupContext();
ExtendedAssert.assertNotNull(markupContext);
String markupString = markupContext.getMarkupString();
ExtendedAssert.assertString1ContainsString2(markupString, "count = " +
count);
@@ -750,12 +751,12 @@
checkSessionForCurrentlyDeployedPortlet(response);
}
- private MarkupContext checkMarkupResponse(MarkupResponse response, String
markupString)
+ private V1MarkupContext checkMarkupResponse(V1MarkupResponse response, String
markupString)
{
ExtendedAssert.assertNotNull(response);
// Markup context
- MarkupContext markupContext = response.getMarkupContext();
+ V1MarkupContext markupContext = response.getMarkupContext();
ExtendedAssert.assertNotNull(markupContext);
ExtendedAssert.assertEquals("text/html", markupContext.getMimeType());
ExtendedAssert.assertEquals("title", markupContext.getPreferredTitle());
@@ -763,7 +764,7 @@
ExtendedAssert.assertEquals(markupString, markupContext.getMarkupString());
// Session context
- SessionContext sessionContext = response.getSessionContext();
+ V1SessionContext sessionContext = response.getSessionContext();
// The session information is should never be sent to the consumer, Cookies are
used instead.
ExtendedAssert.assertNull(sessionContext);
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/NeedPortletHandleTest.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/NeedPortletHandleTest.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/NeedPortletHandleTest.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,39 +1,39 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.protocol.v1;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPTypeFactory;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.GetServiceDescription;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidRegistrationFault;
-import org.oasis.wsrp.v1.MarkupResponse;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.OperationFailedFault;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.ServiceDescription;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1InvalidRegistrationFault;
+import org.oasis.wsrp.v1.V1MarkupResponse;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1ServiceDescription;
import java.rmi.RemoteException;
import java.util.ArrayList;
@@ -110,12 +110,12 @@
if (!war2Handles.containsKey(archiveName))
{
- GetServiceDescription getServiceDescription =
WSRPTypeFactory.createGetServiceDescription();
- ServiceDescription serviceDescription =
serviceDescriptionService.getServiceDescription(getServiceDescription);
- List<PortletDescription> offered =
serviceDescription.getOfferedPortlets();
+ V1GetServiceDescription getServiceDescription =
WSRP1TypeFactory.createGetServiceDescription();
+ V1ServiceDescription serviceDescription =
producer.getServiceDescription(getServiceDescription);
+ List<V1PortletDescription> offered =
serviceDescription.getOfferedPortlets();
if (offered != null)
{
- for (PortletDescription portletDescription : offered)
+ for (V1PortletDescription portletDescription : offered)
{
String handle = portletDescription.getPortletHandle();
String warName = handle.substring(1, handle.indexOf('.')) +
".war";
@@ -191,7 +191,7 @@
*
* @return a basic, valid GetMarkup object representing the markup request
*/
- protected GetMarkup createMarkupRequestForCurrentlyDeployedPortlet() throws Exception
+ protected V1GetMarkup createMarkupRequestForCurrentlyDeployedPortlet() throws
Exception
{
return createMarkupRequest(getHandleForCurrentlyDeployedArchive());
}
@@ -200,13 +200,13 @@
* @param handle
* @return
* @throws RemoteException
- * @throws InvalidRegistrationFault
- * @throws OperationFailedFault
+ * @throws V1InvalidRegistrationFault
+ * @throws V1OperationFailedFault
* @since 2.6.3
*/
- protected GetMarkup createMarkupRequest(String handle) throws RemoteException,
InvalidRegistration, OperationFailed
+ protected V1GetMarkup createMarkupRequest(String handle) throws RemoteException,
V1InvalidRegistration, V1OperationFailed
{
- GetMarkup getMarkup = WSRPTypeFactory.createDefaultMarkupRequest(handle);
+ V1GetMarkup getMarkup = WSRP1TypeFactory.createDefaultMarkupRequest(handle);
getMarkup.getMarkupParams().getMarkupCharacterSets().add(WSRPConstants.DEFAULT_CHARACTER_SET);
return getMarkup;
@@ -226,13 +226,13 @@
throw new IllegalArgumentException("Couldn't find a portlet handle
matching '" + partialHandle + "' in " +
currentlyDeployedArchiveName);
}
- protected GetMarkup createMarkupRequest() throws Exception
+ protected V1GetMarkup createMarkupRequest() throws Exception
{
return createMarkupRequestForCurrentlyDeployedPortlet();
}
- protected void checkSessionForCurrentlyDeployedPortlet(MarkupResponse response)
- throws RemoteException, InvalidRegistration, OperationFailed
+ protected void checkSessionForCurrentlyDeployedPortlet(V1MarkupResponse response)
+ throws RemoteException, V1InvalidRegistration, V1OperationFailed
{
// We don't send any portlet session information, just user cookies... The
producer takes care of the details
// What this means, though is that we don't have access to individual portlet
session ids... so we can only
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,55 +1,54 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.protocol.v1;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.ExtendedAssert;
-import org.oasis.wsrp.v1.AccessDenied;
-import org.oasis.wsrp.v1.ClonePortlet;
-import org.oasis.wsrp.v1.DestroyFailed;
-import org.oasis.wsrp.v1.DestroyPortlets;
-import org.oasis.wsrp.v1.DestroyPortletsResponse;
-import org.oasis.wsrp.v1.GetPortletDescription;
-import org.oasis.wsrp.v1.GetPortletProperties;
-import org.oasis.wsrp.v1.GetPortletPropertyDescription;
-import org.oasis.wsrp.v1.GetServiceDescription;
-import org.oasis.wsrp.v1.InconsistentParameters;
-import org.oasis.wsrp.v1.InvalidHandle;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.InvalidUserCategory;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletContext;
-import org.oasis.wsrp.v1.PortletDescriptionResponse;
-import org.oasis.wsrp.v1.PortletPropertyDescriptionResponse;
-import org.oasis.wsrp.v1.Property;
-import org.oasis.wsrp.v1.PropertyDescription;
-import org.oasis.wsrp.v1.PropertyList;
-import org.oasis.wsrp.v1.SetPortletProperties;
-import org.w3c.dom.Element;
+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.V1GetPortletDescription;
+import org.oasis.wsrp.v1.V1GetPortletProperties;
+import org.oasis.wsrp.v1.V1GetPortletPropertyDescription;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+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.V1ModelDescription;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletContext;
+import org.oasis.wsrp.v1.V1PortletDescriptionResponse;
+import org.oasis.wsrp.v1.V1PortletPropertyDescriptionResponse;
+import org.oasis.wsrp.v1.V1Property;
+import org.oasis.wsrp.v1.V1PropertyDescription;
+import org.oasis.wsrp.v1.V1PropertyList;
+import org.oasis.wsrp.v1.V1SetPortletProperties;
import java.util.ArrayList;
import java.util.Collections;
@@ -72,21 +71,21 @@
public void testClonePortlet() throws Exception
{
String handle = getDefaultHandle();
- PortletContext initialContext = WSRPTypeFactory.createPortletContext(handle);
+ V1PortletContext initialContext = WSRP1TypeFactory.createPortletContext(handle);
// first check that we get a new PortletContext
- PortletContext cloneContext = clonePortlet(handle);
+ V1PortletContext cloneContext = clonePortlet(handle);
ExtendedAssert.assertNotNull(cloneContext);
ExtendedAssert.assertFalse(initialContext.equals(cloneContext));
// then check that the initial state is identical
- GetPortletProperties getPortletProperties =
WSRPTypeFactory.createGetPortletProperties(null, cloneContext);
- List<Property> result =
portletManagementService.getPortletProperties(getPortletProperties).getProperties();
- getPortletProperties = WSRPTypeFactory.createGetPortletProperties(null,
initialContext);
-
checkGetPropertiesResponse(portletManagementService.getPortletProperties(getPortletProperties),
result);
+ V1GetPortletProperties getPortletProperties =
WSRP1TypeFactory.createGetPortletProperties(null, cloneContext);
+ List<V1Property> result =
producer.getPortletProperties(getPortletProperties).getProperties();
+ getPortletProperties = WSRP1TypeFactory.createGetPortletProperties(null,
initialContext);
+ checkGetPropertiesResponse(producer.getPortletProperties(getPortletProperties),
result);
// check that new clone is not listed in service description
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
checkServiceDescriptionWithOnlyBasicPortlet(gs);
}
@@ -95,14 +94,14 @@
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
String handle = getDefaultHandle();
- ClonePortlet clonePortlet = WSRPTypeFactory.createSimpleClonePortlet(handle);
+ V1ClonePortlet clonePortlet = WSRP1TypeFactory.createSimpleClonePortlet(handle);
try
{
- portletManagementService.clonePortlet(clonePortlet);
+ producer.clonePortlet(clonePortlet);
ExtendedAssert.fail("Should have thrown InvalidRegistrationFault");
}
- catch (InvalidRegistration invalidRegistrationFault)
+ catch (V1InvalidRegistration invalidRegistrationFault)
{
// expected
}
@@ -116,21 +115,21 @@
{
// first try to destroy POP, should fail
String handle = getDefaultHandle();
- DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(null,
Collections.<String>singletonList(handle));
- DestroyPortletsResponse response =
portletManagementService.destroyPortlets(destroyPortlets);
+ V1DestroyPortlets destroyPortlets = WSRP1TypeFactory.createDestroyPortlets(null,
Collections.<String>singletonList(handle));
+ V1DestroyPortletsResponse response = producer.destroyPortlets(destroyPortlets);
ExtendedAssert.assertNotNull(response);
- List<DestroyFailed> failures = response.getDestroyFailed();
+ List<V1DestroyFailed> failures = response.getDestroyFailed();
ExtendedAssert.assertNotNull(failures);
ExtendedAssert.assertEquals(1, failures.size());
- DestroyFailed failure = failures.get(0);
+ V1DestroyFailed failure = failures.get(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,
Collections.<String>singletonList(portletContext.getPortletHandle()));
- response = portletManagementService.destroyPortlets(destroyPortlets);
+ V1PortletContext portletContext = clonePortlet(handle);
+ destroyPortlets = WSRP1TypeFactory.createDestroyPortlets(null,
Collections.<String>singletonList(portletContext.getPortletHandle()));
+ response = producer.destroyPortlets(destroyPortlets);
ExtendedAssert.assertNotNull(response);
failures = response.getDestroyFailed();
ExtendedAssert.assertNull(failures);
@@ -141,14 +140,14 @@
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
String handle = getDefaultHandle();
- DestroyPortlets dp = WSRPTypeFactory.createDestroyPortlets(null,
Collections.<String>singletonList(handle));
+ V1DestroyPortlets dp = WSRP1TypeFactory.createDestroyPortlets(null,
Collections.<String>singletonList(handle));
try
{
- portletManagementService.destroyPortlets(dp);
+ producer.destroyPortlets(dp);
ExtendedAssert.fail("Should have thrown InvalidRegistrationFault");
}
- catch (InvalidRegistration invalidRegistrationFault)
+ catch (V1InvalidRegistration invalidRegistrationFault)
{
// expected
}
@@ -161,9 +160,9 @@
public void testGetPortletDescription() throws Exception
{
String handle = getDefaultHandle();
- GetPortletDescription gpd = WSRPTypeFactory.createGetPortletDescription(null,
handle);
+ V1GetPortletDescription gpd = WSRP1TypeFactory.createGetPortletDescription(null,
handle);
- PortletDescriptionResponse response =
portletManagementService.getPortletDescription(gpd);
+ V1PortletDescriptionResponse response = producer.getPortletDescription(gpd);
ExtendedAssert.assertNotNull(response);
checkBasicPortletDescription(response.getPortletDescription(), handle);
@@ -174,14 +173,14 @@
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
String handle = getDefaultHandle();
- GetPortletDescription gpd = WSRPTypeFactory.createGetPortletDescription(null,
handle);
+ V1GetPortletDescription gpd = WSRP1TypeFactory.createGetPortletDescription(null,
handle);
try
{
- portletManagementService.getPortletDescription(gpd);
+ producer.getPortletDescription(gpd);
ExtendedAssert.fail("Should have thrown InvalidRegistrationFault");
}
- catch (InvalidRegistration invalidRegistrationFault)
+ catch (V1InvalidRegistration invalidRegistrationFault)
{
// expected
}
@@ -194,47 +193,47 @@
public void testGetPortletPropertiesNoRegistration() throws Exception
{
String handle = getDefaultHandle();
- PortletContext initialContext = WSRPTypeFactory.createPortletContext(handle);
- GetPortletProperties getPortletProperties =
WSRPTypeFactory.createGetPortletProperties(null, initialContext);
+ V1PortletContext initialContext = WSRP1TypeFactory.createPortletContext(handle);
+ V1GetPortletProperties getPortletProperties =
WSRP1TypeFactory.createGetPortletProperties(null, initialContext);
List<String> names = getPortletProperties.getNames();
Collections.addAll(names, "prefName1", "prefName2");
- PropertyList response =
portletManagementService.getPortletProperties(getPortletProperties);
- List<Property> expected = new ArrayList<Property>(2);
- Collections.addAll(expected, WSRPTypeFactory.createProperty("prefName1",
"en", "prefValue1"),
- WSRPTypeFactory.createProperty("prefName2", "en",
"prefValue2"));
+ V1PropertyList response = producer.getPortletProperties(getPortletProperties);
+ List<V1Property> expected = new ArrayList<V1Property>(2);
+ Collections.addAll(expected, WSRP1TypeFactory.createProperty("prefName1",
"en", "prefValue1"),
+ WSRP1TypeFactory.createProperty("prefName2", "en",
"prefValue2"));
checkGetPropertiesResponse(response, expected);
names.clear();
- response = portletManagementService.getPortletProperties(getPortletProperties);
+ response = producer.getPortletProperties(getPortletProperties);
checkGetPropertiesResponse(response, expected);
names.add("prefName2");
- response = portletManagementService.getPortletProperties(getPortletProperties);
- checkGetPropertiesResponse(response,
Collections.<Property>singletonList(WSRPTypeFactory.createProperty("prefName2",
"en", "prefValue2")));
+ response = producer.getPortletProperties(getPortletProperties);
+ checkGetPropertiesResponse(response,
Collections.<V1Property>singletonList(WSRP1TypeFactory.createProperty("prefName2",
"en", "prefValue2")));
}
public void testGetPortletPropertyDescription() throws Exception
{
String handle = getDefaultHandle();
- GetPortletPropertyDescription getPortletPropertyDescription =
WSRPTypeFactory.createSimpleGetPortletPropertyDescription(handle);
+ V1GetPortletPropertyDescription getPortletPropertyDescription =
WSRP1TypeFactory.createSimpleGetPortletPropertyDescription(handle);
- PortletPropertyDescriptionResponse response =
portletManagementService.getPortletPropertyDescription(getPortletPropertyDescription);
+ V1PortletPropertyDescriptionResponse response =
producer.getPortletPropertyDescription(getPortletPropertyDescription);
- ModelDescription desc = response.getModelDescription();
+ V1ModelDescription desc = response.getModelDescription();
ExtendedAssert.assertNotNull(desc);
- List<PropertyDescription> propertyDescriptions =
desc.getPropertyDescriptions();
+ List<V1PropertyDescription> propertyDescriptions =
desc.getPropertyDescriptions();
ExtendedAssert.assertNotNull(propertyDescriptions);
- List<PropertyDescription> expected = new
ArrayList<PropertyDescription>(2);
- PropertyDescription description =
WSRPTypeFactory.createPropertyDescription("prefName1",
WSRPConstants.XSD_STRING);
- description.setHint(WSRPTypeFactory.createLocalizedString("prefName1"));
-
description.setLabel(WSRPTypeFactory.createLocalizedString("prefName1"));
+ List<V1PropertyDescription> expected = new
ArrayList<V1PropertyDescription>(2);
+ V1PropertyDescription description =
WSRP1TypeFactory.createPropertyDescription("prefName1",
WSRPConstants.XSD_STRING);
+
description.setHint(WSRP1TypeFactory.createLocalizedString("prefName1"));
+
description.setLabel(WSRP1TypeFactory.createLocalizedString("prefName1"));
expected.add(description);
- description = WSRPTypeFactory.createPropertyDescription("prefName2",
WSRPConstants.XSD_STRING);
- description.setHint(WSRPTypeFactory.createLocalizedString("prefName2"));
-
description.setLabel(WSRPTypeFactory.createLocalizedString("prefName2"));
+ description = WSRP1TypeFactory.createPropertyDescription("prefName2",
WSRPConstants.XSD_STRING);
+
description.setHint(WSRP1TypeFactory.createLocalizedString("prefName2"));
+
description.setLabel(WSRP1TypeFactory.createLocalizedString("prefName2"));
expected.add(description);
checkPropertyDescriptions(expected, propertyDescriptions);
@@ -245,14 +244,14 @@
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
String handle = getDefaultHandle();
- GetPortletPropertyDescription getPortletPropertyDescription =
WSRPTypeFactory.createSimpleGetPortletPropertyDescription(handle);
+ V1GetPortletPropertyDescription getPortletPropertyDescription =
WSRP1TypeFactory.createSimpleGetPortletPropertyDescription(handle);
try
{
-
portletManagementService.getPortletPropertyDescription(getPortletPropertyDescription);
+ producer.getPortletPropertyDescription(getPortletPropertyDescription);
ExtendedAssert.fail("Should have thrown InvalidRegistrationFault");
}
- catch (InvalidRegistration invalidRegistrationFault)
+ catch (V1InvalidRegistration invalidRegistrationFault)
{
// expected
}
@@ -266,25 +265,25 @@
{
String handle = getDefaultHandle();
- PortletContext portletContext = clonePortlet(handle);
- PropertyList propertyList = WSRPTypeFactory.createPropertyList();
- List<Property> properties = propertyList.getProperties();
- Collections.addAll(properties,
WSRPTypeFactory.createProperty("prefName1", "en",
"newPrefValue1"),
- WSRPTypeFactory.createProperty("prefName2", "en",
"newPrefValue2"));
- SetPortletProperties setPortletProperties =
WSRPTypeFactory.createSetPortletProperties(null, portletContext, propertyList);
+ V1PortletContext portletContext = clonePortlet(handle);
+ V1PropertyList propertyList = WSRP1TypeFactory.createPropertyList();
+ List<V1Property> properties = propertyList.getProperties();
+ Collections.addAll(properties,
WSRP1TypeFactory.createProperty("prefName1", "en",
"newPrefValue1"),
+ WSRP1TypeFactory.createProperty("prefName2", "en",
"newPrefValue2"));
+ V1SetPortletProperties setPortletProperties =
WSRP1TypeFactory.createSetPortletProperties(null, portletContext, propertyList);
- PortletContext response =
portletManagementService.setPortletProperties(setPortletProperties);
- GetPortletProperties getPortletProperties =
WSRPTypeFactory.createGetPortletProperties(null, response);
-
checkGetPropertiesResponse(portletManagementService.getPortletProperties(getPortletProperties),
properties);
+ V1PortletContext response = producer.setPortletProperties(setPortletProperties);
+ V1GetPortletProperties getPortletProperties =
WSRP1TypeFactory.createGetPortletProperties(null, response);
+ checkGetPropertiesResponse(producer.getPortletProperties(getPortletProperties),
properties);
- portletContext = WSRPTypeFactory.createPortletContext(handle);
+ portletContext = WSRP1TypeFactory.createPortletContext(handle);
setPortletProperties.setPortletContext(portletContext);
try
{
- response = portletManagementService.setPortletProperties(setPortletProperties);
+ response = producer.setPortletProperties(setPortletProperties);
ExtendedAssert.fail("Setting properties on Producer-Offered Portlet should
fail...");
}
- catch (InconsistentParameters expected)
+ catch (V1InconsistentParameters expected)
{
// expected
}
@@ -294,19 +293,19 @@
{
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
- PropertyList propertyList = WSRPTypeFactory.createPropertyList();
- List<Property> properties = propertyList.getProperties();
- Collections.addAll(properties,
WSRPTypeFactory.createProperty("prefName1", "en",
"newPrefValue1"),
- WSRPTypeFactory.createProperty("prefName2", "en",
"newPrefValue2"));
- SetPortletProperties setPortletProperties =
WSRPTypeFactory.createSetPortletProperties(null,
- WSRPTypeFactory.createPortletContext(getDefaultHandle()), propertyList);
+ V1PropertyList propertyList = WSRP1TypeFactory.createPropertyList();
+ List<V1Property> properties = propertyList.getProperties();
+ Collections.addAll(properties,
WSRP1TypeFactory.createProperty("prefName1", "en",
"newPrefValue1"),
+ WSRP1TypeFactory.createProperty("prefName2", "en",
"newPrefValue2"));
+ V1SetPortletProperties setPortletProperties =
WSRP1TypeFactory.createSetPortletProperties(null,
+ WSRP1TypeFactory.createPortletContext(getDefaultHandle()), propertyList);
try
{
- portletManagementService.setPortletProperties(setPortletProperties);
+ producer.setPortletProperties(setPortletProperties);
ExtendedAssert.fail("Should have thrown InvalidRegistrationFault");
}
- catch (InvalidRegistration invalidRegistration)
+ catch (V1InvalidRegistration invalidRegistration)
{
// expected
}
@@ -316,25 +315,25 @@
}
}
- private PortletContext clonePortlet(String handle) throws InvalidUserCategory,
InconsistentParameters,
- InvalidRegistration, MissingParameters, OperationFailed, AccessDenied,
InvalidHandle
+ private V1PortletContext clonePortlet(String handle) throws V1InvalidUserCategory,
V1InconsistentParameters,
+ V1InvalidRegistration, V1MissingParameters, V1OperationFailed, V1AccessDenied,
V1InvalidHandle
{
- ClonePortlet clonePortlet = WSRPTypeFactory.createSimpleClonePortlet(handle);
- return portletManagementService.clonePortlet(clonePortlet);
+ V1ClonePortlet clonePortlet = WSRP1TypeFactory.createSimpleClonePortlet(handle);
+ return producer.clonePortlet(clonePortlet);
}
- private List<Property> checkGetPropertiesResponse(PropertyList response,
List<Property> expected)
+ private List<V1Property> checkGetPropertiesResponse(V1PropertyList response,
List<V1Property> expected)
{
ExtendedAssert.assertNotNull(response);
- List<Property> properties = response.getProperties();
+ List<V1Property> properties = response.getProperties();
ExtendedAssert.assertEquals(expected.toArray(), properties.toArray(), false,
"Didn't receive expected properties!", new PropertyDecorator());
return properties;
}
- private void checkPropertyDescriptions(List<PropertyDescription> expected,
List<PropertyDescription> propertyDescriptions)
+ private void checkPropertyDescriptions(List<V1PropertyDescription> expected,
List<V1PropertyDescription> propertyDescriptions)
{
ExtendedAssert.assertEquals(expected.size(), propertyDescriptions.size());
- PropertyDescription propDesc = propertyDescriptions.get(0);
+ V1PropertyDescription propDesc = propertyDescriptions.get(0);
ExtendedAssert.assertNotNull(propDesc);
String name = propDesc.getName();
if ("prefName1".equals(name))
@@ -360,11 +359,11 @@
private static class PropertyDecorator implements ExtendedAssert.Decorator
{
- private Property prop;
+ private V1Property prop;
public void decorate(Object decorated)
{
- prop = (Property)decorated;
+ prop = (V1Property)decorated;
}
public boolean equals(Object o)
@@ -372,7 +371,7 @@
if (o instanceof ExtendedAssert.DecoratedObject)
{
ExtendedAssert.DecoratedObject decoratedObject =
(ExtendedAssert.DecoratedObject)o;
- Property that = (Property)decoratedObject.getDecorated();
+ V1Property that = (V1Property)decoratedObject.getDecorated();
String name = prop.getName();
if (name != null ? !name.equals(that.getName()) : that.getName() != null)
@@ -392,7 +391,7 @@
return false;
}
- List<Element> any = prop.getAny();
+ List<Object> any = prop.getAny();
return !(any != null ? !any.equals(that.getAny()) : that.getAny() != null);
}
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.protocol.v1;
@@ -27,19 +27,19 @@
import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.ExtendedAssert;
-import org.oasis.wsrp.v1.GetMarkup;
-import org.oasis.wsrp.v1.GetServiceDescription;
-import org.oasis.wsrp.v1.InvalidRegistration;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.ModifyRegistration;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PropertyDescription;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RegistrationData;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1InvalidRegistration;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1ModifyRegistration;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PropertyDescription;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
import javax.xml.namespace.QName;
import java.util.List;
@@ -79,28 +79,28 @@
public void testConsumerAgent() throws Exception
{
configureRegistrationSettings(true, false);
- RegistrationData regData = createBaseRegData();
+ V1RegistrationData regData = createBaseRegData();
regData.setConsumerAgent("invalid consumer agent");
try
{
- registrationService.register(regData);
+ producer.register(regData);
ExtendedAssert.fail("Trying to register with an invalid consumer agent
String should fail.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
}
regData.setConsumerAgent(WSRPConstants.CONSUMER_AGENT);
- registrationService.register(regData);
+ producer.register(regData);
}
- public void testRegistrationHandle() throws OperationFailed, MissingParameters,
RegistrationException
+ public void testRegistrationHandle() throws V1OperationFailed, V1MissingParameters,
RegistrationException
{
// check that a registration handle was created
- RegistrationContext rc = registerConsumer();
+ V1RegistrationContext rc = registerConsumer();
String registrationHandle = rc.getRegistrationHandle();
assertNotNull(registrationHandle);
@@ -122,35 +122,35 @@
{
// initiate registration
configureRegistrationSettings(true, false);
- RegistrationContext rc = registerConsumer();
+ V1RegistrationContext rc = registerConsumer();
// deregister
- registrationService.deregister(rc);
+ producer.deregister(rc);
// try to get markup, portlet handle doesn't matter since it should fail before
trying to retrieve the portlet
- GetMarkup getMarkup = WSRPTypeFactory.createDefaultMarkupRequest("foo");
+ V1GetMarkup getMarkup =
WSRP1TypeFactory.createDefaultMarkupRequest("foo");
getMarkup.getMarkupParams().getMarkupCharacterSets().add(WSRPConstants.DEFAULT_CHARACTER_SET);
try
{
- markupService.getMarkup(getMarkup);
+ producer.getMarkup(getMarkup);
ExtendedAssert.fail("Consumer tried to access info with a de-registered
context. Operations should fail.");
}
- catch (InvalidRegistration invalidRegistrationFault)
+ catch (V1InvalidRegistration invalidRegistrationFault)
{
// expected
}
// Get description with old registration context should fail
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
gs.setRegistrationContext(rc);
try
{
- serviceDescriptionService.getServiceDescription(gs);
+ producer.getServiceDescription(gs);
ExtendedAssert.fail("Required registration info has been modified:
operations should fail until registration is modified.");
}
- catch (InvalidRegistration invalidRegistrationFault)
+ catch (V1InvalidRegistration invalidRegistrationFault)
{
// expected
}
@@ -158,14 +158,14 @@
// Get description should still work without registration context
gs = getNoRegistrationServiceDescriptionRequest();
- ExtendedAssert.assertNotNull(serviceDescriptionService.getServiceDescription(gs));
+ ExtendedAssert.assertNotNull(producer.getServiceDescription(gs));
}
public void testModifyRegistration() throws Exception
{
// initiate registration
configureRegistrationSettings(true, false);
- RegistrationContext rc = registerConsumer();
+ V1RegistrationContext rc = registerConsumer();
// now modify Producer's set of required registration info
String newPropName = "New Prop";
@@ -175,16 +175,16 @@
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().addRegistrationProperty(regProp);
// try to get markup, portlet handle doesn't matter since it should fail before
trying to retrieve the portlet
- GetMarkup getMarkup = WSRPTypeFactory.createDefaultMarkupRequest("foo");
+ V1GetMarkup getMarkup =
WSRP1TypeFactory.createDefaultMarkupRequest("foo");
getMarkup.getMarkupParams().getMarkupCharacterSets().add(WSRPConstants.DEFAULT_CHARACTER_SET);
getMarkup.setRegistrationContext(rc);
try
{
- markupService.getMarkup(getMarkup);
+ producer.getMarkup(getMarkup);
ExtendedAssert.fail("Required registration info has been modified:
operations should fail until registration is modified.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
// WSRP primer recommends returning OperationFailedFault and NOT
InvalidRegistrationFault
@@ -192,15 +192,15 @@
}
// Get description should return information just as if consumer wasn't
registered
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
gs.setRegistrationContext(rc);
try
{
- serviceDescriptionService.getServiceDescription(gs);
+ producer.getServiceDescription(gs);
ExtendedAssert.fail("Required registration info has been modified:
operations should fail until registration is modified.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
// WSRP primer recommends returning OperationFailedFault and NOT
InvalidRegistrationFault
@@ -209,12 +209,12 @@
// remove registration context, try again and check that we get new registration
info
gs.setRegistrationContext(null);
- List<PropertyDescription> pds =
serviceDescriptionService.getServiceDescription(gs)
+ List<V1PropertyDescription> pds = producer.getServiceDescription(gs)
.getRegistrationPropertyDescription().getPropertyDescriptions();
ExtendedAssert.assertEquals(2, pds.size());
// Check that one of the returned property description is equal to the one we just
added
- PropertyDescription description = pds.get(1);
+ V1PropertyDescription description = pds.get(1);
if (description.getName().startsWith("New"))
{
assertEquals(WSRPUtils.convertToPropertyDescription(regProp), description);
@@ -225,14 +225,14 @@
}
// Update registration data
- RegistrationData regData = createBaseRegData();
- regData.getRegistrationProperties().add(WSRPTypeFactory.createProperty(newPropName,
"en", "blah"));
+ V1RegistrationData regData = createBaseRegData();
+
regData.getRegistrationProperties().add(WSRP1TypeFactory.createProperty(newPropName,
"en", "blah"));
// Modify registration and get service description
- ModifyRegistration registration = new ModifyRegistration();
+ V1ModifyRegistration registration = new V1ModifyRegistration();
registration.setRegistrationContext(rc);
registration.setRegistrationData(regData);
- registrationService.modifyRegistration(registration);
+ producer.modifyRegistration(registration);
gs.setRegistrationContext(rc);
checkServiceDescriptionWithOnlyBasicPortlet(gs);
}
@@ -241,7 +241,7 @@
{
// initiate registration
configureRegistrationSettings(true, false);
- RegistrationContext rc = registerConsumer();
+ V1RegistrationContext rc = registerConsumer();
// now modify Producer's set of required registration info
String newPropName = "New Prop";
@@ -252,13 +252,13 @@
try
{
- ModifyRegistration registration = new ModifyRegistration();
+ V1ModifyRegistration registration = new V1ModifyRegistration();
registration.setRegistrationContext(rc);
registration.setRegistrationData(createBaseRegData());
- registrationService.modifyRegistration(registration);
+ producer.modifyRegistration(registration);
ExtendedAssert.fail("Passing incorrect data should fail");
}
- catch (OperationFailed operationFailed)
+ catch (V1OperationFailed operationFailed)
{
// expected
}
@@ -269,9 +269,9 @@
configureRegistrationSettings(true, false);
// service description request without registration info
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
- RegistrationContext registrationContext = registerConsumer();
+ V1RegistrationContext registrationContext = registerConsumer();
ExtendedAssert.assertNotNull(registrationContext);
ExtendedAssert.assertNotNull(registrationContext.getRegistrationHandle());
@@ -289,7 +289,7 @@
registerConsumer();
ExtendedAssert.fail("Shouldn't be possible to register if no
registration is required.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
}
@@ -301,10 +301,10 @@
try
{
- registrationService.deregister(null);
+ producer.deregister(null);
ExtendedAssert.fail("Shouldn't be possible to deregister if no
registration is required.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
}
@@ -316,10 +316,10 @@
try
{
- registrationService.modifyRegistration(null);
+ producer.modifyRegistration(null);
ExtendedAssert.fail("Shouldn't be possible to modify registration if no
registration is required.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
}
@@ -331,10 +331,10 @@
try
{
- registrationService.modifyRegistration(null);
+ producer.modifyRegistration(null);
ExtendedAssert.fail("Shouldn't be possible to modify registration if no
registration is required.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
}
@@ -350,10 +350,10 @@
try
{
- registrationService.deregister(null);
+ producer.deregister(null);
ExtendedAssert.fail("Shouldn't be possible to modify registration if no
registration is required.");
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected
}
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ReleaseSessionTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ReleaseSessionTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ReleaseSessionTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,34 +1,34 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.protocol.v1;
-import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.ExtendedAssert;
import org.jboss.logging.Logger;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.ReleaseSessions;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1ReleaseSessions;
import java.util.Arrays;
import java.util.List;
@@ -62,8 +62,8 @@
public void testReleaseSession() throws Exception
{
// possible registration contexts are: actual RegistrationContext, null, and a made
up value
- RegistrationContext fakeRegContext =
WSRPTypeFactory.createRegistrationContext("Fake Registration Handle");
- RegistrationContext[] regContexts = new RegistrationContext[]{null, null,
fakeRegContext};
+ V1RegistrationContext fakeRegContext =
WSRP1TypeFactory.createRegistrationContext("Fake Registration Handle");
+ V1RegistrationContext[] regContexts = new V1RegistrationContext[]{null, null,
fakeRegContext};
// possible types of sessionIDs include null and a made up value.
// Note: a valid session id cannot be used since the sessionID should never be sent
to the consumer
@@ -81,14 +81,14 @@
{
for (String[] sessionID : sessionIDs)
{
- ReleaseSessions releaseSession =
WSRPTypeFactory.createReleaseSessions(regContexts[i], Arrays.asList(sessionID));
+ V1ReleaseSessions releaseSession =
WSRP1TypeFactory.createReleaseSessions(regContexts[i], Arrays.asList(sessionID));
releaseSessions(releaseSession, false, i);
releaseSessions(releaseSession, true, i);
}
}
}
- private void releaseSessions(ReleaseSessions releaseSessions, boolean useRegistration,
int index) throws Exception
+ private void releaseSessions(V1ReleaseSessions releaseSessions, boolean
useRegistration, int index) throws Exception
{
setUp();
try
@@ -106,10 +106,10 @@
}
}
log.info(getSetupString(releaseSessions));
- markupService.releaseSessions(releaseSessions);
+ producer.releaseSessions(releaseSessions);
ExtendedAssert.fail("ReleaseSessions did not thrown an OperationFailed
Fault." + getSetupString(releaseSessions));
}
- catch (OperationFailed operationFailedFault)
+ catch (V1OperationFailed operationFailedFault)
{
// expected fault.
}
@@ -119,7 +119,7 @@
}
}
- private String getSetupString(ReleaseSessions releaseSessions)
+ private String getSetupString(V1ReleaseSessions releaseSessions)
{
StringBuffer message = new StringBuffer("ReleaseSessions Setup:\n");
@@ -129,7 +129,7 @@
}
else
{
- RegistrationContext regContext = releaseSessions.getRegistrationContext();
+ V1RegistrationContext regContext = releaseSessions.getRegistrationContext();
List<String> sessionIDs = releaseSessions.getSessionIDs();
message.append(" RegistrationContext : ").append(regContext != null ?
regContext.getRegistrationHandle() : null);
message.append(" | SessionIDs : ");
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.
+ */
/*
* JBoss, the OpenSource J2EE webOS
@@ -32,10 +32,10 @@
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
import org.gatein.wsrp.test.ExtendedAssert;
-import org.oasis.wsrp.v1.GetServiceDescription;
-import org.oasis.wsrp.v1.ModelDescription;
-import org.oasis.wsrp.v1.PropertyDescription;
-import org.oasis.wsrp.v1.ServiceDescription;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1ModelDescription;
+import org.oasis.wsrp.v1.V1PropertyDescription;
+import org.oasis.wsrp.v1.V1ServiceDescription;
import java.util.List;
@@ -58,9 +58,9 @@
{
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(false);
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
- ServiceDescription sd = checkServiceDescriptionWithOnlyBasicPortlet(gs);
+ V1ServiceDescription sd = checkServiceDescriptionWithOnlyBasicPortlet(gs);
// registration is not required
ExtendedAssert.assertFalse(sd.isRequiresRegistration());
@@ -74,10 +74,10 @@
RegistrationPropertyDescription regProp = configureRegistrationSettings(true,
false);
// service description request without registration info
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
//Invoke the Web Service
- ServiceDescription sd = serviceDescriptionService.getServiceDescription(gs);
+ V1ServiceDescription sd = producer.getServiceDescription(gs);
ExtendedAssert.assertNotNull(sd);
ExtendedAssert.assertTrue(sd.isRequiresRegistration());
@@ -93,10 +93,10 @@
RegistrationPropertyDescription regProp = configureRegistrationSettings(true,
true);
// service description request without registration info
- GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
//Invoke the Web Service, we should have the complete description
- ServiceDescription sd = checkServiceDescriptionWithOnlyBasicPortlet(gs);
+ V1ServiceDescription sd = checkServiceDescriptionWithOnlyBasicPortlet(gs);
ExtendedAssert.assertNotNull(sd);
ExtendedAssert.assertTrue(sd.isRequiresRegistration());
@@ -108,24 +108,24 @@
{
try
{
- GetServiceDescription gsd = getNoRegistrationServiceDescriptionRequest();
+ V1GetServiceDescription gsd = getNoRegistrationServiceDescriptionRequest();
deploy("test-basic-portlet.war");
- ServiceDescription sd = serviceDescriptionService.getServiceDescription(gsd);
+ V1ServiceDescription sd = producer.getServiceDescription(gsd);
ExtendedAssert.assertEquals(1, sd.getOfferedPortlets().size());
deploy("test-markup-portlet.war");
- sd = serviceDescriptionService.getServiceDescription(gsd);
+ sd = producer.getServiceDescription(gsd);
// should now have 2 offered portlets
ExtendedAssert.assertEquals(2, sd.getOfferedPortlets().size());
deploy("test-session-portlet.war");
- sd = serviceDescriptionService.getServiceDescription(gsd);
+ sd = producer.getServiceDescription(gsd);
// should now have 3 offered portlets
ExtendedAssert.assertEquals(3, sd.getOfferedPortlets().size());
undeploy("test-markup-portlet.war");
- sd = serviceDescriptionService.getServiceDescription(gsd);
+ sd = producer.getServiceDescription(gsd);
// should now have only 2 offered portlets again
ExtendedAssert.assertEquals(2, sd.getOfferedPortlets().size());
@@ -141,11 +141,11 @@
}
}
- private void checkRequiredRegistrationProperties(ServiceDescription sd,
RegistrationPropertyDescription regProp)
+ private void checkRequiredRegistrationProperties(V1ServiceDescription sd,
RegistrationPropertyDescription regProp)
{
- ModelDescription registrationPropertyDescription =
sd.getRegistrationPropertyDescription();
+ V1ModelDescription registrationPropertyDescription =
sd.getRegistrationPropertyDescription();
ExtendedAssert.assertNotNull(registrationPropertyDescription);
- List<PropertyDescription> propertyDescriptions =
registrationPropertyDescription.getPropertyDescriptions();
+ List<V1PropertyDescription> propertyDescriptions =
registrationPropertyDescription.getPropertyDescriptions();
ExtendedAssert.assertNotNull(propertyDescriptions);
ExtendedAssert.assertEquals(1, propertyDescriptions.size());
assertEquals(WSRPUtils.convertToPropertyDescription(regProp),
propertyDescriptions.get(0));
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.protocol.v1;
@@ -28,21 +28,22 @@
import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
import org.gatein.wsrp.WSRPConstants;
-import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.producer.WSRPProducerBaseTest;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.gatein.wsrp.producer.v1.WSRP1Producer;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import org.gatein.wsrp.spec.v1.WSRP1TypeFactory;
import org.gatein.wsrp.test.ExtendedAssert;
-import org.oasis.wsrp.v1.GetServiceDescription;
-import org.oasis.wsrp.v1.LocalizedString;
-import org.oasis.wsrp.v1.MarkupType;
-import org.oasis.wsrp.v1.MissingParameters;
-import org.oasis.wsrp.v1.OperationFailed;
-import org.oasis.wsrp.v1.PortletDescription;
-import org.oasis.wsrp.v1.PropertyDescription;
-import org.oasis.wsrp.v1.RegistrationContext;
-import org.oasis.wsrp.v1.RegistrationData;
-import org.oasis.wsrp.v1.ServiceDescription;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1LocalizedString;
+import org.oasis.wsrp.v1.V1MarkupType;
+import org.oasis.wsrp.v1.V1MissingParameters;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1PropertyDescription;
+import org.oasis.wsrp.v1.V1RegistrationContext;
+import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1ServiceDescription;
import javax.xml.namespace.QName;
import java.util.ArrayList;
@@ -57,7 +58,9 @@
public abstract class V1ProducerBaseTest extends WSRPProducerBaseTest
{
private static final String CONSUMER = "test-consumer";
+ protected WSRP1Producer producer;
+
public V1ProducerBaseTest() throws Exception
{
this("V1ProducerBaseTest");
@@ -89,7 +92,7 @@
* @param desc the tested PortletDescription
* @param handle the PortletHandle to be checked
*/
- public void checkBasicPortletDescription(PortletDescription desc, String handle)
+ public void checkBasicPortletDescription(V1PortletDescription desc, String handle)
{
ExtendedAssert.assertNotNull(desc);
/**
@@ -102,39 +105,39 @@
ExtendedAssert.assertEquals(handle, desc.getPortletHandle());
}
ExtendedAssert.assertEquals("title", desc.getTitle().getValue());
- List<MarkupType> markupTypes = desc.getMarkupTypes();
+ List<V1MarkupType> markupTypes = desc.getMarkupTypes();
ExtendedAssert.assertEquals(1, markupTypes.size());
- MarkupType markupType = markupTypes.get(0);
+ V1MarkupType markupType = markupTypes.get(0);
List<String> states = new ArrayList<String>(3);
states.add(WSRPConstants.NORMAL_WINDOW_STATE);
states.add(WSRPConstants.MAXIMIZED_WINDOW_STATE);
states.add(WSRPConstants.MINIMIZED_WINDOW_STATE);
- MarkupType expected = WSRPTypeFactory.createMarkupType("text/html",
+ V1MarkupType expected = WSRP1TypeFactory.createMarkupType("text/html",
Collections.<String>singletonList(WSRPConstants.VIEW_MODE), states,
Collections.<String>singletonList("en"));
assertEquals(expected, markupType);
}
- protected ServiceDescription
checkServiceDescriptionWithOnlyBasicPortlet(GetServiceDescription gs)
+ protected V1ServiceDescription
checkServiceDescriptionWithOnlyBasicPortlet(V1GetServiceDescription gs)
throws Exception
{
deploy("test-basic-portlet.war");
//Invoke the Web Service
- ServiceDescription sd = producer.getServiceDescription(gs);
+ V1ServiceDescription sd = producer.getServiceDescription(gs);
ExtendedAssert.assertNotNull("sd != null", sd);
// Check offered portlets
- List<PortletDescription> offeredPortlets = sd.getOfferedPortlets();
+ List<V1PortletDescription> offeredPortlets = sd.getOfferedPortlets();
ExtendedAssert.assertNotNull(offeredPortlets);
- for (PortletDescription offeredPortlet : offeredPortlets)
+ for (V1PortletDescription offeredPortlet : offeredPortlets)
{
System.out.println("handle " + offeredPortlet.getPortletHandle());
}
ExtendedAssert.assertEquals(1, offeredPortlets.size());
// Check portlet description
- PortletDescription desc = offeredPortlets.get(0);
+ V1PortletDescription desc = offeredPortlets.get(0);
checkBasicPortletDescription(desc, null);
@@ -142,17 +145,17 @@
return sd; // for further testing...
}
- protected RegistrationContext registerConsumer() throws OperationFailed,
MissingParameters
+ protected V1RegistrationContext registerConsumer() throws V1OperationFailed,
V1MissingParameters
{
- RegistrationData registrationData = createBaseRegData();
+ V1RegistrationData registrationData = createBaseRegData();
return producer.register(registrationData);
}
- protected RegistrationData createBaseRegData()
+ protected V1RegistrationData createBaseRegData()
{
- RegistrationData regData = WSRPTypeFactory.createDefaultRegistrationData();
+ V1RegistrationData regData = WSRP1TypeFactory.createDefaultRegistrationData();
regData.setConsumerName(CONSUMER);
-
regData.getRegistrationProperties().add(WSRPTypeFactory.createProperty("regProp",
"en", "regValue"));
+
regData.getRegistrationProperties().add(WSRP1TypeFactory.createProperty("regProp",
"en", "regValue"));
return regData;
}
@@ -209,9 +212,9 @@
registrationRequirements.removeRegistrationPropertyChangeListener(producer.getRegistrationManager());
}
- protected GetServiceDescription getNoRegistrationServiceDescriptionRequest()
+ protected V1GetServiceDescription getNoRegistrationServiceDescriptionRequest()
{
- GetServiceDescription gs = WSRPTypeFactory.createGetServiceDescription();
+ V1GetServiceDescription gs = WSRP1TypeFactory.createGetServiceDescription();
gs.getDesiredLocales().add("en-US");
gs.getDesiredLocales().add("en");
return gs;
@@ -219,7 +222,7 @@
/** === asserts === * */
- protected static void assertEquals(MarkupType expected, MarkupType tested)
+ protected static void assertEquals(V1MarkupType expected, V1MarkupType tested)
{
String message = "Expected: <" + expected + ">, got:
<" + tested + ">. Failed on: ";
@@ -238,7 +241,7 @@
}
}
- protected static void assertEquals(PropertyDescription expected, PropertyDescription
tested)
+ protected static void assertEquals(V1PropertyDescription expected,
V1PropertyDescription tested)
{
String message = "Expected: <" + expected + ">, got:
<" + tested + ">. Failed on ";
@@ -257,7 +260,7 @@
}
}
- protected static void assertEquals(String message, LocalizedString expected,
LocalizedString tested)
+ protected static void assertEquals(String message, V1LocalizedString expected,
V1LocalizedString tested)
{
String precise = "Expected: <" + expected + ">, got:
<" + tested + ">. Failed on ";
Modified:
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/WSRPBaseEndpoint.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/WSRPBaseEndpoint.java 2010-05-26
11:24:50 UTC (rev 3202)
+++
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/WSRPBaseEndpoint.java 2010-05-26
16:33:07 UTC (rev 3203)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -24,7 +24,7 @@
package org.gatein.wsrp.endpoints;
import org.gatein.wsrp.producer.ProducerHolder;
-import org.gatein.wsrp.producer.WSRPProducer;
+import org.gatein.wsrp.producer.v2.WSRP2Producer;
import org.gatein.wsrp.servlet.ServletAccess;
import javax.servlet.http.HttpSession;
@@ -54,5 +54,5 @@
}*/
}
- protected WSRPProducer producer;
+ protected WSRP2Producer producer;
}