Author: chris.laprun(a)jboss.com
Date: 2008-07-07 11:56:08 -0400 (Mon, 07 Jul 2008)
New Revision: 11317
Added:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPValidator.java
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestProducerBehavior.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPConstants.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
Log:
- Encapsulated access to default locales and MIME types and return copies on WSRPConstants
to prevent client-side modification.
- Encapsulated validation mode handling in WSRPValidator class.
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestProducerBehavior.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestProducerBehavior.java 2008-07-07
12:56:40 UTC (rev 11316)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestProducerBehavior.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -61,7 +61,7 @@
PortletDescription portletDesc = new PortletDescription();
portletDesc.setPortletHandle(portletHandle);
portletDesc.setMarkupTypes(new MarkupType[]{new
MarkupType(MediaType.TEXT_HTML.getValue(), new String[]{WSRPConstants.VIEW_MODE},
- new String[]{WSRPConstants.NORMAL_WINDOW_STATE}, WSRPConstants.DEFAULT_LOCALES,
null)});
+ new String[]{WSRPConstants.NORMAL_WINDOW_STATE},
WSRPConstants.getDefaultLocales(), null)});
String suffixString = suffix == null ? "" : suffix;
portletDesc.setDescription(ServiceObjectFactory.createLocalizedString(ServiceObjectFactory.SAMPLE_DESCRIPTION
+ suffixString));
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2008-07-07
12:56:40 UTC (rev 11316)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -65,6 +65,7 @@
import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
+import org.jboss.portal.wsrp.producer.WSRPValidator;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -131,7 +132,7 @@
// ServiceDescription implementation
********************************************************************************
public ServiceDescription getServiceDescription(GetServiceDescription gs)
- throws InvalidRegistrationFault, OperationFailedFault, RemoteException
+ throws InvalidRegistrationFault, OperationFailedFault, RemoteException
{
return getServiceDescriptionBehavior().getServiceDescription(gs);
}
@@ -139,35 +140,35 @@
// MarkupService implementation
*************************************************************************************
public MarkupResponse getMarkup(GetMarkup getMarkup)
- throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
- InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
- OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
- UnsupportedMimeTypeFault, RemoteException
+ throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
+ InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
+ OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
+ UnsupportedMimeTypeFault, RemoteException
{
return getMarkupBehaviorFor(getMarkup.getPortletContext().getPortletHandle())
- .getMarkup(getMarkup);
+ .getMarkup(getMarkup);
}
public BlockingInteractionResponse
performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
- throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault,
OperationFailedFault,
- UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault,
PortletStateChangeRequiredFault,
- InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
- InvalidHandleFault, InvalidCookieFault, RemoteException
+ throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault,
OperationFailedFault,
+ UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault,
PortletStateChangeRequiredFault,
+ InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ InvalidHandleFault, InvalidCookieFault, RemoteException
{
return
getMarkupBehaviorFor(performBlockingInteraction.getPortletContext().getPortletHandle())
- .performBlockingInteraction(performBlockingInteraction);
+ .performBlockingInteraction(performBlockingInteraction);
}
public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
- throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault,
AccessDeniedFault, RemoteException
+ throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault,
AccessDeniedFault, RemoteException
{
return null;
}
public ReturnAny initCookie(InitCookie initCookie)
- throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
+ throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
{
// should only be called if we required cookies to be initialized
if (requiresInitCookie == null || CookieProtocol.none.equals(requiresInitCookie))
@@ -205,8 +206,8 @@
// PortletManagement implementation
*********************************************************************************
public PortletDescriptionResponse getPortletDescription(GetPortletDescription
getPortletDescription)
- throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
- MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
+ throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
{
return
getPortletManagementBehavior().getPortletDescription(getPortletDescription);
}
@@ -283,6 +284,6 @@
public void usingStrictModeChangedTo(boolean strictMode)
{
- throw new UnsupportedOperationException("usingStrictModeChangedTo not
implemented");
+ WSRPValidator.setStrict(strictMode);
}
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPConstants.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPConstants.java 2008-07-07
12:56:40 UTC (rev 11316)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPConstants.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -118,26 +118,14 @@
/** Default character set used to generate markup. */
public static final String DEFAULT_CHARACTER_SET = "UTF-8";
- /** Default locales. */
- public static final String[] DEFAULT_LOCALES;
-
- static
- {
- String defaultLocale = WSRPUtils.toString(Locale.getDefault());
- DEFAULT_LOCALES = new String[]{defaultLocale, "en"};
- }
-
- /** Default MIME types. */
- public static final String[] DEFAULT_MIME_TYPES = new
String[]{"text/html"};
-
// Registration data related
****************************************************************************************
/** Default consumer name if none has been provided in the WSRP descriptor
(*-wsrp.xml) */
public static final String DEFAULT_CONSUMER_NAME;
/** The String identifying the portal consumer agent */
public static final String CONSUMER_AGENT = PortalConstants.VERSION.getName() +
"."
- + PortalConstants.VERSION.getMajor() + "." +
PortalConstants.VERSION.getMinor() + "."
- + PortalConstants.VERSION.getQualifier();
+ + PortalConstants.VERSION.getMajor() + "." +
PortalConstants.VERSION.getMinor() + "."
+ + PortalConstants.VERSION.getQualifier();
static
{
@@ -182,4 +170,17 @@
private WSRPConstants()
{
}
+
+ // init default locale at loading time as it is slow
+ private static String defaultLocale = WSRPUtils.toString(Locale.getDefault());
+
+ public static String[] getDefaultLocales()
+ {
+ return new String[]{defaultLocale, "en"}; // return copy to prevent
modifications by client code
+ }
+
+ public static String[] getDefaultMimeTypes()
+ {
+ return new String[]{"text/html"}; // return copy to prevent modifications
by client code
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2008-07-07
12:56:40 UTC (rev 11316)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -25,7 +25,6 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.net.media.MediaType;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.ActionURL;
@@ -147,7 +146,7 @@
public static PerformBlockingInteraction
createDefaultPerformBlockingInteraction(String portletHandle)
{
return createPerformBlockingInteraction(createPortletContext(portletHandle),
createDefaultRuntimeContext(), createDefaultMarkupParams(),
- createDefaultInteractionParams());
+ createDefaultInteractionParams());
}
/**
@@ -161,9 +160,9 @@
* @return
*/
public static PerformBlockingInteraction createPerformBlockingInteraction(
- PortletContext portletContext, RuntimeContext runtimeContext,
- MarkupParams markupParams,
- InteractionParams interactionParams)
+ PortletContext portletContext, RuntimeContext runtimeContext,
+ MarkupParams markupParams,
+ InteractionParams interactionParams)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletContext.getPortletHandle(),
"portlet handle", "PortletContext");
@@ -172,7 +171,7 @@
ParameterValidation.throwIllegalArgExceptionIfNull(interactionParams,
"InteractionParams");
return new PerformBlockingInteraction(null, portletContext, runtimeContext, null,
- markupParams, interactionParams);
+ markupParams, interactionParams);
}
/**
@@ -287,20 +286,20 @@
if (portletHandle.length() > 255)
{
throw new IllegalArgumentException("Portlet handles must be less than 255
characters long. Was "
- + portletHandle.length() + " long.");
+ + portletHandle.length() + " long.");
}
}
/**
- * Same as createMarkupParams(false, {@link WSRPConstants#DEFAULT_LOCALES}, {@link
WSRPConstants#DEFAULT_MIME_TYPES},
- * {@link WSRPConstants#VIEW_MODE}, {@link WSRPConstants#NORMAL_WINDOW_STATE})
+ * Same as createMarkupParams(false, {@link WSRPConstants#getDefaultLocales()},
{@link
+ * WSRPConstants#getDefaultMimeTypes()}, {@link WSRPConstants#VIEW_MODE}, {@link
WSRPConstants#NORMAL_WINDOW_STATE})
*
* @return
*/
public static MarkupParams createDefaultMarkupParams()
{
- return createMarkupParams(false, WSRPConstants.DEFAULT_LOCALES,
WSRPConstants.DEFAULT_MIME_TYPES,
- WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE);
+ return createMarkupParams(false, WSRPConstants.getDefaultLocales(),
WSRPConstants.getDefaultMimeTypes(),
+ WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE);
}
/**
@@ -321,7 +320,7 @@
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(windowState, "window
state", "MarkupParams");
return new MarkupParams(secureClientCommunication, locales, mimeTypes, mode,
windowState, null, null, null,
- null, null, null, null);
+ null, null, null, null);
}
/**
@@ -470,11 +469,11 @@
* markupBinary(xsd:base64Binary)), locale(xsd:string)?,
requiresUrlRewriting(xsd:boolean[false])?,
* cacheControl(CacheControl)?, preferredTitle(xsd:string)?, extensions(Extension)*
*
- * @param 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.
+ * @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 MarkupContext createMarkupContext(String mediaType, byte[]
markupBinary)
@@ -552,7 +551,7 @@
public static RegistrationData createDefaultRegistrationData()
{
return new RegistrationData(WSRPConstants.DEFAULT_CONSUMER_NAME,
WSRPConstants.CONSUMER_AGENT, false, null, null,
- null, null, null, null);
+ null, null, null, null);
}
/**
@@ -673,7 +672,7 @@
if (expires < -1)
{
throw new IllegalArgumentException("Cache expiration time must be greater
than -1, " +
- "-1 indicating that the cache will never expire.");
+ "-1 indicating that the cache will never expire.");
}
return new CacheControl(expires, userScope, null, null);
@@ -833,9 +832,9 @@
* @since 2.6
*/
public static SetPortletProperties createSetPortletProperties(
- RegistrationContext registrationContext,
- PortletContext portletContext,
- PropertyList propertyList)
+ RegistrationContext registrationContext,
+ PortletContext portletContext,
+ PropertyList propertyList)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext,
"PortletContext");
ParameterValidation.throwIllegalArgExceptionIfNull(propertyList,
"PropertyList");
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-07-07
12:56:40 UTC (rev 11316)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -710,7 +710,7 @@
//todo: might need to implement customization of default service description
GetServiceDescription gsd = WSRPTypeFactory.createGetServiceDescription();
- gsd.setDesiredLocales(WSRPConstants.DEFAULT_LOCALES);
+ gsd.setDesiredLocales(WSRPConstants.getDefaultLocales());
if (asUnregistred)
{
return gsd;
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-07-07
12:56:40 UTC (rev 11316)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -34,13 +34,10 @@
import org.jboss.portal.registration.Registration;
import org.jboss.portal.registration.RegistrationLocal;
import org.jboss.portal.registration.RegistrationManager;
-import org.jboss.portal.registration.RegistrationUtils;
import org.jboss.portal.wsrp.ResponseDebugFactory;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPExceptionFactory;
-import org.jboss.portal.wsrp.WSRPPortletURL;
import org.jboss.portal.wsrp.WSRPProducer;
-import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
import org.jboss.portal.wsrp.core.ClonePortlet;
@@ -126,7 +123,7 @@
private CookieProtocol requiresInitCookie = CookieProtocol.none;
/** Supported locales. */
- private String[] supportedLocales = WSRPConstants.DEFAULT_LOCALES;
+ private String[] supportedLocales = WSRPConstants.getDefaultLocales();
private ProducerConfigurationService configurationService;
@@ -146,7 +143,7 @@
// ServiceDescription implementation
********************************************************************************
public ServiceDescription getServiceDescription(GetServiceDescription gs)
- throws InvalidRegistrationFault, OperationFailedFault, RemoteException
+ throws InvalidRegistrationFault, OperationFailedFault, RemoteException
{
log.debug("getServiceDescription invoked");
ServiceDescription sd = serviceDescriptionHandler.getServiceDescription(gs);
@@ -173,10 +170,10 @@
// MarkupService implementation
*************************************************************************************
public MarkupResponse getMarkup(GetMarkup getMarkup)
- throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
- InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
- OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
- UnsupportedMimeTypeFault, RemoteException
+ throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
+ InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
+ OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
+ UnsupportedMimeTypeFault, RemoteException
{
log.debug("getMarkup invoked");
MarkupResponse response = markupHandler.getMarkup(getMarkup);
@@ -185,10 +182,10 @@
}
public BlockingInteractionResponse
performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
- throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault,
OperationFailedFault,
- UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault,
PortletStateChangeRequiredFault,
- InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
- InvalidHandleFault, InvalidCookieFault, RemoteException
+ throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault,
OperationFailedFault,
+ UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault,
PortletStateChangeRequiredFault,
+ InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ InvalidHandleFault, InvalidCookieFault, RemoteException
{
log.debug("performBlockingInteraction invoked");
BlockingInteractionResponse interactionResponse =
markupHandler.performBlockingInteraction(performBlockingInteraction);
@@ -197,7 +194,7 @@
}
public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
- throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault,
AccessDeniedFault, RemoteException
+ throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault,
AccessDeniedFault, RemoteException
{
log.debug("releaseSessions invoked");
ReturnAny returnAny = markupHandler.releaseSessions(releaseSessions);
@@ -206,7 +203,7 @@
}
public ReturnAny initCookie(InitCookie initCookie)
- throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
+ throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
{
log.debug("initCookie invoked");
ReturnAny returnAny = markupHandler.initCookie(initCookie);
@@ -217,7 +214,7 @@
// Registration implementation
**************************************************************************************
public RegistrationContext register(RegistrationData register) throws
MissingParametersFault, OperationFailedFault,
- RemoteException
+ RemoteException
{
log.debug("register invoked");
RegistrationContext registrationContext = registrationHandler.register(register);
@@ -226,7 +223,7 @@
}
public ReturnAny deregister(RegistrationContext deregister) throws
OperationFailedFault, InvalidRegistrationFault,
- RemoteException
+ RemoteException
{
log.debug("deregister invoked");
ReturnAny returnAny = registrationHandler.deregister(deregister);
@@ -235,7 +232,7 @@
}
public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
throws MissingParametersFault,
- OperationFailedFault, InvalidRegistrationFault, RemoteException
+ OperationFailedFault, InvalidRegistrationFault, RemoteException
{
log.debug("modifyRegistration invoked");
RegistrationState registrationState =
registrationHandler.modifyRegistration(modifyRegistration);
@@ -307,8 +304,8 @@
// PortletManagement implementation
*********************************************************************************
public PortletDescriptionResponse getPortletDescription(GetPortletDescription
getPortletDescription)
- throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
- MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
+ throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
{
log.debug("getPortletDescription invoked");
PortletDescriptionResponse description =
portletManagementHandler.getPortletDescription(getPortletDescription);
@@ -317,8 +314,8 @@
}
public PortletContext clonePortlet(ClonePortlet clonePortlet) throws
InvalidUserCategoryFault, AccessDeniedFault,
- OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault,
InconsistentParametersFault,
- MissingParametersFault, RemoteException
+ OperationFailedFault, InvalidHandleFault, InvalidRegistrationFault,
InconsistentParametersFault,
+ MissingParametersFault, RemoteException
{
log.debug("clonePortlet invoked");
PortletContext portletContext =
portletManagementHandler.clonePortlet(clonePortlet);
@@ -327,7 +324,7 @@
}
public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws
InconsistentParametersFault,
- MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
{
log.debug("destroyPortlets invoked");
DestroyPortletsResponse destroyPortletsResponse =
portletManagementHandler.destroyPortlets(destroyPortlets);
@@ -336,8 +333,8 @@
}
public PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
throws OperationFailedFault,
- InvalidHandleFault, MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault,
- AccessDeniedFault, InvalidRegistrationFault, RemoteException
+ InvalidHandleFault, MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault,
+ AccessDeniedFault, InvalidRegistrationFault, RemoteException
{
log.debug("setPortletProperties invoked");
PortletContext portletContext =
portletManagementHandler.setPortletProperties(setPortletProperties);
@@ -346,8 +343,8 @@
}
public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
throws InvalidHandleFault,
- MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault,
OperationFailedFault,
- InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
+ MissingParametersFault, InvalidRegistrationFault, AccessDeniedFault,
OperationFailedFault,
+ InconsistentParametersFault, InvalidUserCategoryFault, RemoteException
{
log.debug("getPortletProperties invoked");
PropertyList list =
portletManagementHandler.getPortletProperties(getPortletProperties);
@@ -356,8 +353,8 @@
}
public PortletPropertyDescriptionResponse
getPortletPropertyDescription(GetPortletPropertyDescription
getPortletPropertyDescription)
- throws MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault, InvalidRegistrationFault,
- AccessDeniedFault, InvalidHandleFault, OperationFailedFault, RemoteException
+ throws MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault, InvalidRegistrationFault,
+ AccessDeniedFault, InvalidHandleFault, OperationFailedFault, RemoteException
{
log.debug("getPortletPropertyDescription invoked");
PortletPropertyDescriptionResponse descriptionResponse =
portletManagementHandler.getPortletPropertyDescription(getPortletPropertyDescription);
@@ -409,7 +406,7 @@
catch (NoSuchPortletException e)
{
throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.INVALID_HANDLE,
- "Couldn't find portlet with handle '" +
portletContext.getId() + "'", null);
+ "Couldn't find portlet with handle '" +
portletContext.getId() + "'", null);
}
finally
{
@@ -419,7 +416,7 @@
if (!isRemotable(portlet))
{
throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.INVALID_HANDLE,
- "Portlet '" + portletContext.getId() + "' is not
remotely available.", null);
+ "Portlet '" + portletContext.getId() + "' is not
remotely available.", null);
}
return portlet;
@@ -534,8 +531,6 @@
public void usingStrictModeChangedTo(boolean strictMode)
{
- RegistrationUtils.setStrict(strictMode);
- WSRPUtils.setStrict(strictMode);
- WSRPPortletURL.setStrict(strictMode);
+ WSRPValidator.setStrict(strictMode);
}
}
Added:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPValidator.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPValidator.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPValidator.java 2008-07-07
15:56:08 UTC (rev 11317)
@@ -0,0 +1,49 @@
+/*
+* 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.
+*/
+
+package org.jboss.portal.wsrp.producer;
+
+import org.jboss.portal.registration.RegistrationUtils;
+import org.jboss.portal.wsrp.WSRPPortletURL;
+import org.jboss.portal.wsrp.WSRPUtils;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class WSRPValidator
+{
+ private static boolean strict = true;
+
+ public static void setStrict(boolean strictMode)
+ {
+ strict = strictMode;
+ RegistrationUtils.setStrict(strict);
+ WSRPUtils.setStrict(strict);
+ WSRPPortletURL.setStrict(strict);
+ }
+
+ public static boolean isStrict()
+ {
+ return strict;
+ }
+}