gatein SVN: r3732 - in portal/trunk: component/web/server/src/main/java/org/exoplatform/web/handler and 1 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-07-31 15:52:13 -0400 (Sat, 31 Jul 2010)
New Revision: 3732
Modified:
portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleDownloadUpload.java
Log:
GTNPORTAL-1380 Keep UploadService transparent from previous version
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-07-31 14:28:22 UTC (rev 3731)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-07-31 19:52:13 UTC (rev 3732)
@@ -160,12 +160,22 @@
}
/**
- * Remove UploadResource by uploadId, Delete temp file of UploadResource. If
- * uploadId is null or UploadResource is null, do nothing
+ * @deprecated use {@link #removeUploadResource(String)} instead
*
* @param uploadId
- * uploadId of UploadResource will be removed
*/
+ @Deprecated
+ public void removeUpload(String uploadId)
+ {
+ removeUploadResource(uploadId);
+ }
+
+ /**
+ * Remove the UploadResource and its temporary file that associated with given <code>uploadId</code>.
+ * <br/>If <code>uploadId</code> is null or UploadResource is null, do nothing
+ *
+ * @param uploadId uploadId of UploadResource will be removed
+ */
public void removeUploadResource(String uploadId)
{
if (uploadId == null)
@@ -211,7 +221,7 @@
return uploadLimitsMB_;
}
- private ServletFileUpload makeServletFileUpload(UploadResource upResource)
+ private ServletFileUpload makeServletFileUpload(final UploadResource upResource)
{
// Create a factory for disk-based file items
DiskFileItemFactory factory = new DiskFileItemFactory();
@@ -222,13 +232,7 @@
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload(factory);
- upload.setProgressListener(makeProgressListener(upResource));
- return upload;
- }
-
- private ProgressListener makeProgressListener(final UploadResource upResource)
- {
- return new ProgressListener()
+ ProgressListener listener = new ProgressListener()
{
public void update(long pBytesRead, long pContentLength, int pItems)
{
@@ -237,6 +241,8 @@
upResource.addUploadedBytes(pBytesRead - upResource.getUploadedSize());
}
};
+ upload.setProgressListener(listener);
+ return upload;
}
private boolean isLimited(UploadResource upResource, double contentLength)
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java 2010-07-31 14:28:22 UTC (rev 3731)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java 2010-07-31 19:52:13 UTC (rev 3732)
@@ -55,7 +55,7 @@
public void execute(WebAppController controller, HttpServletRequest req, HttpServletResponse res) throws Exception
{
String action = req.getParameter("action");
- String[] uploadId = req.getParameterValues("uploadId");
+ String[] uploadIds = req.getParameterValues("uploadId");
res.setHeader("Cache-Control", "no-cache");
@@ -68,20 +68,20 @@
if (uploadActionService == UploadServiceAction.PROGRESS)
{
Writer writer = res.getWriter();
- if (uploadId == null)
+ if (uploadIds == null)
return;
StringBuilder value = new StringBuilder();
value.append("{\n upload : {");
- for (int i = 0; i < uploadId.length; i++)
+ for (int i = 0; i < uploadIds.length; i++)
{
- UploadResource upResource = service.getUploadResource(uploadId[i]);
+ UploadResource upResource = service.getUploadResource(uploadIds[i]);
if (upResource == null)
continue;
if (upResource.getStatus() == UploadResource.FAILED_STATUS)
{
- int limitMB = service.getUploadLimitsMB().get(uploadId[i]).intValue();
- value.append("\n \"").append(uploadId[i]).append("\": {");
+ int limitMB = service.getUploadLimitsMB().get(uploadIds[i]).intValue();
+ value.append("\n \"").append(uploadIds[i]).append("\": {");
value.append("\n \"status\":").append('\"').append("failed").append("\",");
value.append("\n \"size\":").append('\"').append(limitMB).append("\"");
value.append("\n }");
@@ -92,12 +92,12 @@
{
percent = (upResource.getUploadedSize() * 100) / upResource.getEstimatedSize();
}
- value.append("\n \"").append(uploadId[i]).append("\": {");
+ value.append("\n \"").append(uploadIds[i]).append("\": {");
value.append("\n \"percent\":").append('\"').append((int)percent).append("\",");
value.append("\n \"fileName\":").append('\"').append(encodeName(upResource.getFileName()))
.append("\"");
value.append("\n }");
- if (i < uploadId.length - 1)
+ if (i < uploadIds.length - 1)
value.append(',');
}
value.append("\n }\n}");
@@ -109,11 +109,11 @@
}
else if (uploadActionService == UploadServiceAction.DELETE)
{
- service.removeUploadResource(uploadId[0]);
+ service.removeUploadResource(uploadIds[0]);
}
else if (uploadActionService == UploadServiceAction.ABORT)
{
- service.removeUploadResource(uploadId[0]);
+ service.removeUploadResource(uploadIds[0]);
}
}
Modified: portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleDownloadUpload.java
===================================================================
--- portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleDownloadUpload.java 2010-07-31 14:28:22 UTC (rev 3731)
+++ portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleDownloadUpload.java 2010-07-31 19:52:13 UTC (rev 3732)
@@ -30,8 +30,8 @@
public UISampleDownloadUpload() throws Exception
{
addUIFormInput(new UIFormUploadInput("name0", "value0"));
- addUIFormInput(new UIFormUploadInput("name1", "value1"));
- addUIFormInput(new UIFormUploadInput("name2", "value2"));
+ addUIFormInput(new UIFormUploadInput("name1", "value1", 100));
+ addUIFormInput(new UIFormUploadInput("name2", "value2", 200));
}
public void setDownloadLink(String[] downloadLink)
14 years, 4 months
gatein SVN: r3731 - in components/wsrp/trunk: producer/src/main/java/org/gatein/wsrp/producer/v1 and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-07-31 10:28:22 -0400 (Sat, 31 Jul 2010)
New Revision: 3731
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionInterface.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java
Log:
- GTNWSRP-8: Added missing exceptions and methods.
- Simplified code when ReturnAny is involved since we don't currently deal with it.
- Make several methods return List<Extension> instead of ReturnAny.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupHandler.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupHandler.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.producer;
-import org.gatein.common.NotYetImplemented;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.invocation.response.ContentResponse;
import org.gatein.pc.api.invocation.response.ErrorResponse;
@@ -36,6 +35,7 @@
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.BlockingInteractionResponse;
+import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetMarkup;
import org.oasis.wsrp.v2.GetResource;
import org.oasis.wsrp.v2.HandleEvents;
@@ -58,7 +58,6 @@
import org.oasis.wsrp.v2.ReleaseSessions;
import org.oasis.wsrp.v2.ResourceResponse;
import org.oasis.wsrp.v2.ResourceSuspended;
-import org.oasis.wsrp.v2.ReturnAny;
import org.oasis.wsrp.v2.UnsupportedLocale;
import org.oasis.wsrp.v2.UnsupportedMimeType;
import org.oasis.wsrp.v2.UnsupportedMode;
@@ -66,6 +65,8 @@
import javax.portlet.PortletModeException;
import javax.portlet.WindowStateException;
+import java.util.Collections;
+import java.util.List;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -86,7 +87,10 @@
// Markup implementation ********************************************************************************************
- public MarkupResponse getMarkup(GetMarkup getMarkup) throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied, InconsistentParameters, InvalidHandle, UnsupportedLocale, UnsupportedMode, OperationFailed, MissingParameters, InvalidUserCategory, InvalidRegistration, UnsupportedMimeType
+ public MarkupResponse getMarkup(GetMarkup getMarkup)
+ throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, ResourceSuspended,
+ UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getMarkup, GET_MARKUP);
@@ -110,15 +114,15 @@
return (MarkupResponse)requestProcessor.processResponse(response);
}
- public ResourceResponse getResource(GetResource getResource) throws AccessDenied, InconsistentParameters,
- InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters,
- ModifyRegistrationRequired, OperationFailed, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType,
- UnsupportedMode, UnsupportedWindowState
+ public ResourceResponse getResource(GetResource getResource)
+ throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getResource, GET_RESOURCE);
-
+
ResourceRequestProcessor requestProcessor = new ResourceRequestProcessor(producer, getResource);
-
+
String handle = requestProcessor.getPortletContext().getPortletHandle();
PortletInvocationResponse response;
try
@@ -131,13 +135,16 @@
{
throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, "Could not access portlet resource '" + handle + "'", e);
}
-
+
checkForError(response);
-
- return (ResourceResponse)requestProcessor.processResponse(response);
+
+ return requestProcessor.processResponse(response);
}
- public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction) throws InvalidSession, UnsupportedMode, UnsupportedMimeType, OperationFailed, UnsupportedWindowState, UnsupportedLocale, AccessDenied, PortletStateChangeRequired, InvalidRegistration, MissingParameters, InvalidUserCategory, InconsistentParameters, InvalidHandle, InvalidCookie
+ public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
+ throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, PortletStateChangeRequired,
+ ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(performBlockingInteraction, PBI);
final InteractionParams interactionParams = performBlockingInteraction.getInteractionParams();
@@ -167,14 +174,18 @@
return (BlockingInteractionResponse)requestProcessor.processResponse(response);
}
- public ReturnAny releaseSessions(ReleaseSessions releaseSessions) throws InvalidRegistration, OperationFailed, MissingParameters, AccessDenied
+ public List<Extension> releaseSessions(ReleaseSessions releaseSessions)
+ throws AccessDenied, InvalidRegistration, MissingParameters, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended
{
// our producer never sends session ids so a Consumer trying to release sessions is an error condition
throwOperationFaultOnSessionOperation();
return null;
}
- public ReturnAny initCookie(InitCookie initCookie) throws AccessDenied, OperationFailed, InvalidRegistration
+ public List<Extension> initCookie(InitCookie initCookie)
+ throws AccessDenied, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(initCookie, "InitCookie");
producer.getRegistrationOrFailIfInvalid(initCookie.getRegistrationContext());
@@ -184,13 +195,14 @@
String sessionId = ServletAccess.getRequest().getSession().getId();
log.debug("Got init cookie operation, created a session with id " + sessionId);
- return new ReturnAny();
+ return Collections.emptyList();
}
- public HandleEventsResponse handleEvents(HandleEvents handleEvents) throws AccessDenied, InconsistentParameters,
- InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters,
- ModifyRegistrationRequired, OperationFailed, OperationNotSupported, PortletStateChangeRequired, ResourceSuspended,
- UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
+ public HandleEventsResponse handleEvents(HandleEvents handleEvents)
+ throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ PortletStateChangeRequired, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode,
+ UnsupportedWindowState
{
EventRequestProcessor requestProcessor = new EventRequestProcessor(producer, handleEvents);
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupInterface.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupInterface.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/MarkupInterface.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -25,6 +25,7 @@
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.BlockingInteractionResponse;
+import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetMarkup;
import org.oasis.wsrp.v2.GetResource;
import org.oasis.wsrp.v2.HandleEvents;
@@ -46,12 +47,13 @@
import org.oasis.wsrp.v2.ReleaseSessions;
import org.oasis.wsrp.v2.ResourceResponse;
import org.oasis.wsrp.v2.ResourceSuspended;
-import org.oasis.wsrp.v2.ReturnAny;
import org.oasis.wsrp.v2.UnsupportedLocale;
import org.oasis.wsrp.v2.UnsupportedMimeType;
import org.oasis.wsrp.v2.UnsupportedMode;
import org.oasis.wsrp.v2.UnsupportedWindowState;
+import java.util.List;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -59,23 +61,15 @@
public interface MarkupInterface
{
MarkupResponse getMarkup(GetMarkup getMarkup)
- throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied,
- InconsistentParameters, InvalidHandle, UnsupportedLocale, UnsupportedMode,
- OperationFailed, MissingParameters, InvalidUserCategory, InvalidRegistration,
- UnsupportedMimeType;
+ throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, ResourceSuspended,
+ UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState;
BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
- throws InvalidSession, UnsupportedMode, UnsupportedMimeType, OperationFailed,
- UnsupportedWindowState, UnsupportedLocale, AccessDenied, PortletStateChangeRequired,
- InvalidRegistration, MissingParameters, InvalidUserCategory, InconsistentParameters,
- InvalidHandle, InvalidCookie;
+ throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, PortletStateChangeRequired,
+ ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState;
- ReturnAny releaseSessions(ReleaseSessions releaseSessions)
- throws InvalidRegistration, OperationFailed, MissingParameters, AccessDenied;
-
- ReturnAny initCookie(InitCookie initCookie)
- throws AccessDenied, OperationFailed, InvalidRegistration;
-
HandleEventsResponse handleEvents(HandleEvents handleEvents)
throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
@@ -84,6 +78,14 @@
ResourceResponse getResource(GetResource getResource)
throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
- InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, ResourceSuspended,
- UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState;
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState;
+
+ List<Extension> releaseSessions(ReleaseSessions releaseSessions)
+ throws AccessDenied, InvalidRegistration, MissingParameters, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended;
+
+ List<Extension> initCookie(InitCookie initCookie)
+ throws AccessDenied, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ ResourceSuspended;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -25,6 +25,7 @@
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
+import org.gatein.common.NotYetImplemented;
import org.gatein.common.i18n.LocalizedString;
import org.gatein.pc.api.InvalidPortletIdException;
import org.gatein.pc.api.NoSuchPortletException;
@@ -45,18 +46,32 @@
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.ClonePortlet;
+import org.oasis.wsrp.v2.CopyPortlets;
+import org.oasis.wsrp.v2.CopyPortletsResponse;
import org.oasis.wsrp.v2.DestroyPortlets;
import org.oasis.wsrp.v2.DestroyPortletsResponse;
+import org.oasis.wsrp.v2.ExportByValueNotSupported;
+import org.oasis.wsrp.v2.ExportNoLongerValid;
+import org.oasis.wsrp.v2.ExportPortlets;
+import org.oasis.wsrp.v2.ExportPortletsResponse;
+import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.FailedPortlets;
import org.oasis.wsrp.v2.GetPortletDescription;
import org.oasis.wsrp.v2.GetPortletProperties;
import org.oasis.wsrp.v2.GetPortletPropertyDescription;
+import org.oasis.wsrp.v2.GetPortletsLifetime;
+import org.oasis.wsrp.v2.GetPortletsLifetimeResponse;
+import org.oasis.wsrp.v2.ImportPortlets;
+import org.oasis.wsrp.v2.ImportPortletsResponse;
import org.oasis.wsrp.v2.InconsistentParameters;
import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
import org.oasis.wsrp.v2.InvalidUserCategory;
+import org.oasis.wsrp.v2.Lifetime;
import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescription;
import org.oasis.wsrp.v2.PortletDescriptionResponse;
@@ -64,8 +79,13 @@
import org.oasis.wsrp.v2.Property;
import org.oasis.wsrp.v2.PropertyDescription;
import org.oasis.wsrp.v2.PropertyList;
+import org.oasis.wsrp.v2.ReleaseExport;
import org.oasis.wsrp.v2.ResetProperty;
+import org.oasis.wsrp.v2.ResourceSuspended;
+import org.oasis.wsrp.v2.SetExportLifetime;
import org.oasis.wsrp.v2.SetPortletProperties;
+import org.oasis.wsrp.v2.SetPortletsLifetime;
+import org.oasis.wsrp.v2.SetPortletsLifetimeResponse;
import org.oasis.wsrp.v2.UserContext;
import java.util.ArrayList;
@@ -93,8 +113,8 @@
}
public PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
- throws AccessDenied, InvalidHandle, InvalidUserCategory, InconsistentParameters,
- MissingParameters, InvalidRegistration, OperationFailed
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getPortletDescription, GET_PORTLET_DESCRIPTION);
Registration registration = producer.getRegistrationOrFailIfInvalid(getPortletDescription.getRegistrationContext());
@@ -111,8 +131,8 @@
}
public PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
- throws MissingParameters, InconsistentParameters, InvalidUserCategory, InvalidRegistration, AccessDenied,
- InvalidHandle, OperationFailed
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getPortletPropertyDescription, GET_PORTLET_PROPERTY_DESCRIPTION);
@@ -156,8 +176,9 @@
return WSRPTypeFactory.createPortletPropertyDescriptionResponse(descs);
}
- public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategory, AccessDenied, OperationFailed,
- InvalidHandle, InvalidRegistration, InconsistentParameters, MissingParameters
+ public PortletContext clonePortlet(ClonePortlet clonePortlet)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(clonePortlet, "ClonePortlet");
@@ -194,8 +215,9 @@
}
}
- public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParameters,
- MissingParameters, InvalidRegistration, OperationFailed
+ public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets)
+ throws InconsistentParameters, InvalidRegistration, MissingParameters, ModifyRegistrationRequired,
+ OperationFailed, OperationNotSupported, ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(destroyPortlets, "DestroyPortlets");
@@ -249,9 +271,58 @@
}
}
- public PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailed,
- InvalidHandle, MissingParameters, InconsistentParameters, InvalidUserCategory, AccessDenied, InvalidRegistration
+ public GetPortletsLifetimeResponse getPortletsLifetime(GetPortletsLifetime getPortletsLifetime)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
+ OperationFailed, OperationNotSupported, ResourceSuspended
{
+ throw WSRP2ExceptionFactory.throwWSException(OperationNotSupported.class, "Lifetime operations are not currently supported.", null);
+ }
+
+ public SetPortletsLifetimeResponse setPortletsLifetime(SetPortletsLifetime setPortletsLifetime)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
+ OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ throw WSRP2ExceptionFactory.throwWSException(OperationNotSupported.class, "Lifetime operations are not currently supported.", null);
+ }
+
+ public CopyPortletsResponse copyPortlets(CopyPortlets copyPortlets)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ throw new NotYetImplemented();
+ }
+
+ public ExportPortletsResponse exportPortlets(ExportPortlets exportPortlets)
+ throws AccessDenied, ExportByValueNotSupported, InconsistentParameters, InvalidHandle, InvalidRegistration,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ ResourceSuspended
+ {
+ throw new NotYetImplemented();
+ }
+
+ public ImportPortletsResponse importPortlets(ImportPortlets importPortlets)
+ throws AccessDenied, ExportNoLongerValid, InconsistentParameters, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ throw new NotYetImplemented();
+ }
+
+ public List<Extension> releaseExport(ReleaseExport releaseExport)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Lifetime setExportLifetime(SetExportLifetime setExportLifetime)
+ throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended
+ {
+ throw new NotYetImplemented();
+ }
+
+ public PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(setPortletProperties, "SetPortletProperties");
PortletContext portletContext = setPortletProperties.getPortletContext();
@@ -332,8 +403,9 @@
return portletContext;
}
- public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandle,
- MissingParameters, InvalidRegistration, AccessDenied, OperationFailed, InconsistentParameters, InvalidUserCategory
+ public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getPortletProperties, GET_PORTLET_PROPERTIES);
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementInterface.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementInterface.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementInterface.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -25,46 +25,98 @@
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.ClonePortlet;
+import org.oasis.wsrp.v2.CopyPortlets;
+import org.oasis.wsrp.v2.CopyPortletsResponse;
import org.oasis.wsrp.v2.DestroyPortlets;
import org.oasis.wsrp.v2.DestroyPortletsResponse;
+import org.oasis.wsrp.v2.ExportByValueNotSupported;
+import org.oasis.wsrp.v2.ExportNoLongerValid;
+import org.oasis.wsrp.v2.ExportPortlets;
+import org.oasis.wsrp.v2.ExportPortletsResponse;
+import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetPortletDescription;
import org.oasis.wsrp.v2.GetPortletProperties;
import org.oasis.wsrp.v2.GetPortletPropertyDescription;
+import org.oasis.wsrp.v2.GetPortletsLifetime;
+import org.oasis.wsrp.v2.GetPortletsLifetimeResponse;
+import org.oasis.wsrp.v2.ImportPortlets;
+import org.oasis.wsrp.v2.ImportPortletsResponse;
import org.oasis.wsrp.v2.InconsistentParameters;
import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
import org.oasis.wsrp.v2.InvalidUserCategory;
+import org.oasis.wsrp.v2.Lifetime;
import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescriptionResponse;
import org.oasis.wsrp.v2.PortletPropertyDescriptionResponse;
import org.oasis.wsrp.v2.PropertyList;
+import org.oasis.wsrp.v2.ReleaseExport;
+import org.oasis.wsrp.v2.ResourceSuspended;
+import org.oasis.wsrp.v2.SetExportLifetime;
import org.oasis.wsrp.v2.SetPortletProperties;
+import org.oasis.wsrp.v2.SetPortletsLifetime;
+import org.oasis.wsrp.v2.SetPortletsLifetimeResponse;
+import java.util.List;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
public interface PortletManagementInterface
{
- PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
- throws AccessDenied, InvalidHandle, InvalidUserCategory, InconsistentParameters, MissingParameters,
- InvalidRegistration, OperationFailed;
+ public PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
- PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategory, AccessDenied,
- OperationFailed, InvalidHandle, InvalidRegistration, InconsistentParameters, MissingParameters;
+ public PortletContext clonePortlet(ClonePortlet clonePortlet)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
- DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParameters,
- MissingParameters, InvalidRegistration, OperationFailed;
+ public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets)
+ throws InconsistentParameters, InvalidRegistration, MissingParameters, ModifyRegistrationRequired,
+ OperationFailed, OperationNotSupported, ResourceSuspended;
- PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailed,
- InvalidHandle, MissingParameters, InconsistentParameters, InvalidUserCategory, AccessDenied, InvalidRegistration;
+ public GetPortletsLifetimeResponse getPortletsLifetime(GetPortletsLifetime getPortletsLifetime)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
+ OperationFailed, OperationNotSupported, ResourceSuspended;
- PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandle,
- MissingParameters, InvalidRegistration, AccessDenied, OperationFailed, InconsistentParameters, InvalidUserCategory;
+ public SetPortletsLifetimeResponse setPortletsLifetime(SetPortletsLifetime setPortletsLifetime)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired,
+ OperationFailed, OperationNotSupported, ResourceSuspended;
- PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
- throws MissingParameters, InconsistentParameters, InvalidUserCategory, InvalidRegistration, AccessDenied,
- InvalidHandle, OperationFailed;
+ public CopyPortletsResponse copyPortlets(CopyPortlets copyPortlets)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
+
+ public ExportPortletsResponse exportPortlets(ExportPortlets exportPortlets)
+ throws AccessDenied, ExportByValueNotSupported, InconsistentParameters, InvalidHandle, InvalidRegistration,
+ InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
+ ResourceSuspended;
+
+ public ImportPortletsResponse importPortlets(ImportPortlets importPortlets)
+ throws AccessDenied, ExportNoLongerValid, InconsistentParameters, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
+
+ public List<Extension> releaseExport(ReleaseExport releaseExport);
+
+ public Lifetime setExportLifetime(SetExportLifetime setExportLifetime)
+ throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended;
+
+ public PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
+
+ public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
+
+ public PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
+ throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
+ MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -37,15 +37,23 @@
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
+import org.oasis.wsrp.v2.AccessDenied;
+import org.oasis.wsrp.v2.Extension;
+import org.oasis.wsrp.v2.GetRegistrationLifetime;
+import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.Lifetime;
import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.ModifyRegistration;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.Property;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
import org.oasis.wsrp.v2.RegistrationState;
-import org.oasis.wsrp.v2.ReturnAny;
+import org.oasis.wsrp.v2.ResourceSuspended;
+import org.oasis.wsrp.v2.SetRegistrationLifetime;
import javax.xml.namespace.QName;
import java.util.ArrayList;
@@ -67,7 +75,8 @@
super(producer);
}
- public RegistrationContext register(RegistrationData registrationData) throws MissingParameters, OperationFailed
+ public RegistrationContext register(RegistrationData registrationData)
+ throws MissingParameters, OperationFailed, OperationNotSupported
{
ProducerRegistrationRequirements registrationRequirements = producer.getProducerRegistrationRequirements();
if (registrationRequirements.isRegistrationRequired())
@@ -142,7 +151,8 @@
producer.getRegistrationManager().getPersistenceManager().saveChangesTo(consumer);
}
- public ReturnAny deregister(RegistrationContext deregister) throws OperationFailed, InvalidRegistration
+ public List<Extension> deregister(RegistrationContext deregister)
+ throws InvalidRegistration, OperationFailed, OperationNotSupported, ResourceSuspended
{
if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
@@ -172,14 +182,14 @@
throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, msg, e);
}
- return new ReturnAny();
+ return Collections.emptyList();
}
throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, "Deregistration shouldn't be attempted if registration is not required", null);
}
- public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration) throws MissingParameters,
- OperationFailed, InvalidRegistration
+ public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
+ throws InvalidRegistration, MissingParameters, OperationFailed, OperationNotSupported, ResourceSuspended
{
if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
@@ -236,6 +246,20 @@
throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, "Modifying a registration shouldn't be attempted if registration is not required", null);
}
+ public Lifetime getRegistrationLifetime(GetRegistrationLifetime getRegistrationLifetime)
+ throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended
+ {
+ throw WSRP2ExceptionFactory.throwWSException(OperationNotSupported.class, "Lifetime operations are not currently supported.", null);
+ }
+
+ public Lifetime setRegistrationLifetime(SetRegistrationLifetime setRegistrationLifetime)
+ throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended
+ {
+ throw WSRP2ExceptionFactory.throwWSException(OperationNotSupported.class, "Lifetime operations are not currently supported.", null);
+ }
+
/**
* @param reg
* @param throwExceptionIfInvalid
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationInterface.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationInterface.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationInterface.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -23,25 +23,45 @@
package org.gatein.wsrp.producer;
+import org.oasis.wsrp.v2.AccessDenied;
+import org.oasis.wsrp.v2.Extension;
+import org.oasis.wsrp.v2.GetRegistrationLifetime;
+import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.Lifetime;
import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.ModifyRegistration;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
import org.oasis.wsrp.v2.RegistrationState;
-import org.oasis.wsrp.v2.ReturnAny;
+import org.oasis.wsrp.v2.ResourceSuspended;
+import org.oasis.wsrp.v2.SetRegistrationLifetime;
+import java.util.List;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
public interface RegistrationInterface
{
- RegistrationContext register(RegistrationData register) throws MissingParameters, OperationFailed;
+ RegistrationContext register(RegistrationData register)
+ throws MissingParameters, OperationFailed, OperationNotSupported;
- ReturnAny deregister(RegistrationContext deregister) throws OperationFailed, InvalidRegistration;
+ List<Extension> deregister(RegistrationContext deregister)
+ throws InvalidRegistration, OperationFailed, OperationNotSupported, ResourceSuspended;
- RegistrationState modifyRegistration(ModifyRegistration modifyRegistration) throws MissingParameters,
- OperationFailed, InvalidRegistration;
+ RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
+ throws InvalidRegistration, MissingParameters, OperationFailed, OperationNotSupported, ResourceSuspended;
+
+ public Lifetime getRegistrationLifetime(GetRegistrationLifetime getRegistrationLifetime)
+ throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended;
+
+ public Lifetime setRegistrationLifetime(SetRegistrationLifetime setRegistrationLifetime)
+ throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed,
+ OperationNotSupported, ResourceSuspended;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -52,11 +52,13 @@
import org.oasis.wsrp.v2.InvalidRegistration;
import org.oasis.wsrp.v2.MarkupType;
import org.oasis.wsrp.v2.ModelDescription;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
import org.oasis.wsrp.v2.ParameterDescription;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescription;
import org.oasis.wsrp.v2.RegistrationContext;
+import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.ServiceDescription;
import javax.xml.namespace.QName;
@@ -86,7 +88,8 @@
serviceDescription = new ServiceDescriptionInfo(producer);
}
- public ServiceDescription getServiceDescription(GetServiceDescription gs) throws InvalidRegistration, OperationFailed
+ public ServiceDescription getServiceDescription(GetServiceDescription gs)
+ throws InvalidRegistration, ModifyRegistrationRequired, OperationFailed, ResourceSuspended
{
WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(gs, "GetServiceDescription");
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionInterface.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionInterface.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionInterface.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -25,7 +25,9 @@
import org.oasis.wsrp.v2.GetServiceDescription;
import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.ServiceDescription;
/**
@@ -34,5 +36,6 @@
*/
public interface ServiceDescriptionInterface
{
- ServiceDescription getServiceDescription(GetServiceDescription gs) throws InvalidRegistration, OperationFailed;
+ ServiceDescription getServiceDescription(GetServiceDescription gs)
+ throws InvalidRegistration, ModifyRegistrationRequired, OperationFailed, ResourceSuspended;
}
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-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -41,16 +41,28 @@
import org.oasis.wsrp.v2.BlockingInteractionResponse;
import org.oasis.wsrp.v2.ClonePortlet;
import org.oasis.wsrp.v2.CookieProtocol;
+import org.oasis.wsrp.v2.CopyPortlets;
+import org.oasis.wsrp.v2.CopyPortletsResponse;
import org.oasis.wsrp.v2.DestroyPortlets;
import org.oasis.wsrp.v2.DestroyPortletsResponse;
+import org.oasis.wsrp.v2.ExportByValueNotSupported;
+import org.oasis.wsrp.v2.ExportNoLongerValid;
+import org.oasis.wsrp.v2.ExportPortlets;
+import org.oasis.wsrp.v2.ExportPortletsResponse;
+import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetMarkup;
import org.oasis.wsrp.v2.GetPortletDescription;
import org.oasis.wsrp.v2.GetPortletProperties;
import org.oasis.wsrp.v2.GetPortletPropertyDescription;
+import org.oasis.wsrp.v2.GetPortletsLifetime;
+import org.oasis.wsrp.v2.GetPortletsLifetimeResponse;
+import org.oasis.wsrp.v2.GetRegistrationLifetime;
import org.oasis.wsrp.v2.GetResource;
import org.oasis.wsrp.v2.GetServiceDescription;
import org.oasis.wsrp.v2.HandleEvents;
import org.oasis.wsrp.v2.HandleEventsResponse;
+import org.oasis.wsrp.v2.ImportPortlets;
+import org.oasis.wsrp.v2.ImportPortletsResponse;
import org.oasis.wsrp.v2.InconsistentParameters;
import org.oasis.wsrp.v2.InitCookie;
import org.oasis.wsrp.v2.InvalidCookie;
@@ -58,6 +70,7 @@
import org.oasis.wsrp.v2.InvalidRegistration;
import org.oasis.wsrp.v2.InvalidSession;
import org.oasis.wsrp.v2.InvalidUserCategory;
+import org.oasis.wsrp.v2.Lifetime;
import org.oasis.wsrp.v2.MarkupResponse;
import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.ModifyRegistration;
@@ -74,12 +87,16 @@
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
import org.oasis.wsrp.v2.RegistrationState;
+import org.oasis.wsrp.v2.ReleaseExport;
import org.oasis.wsrp.v2.ReleaseSessions;
import org.oasis.wsrp.v2.ResourceResponse;
import org.oasis.wsrp.v2.ResourceSuspended;
-import org.oasis.wsrp.v2.ReturnAny;
import org.oasis.wsrp.v2.ServiceDescription;
+import org.oasis.wsrp.v2.SetExportLifetime;
import org.oasis.wsrp.v2.SetPortletProperties;
+import org.oasis.wsrp.v2.SetPortletsLifetime;
+import org.oasis.wsrp.v2.SetPortletsLifetimeResponse;
+import org.oasis.wsrp.v2.SetRegistrationLifetime;
import org.oasis.wsrp.v2.UnsupportedLocale;
import org.oasis.wsrp.v2.UnsupportedMimeType;
import org.oasis.wsrp.v2.UnsupportedMode;
@@ -159,150 +176,151 @@
// ServiceDescription implementation ********************************************************************************
public ServiceDescription getServiceDescription(GetServiceDescription gs)
- throws InvalidRegistration, OperationFailed
+ throws InvalidRegistration, OperationFailed, ResourceSuspended, ModifyRegistrationRequired
{
- log.debug("getServiceDescription invoked");
- ServiceDescription sd = serviceDescriptionHandler.getServiceDescription(gs);
- log.debug("end getServiceDescription");
- return sd;
+ return serviceDescriptionHandler.getServiceDescription(gs);
}
// MarkupService implementation *************************************************************************************
- public MarkupResponse getMarkup(GetMarkup getMarkup) throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied, InconsistentParameters, InvalidHandle, UnsupportedLocale, UnsupportedMode, OperationFailed, MissingParameters, InvalidUserCategory, InvalidRegistration, UnsupportedMimeType
+ public MarkupResponse getMarkup(GetMarkup getMarkup) throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied, InconsistentParameters, InvalidHandle, UnsupportedLocale, UnsupportedMode, OperationFailed, MissingParameters, InvalidUserCategory, InvalidRegistration, UnsupportedMimeType, ResourceSuspended, ModifyRegistrationRequired
{
- log.debug("getMarkup invoked");
- MarkupResponse response = markupHandler.getMarkup(getMarkup);
- log.debug("end getMarkup");
- return response;
+ return markupHandler.getMarkup(getMarkup);
}
- public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction) throws InvalidSession, UnsupportedMode, UnsupportedMimeType, OperationFailed, UnsupportedWindowState, UnsupportedLocale, AccessDenied, PortletStateChangeRequired, InvalidRegistration, MissingParameters, InvalidUserCategory, InconsistentParameters, InvalidHandle, InvalidCookie
+ public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction) throws InvalidSession, UnsupportedMode, UnsupportedMimeType, OperationFailed, UnsupportedWindowState, UnsupportedLocale, AccessDenied, PortletStateChangeRequired, InvalidRegistration, MissingParameters, InvalidUserCategory, InconsistentParameters, InvalidHandle, InvalidCookie, ResourceSuspended, ModifyRegistrationRequired
{
- log.debug("performBlockingInteraction invoked");
- BlockingInteractionResponse interactionResponse = markupHandler.performBlockingInteraction(performBlockingInteraction);
- log.debug("end performBlockingInteraction");
- return interactionResponse;
+ return markupHandler.performBlockingInteraction(performBlockingInteraction);
}
- public ReturnAny releaseSessions(ReleaseSessions releaseSessions) throws InvalidRegistration, OperationFailed, MissingParameters, AccessDenied
+ public List<Extension> releaseSessions(ReleaseSessions releaseSessions) throws InvalidRegistration, OperationFailed, MissingParameters, AccessDenied, ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("releaseSessions invoked");
- ReturnAny returnAny = markupHandler.releaseSessions(releaseSessions);
- log.debug("end releaseSessions");
- return returnAny;
+ return markupHandler.releaseSessions(releaseSessions);
}
- public ReturnAny initCookie(InitCookie initCookie) throws AccessDenied, OperationFailed, InvalidRegistration
+ public List<Extension> initCookie(InitCookie initCookie) throws AccessDenied, OperationFailed, InvalidRegistration, ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("initCookie invoked");
- ReturnAny returnAny = markupHandler.initCookie(initCookie);
- log.debug("end initCookie");
- return returnAny;
+ return markupHandler.initCookie(initCookie);
}
public HandleEventsResponse handleEvents(HandleEvents handleEvents) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, PortletStateChangeRequired, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
{
- log.debug("handleEvents invoked");
- HandleEventsResponse response = markupHandler.handleEvents(handleEvents);
- log.debug("end handleEvents");
- return response;
+ return markupHandler.handleEvents(handleEvents);
}
- public ResourceResponse getResource(GetResource getResource) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
+ public ResourceResponse getResource(GetResource getResource) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, OperationNotSupported
{
- log.debug("getResource invoked");
- ResourceResponse response = markupHandler.getResource(getResource);
- log.debug("end getResource");
- return response;
+ return markupHandler.getResource(getResource);
}
// Registration implementation **************************************************************************************
- public RegistrationContext register(RegistrationData register) throws MissingParameters, OperationFailed
+ public RegistrationContext register(RegistrationData register) throws MissingParameters, OperationFailed, OperationNotSupported
{
- log.debug("register invoked");
- RegistrationContext registrationContext = registrationHandler.register(register);
- log.debug("end register");
- return registrationContext;
+ return registrationHandler.register(register);
}
- public ReturnAny deregister(RegistrationContext deregister) throws OperationFailed, InvalidRegistration
+ public List<Extension> deregister(RegistrationContext deregister) throws OperationFailed, InvalidRegistration, ResourceSuspended, OperationNotSupported
{
- log.debug("deregister invoked");
- ReturnAny returnAny = registrationHandler.deregister(deregister);
- log.debug("end deregister");
- return returnAny;
+ return registrationHandler.deregister(deregister);
}
public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration) throws MissingParameters,
- OperationFailed, InvalidRegistration
+ OperationFailed, InvalidRegistration, ResourceSuspended, OperationNotSupported
{
- log.debug("modifyRegistration invoked");
- RegistrationState registrationState = registrationHandler.modifyRegistration(modifyRegistration);
- log.debug("end modifyRegistration");
- return registrationState;
+ return registrationHandler.modifyRegistration(modifyRegistration);
}
-// PortletManagement implementation *********************************************************************************
+ public Lifetime getRegistrationLifetime(GetRegistrationLifetime getRegistrationLifetime) throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return registrationHandler.getRegistrationLifetime(getRegistrationLifetime);
+ }
+ public Lifetime setRegistrationLifetime(SetRegistrationLifetime setRegistrationLifetime) throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return registrationHandler.setRegistrationLifetime(setRegistrationLifetime);
+ }
+
+ // PortletManagement implementation *********************************************************************************
+
public PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
throws AccessDenied, InvalidHandle, InvalidUserCategory, InconsistentParameters, MissingParameters,
- InvalidRegistration, OperationFailed
+ InvalidRegistration, OperationFailed, ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("getPortletDescription invoked");
- PortletDescriptionResponse description = portletManagementHandler.getPortletDescription(getPortletDescription);
- log.debug("end getPortletDescription");
- return description;
+ return portletManagementHandler.getPortletDescription(getPortletDescription);
}
public PortletContext clonePortlet(ClonePortlet clonePortlet) throws InvalidUserCategory, AccessDenied,
- OperationFailed, InvalidHandle, InvalidRegistration, InconsistentParameters, MissingParameters
+ OperationFailed, InvalidHandle, InvalidRegistration, InconsistentParameters, MissingParameters,
+ ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("clonePortlet invoked");
- PortletContext portletContext = portletManagementHandler.clonePortlet(clonePortlet);
- log.debug("end clonePortlet");
- return portletContext;
+ return portletManagementHandler.clonePortlet(clonePortlet);
}
public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws InconsistentParameters,
- MissingParameters, InvalidRegistration, OperationFailed
+ MissingParameters, InvalidRegistration, OperationFailed, ResourceSuspended, OperationNotSupported,
+ ModifyRegistrationRequired
{
- log.debug("destroyPortlets invoked");
- DestroyPortletsResponse destroyPortletsResponse = portletManagementHandler.destroyPortlets(destroyPortlets);
- log.debug("end destroyPortlets");
- return destroyPortletsResponse;
+ return portletManagementHandler.destroyPortlets(destroyPortlets);
}
public PortletContext setPortletProperties(SetPortletProperties setPortletProperties) throws OperationFailed,
- InvalidHandle, MissingParameters, InconsistentParameters, InvalidUserCategory, AccessDenied, InvalidRegistration
+ InvalidHandle, MissingParameters, InconsistentParameters, InvalidUserCategory, AccessDenied, InvalidRegistration,
+ ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("setPortletProperties invoked");
- PortletContext portletContext = portletManagementHandler.setPortletProperties(setPortletProperties);
- log.debug("end setPortletProperties");
- return portletContext;
+ return portletManagementHandler.setPortletProperties(setPortletProperties);
}
public PropertyList getPortletProperties(GetPortletProperties getPortletProperties) throws InvalidHandle,
- MissingParameters, InvalidRegistration, AccessDenied, OperationFailed, InconsistentParameters, InvalidUserCategory
+ MissingParameters, InvalidRegistration, AccessDenied, OperationFailed, InconsistentParameters, InvalidUserCategory,
+ ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("getPortletProperties invoked");
- PropertyList list = portletManagementHandler.getPortletProperties(getPortletProperties);
- log.debug("end getPortletProperties");
- return list;
+ return portletManagementHandler.getPortletProperties(getPortletProperties);
}
public PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
throws MissingParameters, InconsistentParameters, InvalidUserCategory, InvalidRegistration, AccessDenied,
- InvalidHandle, OperationFailed
+ InvalidHandle, OperationFailed, ResourceSuspended, OperationNotSupported, ModifyRegistrationRequired
{
- log.debug("getPortletPropertyDescription invoked");
- PortletPropertyDescriptionResponse descriptionResponse = portletManagementHandler.getPortletPropertyDescription(getPortletPropertyDescription);
- log.debug("end getPortletPropertyDescription");
- return descriptionResponse;
+ return portletManagementHandler.getPortletPropertyDescription(getPortletPropertyDescription);
}
+ public GetPortletsLifetimeResponse getPortletsLifetime(GetPortletsLifetime getPortletsLifetime) throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return portletManagementHandler.getPortletsLifetime(getPortletsLifetime);
+ }
+
+ public SetPortletsLifetimeResponse setPortletsLifetime(SetPortletsLifetime setPortletsLifetime) throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return portletManagementHandler.setPortletsLifetime(setPortletsLifetime);
+ }
+
+ public CopyPortletsResponse copyPortlets(CopyPortlets copyPortlets) throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return portletManagementHandler.copyPortlets(copyPortlets);
+ }
+
+ public ExportPortletsResponse exportPortlets(ExportPortlets exportPortlets) throws AccessDenied, ExportByValueNotSupported, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return portletManagementHandler.exportPortlets(exportPortlets);
+ }
+
+ public ImportPortletsResponse importPortlets(ImportPortlets importPortlets) throws AccessDenied, ExportNoLongerValid, InconsistentParameters, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return portletManagementHandler.importPortlets(importPortlets);
+ }
+
+ public List<Extension> releaseExport(ReleaseExport releaseExport)
+ {
+ return portletManagementHandler.releaseExport(releaseExport);
+ }
+
+ public Lifetime setExportLifetime(SetExportLifetime setExportLifetime) throws AccessDenied, InvalidHandle, InvalidRegistration, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
+ {
+ return portletManagementHandler.setExportLifetime(setExportLifetime);
+ }
+
private ProducerConfiguration getProducerConfiguration()
{
return configurationService.getConfiguration();
Modified: 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 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -23,7 +23,6 @@
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;
@@ -32,6 +31,7 @@
import org.gatein.wsrp.producer.v2.WSRP2Producer;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
import org.oasis.wsrp.v1.V1ClonePortlet;
@@ -81,7 +81,9 @@
import org.oasis.wsrp.v2.InvalidUserCategory;
import org.oasis.wsrp.v2.MarkupResponse;
import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescriptionResponse;
import org.oasis.wsrp.v2.PortletPropertyDescriptionResponse;
@@ -89,7 +91,7 @@
import org.oasis.wsrp.v2.PropertyList;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationState;
-import org.oasis.wsrp.v2.ReturnAny;
+import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.ServiceDescription;
import org.oasis.wsrp.v2.UnsupportedLocale;
import org.oasis.wsrp.v2.UnsupportedMimeType;
@@ -182,6 +184,14 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
}
@@ -200,14 +210,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1ReturnAny deregister(V1RegistrationContext deregister) throws V1OperationFailed, V1InvalidRegistration
{
try
{
- ReturnAny returnAny = producer.deregister(V1ToV2Converter.toV2RegistrationContext(deregister));
- return V2ToV1Converter.toV1ReturnAny(returnAny);
+ producer.deregister(V1ToV2Converter.toV2RegistrationContext(deregister));
+ return null;
}
catch (InvalidRegistration invalidRegistration)
{
@@ -217,6 +231,14 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1RegistrationState modifyRegistration(V1ModifyRegistration modifyRegistration) throws V1MissingParameters, V1OperationFailed, V1InvalidRegistration
@@ -238,6 +260,14 @@
{
throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, invalidRegistration);
}
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
@@ -276,6 +306,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
@@ -338,6 +380,14 @@
{
throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
}
public V1PortletContext clonePortlet(V1ClonePortlet clonePortlet) throws V1InvalidUserCategory, V1AccessDenied, V1OperationFailed, V1InvalidHandle, V1InvalidRegistration, V1InconsistentParameters, V1MissingParameters
@@ -375,6 +425,18 @@
{
throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1BlockingInteractionResponse performBlockingInteraction(V1PerformBlockingInteraction performBlockingInteraction) throws V1InvalidSession, V1UnsupportedMode, V1UnsupportedMimeType, V1OperationFailed, V1UnsupportedWindowState, V1UnsupportedLocale, V1AccessDenied, V1PortletStateChangeRequired, V1InvalidRegistration, V1MissingParameters, V1InvalidUserCategory, V1InconsistentParameters, V1InvalidHandle, V1InvalidCookie
@@ -440,6 +502,14 @@
{
throw V2ToV1Converter.toV1Exception(V1InvalidCookie.class, invalidCookie);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
}
public V1DestroyPortletsResponse destroyPortlets(V1DestroyPortlets destroyPortlets) throws V1InconsistentParameters, V1MissingParameters, V1InvalidRegistration, V1OperationFailed
@@ -465,6 +535,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1PortletContext setPortletProperties(V1SetPortletProperties setPortletProperties) throws V1OperationFailed, V1InvalidHandle, V1MissingParameters, V1InconsistentParameters, V1InvalidUserCategory, V1AccessDenied, V1InvalidRegistration
@@ -502,14 +584,26 @@
{
throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1ReturnAny releaseSessions(V1ReleaseSessions releaseSessions) throws V1InvalidRegistration, V1OperationFailed, V1MissingParameters, V1AccessDenied
{
try
{
- ReturnAny returnAny = producer.releaseSessions(V1ToV2Converter.toV2ReleaseSessions(releaseSessions));
- return V2ToV1Converter.toV1ReturnAny(returnAny);
+ producer.releaseSessions(V1ToV2Converter.toV2ReleaseSessions(releaseSessions));
+ return null;
}
catch (InvalidRegistration invalidRegistration)
{
@@ -527,6 +621,18 @@
{
throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1PropertyList getPortletProperties(V1GetPortletProperties getPortletProperties) throws V1InvalidHandle, V1MissingParameters, V1InvalidRegistration, V1AccessDenied, V1OperationFailed, V1InconsistentParameters, V1InvalidUserCategory
@@ -564,14 +670,26 @@
{
throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1ReturnAny initCookie(V1InitCookie initCookie) throws V1AccessDenied, V1OperationFailed, V1InvalidRegistration
{
try
{
- ReturnAny returnAny = producer.initCookie(V1ToV2Converter.toV2InitCookie(initCookie));
- return V2ToV1Converter.toV1ReturnAny(returnAny);
+ producer.initCookie(V1ToV2Converter.toV2InitCookie(initCookie));
+ return null;
}
catch (AccessDenied accessDenied)
{
@@ -585,6 +703,18 @@
{
throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public V1PortletPropertyDescriptionResponse getPortletPropertyDescription(V1GetPortletPropertyDescription getPortletPropertyDescription) throws V1MissingParameters, V1InconsistentParameters, V1InvalidUserCategory, V1InvalidRegistration, V1AccessDenied, V1InvalidHandle, V1OperationFailed
@@ -622,5 +752,17 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -28,6 +28,7 @@
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1Extension;
import org.oasis.wsrp.v1.V1InconsistentParameters;
@@ -55,6 +56,7 @@
import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
import org.oasis.wsrp.v2.AccessDenied;
import org.oasis.wsrp.v2.BlockingInteractionResponse;
+import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetMarkup;
import org.oasis.wsrp.v2.InconsistentParameters;
import org.oasis.wsrp.v2.InitCookie;
@@ -65,11 +67,13 @@
import org.oasis.wsrp.v2.InvalidUserCategory;
import org.oasis.wsrp.v2.MarkupResponse;
import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.PerformBlockingInteraction;
import org.oasis.wsrp.v2.PortletStateChangeRequired;
import org.oasis.wsrp.v2.ReleaseSessions;
-import org.oasis.wsrp.v2.ReturnAny;
+import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.UnsupportedLocale;
import org.oasis.wsrp.v2.UnsupportedMimeType;
import org.oasis.wsrp.v2.UnsupportedMode;
@@ -185,6 +189,14 @@
{
throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
updateResponse.value = V2ToV1Converter.toV1UpdateResponse(interactionResponse.getUpdateResponse());
redirectURL.value = interactionResponse.getRedirectURL();
@@ -203,10 +215,10 @@
sessionIDs
);
- ReturnAny returnAny;
+ List<Extension> extensions;
try
{
- returnAny = producer.releaseSessions(releaseSessions);
+ extensions = producer.releaseSessions(releaseSessions);
}
catch (InvalidRegistration invalidRegistration)
{
@@ -224,8 +236,20 @@
{
throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
- return Lists.transform(returnAny.getExtensions(), V2ToV1Converter.EXTENSION);
+ return Lists.transform(extensions, V2ToV1Converter.EXTENSION);
}
public void getMarkup(
@@ -308,6 +332,14 @@
{
throw V2ToV1Converter.toV1Exception(V1UnsupportedMimeType.class, unsupportedMimeType);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
markupContext.value = V2ToV1Converter.toV1MarkupContext(response.getMarkupContext());
sessionContext.value = V2ToV1Converter.toV1SessionContext(response.getSessionContext());
@@ -322,10 +354,10 @@
InitCookie initCookie = WSRPTypeFactory.createInitCookie(V1ToV2Converter.toV2RegistrationContext(registrationContext));
- ReturnAny returnAny;
+ List<Extension> extensions;
try
{
- returnAny = producer.initCookie(initCookie);
+ extensions = producer.initCookie(initCookie);
}
catch (AccessDenied accessDenied)
{
@@ -339,7 +371,19 @@
{
throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
- return Lists.transform(returnAny.getExtensions(), V2ToV1Converter.EXTENSION);
+ return Lists.transform(extensions, V2ToV1Converter.EXTENSION);
}
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -29,6 +29,7 @@
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1DestroyFailed;
import org.oasis.wsrp.v1.V1Extension;
@@ -60,11 +61,14 @@
import org.oasis.wsrp.v2.InvalidRegistration;
import org.oasis.wsrp.v2.InvalidUserCategory;
import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescriptionResponse;
import org.oasis.wsrp.v2.PortletPropertyDescriptionResponse;
import org.oasis.wsrp.v2.PropertyList;
+import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.SetPortletProperties;
import javax.jws.HandlerChain;
@@ -141,6 +145,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void setPortletProperties(
@@ -194,6 +210,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void clonePortlet(
@@ -246,6 +274,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void getPortletDescription(
@@ -304,6 +344,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void getPortletProperties(
@@ -359,6 +411,18 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void destroyPortlets(
@@ -394,5 +458,17 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -29,6 +29,7 @@
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1Extension;
import org.oasis.wsrp.v1.V1InvalidRegistration;
import org.oasis.wsrp.v1.V1MissingParameters;
@@ -41,9 +42,11 @@
import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.ModifyRegistration;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationNotSupported;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
import org.oasis.wsrp.v2.RegistrationState;
+import org.oasis.wsrp.v2.ResourceSuspended;
import javax.jws.HandlerChain;
import javax.jws.WebParam;
@@ -120,6 +123,10 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void deregister(
@@ -142,6 +149,14 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
public void modifyRegistration(
@@ -179,5 +194,13 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
+ catch (OperationNotSupported operationNotSupported)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
+ }
}
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -28,6 +28,7 @@
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
+import org.gatein.wsrp.spec.v1.WSRP1ExceptionFactory;
import org.oasis.wsrp.v1.V1CookieProtocol;
import org.oasis.wsrp.v1.V1Extension;
import org.oasis.wsrp.v1.V1InvalidRegistration;
@@ -40,7 +41,9 @@
import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
import org.oasis.wsrp.v2.GetServiceDescription;
import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.ServiceDescription;
import javax.jws.HandlerChain;
@@ -96,6 +99,14 @@
{
throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
}
+ catch (ModifyRegistrationRequired modifyRegistrationRequired)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
+ }
+ catch (ResourceSuspended resourceSuspended)
+ {
+ throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
+ }
requiresRegistration.value = description.isRequiresRegistration();
offeredPortlets.value = WSRPUtils.transform(description.getOfferedPortlets(), V2ToV1Converter.PORTLETDESCRIPTION);
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java 2010-07-30 10:41:09 UTC (rev 3730)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java 2010-07-31 14:28:22 UTC (rev 3731)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.endpoints.v2;
-import org.gatein.common.NotYetImplemented;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.oasis.wsrp.v2.AccessDenied;
@@ -59,7 +58,6 @@
import org.oasis.wsrp.v2.ResourceParams;
import org.oasis.wsrp.v2.ResourceResponse;
import org.oasis.wsrp.v2.ResourceSuspended;
-import org.oasis.wsrp.v2.ReturnAny;
import org.oasis.wsrp.v2.RuntimeContext;
import org.oasis.wsrp.v2.SessionContext;
import org.oasis.wsrp.v2.UnsupportedLocale;
@@ -133,9 +131,7 @@
releaseSessions.setRegistrationContext(registrationContext);
releaseSessions.getSessionIDs().addAll(sessionIDs);
- ReturnAny returnAny = producer.releaseSessions(releaseSessions);
-
- return returnAny.getExtensions();
+ return producer.releaseSessions(releaseSessions);
}
public List<Extension> initCookie(
@@ -148,9 +144,7 @@
InitCookie initCookie = new InitCookie();
initCookie.setRegistrationContext(registrationContext);
- ReturnAny returnAny = producer.initCookie(initCookie);
-
- return returnAny.getExtensions();
+ return producer.initCookie(initCookie);
}
public void getMarkup(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") PortletContext portletContext, @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") RuntimeContext runtimeContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") UserContext userContext, @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") MarkupParams markupParams, @WebParam(name = "markupContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<MarkupContext> markupContext, @WebParam(name = "sessionContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<SessionContext> sessionContext, @WebParam(name = "extensions", targetNamespace = "urn:oasi!
s:names:tc:wsrp:v2:types", mode = WebParam.Mode.OUT) Holder<List<Extension>> extensions) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
@@ -191,9 +185,9 @@
getResource.setResourceParams(resourceParams);
getResource.setRuntimeContext(runtimeContext);
getResource.setUserContext(userContext);
-
+
ResourceResponse response = producer.getResource(getResource);
-
+
resourceContext.value = response.getResourceContext();
sessionContext.value = response.getSessionContext();
portletContext.value = response.getPortletContext();
14 years, 4 months
gatein SVN: r3730 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-30 06:41:09 -0400 (Fri, 30 Jul 2010)
New Revision: 3730
Modified:
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
Log:
Update Snifftest for GateIn_v3.1.0
Modified: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
===================================================================
(Binary files differ)
14 years, 5 months
gatein SVN: r3729 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-30 06:40:37 -0400 (Fri, 30 Jul 2010)
New Revision: 3729
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_11_MembershipManagement.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_12_ImportApplication.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_13_ShowOrHideImportApplicationIcon.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_14_ManageCategory.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_15_AddApplicationIntoCategory.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_16_ViewPortlets.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_18_ManageManualGadget.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_19_LinkToGadget.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_20_ExpandAllCollapseAll.html
Log:
TESTVN-1163: Create new Snifftest for GateIn Selenium scripts
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_11_MembershipManagement.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_11_MembershipManagement.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_11_MembershipManagement.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_11_MembershipManagement</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_11_MembershipManagement</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Memberships Management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Users and group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Membership Management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Membership Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Membership Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_SNF_PRL_11</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_SNF_PRL_11</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_11</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_11</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit membership --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGrid']/table/tbody/tr[2]/td[5]/div/img[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGrid']/table/tbody/tr[2]/td[5]/div/img[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>description</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_SNF_PRL_11_edit</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_11_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_11_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete membership --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGrid']/table/tbody/tr[2]/td[5]/div/img[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGrid']/table/tbody/tr[2]/td[5]/div/img[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this membership?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_12_ImportApplication.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_12_ImportApplication.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_12_ImportApplication.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_12_ImportApplication</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_12_ImportApplication</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Import application--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[1]/div[1]/div/div/div/a[1]</td>
+ <td>Administration</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[1]/div[1]/div/div/div/a[1]</td>
+ <td>Administration</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[2]/div/div/div/div/a</td>
+ <td>Dashboard</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[2]/div/div/div/div/a</td>
+ <td>Dashboard</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>link=Gadgets</td>
+ <td>Gadgets</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=Gadgets</td>
+ <td>Gadgets</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>link=web</td>
+ <td>web</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=web</td>
+ <td>web</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click Import Application --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>This action will automatically create categories and import all the gadgets and portlets on it.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Show existing portlets and category are imported successfully--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[1]/div[1]/div/div/div/a[1]</td>
+ <td>Administration</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[1]/div[1]/div/div/div/a[1]</td>
+ <td>Administration</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[2]/div/div/div/div/a</td>
+ <td>Dashboard</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[2]/div/div/div/div/a</td>
+ <td>Dashboard</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>link=Gadgets</td>
+ <td>Gadgets</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=Gadgets</td>
+ <td>Gadgets</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>link=Integration</td>
+ <td>Integration</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=Integration</td>
+ <td>Integration</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>link=Navigation</td>
+ <td>Navigation</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=Navigation</td>
+ <td>Navigation</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=System</td>
+ <td>System</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=System</td>
+ <td>System</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>link=web</td>
+ <td>web</td>
+</tr>
+<tr>
+ <td>verifyText</td>
+ <td>link=web</td>
+ <td>web</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete some category after imported--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Integration</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Integration</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this category and all applications on it?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this category and all applications on it?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=System</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=System</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this category and all applications on it?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_13_ShowOrHideImportApplicationIcon.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_13_ShowOrHideImportApplicationIcon.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_13_ShowOrHideImportApplicationIcon.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_13_ShowOrHideImportApplicationIcon</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_13_ShowOrHideImportApplicationIcon</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Show or hide Import Application icon--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Import Applications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Import Applications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Hide import application icon --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseOver</td>
+ <td>//div[2]/div/div/div/div/div/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div/div/div[2]/div/div/div/div/div/div/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div/div/div[2]/div/div/div/div/div/div/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>showImport</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>showImport</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Close</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Close</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextNotPresent</td>
+ <td>Import Applications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Import Applications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Show Import Application icon --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseOver</td>
+ <td>//div[2]/div/div/div/div/div/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div/div/div[2]/div/div/div/div/div/div/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div/div/div[2]/div/div/div/div/div/div/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>showImport</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>showImport</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Close</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Close</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Import Applications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Import Applications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_14_ManageCategory.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_14_ManageCategory.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_14_ManageCategory.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_14_ManageCategory</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_14_ManageCategory</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Manage categoryt (Add/Edit/Delete categoryt)--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new catefory--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_SNF_PRL_14</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_SNF_PRL_14</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_SNF_PRL_14</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Permission Setting tab--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='ListPermissionSelector']/div/div[2]/div/div[2]/div/div/div[3]/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='ListPermissionSelector']/div/div[2]/div/div[2]/div/div/div[3]/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=exact:*</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=exact:*</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_14</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_14</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[4]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[4]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>displayName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_SNF_PRL_14_edit</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_SNF_PRL_14_edit</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_14_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_14_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this category and all applications on it?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextNotPresent</td>
+ <td>Test_SNF_PRL_14_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Test_SNF_PRL_14_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_15_AddApplicationIntoCategory.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_15_AddApplicationIntoCategory.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_15_AddApplicationIntoCategory.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_15_AddApplicationIntoCategory</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_15_AddApplicationIntoCategory</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add application into category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_SNF_PRL_15</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_SNF_PRL_15</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_SNF_PRL_15</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Permission Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Customers</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Customers</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=manager</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=manager</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_15</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_15</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add application into category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//input[@name='application' and @value='5']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//input[@name='application' and @value='5']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>displayName</td>
+ <td>Test_SNF_PRL_15</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_SNF_PRL_15</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_15</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_15</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete category-- </td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this category and all applications on it?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_16_ViewPortlets.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_16_ViewPortlets.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_16_ViewPortlets.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,687 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_16_ViewPortlets</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_16_ViewPortlets</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- View Portlets--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Portlet tab--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Dashboard >> Dashboard portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Dashboard >>Gadget Wrapper portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Gadget Wrapper Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Gadget Wrapper Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Gadget Wrapper Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Gadget Wrapper Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Dashboard >>Tabbed Dashboard--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Tabbed Dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Tabbed Dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Tabbed Dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Tabbed Dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Account Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Account Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Account Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Account Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Account Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Administration Toolbar Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Administration Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Administration Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Administration Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Administration Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Application Registry Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div[2]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Group Navigation Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Group Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Group Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Group Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Group Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Organization Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Organization Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Organization Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Organization Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Organization Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Page Management Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Page Management Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Page Management Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Page Management Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Page Management Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Portal Navigation Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Portal Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Portal Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Portal Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Portal Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Register Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Register Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Register Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Register Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Register Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>Star Toolbar Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Star Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Star Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Star Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Star Toolbar Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>User Info Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=User Info Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=User Info Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>User Info Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>User Info Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>User Toolbar Dashboard Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=User Toolbar Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=User Toolbar Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>User Toolbar Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>User Toolbar Dashboard Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>User Toolbar Group Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=User Toolbar Group Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=User Toolbar Group Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>User Toolbar Group Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>User Toolbar Group Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Exoadmin >>User Toolbar Site Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=User Toolbar Site Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=User Toolbar Site Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>User Toolbar Site Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>User Toolbar Site Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Banner Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Banner Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Banner Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Banner Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Banner Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Breadcumbs Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Breadcumbs Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Breadcumbs Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Breadcumbs Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Breadcumbs Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Footer Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Footer Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Footer Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Footer Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Footer Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Homepage Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=HomePage Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=HomePage Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>HomePage Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>HomePage Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Iframe Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=IFrame Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=IFrame Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>IFrame Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>IFrame Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Logo Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Logo Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Logo Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Logo Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Logo Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Navigation Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Navigation Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Verify details of Web >>Sitemap Portlet--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Site Map Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Site Map Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Site Map Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Site Map Portlet</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_17_ManageRemoteGadget.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8080/" />
+<title>Test_SNF_PRL_17_ManageRemoteGadget</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_17_ManageRemoteGadget</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Manage remote gadget--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Regsitry--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Gadget tab--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Gadget</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Gadget</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click add remote gadget icon --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetManagement']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetManagement']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>url</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>url</td>
+ <td>http://www.labpixies.com/campaigns/phonebook/phonebook_igoogle.xml</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Phonebook</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Phonebook</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add gadget into category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetInfo']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetInfo']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Click here to add into categories</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Click here to add into categories</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>category_Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>category_Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete gadget--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[4]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[4]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this gadget?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextNotPresent</td>
+ <td>Phonebook</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Phonebook</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_18_ManageManualGadget.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_18_ManageManualGadget.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_18_ManageManualGadget.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_18_ManageManualGadget</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_18_ManageManualGadget</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Manage manual gadget--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Application Registry--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Gadget tab--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Gadget</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Gadget</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click create new gadget--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetManagement']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetManagement']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_SNF_PRL_18</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>hello world example</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>hello world example</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit gadget --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetInfo']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetInfo']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>source</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>source</td>
+ <td><?xml version="1.0" encoding="UTF-8"?><Module><ModulePrefs title="Test_SNF_PRL_18_edit" description="The hello world gadget."/><Content type="html"></Content></Module></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_SNF_PRL_18_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_SNF_PRL_18_edit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click Refresh --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetInfo']//div[@title='Refresh information']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetInfo']//div[@title='Refresh information']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add gadget into category--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Click here to add into categories</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Click here to add into categories</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>category_Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>category_Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Gadgets</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete gadget--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[5]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[5]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this gadget?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_19_LinkToGadget.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_19_LinkToGadget.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_19_LinkToGadget.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_19_LinkToGadget</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_19_LinkToGadget</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Link to pages--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Site map on Breadcumbs--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='PortalNavigationTopContainer']/div[2]/div/div/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click on link to move to another page--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UISiteMap']/div[2]/div/div[4]/div[1]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UISiteMap']/div[2]/div/div[4]/div[1]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UISiteMap']/div[2]/div/div[4]/div[2]/div[2]/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UISiteMap']/div[2]/div/div[4]/div[2]/div[2]/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseOver</td>
+ <td>//div[@id='PortalNavigationTopContainer']/div[1]/div[1]/div/div/div/div/div/a</td>
+ <td>Organization</td>
+</tr>
+<tr>
+ <td>mouseOver</td>
+ <td>//div[2]/div/div/div[2]/div/div/a</td>
+ <td>Users and groups management</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_20_ExpandAllCollapseAll.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_20_ExpandAllCollapseAll.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_20_ExpandAllCollapseAll.html 2010-07-30 10:40:37 UTC (rev 3729)
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_20_ExpandAllCollapseAll</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_20_ExpandAllCollapseAll</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-CollapseAll-</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=SiteMap</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Expand SiteMap tree</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UISiteMap']/div[1]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Page Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Page Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>New Staff</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Blog</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Google</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Facebook</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Collapse SiteMap Tree</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UISiteMap']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UISiteMap']/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify Application Registry disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyElementNotPresent</td>
+ <td>//div[@id='UISiteMap']/div[2]/div/div[3]/div[2]/div[1]/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify Page Management disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Page Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify New Staff disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>New Staff</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify Users and groups management disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify Blog disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Blog</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify Google disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Google</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- verify Facebook disappear</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>Facebook</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 5 months
gatein SVN: r3728 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-30 05:59:10 -0400 (Fri, 30 Jul 2010)
New Revision: 3728
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17_CollapseAll.html
Log:
TESTVN-356: Clean and improve
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17_CollapseAll.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17_CollapseAll.html 2010-07-30 09:46:15 UTC (rev 3727)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17_CollapseAll.html 2010-07-30 09:59:10 UTC (rev 3728)
@@ -68,6 +68,16 @@
</tr>
<tr>
<td>waitForTextPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
<td>Page Management</td>
<td></td>
</tr>
14 years, 5 months
gatein SVN: r3727 - in portal/trunk: component/web/api/src/test/java/org/exoplatform/web and 15 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-07-30 05:46:15 -0400 (Fri, 30 Jul 2010)
New Revision: 3727
Added:
portal/trunk/component/web/controller/src/main/java/conf/
portal/trunk/component/web/controller/src/main/java/conf/portal/
portal/trunk/component/web/controller/src/main/java/conf/portal/configuration.xml
portal/trunk/component/web/server/src/main/java/conf/
portal/trunk/component/web/server/src/main/java/conf/portal/
portal/trunk/component/web/server/src/main/java/conf/portal/configuration.xml
portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadSessionListener.java
Removed:
portal/trunk/component/web/api/src/test/java/conf/portal/
portal/trunk/component/web/api/src/test/java/org/exoplatform/web/command/
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/command/
Modified:
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebRequestHandler.java
portal/trunk/component/web/security/src/main/java/conf/portal/configuration.xml
portal/trunk/component/web/server/src/main/java/org/exoplatform/download/DownloadService.java
portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/DownloadHandler.java
portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java
portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormUploadInput.java
Log:
GTNPORTAL-1380 Upload/Download services improvements
Added: portal/trunk/component/web/controller/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/web/controller/src/main/java/conf/portal/configuration.xml (rev 0)
+++ portal/trunk/component/web/controller/src/main/java/conf/portal/configuration.xml 2010-07-30 09:46:15 UTC (rev 3727)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <type>org.exoplatform.web.WebAppController</type>
+ </component>
+
+</configuration>
Modified: portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -21,12 +21,10 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.Application;
-import org.exoplatform.web.command.CommandHandler;
import java.util.ArrayList;
import java.util.HashMap;
@@ -67,10 +65,8 @@
applications_ = new HashMap<String, Application>();
attributes_ = new HashMap<String, Object>();
handlers_ = new HashMap<String, WebRequestHandler>();
- register(new CommandHandler());
}
- @SuppressWarnings("unused")
public Object getAttribute(String name, Object value)
{
return attributes_.get(name);
@@ -108,7 +104,7 @@
for (String path : handler.getPath())
handlers_.put(path, handler);
}
-
+
public void unregister(String[] paths)
{
for (String path : paths)
Modified: portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebRequestHandler.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebRequestHandler.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/WebRequestHandler.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -19,6 +19,8 @@
package org.exoplatform.web;
+import org.exoplatform.container.component.BaseComponentPlugin;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -31,9 +33,9 @@
* In case of portal the path is /portal but you could return your own from the getPath() method and hence the
* WebAppController would use your own handler
*
- * The execute method is to be overideen and the buisness logic should be handled here
+ * The execute method is to be overrided and the buisness logic should be handled here
*/
-abstract public class WebRequestHandler
+abstract public class WebRequestHandler extends BaseComponentPlugin
{
public void onInit(WebAppController controller) throws Exception
Modified: portal/trunk/component/web/security/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/web/security/src/main/java/conf/portal/configuration.xml 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/security/src/main/java/conf/portal/configuration.xml 2010-07-30 09:46:15 UTC (rev 3727)
@@ -24,32 +24,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <type>org.exoplatform.upload.UploadService</type>
- <init-params>
- <value-param>
- <name>upload.limit.size</name>
- <description>Maximum size of the file to upload in MB</description>
- <value>10</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <type>org.exoplatform.download.DownloadService</type>
- <init-params>
- <value-param>
- <name>download.resource.cache.size</name>
- <description>Maximun number of the download can be in the cache</description>
- <value>500</value>
- </value-param>
- </init-params>
- </component>
- <component>
- <type>org.exoplatform.web.WebAppController</type>
- </component>
-
<component>
<key>org.exoplatform.web.application.javascript.JavascriptConfigService</key>
<type>org.exoplatform.web.application.javascript.JavascriptConfigService</type>
Added: portal/trunk/component/web/server/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/web/server/src/main/java/conf/portal/configuration.xml (rev 0)
+++ portal/trunk/component/web/server/src/main/java/conf/portal/configuration.xml 2010-07-30 09:46:15 UTC (rev 3727)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.exoplatform.upload.UploadService</type>
+ <init-params>
+ <value-param>
+ <name>upload.limit.size</name>
+ <description>Maximum size of the file to upload in MB</description>
+ <value>10</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.download.DownloadService</type>
+ <init-params>
+ <value-param>
+ <name>download.resource.cache.size</name>
+ <description>Maximun number of the download can be in the cache</description>
+ <value>500</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.listener.ListenerService</target-component>
+ <component-plugin>
+ <name>org.exoplatform.web.GenericHttpListener.sessionDestroyed</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.upload.UploadSessionListener</type>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.web.WebAppController</target-component>
+ <component-plugin>
+ <name>UploadHandler</name>
+ <set-method>register</set-method>
+ <type>org.exoplatform.web.handler.UploadHandler</type>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.web.WebAppController</target-component>
+ <component-plugin>
+ <name>DownloadHandler</name>
+ <set-method>register</set-method>
+ <type>org.exoplatform.web.handler.DownloadHandler</type>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/download/DownloadService.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/download/DownloadService.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/download/DownloadService.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -35,11 +35,13 @@
public class DownloadService
{
- private Cache downloadResources_;
+ private Cache downloadResources_;
private Map<String, DownloadResource> defaultResources_;
private PortalContainerInfo pinfo_;
+
+ public static final String DOWNLOAD_HANDLER_PATH = "download";
public DownloadService(PortalContainerInfo pinfo, InitParams params) throws Exception
{
@@ -82,8 +84,8 @@
public String getDownloadLink(String id)
{
- return "/" + pinfo_.getContainerName() + "/command?"
- + "type=org.exoplatform.web.command.handler.DownloadHandler&resourceId=" + id;
+ return "/" + pinfo_.getContainerName() + "/" + DOWNLOAD_HANDLER_PATH + "?"
+ + "resourceId=" + id;
}
@SuppressWarnings("serial")
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -19,29 +19,29 @@
package org.exoplatform.upload;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.PortalContainerInfo;
-import org.gatein.common.logging.Logger;
-import org.gatein.common.logging.LoggerFactory;
-
import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.util.HashSet;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan.nguyen(a)exoplatform.com
- * Dec 8, 2006
- */
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.ProgressListener;
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.PortalContainerInfo;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+
public class UploadService
{
-
/** . */
private static final Logger log = LoggerFactory.getLogger(UploadService.class);
@@ -53,6 +53,8 @@
private Map<String, Integer> uploadLimitsMB_ = new LinkedHashMap<String, Integer>();
+ public static String UPLOAD_RESOURCES_STACK = "uploadResourcesStack";
+
public UploadService(PortalContainerInfo pinfo, InitParams params) throws Exception
{
String tmpDir = System.getProperty("java.io.tmpdir");
@@ -67,167 +69,129 @@
}
/**
- * Create UploadResource for HttpServletRequest.
- * If Upload size greater than limit upload size, do not create UploadResource
- * @param request
- * the webapp's {@link javax.servlet.http.HttpServletRequest}
- * @throws IOException
- * any io exception
+ * Create UploadResource for HttpServletRequest
+ *
+ * @param requestow
+ * the webapp's {@link javax.servlet.http.HttpServletRequest}
+ * @throws FileUploadException
*/
- public void createUploadResource(HttpServletRequest request) throws IOException
+ @SuppressWarnings("unchecked")
+ public void createUploadResource(HttpServletRequest request) throws FileUploadException
{
String uploadId = request.getParameter("uploadId");
- // by default, use the limit set in the service
- //int limitMB = defaultUploadLimitMB_;
- // if the limit is set in the request (specific for this upload) then use this value instead of the default one
- //if (uploadLimitsMB_.containsKey(uploadId)) limitMB = uploadLimitsMB_.get(uploadId).intValue() ;
- int limitMB = uploadLimitsMB_.get(uploadId).intValue();
+ UploadResource upResource = new UploadResource(uploadId);
+ upResource.setFileName("");// Avoid NPE in UploadHandler
+ uploadResources.put(upResource.getUploadId(), upResource);
+
+ putToStackInSession(request.getSession(true), uploadId);
- UploadResource upResource = new UploadResource(uploadId);
- RequestStreamReader reader = new RequestStreamReader(upResource);
- int estimatedSizeMB = (request.getContentLength() / 1024) / 1024;
- if (limitMB > 0 && estimatedSizeMB > limitMB)
- { // a limit set to 0 means unlimited
+ double contentLength = request.getContentLength();
+ upResource.setEstimatedSize(contentLength);
+ if (isLimited(upResource, contentLength))
+ {
upResource.setStatus(UploadResource.FAILED_STATUS);
- //upResource.setLimitMB(limitMB);
- uploadResources.put(uploadId, upResource);
- log.debug("Upload cancelled because file bigger than size limit : " + estimatedSizeMB + " MB > "
- + limitMB + " MB");
- // WebuiRequestContext ctx = WebuiRequestContext.getCurrentInstance();
- // UIApplication uiApp = ctx.getUIApplication();
- // uiApp.addMessage(new ApplicationMessage("The file must be < "+limitMB+" MB.", null, ApplicationMessage.WARNING));
return;
}
- // TODO : display error message, terminate upload correctly
- String headerEncoding = request.getCharacterEncoding();
- Map<String, String> headers = reader.parseHeaders(request.getInputStream(), headerEncoding);
-
- String fileName = reader.getFileName(headers);
- if (fileName == null)
- fileName = uploadId;
- fileName = fileName.substring(fileName.lastIndexOf('\\') + 1);
-
- upResource.setFileName(fileName);
- upResource.setMimeType(headers.get(RequestStreamReader.CONTENT_TYPE));
- upResource.setStoreLocation(uploadLocation_ + "/" + uploadId + "." + fileName);
- upResource.setEstimatedSize(request.getContentLength());
-
- uploadResources.put(upResource.getUploadId(), upResource);
-
- File fileStore = new File(upResource.getStoreLocation());
- if (!fileStore.exists())
- fileStore.createNewFile();
- FileOutputStream output = new FileOutputStream(fileStore);
- reader.readBodyData(request, output);
-
- if (upResource.getStatus() == UploadResource.UPLOADING_STATUS)
+ ServletFileUpload servletFileUpload = makeServletFileUpload(upResource);
+ // parse request
+ List<FileItem> itemList = servletFileUpload.parseRequest(request);
+ if (itemList == null || itemList.size() != 1 || itemList.get(0).isFormField())
{
- upResource.setStatus(UploadResource.UPLOADED_STATUS);
+ log.debug("Please upload 1 file per request");
return;
}
- uploadResources.remove(uploadId);
- fileStore.delete();
- }
+ DiskFileItem fileItem = (DiskFileItem)itemList.get(0);
+ String fileName = fileItem.getName();
+ String storeLocation = uploadLocation_ + "/" + uploadId + "." + fileName;
- /**
- * Create UploadResource for uploadId.
- * If Upload size greater than limit upload size, do not create UploadResource.
- * @param uploadId
- * the uploadId will be use to create UploadResource
- * @param encoding
- * type of encode
- * @param contentType
- * type of upload content
- * @param contentLength
- * size of upload content
- * @param inputStream
- * java.io.InputStream
- * @throws Exception
- */
- public void createUploadResource(String uploadId, String encoding, String contentType, double contentLength,
- InputStream inputStream) throws Exception
- {
- UploadResource upResource = new UploadResource(uploadId);
- RequestStreamReader reader = new RequestStreamReader(upResource);
- int limitMB = uploadLimitsMB_.get(uploadId).intValue();
- int estimatedSizeMB = (int)contentLength / 1024 / 1024;
- if (limitMB > 0 && estimatedSizeMB > limitMB)
- { // a limit set to 0 means unlimited
- upResource.setStatus(UploadResource.FAILED_STATUS);
- uploadResources.put(uploadId, upResource);
- log.debug("Upload cancelled because file bigger than size limit : " + estimatedSizeMB + " MB > "
- + limitMB + " MB");
- return;
- }
- Map<String, String> headers = reader.parseHeaders(inputStream, encoding);
+ // commons-fileupload will store the temp file with name *.tmp
+ // we need to rename it to our desired name
+ fileItem.getStoreLocation().renameTo(new File(storeLocation));
- String fileName = reader.getFileName(headers);
- if (fileName == null)
- fileName = uploadId;
- fileName = fileName.substring(fileName.lastIndexOf('\\') + 1);
-
upResource.setFileName(fileName);
- upResource.setMimeType(headers.get(RequestStreamReader.CONTENT_TYPE));
- upResource.setStoreLocation(uploadLocation_ + "/" + uploadId + "." + fileName);
- upResource.setEstimatedSize(contentLength);
- uploadResources.put(upResource.getUploadId(), upResource);
- File fileStore = new File(upResource.getStoreLocation());
- if (!fileStore.exists())
- fileStore.createNewFile();
- FileOutputStream output = new FileOutputStream(fileStore);
- reader.readBodyData(inputStream, contentType, output);
+ upResource.setMimeType(fileItem.getContentType());
+ upResource.setStoreLocation(storeLocation);
+ upResource.setStatus(UploadResource.UPLOADED_STATUS);
+ }
- if (upResource.getStatus() == UploadResource.UPLOADING_STATUS)
+ @SuppressWarnings("unchecked")
+ private void putToStackInSession(HttpSession session, String uploadId)
+ {
+ Set<String> uploadResouceIds = (Set<String>)session.getAttribute(UploadService.UPLOAD_RESOURCES_STACK);
+ if (uploadResouceIds == null)
{
- upResource.setStatus(UploadResource.UPLOADED_STATUS);
- return;
+ uploadResouceIds = new HashSet();
}
-
- uploadResources.remove(uploadId);
- fileStore.delete();
+ uploadResouceIds.add(uploadId);
+ session.setAttribute(UploadService.UPLOAD_RESOURCES_STACK, uploadResouceIds);
}
/**
* Get UploadResource by uploadId
+ *
* @param uploadId
- * uploadId of UploadResource
+ * uploadId of UploadResource
* @return org.exoplatform.upload.UploadResource of uploadId
*/
public UploadResource getUploadResource(String uploadId)
- {//throws Exception
- UploadResource upResource = uploadResources.get(uploadId);
- return upResource;
+ {
+ return uploadResources.get(uploadId);
}
/**
- * Remove UploadResource by uploadId, Delete temp file of UploadResource.
- * If uploadId is null or UploadResource is null or Store Location of UploadResource is null, do nothing
+ * Clean up temporary files that are uploaded in the Session but not removed yet
+ *
+ * @param session
+ */
+ public void cleanUp(HttpSession session)
+ {
+ log.debug("Cleaning up uploaded files for temporariness");
+ Set<String> uploadIds = (Set<String>)session.getAttribute(UploadService.UPLOAD_RESOURCES_STACK);
+ if (uploadIds != null)
+ {
+ for (String id : uploadIds)
+ {
+ removeUploadResource(id);
+ uploadLimitsMB_.remove(id);
+ }
+ }
+ }
+
+ /**
+ * Remove UploadResource by uploadId, Delete temp file of UploadResource. If
+ * uploadId is null or UploadResource is null, do nothing
+ *
* @param uploadId
- * uploadId of UploadResource will be removed
+ * uploadId of UploadResource will be removed
*/
- public void removeUpload(String uploadId)
+ public void removeUploadResource(String uploadId)
{
if (uploadId == null)
return;
UploadResource upResource = uploadResources.get(uploadId);
- if (upResource == null)
- return;
- if (upResource.getStoreLocation() == null)
- return;
- File file = new File(upResource.getStoreLocation());
- file.delete();
- uploadResources.remove(uploadId);
- //uploadLimitsMB_.remove(uploadId);
+ if (upResource != null)
+ {
+ uploadResources.remove(uploadId);
+
+ if (upResource.getStoreLocation() != null)
+ {
+ File file = new File(upResource.getStoreLocation());
+ file.delete();
+ }
+ }
+
+ // uploadLimitsMB_.remove(uploadId);
}
/**
- * Registry upload limit size for uploadLimitsMB_.
- * If limitMB is null, defaultUploadLimitMB_ will be registried
+ * Registry upload limit size for uploadLimitsMB_. If limitMB is null,
+ * defaultUploadLimitMB_ will be registried
+ *
* @param uploadId
* @param limitMB
- * upload limit size
+ * upload limit size
*/
public void addUploadLimit(String uploadId, Integer limitMB)
{
@@ -239,11 +203,63 @@
/**
* Get all upload limit sizes
- * @return
- * all upload limit sizes
+ *
+ * @return all upload limit sizes
*/
public Map<String, Integer> getUploadLimitsMB()
{
return uploadLimitsMB_;
}
-}
\ No newline at end of file
+
+ private ServletFileUpload makeServletFileUpload(UploadResource upResource)
+ {
+ // Create a factory for disk-based file items
+ DiskFileItemFactory factory = new DiskFileItemFactory();
+
+ // Set factory constraints
+ factory.setSizeThreshold(0);
+ factory.setRepository(new File(uploadLocation_));
+
+ // Create a new file upload handler
+ ServletFileUpload upload = new ServletFileUpload(factory);
+ upload.setProgressListener(makeProgressListener(upResource));
+ return upload;
+ }
+
+ private ProgressListener makeProgressListener(final UploadResource upResource)
+ {
+ return new ProgressListener()
+ {
+ public void update(long pBytesRead, long pContentLength, int pItems)
+ {
+ if (pBytesRead == upResource.getUploadedSize())
+ return;
+ upResource.addUploadedBytes(pBytesRead - upResource.getUploadedSize());
+ }
+ };
+ }
+
+ private boolean isLimited(UploadResource upResource, double contentLength)
+ {
+ // by default, use the limit set in the service
+ int limitMB = defaultUploadLimitMB_;
+ // if the limit is set in the request (specific for this upload) then use
+ // this value instead of the default one
+ if (uploadLimitsMB_.containsKey(upResource.getUploadId()))
+ {
+ limitMB = uploadLimitsMB_.get(upResource.getUploadId()).intValue();
+ }
+
+ int estimatedSizeMB = (int)((contentLength / 1024) / 1024);
+ if (limitMB > 0 && estimatedSizeMB > limitMB)
+ { // a limit set to 0 means unlimited
+ if (log.isDebugEnabled())
+ {
+ log.debug("Upload cancelled because file bigger than size limit : " + estimatedSizeMB + " MB > " + limitMB
+ + " MB");
+ }
+ return true;
+ }
+ return false;
+ }
+}
Added: portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadSessionListener.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadSessionListener.java (rev 0)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadSessionListener.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -0,0 +1,30 @@
+package org.exoplatform.upload;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.listener.Event;
+import org.exoplatform.services.listener.Listener;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+
+/**
+ * This listener for the purpose of cleaning up temporary files that are uploaded to the server
+ * but not removed by specific actions from user
+ *
+ * The listener is triggered when a session is destroyed
+ *
+ * @author <a href="mailto:trongtt@gmail.com">Tran The Trong</a>
+ * @version $Revision$
+ */
+public class UploadSessionListener extends Listener<PortalContainer, HttpSessionEvent>
+{
+ @Override
+ public void onEvent(Event<PortalContainer, HttpSessionEvent> event) throws Exception
+ {
+ PortalContainer container = event.getSource();
+ HttpSession session = event.getData().getSession();
+
+ UploadService uploadService = (UploadService)container.getComponentInstanceOfType(UploadService.class);
+ uploadService.cleanUp(session);
+ }
+}
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/DownloadHandler.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/DownloadHandler.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/DownloadHandler.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -24,7 +24,7 @@
import org.exoplatform.download.DownloadResource;
import org.exoplatform.download.DownloadService;
import org.exoplatform.web.WebAppController;
-import org.exoplatform.web.command.Command;
+import org.exoplatform.web.WebRequestHandler;
import java.io.InputStream;
import java.io.OutputStream;
@@ -39,14 +39,18 @@
* thuy.le(a)exoplatform.com
* Dec 9, 2006
*/
-public class DownloadHandler extends Command
+public class DownloadHandler extends WebRequestHandler
{
- private String resourceId;
+ @Override
+ public String[] getPath()
+ {
+ return new String[]{"/download"};
+ }
- @SuppressWarnings("unused")
public void execute(WebAppController controller, HttpServletRequest req, HttpServletResponse res) throws Exception
{
+ String resourceId = req.getParameter("resourceId");
res.setHeader("Cache-Control", "private max-age=600, s-maxage=120");
ExoContainer container = ExoContainerContext.getCurrentContainer();
DownloadService dservice = (DownloadService)container.getComponentInstanceOfType(DownloadService.class);
@@ -87,11 +91,6 @@
}
}
- public String getResourceId()
- {
- return resourceId;
- }
-
private static void optimalRead(InputStream is, OutputStream os) throws Exception
{
int bufferLength = 1024; //TODO: Better to compute bufferLength in term of -Xms, -Xmx properties
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -20,11 +20,12 @@
package org.exoplatform.web.handler;
import org.exoplatform.container.ExoContainer;
+
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.upload.UploadResource;
import org.exoplatform.upload.UploadService;
import org.exoplatform.web.WebAppController;
-import org.exoplatform.web.command.Command;
+import org.exoplatform.web.WebRequestHandler;
import java.io.Writer;
import java.net.URLEncoder;
@@ -38,30 +39,24 @@
* nhudinhthuan(a)exoplatform.com
* Dec 9, 2006
*/
-public class UploadHandler extends Command
+public class UploadHandler extends WebRequestHandler
{
static enum UploadServiceAction {
PROGRESS, UPLOAD, DELETE, ABORT
}
- private String action;
-
- private String[] uploadId;
-
- public void setAction(String action)
+ @Override
+ public String[] getPath()
{
- this.action = action;
+ return new String[]{"/upload"};
}
- public void setUploadId(String[] uploadId)
- {
- this.uploadId = uploadId;
- }
-
- @SuppressWarnings("unused")
public void execute(WebAppController controller, HttpServletRequest req, HttpServletResponse res) throws Exception
{
+ String action = req.getParameter("action");
+ String[] uploadId = req.getParameterValues("uploadId");
+
res.setHeader("Cache-Control", "no-cache");
ExoContainer container = ExoContainerContext.getCurrentContainer();
@@ -84,6 +79,7 @@
continue;
if (upResource.getStatus() == UploadResource.FAILED_STATUS)
{
+
int limitMB = service.getUploadLimitsMB().get(uploadId[i]).intValue();
value.append("\n \"").append(uploadId[i]).append("\": {");
value.append("\n \"status\":").append('\"').append("failed").append("\",");
@@ -113,14 +109,11 @@
}
else if (uploadActionService == UploadServiceAction.DELETE)
{
- service.removeUpload(uploadId[0]);
+ service.removeUploadResource(uploadId[0]);
}
else if (uploadActionService == UploadServiceAction.ABORT)
{
- //TODO: dang.tung - we don't need 2 statements because it'll show error when we reload browser
- //UploadResource upResource = service.getUploadResource(uploadId[0]);
- //if(upResource != null) upResource.setStatus(UploadResource.UPLOADED_STATUS) ;
- service.removeUpload(uploadId[0]);
+ service.removeUploadResource(uploadId[0]);
}
}
Modified: portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-07-30 09:46:15 UTC (rev 3727)
@@ -220,10 +220,14 @@
<url-pattern>/service</url-pattern>
</servlet-mapping>
<servlet-mapping>
- <servlet-name>portal</servlet-name>
- <url-pattern>/command/*</url-pattern>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/upload/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/download/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
<servlet-name>RestServer</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-07-30 09:46:15 UTC (rev 3727)
@@ -28,8 +28,8 @@
* @param {boolean} isAutoUpload auto upload or none
*/
UIUpload.prototype.initUploadEntry = function(uploadId, isAutoUpload) {
- var url = eXo.env.server.context + "/command?" ;
- url += "type=org.exoplatform.web.command.handler.UploadHandler&action=progress&uploadId="+uploadId ;
+ var url = eXo.env.server.context + "/upload?" ;
+ url += "action=progress&uploadId="+uploadId ;
var responseText = ajaxAsyncGetRequest(url, false);
var response;
@@ -51,9 +51,8 @@
UIUpload.prototype.createUploadEntry = function(uploadId, isAutoUpload) {
var iframe = document.getElementById(uploadId+'uploadFrame');
var idoc = iframe.contentWindow.document ;
- var uploadAction = eXo.env.server.context + "/command?" ;
- uploadAction += "type=org.exoplatform.web.command.handler.UploadHandler";
- uploadAction += "&uploadId=" + uploadId+"&action=upload" ;
+ var uploadAction = eXo.env.server.context + "/upload?" ;
+ uploadAction += "uploadId=" + uploadId+"&action=upload" ;
idoc.open();
idoc.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
idoc.write("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='" +eXo.core.I18n.lang+ "' dir='" +eXo.core.I18n.dir+ "'>");
@@ -85,8 +84,8 @@
UIUpload.prototype.refeshProgress = function(elementId) {
var list = eXo.webui.UIUpload.listUpload;
if(list.length < 1) return;
- var url = eXo.env.server.context + "/command?" ;
- url += "type=org.exoplatform.web.command.handler.UploadHandler&action=progress" ;
+ var url = eXo.env.server.context + "/upload?" ;
+ url += "action=progress" ;
// var url = eXo.env.server.context + "/upload?action=progress";
for(var i = 0; i < list.length; i++){
url = url + "&uploadId=" + list[i];
@@ -165,8 +164,8 @@
*/
UIUpload.prototype.abortUpload = function(id) {
eXo.webui.UIUpload.listUpload.remove(id);
- var url = eXo.env.server.context + "/command?" ;
- url += "type=org.exoplatform.web.command.handler.UploadHandler&uploadId=" +id+"&action=abort" ;
+ var url = eXo.env.server.context + "/upload?" ;
+ url += "uploadId=" +id+"&action=abort" ;
// var url = eXo.env.server.context + "/upload?uploadId=" +id+"&action=abort" ;
var request = eXo.core.Browser.createHttpRequest();
request.open('GET', url, false);
@@ -197,8 +196,8 @@
* @param {String} id upload identifier
*/
UIUpload.prototype.deleteUpload = function(id) {
- var url = eXo.env.server.context + "/command?";
- url += "type=org.exoplatform.web.command.handler.UploadHandler&uploadId=" +id+"&action=delete" ;
+ var url = eXo.env.server.context + "/upload?";
+ url += "uploadId=" +id+"&action=delete" ;
// var url = eXo.env.server.context + "/upload?uploadId=" +id+"&action=delete" ;
var request = eXo.core.Browser.createHttpRequest();
request.open('GET', url, false);
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml 2010-07-30 09:46:15 UTC (rev 3727)
@@ -267,8 +267,12 @@
</servlet-mapping>
<servlet-mapping>
<servlet-name>portal</servlet-name>
- <url-pattern>/command/*</url-pattern>
+ <url-pattern>/upload/*</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/download/*</url-pattern>
+ </servlet-mapping>
<servlet-mapping>
<servlet-name>RestServer</servlet-name>
<url-pattern>/rest/*</url-pattern>
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormUploadInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormUploadInput.java 2010-07-30 08:48:02 UTC (rev 3726)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormUploadInput.java 2010-07-30 09:46:15 UTC (rev 3727)
@@ -54,11 +54,6 @@
*/
private boolean isAutoUpload = false;
- /**
- * The maximum size of the file to upload, in MB
- */
- //private int limitMB_;
-
public UIFormUploadInput(String name, String bindingExpression)
{
super(name, bindingExpression, String.class);
@@ -127,9 +122,8 @@
WebuiRequestContext pcontext = (WebuiRequestContext)context.getParentAppRequestContext();
if (pcontext == null)
pcontext = context;
- String uploadAction = pcontext.getRequestContextPath() + "/command?";
- uploadAction += "type=org.exoplatform.web.command.handler.UploadHandler";
- uploadAction += "&uploadId=" + uploadId_ + "&action=upload";
+ String uploadAction = pcontext.getRequestContextPath() + "/upload?";
+ uploadAction += "uploadId=" + uploadId_ + "&action=upload";
return uploadAction;
}
@@ -147,9 +141,4 @@
{
this.isAutoUpload = isAutoUpload;
}
-
- // public void setLimit(int size) { limitMB_ = size; }
- //
- // public int getLimit() { return limitMB_; }
-
}
\ No newline at end of file
14 years, 5 months
gatein SVN: r3726 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-30 04:48:02 -0400 (Fri, 30 Jul 2010)
New Revision: 3726
Modified:
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
Log:
Update Snifftest for GateIn_v3.1.0
Modified: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
===================================================================
(Binary files differ)
14 years, 5 months
gatein SVN: r3725 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-30 00:03:34 -0400 (Fri, 30 Jul 2010)
New Revision: 3725
Modified:
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
Log:
Update Snifftest for GateIn_v3.1.0
Modified: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
===================================================================
(Binary files differ)
14 years, 5 months
gatein SVN: r3724 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-29 23:45:35 -0400 (Thu, 29 Jul 2010)
New Revision: 3724
Modified:
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
Log:
Update Snifftest for GateIn_v3.1.0
Modified: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
===================================================================
(Binary files differ)
14 years, 5 months
gatein SVN: r3723 - portal/branches.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-07-29 10:31:44 -0400 (Thu, 29 Jul 2010)
New Revision: 3723
Removed:
portal/branches/management/
Log:
cleaning up old branch
14 years, 5 months