gatein SVN: r3335 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-06-15 02:24:46 -0400 (Tue, 15 Jun 2010)
New Revision: 3335
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_14_01_032_CreateNewNodeWithPageNameTheSameWithExisting.html
Log:
TESTVN-399: Create new GateIn Selenium Scrips
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_14_01_032_CreateNewNodeWithPageNameTheSameWithExisting.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_14_01_032_CreateNewNodeWithPageNameTheSameWithExisting.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_POR_14_01_032_CreateNewNodeWithPageNameTheSameWithExisting.html 2010-06-15 06:24:46 UTC (rev 3335)
@@ -0,0 +1,327 @@
+<?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_POR_14_01_032_CreateNewNodeWithPageNameTheSameWithExisting</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_POR_14_01_032_CreateNewNodeWithPageNameTheSameWithExisting</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</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 Site --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Site</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new node--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Page Selector--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageName</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageTitle</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageSelector2']/div[3]/table/tbody/tr/td/div[2]/div/div/div/div</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>echo</td>
+ <td>-- Add new node have same page name--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>POR_14_01_032_add</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>POR_14_01_032_add</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add page have same name--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>pageName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageName</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageTitle</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- do action add page have same name--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Create Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Create Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Show message alert--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Back</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Back</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete node(page)--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>componentExoContextMenu</td>
+ <td>//a[@class='NodeIcon DefaultPageIcon' and @title='POR_14_01_032']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Delete Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Delete Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this node?</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>echo</td>
+ <td>-- Go to Page Management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Page Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>searchTerm</td>
+ <td>POR_14_01_032</td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>searchOption</td>
+ <td>label=Title</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//form[@id='UIPageSearch']/div[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//form[@id='UIPageSearch']/div[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//img[@title='Delete Page']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//img[@title='Delete Page']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Do you want to delete this page?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Close Message--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 6 months
gatein SVN: r3334 - in components/wsrp/trunk: producer/src/main/java/org/gatein/wsrp/producer/v1 and 1 other directory.
by do-not-reply@jboss.org
Author: mwringe
Date: 2010-06-15 02:07:47 -0400 (Tue, 15 Jun 2010)
New Revision: 3334
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
Log:
Update WSRP1Producer to implement empty methods and add corresponding methods to the Converter classes.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-15 02:09:01 UTC (rev 3333)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-15 06:07:47 UTC (rev 3334)
@@ -31,14 +31,21 @@
import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
+import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
import org.oasis.wsrp.v1.V1CacheControl;
import org.oasis.wsrp.v1.V1ClientData;
+import org.oasis.wsrp.v1.V1ClonePortlet;
import org.oasis.wsrp.v1.V1Contact;
import org.oasis.wsrp.v1.V1CookieProtocol;
import org.oasis.wsrp.v1.V1DestroyFailed;
+import org.oasis.wsrp.v1.V1DestroyPortlets;
import org.oasis.wsrp.v1.V1EmployerInfo;
import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1GetMarkup;
+import org.oasis.wsrp.v1.V1GetPortletProperties;
+import org.oasis.wsrp.v1.V1GetPortletPropertyDescription;
import org.oasis.wsrp.v1.V1GetServiceDescription;
+import org.oasis.wsrp.v1.V1InitCookie;
import org.oasis.wsrp.v1.V1InteractionParams;
import org.oasis.wsrp.v1.V1ItemDescription;
import org.oasis.wsrp.v1.V1LocalizedString;
@@ -47,8 +54,10 @@
import org.oasis.wsrp.v1.V1MarkupType;
import org.oasis.wsrp.v1.V1ModelDescription;
import org.oasis.wsrp.v1.V1ModelTypes;
+import org.oasis.wsrp.v1.V1ModifyRegistration;
import org.oasis.wsrp.v1.V1NamedString;
import org.oasis.wsrp.v1.V1Online;
+import org.oasis.wsrp.v1.V1PerformBlockingInteraction;
import org.oasis.wsrp.v1.V1PersonName;
import org.oasis.wsrp.v1.V1PortletContext;
import org.oasis.wsrp.v1.V1PortletDescription;
@@ -58,12 +67,14 @@
import org.oasis.wsrp.v1.V1PropertyList;
import org.oasis.wsrp.v1.V1RegistrationContext;
import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1ReleaseSessions;
import org.oasis.wsrp.v1.V1ResetProperty;
import org.oasis.wsrp.v1.V1Resource;
import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.V1ResourceValue;
import org.oasis.wsrp.v1.V1RuntimeContext;
import org.oasis.wsrp.v1.V1SessionContext;
+import org.oasis.wsrp.v1.V1SetPortletProperties;
import org.oasis.wsrp.v1.V1StateChange;
import org.oasis.wsrp.v1.V1Telecom;
import org.oasis.wsrp.v1.V1TelephoneNum;
@@ -72,14 +83,21 @@
import org.oasis.wsrp.v1.V1UploadContext;
import org.oasis.wsrp.v1.V1UserContext;
import org.oasis.wsrp.v1.V1UserProfile;
+import org.oasis.wsrp.v2.BlockingInteractionResponse;
import org.oasis.wsrp.v2.CacheControl;
import org.oasis.wsrp.v2.ClientData;
+import org.oasis.wsrp.v2.ClonePortlet;
import org.oasis.wsrp.v2.Contact;
import org.oasis.wsrp.v2.CookieProtocol;
+import org.oasis.wsrp.v2.DestroyPortlets;
import org.oasis.wsrp.v2.EmployerInfo;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.FailedPortlets;
+import org.oasis.wsrp.v2.GetMarkup;
+import org.oasis.wsrp.v2.GetPortletProperties;
+import org.oasis.wsrp.v2.GetPortletPropertyDescription;
import org.oasis.wsrp.v2.GetServiceDescription;
+import org.oasis.wsrp.v2.InitCookie;
import org.oasis.wsrp.v2.InteractionParams;
import org.oasis.wsrp.v2.ItemDescription;
import org.oasis.wsrp.v2.LocalizedString;
@@ -88,8 +106,10 @@
import org.oasis.wsrp.v2.MarkupType;
import org.oasis.wsrp.v2.ModelDescription;
import org.oasis.wsrp.v2.ModelTypes;
+import org.oasis.wsrp.v2.ModifyRegistration;
import org.oasis.wsrp.v2.NamedString;
import org.oasis.wsrp.v2.Online;
+import org.oasis.wsrp.v2.PerformBlockingInteraction;
import org.oasis.wsrp.v2.PersonName;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescription;
@@ -99,6 +119,7 @@
import org.oasis.wsrp.v2.PropertyList;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
+import org.oasis.wsrp.v2.ReleaseSessions;
import org.oasis.wsrp.v2.ResetProperty;
import org.oasis.wsrp.v2.Resource;
import org.oasis.wsrp.v2.ResourceList;
@@ -106,6 +127,7 @@
import org.oasis.wsrp.v2.RuntimeContext;
import org.oasis.wsrp.v2.SessionContext;
import org.oasis.wsrp.v2.SessionParams;
+import org.oasis.wsrp.v2.SetPortletProperties;
import org.oasis.wsrp.v2.StateChange;
import org.oasis.wsrp.v2.Telecom;
import org.oasis.wsrp.v2.TelephoneNum;
@@ -856,7 +878,179 @@
return null;
}
}
+
+ public static GetMarkup toV2GetMarkup(V1GetMarkup getMarkup)
+ {
+ if (getMarkup != null)
+ {
+ PortletContext portletContext = toV2PortletContext(getMarkup.getPortletContext());
+ RuntimeContext runtimeContext = toV2RuntimeContext(getMarkup.getRuntimeContext());
+ MarkupParams markupParams = toV2MarkupParams(getMarkup.getMarkupParams());
+ GetMarkup result = WSRPTypeFactory.createMarkupRequest(portletContext, runtimeContext, markupParams);
+
+ result.setRegistrationContext(toV2RegistrationContext(getMarkup.getRegistrationContext()));
+ result.setUserContext(toV2UserContext(getMarkup.getUserContext()));
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ public static ModifyRegistration toV2ModifyRegistration(V1ModifyRegistration modifyRegistration)
+ {
+ if (modifyRegistration != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(modifyRegistration.getRegistrationContext());
+ RegistrationData registrationData = toV2RegistrationData(modifyRegistration.getRegistrationData());
+ ModifyRegistration result = WSRPTypeFactory.createModifyRegistration(registrationContext, registrationData);
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static ClonePortlet toV2ClonePortlet(V1ClonePortlet clonePortlet)
+ {
+ if (clonePortlet != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(clonePortlet.getRegistrationContext());
+ PortletContext portletContext = toV2PortletContext(clonePortlet.getPortletContext());
+ UserContext userContext = toV2UserContext(clonePortlet.getUserContext());
+ ClonePortlet result = WSRPTypeFactory.createClonePortlet(registrationContext, portletContext, userContext);
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static PerformBlockingInteraction toV2PerformBlockingInteraction(V1PerformBlockingInteraction performBlockingInteraction)
+ {
+ if (performBlockingInteraction != null)
+ {
+ InteractionParams interactionParams = toV2InteractionParams(performBlockingInteraction.getInteractionParams());
+ MarkupParams markupParams = toV2MarkupParams(performBlockingInteraction.getMarkupParams());
+ PortletContext portletContext = toV2PortletContext(performBlockingInteraction.getPortletContext());
+ RuntimeContext runtimeContext = toV2RuntimeContext(performBlockingInteraction.getRuntimeContext());
+
+ PerformBlockingInteraction result = WSRPTypeFactory.createPerformBlockingInteraction(portletContext, runtimeContext, markupParams, interactionParams);
+
+ result.setRegistrationContext(toV2RegistrationContext(performBlockingInteraction.getRegistrationContext()));
+ result.setUserContext(toV2UserContext(performBlockingInteraction.getUserContext()));
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static DestroyPortlets toV2DestroyPortlets(V1DestroyPortlets destroyPortlets)
+ {
+ if (destroyPortlets != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(destroyPortlets.getRegistrationContext());
+ DestroyPortlets result = WSRPTypeFactory.createDestroyPortlets(registrationContext, destroyPortlets.getPortletHandles());
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static SetPortletProperties toV2SetPortletProperties(V1SetPortletProperties setPortletProperties)
+ {
+ if (setPortletProperties != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(setPortletProperties.getRegistrationContext());
+ PortletContext portletContext = toV2PortletContext(setPortletProperties.getPortletContext());
+ PropertyList propertyList = toV2PropertyList(setPortletProperties.getPropertyList());
+ SetPortletProperties result = WSRPTypeFactory.createSetPortletProperties(registrationContext, portletContext, propertyList);
+
+ result.setUserContext(toV2UserContext(setPortletProperties.getUserContext()));
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static GetPortletProperties toV2GetPortletProperties(V1GetPortletProperties getPortletProperties)
+ {
+ if (getPortletProperties != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(getPortletProperties.getRegistrationContext());
+ PortletContext portletContext = toV2PortletContext(getPortletProperties.getPortletContext());
+ UserContext userContext = toV2UserContext(getPortletProperties.getUserContext());
+ GetPortletProperties result = WSRPTypeFactory.createGetPortletProperties(registrationContext, portletContext, userContext, getPortletProperties.getNames());
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static ReleaseSessions toV2ReleaseSessions(V1ReleaseSessions releaseSessions)
+ {
+ if (releaseSessions != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(releaseSessions.getRegistrationContext());
+ ReleaseSessions result = WSRPTypeFactory.createReleaseSessions(registrationContext, releaseSessions.getSessionIDs());
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static InitCookie toV2InitCookie(V1InitCookie initCookie)
+ {
+ if (initCookie != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(initCookie.getRegistrationContext());
+ InitCookie result = WSRPTypeFactory.createInitCookie(registrationContext);
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static GetPortletPropertyDescription toV2GetPortletPropertyDescription(V1GetPortletPropertyDescription getPortletPropertyDescription)
+ {
+ if (getPortletPropertyDescription != null)
+ {
+ RegistrationContext registrationContext = toV2RegistrationContext(getPortletPropertyDescription.getRegistrationContext());
+ PortletContext portletContext = toV2PortletContext(getPortletPropertyDescription.getPortletContext());
+ UserContext userContext = toV2UserContext(getPortletPropertyDescription.getUserContext());
+ GetPortletPropertyDescription result = WSRPTypeFactory.createGetPortletPropertyDescription(registrationContext, portletContext, userContext, getPortletPropertyDescription.getDesiredLocales());
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public static class V1ToV2Extension implements Function<V1Extension, Extension>
{
public Extension apply(V1Extension from)
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-15 02:09:01 UTC (rev 3333)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-15 06:07:47 UTC (rev 3334)
@@ -26,19 +26,25 @@
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
+import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
import org.oasis.wsrp.v1.V1CacheControl;
import org.oasis.wsrp.v1.V1ClientData;
import org.oasis.wsrp.v1.V1Contact;
import org.oasis.wsrp.v1.V1CookieProtocol;
import org.oasis.wsrp.v1.V1DestroyFailed;
+import org.oasis.wsrp.v1.V1DestroyPortletsResponse;
import org.oasis.wsrp.v1.V1EmployerInfo;
import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1Fault;
+import org.oasis.wsrp.v1.V1GetPortletPropertyDescription;
import org.oasis.wsrp.v1.V1InteractionParams;
import org.oasis.wsrp.v1.V1ItemDescription;
import org.oasis.wsrp.v1.V1LocalizedString;
import org.oasis.wsrp.v1.V1MarkupContext;
import org.oasis.wsrp.v1.V1MarkupParams;
+import org.oasis.wsrp.v1.V1MarkupResponse;
import org.oasis.wsrp.v1.V1MarkupType;
import org.oasis.wsrp.v1.V1ModelDescription;
import org.oasis.wsrp.v1.V1ModelTypes;
@@ -47,16 +53,19 @@
import org.oasis.wsrp.v1.V1PersonName;
import org.oasis.wsrp.v1.V1PortletContext;
import org.oasis.wsrp.v1.V1PortletDescription;
+import org.oasis.wsrp.v1.V1PortletPropertyDescriptionResponse;
import org.oasis.wsrp.v1.V1Postal;
import org.oasis.wsrp.v1.V1Property;
import org.oasis.wsrp.v1.V1PropertyDescription;
import org.oasis.wsrp.v1.V1PropertyList;
import org.oasis.wsrp.v1.V1RegistrationContext;
import org.oasis.wsrp.v1.V1RegistrationData;
+import org.oasis.wsrp.v1.V1RegistrationState;
import org.oasis.wsrp.v1.V1ResetProperty;
import org.oasis.wsrp.v1.V1Resource;
import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.V1ResourceValue;
+import org.oasis.wsrp.v1.V1ReturnAny;
import org.oasis.wsrp.v1.V1RuntimeContext;
import org.oasis.wsrp.v1.V1ServiceDescription;
import org.oasis.wsrp.v1.V1SessionContext;
@@ -68,18 +77,22 @@
import org.oasis.wsrp.v1.V1UploadContext;
import org.oasis.wsrp.v1.V1UserContext;
import org.oasis.wsrp.v1.V1UserProfile;
+import org.oasis.wsrp.v2.BlockingInteractionResponse;
import org.oasis.wsrp.v2.CacheControl;
import org.oasis.wsrp.v2.ClientData;
import org.oasis.wsrp.v2.Contact;
import org.oasis.wsrp.v2.CookieProtocol;
+import org.oasis.wsrp.v2.DestroyPortletsResponse;
import org.oasis.wsrp.v2.EmployerInfo;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.FailedPortlets;
+import org.oasis.wsrp.v2.GetPortletPropertyDescription;
import org.oasis.wsrp.v2.InteractionParams;
import org.oasis.wsrp.v2.ItemDescription;
import org.oasis.wsrp.v2.LocalizedString;
import org.oasis.wsrp.v2.MarkupContext;
import org.oasis.wsrp.v2.MarkupParams;
+import org.oasis.wsrp.v2.MarkupResponse;
import org.oasis.wsrp.v2.MarkupType;
import org.oasis.wsrp.v2.ModelDescription;
import org.oasis.wsrp.v2.ModelTypes;
@@ -88,16 +101,19 @@
import org.oasis.wsrp.v2.PersonName;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.PortletDescription;
+import org.oasis.wsrp.v2.PortletPropertyDescriptionResponse;
import org.oasis.wsrp.v2.Postal;
import org.oasis.wsrp.v2.Property;
import org.oasis.wsrp.v2.PropertyDescription;
import org.oasis.wsrp.v2.PropertyList;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
+import org.oasis.wsrp.v2.RegistrationState;
import org.oasis.wsrp.v2.ResetProperty;
import org.oasis.wsrp.v2.Resource;
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceValue;
+import org.oasis.wsrp.v2.ReturnAny;
import org.oasis.wsrp.v2.RuntimeContext;
import org.oasis.wsrp.v2.ServiceDescription;
import org.oasis.wsrp.v2.SessionContext;
@@ -134,6 +150,7 @@
public static final V2ToV1UploadContext UPLOADCONTEXT = new V2ToV1UploadContext();
public static final V2ToV1Property PROPERTY = new V2ToV1Property();
public static final V2ToV1ResetProperty RESETPROPERTY = new V2ToV1ResetProperty();
+ public static final V2ToV1FailedPortlets FAILEDPORTLET = new V2ToV1FailedPortlets();
public static V1PortletContext toV1PortletContext(PortletContext portletContext)
@@ -509,7 +526,6 @@
}
v1MarkupContext.setCacheControl(toV1CacheControl(markupContext.getCacheControl()));
v1MarkupContext.setLocale(markupContext.getLocale());
- v1MarkupContext.setMimeType(markupContext.getMimeType());
v1MarkupContext.setPreferredTitle(markupContext.getPreferredTitle());
v1MarkupContext.setRequiresUrlRewriting(markupContext.isRequiresRewriting());
v1MarkupContext.setUseCachedMarkup(markupContext.isUseCachedItem());
@@ -898,7 +914,137 @@
return null;
}
}
+
+ public static V1MarkupResponse toV1MarkupResponse(MarkupResponse markupResponse)
+ {
+ if (markupResponse != null)
+ {
+ V1MarkupResponse result = WSRP1TypeFactory.createMarkupResponse(toV1MarkupContext(markupResponse.getMarkupContext()));
+ result.setSessionContext(toV1SessionContext(markupResponse.getSessionContext()));
+ List<V1Extension> extensions = WSRPUtils.transform(markupResponse.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static V1ReturnAny toV1ReturnAny(ReturnAny returnAny)
+ {
+ if (returnAny != null)
+ {
+ V1ReturnAny result = new V1ReturnAny();
+
+ List<V1Extension> extensions = WSRPUtils.transform(returnAny.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static V1RegistrationState toV1RegistrationState(RegistrationState registrationState)
+ {
+ if (registrationState != null)
+ {
+ V1RegistrationState result = new V1RegistrationState();
+ result.setRegistrationState(registrationState.getRegistrationState());
+
+ List<V1Extension> extensions = WSRPUtils.transform(registrationState.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static V1BlockingInteractionResponse toV1BlockingInteractionResponse(BlockingInteractionResponse blockingInteractionResponse)
+ {
+ if (blockingInteractionResponse != null)
+ {
+ V1UpdateResponse updateResponse = toV1UpdateResponse(blockingInteractionResponse.getUpdateResponse());
+ V1BlockingInteractionResponse result = WSRP1TypeFactory.createBlockingInteractionResponse(updateResponse);
+
+ result.setRedirectURL(blockingInteractionResponse.getRedirectURL());
+
+ List<V1Extension> extensions = WSRPUtils.transform(blockingInteractionResponse.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static V1DestroyPortletsResponse toV1DestroyPortlesResponse(DestroyPortletsResponse destroyPortletResponse)
+ {
+ if (destroyPortletResponse != null)
+ {
+
+ List<V1DestroyFailed> destroyedFailed = WSRPUtils.transform(destroyPortletResponse.getFailedPortlets(), FAILEDPORTLET);
+ V1DestroyPortletsResponse result = WSRP1TypeFactory.createDestroyPortletsResponse(destroyedFailed);
+
+ List<V1Extension> extensions = WSRPUtils.transform(destroyPortletResponse.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static V1PortletPropertyDescriptionResponse toV1PortletPropertyDescriptionResponse(PortletPropertyDescriptionResponse portletPropertyDescriptionResponse)
+ {
+ if (portletPropertyDescriptionResponse != null)
+ {
+ //todo use WSRP1TypeFactory instead
+ V1PortletPropertyDescriptionResponse result = new V1PortletPropertyDescriptionResponse();
+ result.setModelDescription(toV1ModelDescription(portletPropertyDescriptionResponse.getModelDescription()));
+ result.setResourceList(toV1ResourceList(portletPropertyDescriptionResponse.getResourceList()));
+
+ List<V1Extension> extensions = WSRPUtils.transform(portletPropertyDescriptionResponse.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
private static class V2ToV1Extension implements Function<Extension, V1Extension>
{
public V1Extension apply(Extension from)
@@ -1190,4 +1336,29 @@
}
}
}
+
+ private static class V2ToV1FailedPortlets implements Function<FailedPortlets, V1DestroyFailed>
+ {
+ public V1ResetProperty apply(ResetProperty from)
+ {
+ if (from != null)
+ {
+ return WSRP1TypeFactory.createResetProperty(from.getName().toString());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public V1DestroyFailed apply(FailedPortlets from)
+ {
+ if (from != null)
+ {
+ return WSRP1TypeFactory.createDestroyFailed(from.getPortletHandles().get(0), from.getReason().toString());
+ }
+ return null;
+ }
+ }
+
}
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-06-15 02:09:01 UTC (rev 3333)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-06-15 06:07:47 UTC (rev 3334)
@@ -23,20 +23,26 @@
package org.gatein.wsrp.producer.v1;
+import java.security.AccessControlException;
+import java.util.List;
+
import org.gatein.common.NotYetImplemented;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.registration.RegistrationManager;
+import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.producer.ProducerHolder;
import org.gatein.wsrp.producer.WSRPProducer;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
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.V2ToV1Converter.V2ToV1NamedString;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
import org.oasis.wsrp.v1.V1ClonePortlet;
import org.oasis.wsrp.v1.V1DestroyPortlets;
import org.oasis.wsrp.v1.V1DestroyPortletsResponse;
+import org.oasis.wsrp.v1.V1Extension;
import org.oasis.wsrp.v1.V1GetMarkup;
import org.oasis.wsrp.v1.V1GetPortletDescription;
import org.oasis.wsrp.v1.V1GetPortletProperties;
@@ -70,9 +76,30 @@
import org.oasis.wsrp.v1.V1UnsupportedMimeType;
import org.oasis.wsrp.v1.V1UnsupportedMode;
import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v2.AccessDenied;
+import org.oasis.wsrp.v2.BlockingInteractionResponse;
+import org.oasis.wsrp.v2.DestroyPortletsResponse;
+import org.oasis.wsrp.v2.InconsistentParameters;
+import org.oasis.wsrp.v2.InvalidCookie;
+import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.InvalidSession;
+import org.oasis.wsrp.v2.InvalidUserCategory;
+import org.oasis.wsrp.v2.MarkupResponse;
+import org.oasis.wsrp.v2.MissingParameters;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.PortletContext;
+import org.oasis.wsrp.v2.PortletPropertyDescriptionResponse;
+import org.oasis.wsrp.v2.PortletStateChangeRequired;
+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.ServiceDescription;
+import org.oasis.wsrp.v2.UnsupportedLocale;
+import org.oasis.wsrp.v2.UnsupportedMimeType;
+import org.oasis.wsrp.v2.UnsupportedMode;
+import org.oasis.wsrp.v2.UnsupportedWindowState;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -98,7 +125,7 @@
{
}
- private final WSRP2Producer producer = ProducerHolder.getProducer();
+ private final WSRP2Producer producer = ProducerHolder.getProducer(true);
public RegistrationManager getRegistrationManager()
{
@@ -165,17 +192,58 @@
public V1RegistrationContext register(V1RegistrationData register) throws V1MissingParameters, V1OperationFailed
{
- throw new NotYetImplemented();
+ try
+ {
+ RegistrationContext registrationContext = producer.register(V1ToV2Converter.toV2RegistrationData(register));
+ return V2ToV1Converter.toV1RegistrationContext(registrationContext);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
}
public V1ReturnAny deregister(V1RegistrationContext deregister) throws V1OperationFailed, V1InvalidRegistration
{
- throw new NotYetImplemented();
+ try
+ {
+ ReturnAny returnAny = producer.deregister(V1ToV2Converter.toV2RegistrationContext(deregister));
+ return V2ToV1Converter.toV1ReturnAny(returnAny);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
}
public V1RegistrationState modifyRegistration(V1ModifyRegistration modifyRegistration) throws V1MissingParameters, V1OperationFailed, V1InvalidRegistration
{
- throw new NotYetImplemented();
+ try
+ {
+ RegistrationState registrationState = producer.modifyRegistration(V1ToV2Converter.toV2ModifyRegistration(modifyRegistration));
+ return V2ToV1Converter.toV1RegistrationState(registrationState);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, invalidRegistration);
+ }
+
}
public V1PortletDescriptionResponse getPortletDescription(V1GetPortletDescription getPortletDescription) throws V1AccessDenied, V1InvalidHandle, V1InvalidUserCategory, V1InconsistentParameters, V1MissingParameters, V1InvalidRegistration, V1OperationFailed
@@ -185,46 +253,346 @@
public V1MarkupResponse getMarkup(V1GetMarkup getMarkup) throws V1UnsupportedWindowState, V1InvalidCookie, V1InvalidSession, V1AccessDenied, V1InconsistentParameters, V1InvalidHandle, V1UnsupportedLocale, V1UnsupportedMode, V1OperationFailed, V1MissingParameters, V1InvalidUserCategory, V1InvalidRegistration, V1UnsupportedMimeType
{
- throw new NotYetImplemented();
+ try
+ {
+ MarkupResponse markupResponse = producer.getMarkup(V1ToV2Converter.toV2GetMarkup(getMarkup));
+ return V2ToV1Converter.toV1MarkupResponse(markupResponse);
+ }
+ catch (UnsupportedMimeType unsupportedMimeType)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedMimeType.class, unsupportedMimeType);
+ }
+ catch (UnsupportedWindowState unsupportedWindowState)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedWindowState.class, unsupportedWindowState);
+ }
+ catch (InvalidCookie invalidCookie)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidCookie.class, invalidCookie);
+ }
+ catch (InvalidSession invalidSession)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidSession.class, invalidSession);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidHandle.class, invalidHandle);
+ }
+ catch (UnsupportedLocale unsupportedLocale)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedLocale.class, unsupportedLocale);
+ }
+ catch (UnsupportedMode unsupportedMode)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedMode.class, unsupportedMode);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
}
public V1PortletContext clonePortlet(V1ClonePortlet clonePortlet) throws V1InvalidUserCategory, V1AccessDenied, V1OperationFailed, V1InvalidHandle, V1InvalidRegistration, V1InconsistentParameters, V1MissingParameters
{
- throw new NotYetImplemented();
+ try
+ {
+ PortletContext portletContext = producer.clonePortlet(V1ToV2Converter.toV2ClonePortlet(clonePortlet));
+ return V2ToV1Converter.toV1PortletContext(portletContext);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidHandle.class, invalidHandle);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
}
public V1BlockingInteractionResponse performBlockingInteraction(V1PerformBlockingInteraction performBlockingInteraction) throws V1InvalidSession, V1UnsupportedMode, V1UnsupportedMimeType, V1OperationFailed, V1UnsupportedWindowState, V1UnsupportedLocale, V1AccessDenied, V1PortletStateChangeRequired, V1InvalidRegistration, V1MissingParameters, V1InvalidUserCategory, V1InconsistentParameters, V1InvalidHandle, V1InvalidCookie
{
- throw new NotYetImplemented();
+ try
+ {
+ BlockingInteractionResponse blockingInteractionResponse = producer.performBlockingInteraction(V1ToV2Converter.toV2PerformBlockingInteraction(performBlockingInteraction));
+ return V2ToV1Converter.toV1BlockingInteractionResponse(blockingInteractionResponse);
+ }
+ catch (InvalidSession invalidSession)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidSession.class, invalidSession);
+ }
+ catch (UnsupportedMode unsupportedMode)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedMode.class, unsupportedMode);
+ }
+ catch (UnsupportedMimeType unsupportedMimeType)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedMimeType.class, unsupportedMimeType);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (UnsupportedWindowState unsupportedWindowState)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedWindowState.class, unsupportedWindowState);
+ }
+ catch (UnsupportedLocale unsupportedLocale)
+ {
+ throw V2ToV1Converter.toV1Exception(V1UnsupportedLocale.class, unsupportedLocale);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (PortletStateChangeRequired portletStateChangeRequired)
+ {
+ throw V2ToV1Converter.toV1Exception(V1PortletStateChangeRequired.class, portletStateChangeRequired);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidHandle.class, invalidHandle);
+ }
+ catch (InvalidCookie invalidCookie)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidCookie.class, invalidCookie);
+ }
}
public V1DestroyPortletsResponse destroyPortlets(V1DestroyPortlets destroyPortlets) throws V1InconsistentParameters, V1MissingParameters, V1InvalidRegistration, V1OperationFailed
{
- throw new NotYetImplemented();
+ try
+ {
+ DestroyPortletsResponse destroyportletResponse = producer.destroyPortlets(V1ToV2Converter.toV2DestroyPortlets(destroyPortlets));
+ return V2ToV1Converter.toV1DestroyPortlesResponse(destroyportletResponse);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
}
public V1PortletContext setPortletProperties(V1SetPortletProperties setPortletProperties) throws V1OperationFailed, V1InvalidHandle, V1MissingParameters, V1InconsistentParameters, V1InvalidUserCategory, V1AccessDenied, V1InvalidRegistration
{
- throw new NotYetImplemented();
+ try
+ {
+ PortletContext portletContext = producer.setPortletProperties(V1ToV2Converter.toV2SetPortletProperties(setPortletProperties));
+ return V2ToV1Converter.toV1PortletContext(portletContext);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidHandle.class, invalidHandle);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
}
public V1ReturnAny releaseSessions(V1ReleaseSessions releaseSessions) throws V1InvalidRegistration, V1OperationFailed, V1MissingParameters, V1AccessDenied
{
- throw new NotYetImplemented();
+ try
+ {
+ ReturnAny returnAny = producer.releaseSessions(V1ToV2Converter.toV2ReleaseSessions(releaseSessions));
+ return V2ToV1Converter.toV1ReturnAny(returnAny);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
}
public V1PropertyList getPortletProperties(V1GetPortletProperties getPortletProperties) throws V1InvalidHandle, V1MissingParameters, V1InvalidRegistration, V1AccessDenied, V1OperationFailed, V1InconsistentParameters, V1InvalidUserCategory
{
- throw new NotYetImplemented();
+ try
+ {
+ PropertyList propertyList = producer.getPortletProperties(V1ToV2Converter.toV2GetPortletProperties(getPortletProperties));
+ return V2ToV1Converter.toV1PropertyList(propertyList);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidHandle.class, invalidHandle);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
+ }
}
public V1ReturnAny initCookie(V1InitCookie initCookie) throws V1AccessDenied, V1OperationFailed, V1InvalidRegistration
{
- throw new NotYetImplemented();
+ try
+ {
+ ReturnAny returnAny = producer.initCookie(V1ToV2Converter.toV2InitCookie(initCookie));
+ return V2ToV1Converter.toV1ReturnAny(returnAny);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
}
public V1PortletPropertyDescriptionResponse getPortletPropertyDescription(V1GetPortletPropertyDescription getPortletPropertyDescription) throws V1MissingParameters, V1InconsistentParameters, V1InvalidUserCategory, V1InvalidRegistration, V1AccessDenied, V1InvalidHandle, V1OperationFailed
{
- throw new NotYetImplemented();
+ try
+ {
+ PortletPropertyDescriptionResponse portletPropertyDescriptionResponse = producer.getPortletPropertyDescription(V1ToV2Converter.toV2GetPortletPropertyDescription(getPortletPropertyDescription));
+ return V2ToV1Converter.toV1PortletPropertyDescriptionResponse(portletPropertyDescriptionResponse);
+ }
+ catch (MissingParameters missingParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1MissingParameters.class, missingParameters);
+ }
+ catch (InconsistentParameters inconsistentParameters)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InconsistentParameters.class, inconsistentParameters);
+ }
+ catch (InvalidUserCategory invalidUserCategory)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidUserCategory.class, invalidUserCategory);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (AccessDenied accessDenied)
+ {
+ throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidHandle.class, invalidHandle);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
}
}
14 years, 6 months
gatein SVN: r3333 - epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-06-14 22:09:01 -0400 (Mon, 14 Jun 2010)
New Revision: 3333
Modified:
epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Book_Info.xml
epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Documentation.xml
epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Installation.xml
epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Revision_History.xml
Log:
Finalize installation instructions and file naming conventions.
Modified: epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Book_Info.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Book_Info.xml 2010-06-14 22:53:55 UTC (rev 3332)
+++ epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Book_Info.xml 2010-06-15 02:09:01 UTC (rev 3333)
@@ -9,7 +9,7 @@
<productname>JBoss Enterprise Portal Platform</productname>
<productnumber>5.0</productnumber>
<edition>1</edition>
- <pubsnumber>1.0</pubsnumber>
+ <pubsnumber>1.5</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the &JBEPP; Site Publisher Technical Preview that may not be currently available in the Product Manuals. You should read these Release Notes in their entirety before installing &JBEPP; Site Publisher.
Modified: epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Documentation.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Documentation.xml 2010-06-14 22:53:55 UTC (rev 3332)
+++ epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Documentation.xml 2010-06-15 02:09:01 UTC (rev 3333)
@@ -6,9 +6,12 @@
<chapter id="chap-Site_Publisher_Release_Notes-Documentation">
<title>Documentation</title>
<para>
- The User Guide for this Technical Preview has been included within the provided zip file in the <DIRECTORY>
+ A copy of the User Guide for this Technical Preview is included in the provided zip file. It is found at <filename>exo-wcm-2.0.0-tp/docs/ECMS v3.0.pdf</filename>
</para>
<para>
- For more Jboss Enterprise Portal Platform documentation please consult the following URL for the latest information: <ulink type="http" url="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/index.html">http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/index.html</ulink>
+ This document was prepared by the documentation team at eXo Platform. It is included in this Technical Preview with thanks. It will be superseded by official Red Hat documentation in the official release of Site Publisher.
</para>
+ <para>
+ For more Jboss Enterprise Portal Platform documentation please visit the following URL for the latest information: <ulink type="http" url="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/index.html">http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/index.html</ulink>
+ </para>
</chapter>
Modified: epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Installation.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Installation.xml 2010-06-14 22:53:55 UTC (rev 3332)
+++ epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Installation.xml 2010-06-15 02:09:01 UTC (rev 3333)
@@ -8,105 +8,144 @@
<note>
<title>DOC NOTE</title>
<para>
- The instructions below are based on the eXo Release Notes. More information is required to ensure they are correct.
+ The instructions below require tech review to ensure they are correct.
</para>
</note>
-
+ <formalpara>
+ <title>Configuration Locations</title>
+ <para>
+ Installation of the Site Publisher add-on requires various configuration files to be copied to the configuration location of your &PRODUCT; instance.
+ </para>
+ </formalpara>
+ <para>
+ There are three possible locations for this configuration location depending on your &PRODUCT; configuration setup:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Default</term>
+ <listitem>
+ <para>
+ <filename>jboss-epp-5.0/jboss-as/server/default/deploy</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>All</term>
+ <listitem>
+ <para>
+ <filename>jboss-epp-5.0/jboss-as/server/all/deploy</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Production</term>
+ <listitem>
+ <para>
+ <filename>jboss-epp-5.0/jboss-as/server/production/deploy</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ If you use a custom configuration location, copy the files into that location.
+ </para>
+ <para>
+ Ensure you know which of the above locations is in use in your &PRODUCT; environment before you begin the installation.
+ </para>
+ <para>
+ Alternatively, the required files can be copied into each of the three locations.
+ </para>
<procedure>
- <title>eXo Install procedure (Doc Note: will be removed)</title>
+ <title>Installation Instructions</title>
<step>
<para>
- Install Java...
+ If you have not already done so, install &PRODUCT; &VERSION;.
</para>
<para>
- Based on JavaEE, Site Publisher runs with version 1.6 so if you are using newer version, please download and install this version to run Site Publisher. Support for newer versions of Java will be added in future releases.
+ Installation instructions can be found in the &PRODUCT; Installation Guide at <ulink type="http" url="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/">http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/</ulink>
</para>
</step>
<step>
<para>
- Unzip the Site Publisher package under a path that does not contain any spaces (in Windows).
+ Download the <filename>exo-wcm-2.0.0-tech-preview-for-epp-5.0.0.GA.zip</filename> file from the Red Hat JBoss Customer Support Portal.
</para>
</step>
<step>
<para>
- Open a command terminal session and navigate to the <filename>bin/</filename> in the extracted location.
+ Extract the Site Publisher package to an appropriate location. Ensure the path to this location does not contain any spaces.
</para>
</step>
<step>
<para>
- Run the command that corresponds to your operating environment.
+ Copy the following files from the extracted location to the configuration location of your &PRODUCT; installation (as discussed above).
</para>
<itemizedlist>
<listitem>
<para>
- In Windows:
+ <filename>gatein-ecmdemo-extension-2.0.0-GA.ear</filename>
</para>
-<programlisting>run.bat
-</programlisting>
</listitem>
<listitem>
<para>
- In Unix/Linux/cygwin:
+ <filename>gatein-ecmdemo-portal-2.0.0-GA.ear</filename>
</para>
-<programlisting>./run.sh
-</programlisting>
</listitem>
+ <listitem>
+ <para>
+ <filename>gatein-exo-workflow-2.0.0-GA.ear</filename>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <filename>gatein-ds.xml</filename>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <filename>wcm-ds.xml</filename>
+ </para>
+ </listitem>
</itemizedlist>
- </step>
- </procedure>
- <procedure>
- <title>EPP Install Procedure</title>
- <step>
+ <note>
+ <title>Overwriting gatein-ds.xml</title>
<para>
- If you have not already done so, install &PRODUCT; &VERSION;.
+ Be aware that the base installation of &PRODUCT; already contains a <filename>gatein-ds.xml</filename> file in the <filename>deploy</filename> directory. It is recommended that this file be backed-up before copying the new Site Publisher version of the file.
</para>
<para>
- Installation instructions can be found in the &PRODUCT; Installation Guide at <ulink type="http" url="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/">http://www.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/</ulink>
+ This ensures that if you wish to 'uninstall' the Site Publisher add-on, you can revert to the original <filename>gatein-ds.xml</filename> file.
</para>
- </step>
- <step>
- <para>
- Unzip the Site Publisher package to an appropriate location. In Windows environments, ensure the path to this location does not contain any spaces.
- </para>
- </step>
- <step>
- <para>
- Copy the <filename>X</filename>, <filename>Y</filename> and <filename>Z</filename> EAR files from the <filename>directory/name</filename> directory in to the <filename>jboss-as/somewhere/</filename> directory.
- </para>
- </step>
- <step>
+ </note>
+ </step>
+ <step>
<para>
Start &PRODUCT; using your established method, the procedures outlined in the &PRODUCT; &VERSION; Installation Guide or by following the steps below.
</para>
- </step>
- <step>
- <procedure>
- <step>
- <para>
- Open a command-line terminal session and navigate to the <filename>bin/</filename> directory in the &PRODUCT; location.
- </para>
- </step>
- <step>
- <para>
- Run the command that corresponds to your operating environment.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- In Windows:
- </para>
+ <procedure>
+ <step>
+ <para>
+ Open a command-line terminal session and navigate to the <filename>jboss-epp-5.0/jboss-as/bin</filename> directory in the &PRODUCT; location.
+ </para>
+ </step>
+ <step>
+ <para>
+ Run the command that corresponds to your operating environment.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ In Windows:
+ </para>
<programlisting>run.bat</programlisting>
- </listitem>
- <listitem>
- <para>
- In Unix/Linux/cygwin:
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ In Unix/Linux/cygwin:
+ </para>
<programlisting>./run.sh</programlisting>
- </listitem>
- </itemizedlist>
- </step>
- </procedure>
+ </listitem>
+ </itemizedlist>
+ </step>
+ </procedure>
</step>
</procedure>
-
</chapter>
Modified: epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Revision_History.xml 2010-06-14 22:53:55 UTC (rev 3332)
+++ epp/docs/branches/EPP_5_0_Branch/Site_Publisher_Release_Notes/en-US/Revision_History.xml 2010-06-15 02:09:01 UTC (rev 3333)
@@ -8,6 +8,24 @@
<simpara>
<revhistory>
<revision>
+ <revnumber>1.5</revnumber>
+ <date>Mon Jun 15 2010</date>
+ <author>
+ <firstname>Scott</firstname>
+ <surname>Mumford</surname>
+ <email>smumford(a)redhat.com</email>
+
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Finalize installation instructions and file naming conventions.</member>
+
+ </simplelist>
+
+ </revdescription>
+
+ </revision>
+ <revision>
<revnumber>1.0</revnumber>
<date>Wed Jun 9 2010</date>
<author>
14 years, 6 months
gatein SVN: r3332 - in components/wsrp/trunk: producer/src/main/java/org/gatein/wsrp/producer/v1 and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-06-14 18:53:55 -0400 (Mon, 14 Jun 2010)
New Revision: 3332
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
Log:
- WSRP1Producer now references WSRP2Producer.
- Started implementing missing methods. Yay more boilerplate code... NOT! :(
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-14 22:52:05 UTC (rev 3331)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-14 22:53:55 UTC (rev 3332)
@@ -38,6 +38,7 @@
import org.oasis.wsrp.v1.V1DestroyFailed;
import org.oasis.wsrp.v1.V1EmployerInfo;
import org.oasis.wsrp.v1.V1Extension;
+import org.oasis.wsrp.v1.V1GetServiceDescription;
import org.oasis.wsrp.v1.V1InteractionParams;
import org.oasis.wsrp.v1.V1ItemDescription;
import org.oasis.wsrp.v1.V1LocalizedString;
@@ -78,6 +79,7 @@
import org.oasis.wsrp.v2.EmployerInfo;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.FailedPortlets;
+import org.oasis.wsrp.v2.GetServiceDescription;
import org.oasis.wsrp.v2.InteractionParams;
import org.oasis.wsrp.v2.ItemDescription;
import org.oasis.wsrp.v2.LocalizedString;
@@ -835,6 +837,26 @@
}
}
+ public static GetServiceDescription toV2GetServiceDescription(V1GetServiceDescription getServiceDescription)
+ {
+ if (getServiceDescription != null)
+ {
+ GetServiceDescription result = WSRPTypeFactory.createGetServiceDescription();
+ result.setRegistrationContext(toV2RegistrationContext(getServiceDescription.getRegistrationContext()));
+ List<String> locales = getServiceDescription.getDesiredLocales();
+ if (ParameterValidation.existsAndIsNotEmpty(locales))
+ {
+ result.getDesiredLocales().addAll(locales);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public static class V1ToV2Extension implements Function<V1Extension, Extension>
{
public Extension apply(V1Extension from)
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-14 22:52:05 UTC (rev 3331)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-14 22:53:55 UTC (rev 3332)
@@ -58,6 +58,7 @@
import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.V1ResourceValue;
import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1ServiceDescription;
import org.oasis.wsrp.v1.V1SessionContext;
import org.oasis.wsrp.v1.V1StateChange;
import org.oasis.wsrp.v1.V1Telecom;
@@ -98,6 +99,7 @@
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceValue;
import org.oasis.wsrp.v2.RuntimeContext;
+import org.oasis.wsrp.v2.ServiceDescription;
import org.oasis.wsrp.v2.SessionContext;
import org.oasis.wsrp.v2.SessionParams;
import org.oasis.wsrp.v2.StateChange;
@@ -843,6 +845,60 @@
}
}
+ public static V1ServiceDescription toV1ServiceDescription(ServiceDescription serviceDescription)
+ {
+ if (serviceDescription != null)
+ {
+ V1ServiceDescription result = new V1ServiceDescription();
+ result.setRegistrationPropertyDescription(toV1ModelDescription(serviceDescription.getRegistrationPropertyDescription()));
+ result.setRequiresInitCookie(toV1CookieProtocol(serviceDescription.getRequiresInitCookie()));
+ result.setRequiresRegistration(serviceDescription.isRequiresRegistration());
+ result.setResourceList(toV1ResourceList(serviceDescription.getResourceList()));
+
+ List<V1ItemDescription> modes = WSRPUtils.transform(serviceDescription.getCustomModeDescriptions(), ITEMDESCRIPTION);
+ if (modes != null)
+ {
+ result.getCustomModeDescriptions().addAll(modes);
+ }
+
+ List<V1ItemDescription> windowStates = WSRPUtils.transform(serviceDescription.getCustomWindowStateDescriptions(), ITEMDESCRIPTION);
+ if (windowStates != null)
+ {
+ result.getCustomWindowStateDescriptions().addAll(windowStates);
+ }
+
+ List<V1Extension> extensions = WSRPUtils.transform(serviceDescription.getExtensions(), EXTENSION);
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(extensions);
+ }
+
+ List<String> locales = result.getLocales();
+ if (ParameterValidation.existsAndIsNotEmpty(locales))
+ {
+ result.getLocales().addAll(locales);
+ }
+
+ List<V1ItemDescription> userCategories = WSRPUtils.transform(serviceDescription.getUserCategoryDescriptions(), ITEMDESCRIPTION);
+ if (userCategories != null)
+ {
+ result.getUserCategoryDescriptions().addAll(userCategories);
+ }
+
+ List<V1PortletDescription> portletDescriptions = WSRPUtils.transform(serviceDescription.getOfferedPortlets(), PORTLETDESCRIPTION);
+ if (portletDescriptions != null)
+ {
+ result.getOfferedPortlets().addAll(portletDescriptions);
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
private static class V2ToV1Extension implements Function<Extension, V1Extension>
{
public V1Extension apply(Extension from)
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-06-14 22:52:05 UTC (rev 3331)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-06-14 22:53:55 UTC (rev 3332)
@@ -29,6 +29,9 @@
import org.gatein.wsrp.producer.ProducerHolder;
import org.gatein.wsrp.producer.WSRPProducer;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.producer.v2.WSRP2Producer;
+import org.gatein.wsrp.spec.v1.V1ToV2Converter;
+import org.gatein.wsrp.spec.v1.V2ToV1Converter;
import org.oasis.wsrp.v1.V1AccessDenied;
import org.oasis.wsrp.v1.V1BlockingInteractionResponse;
import org.oasis.wsrp.v1.V1ClonePortlet;
@@ -67,6 +70,9 @@
import org.oasis.wsrp.v1.V1UnsupportedMimeType;
import org.oasis.wsrp.v1.V1UnsupportedMode;
import org.oasis.wsrp.v1.V1UnsupportedWindowState;
+import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.ServiceDescription;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -92,7 +98,7 @@
{
}
- private final WSRPProducer producer = ProducerHolder.getProducer();
+ private final WSRP2Producer producer = ProducerHolder.getProducer();
public RegistrationManager getRegistrationManager()
{
@@ -141,7 +147,20 @@
public V1ServiceDescription getServiceDescription(V1GetServiceDescription gs) throws V1InvalidRegistration, V1OperationFailed
{
- throw new NotYetImplemented();
+ try
+ {
+ ServiceDescription description = producer.getServiceDescription(V1ToV2Converter.toV2GetServiceDescription(gs));
+ return V2ToV1Converter.toV1ServiceDescription(description);
+ }
+ catch (InvalidRegistration invalidRegistration)
+ {
+ throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
+ }
+ catch (OperationFailed operationFailed)
+ {
+ throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ }
+
}
public V1RegistrationContext register(V1RegistrationData register) throws V1MissingParameters, V1OperationFailed
14 years, 6 months
gatein SVN: r3331 - in components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp: protocol/v1 and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-06-14 18:52:05 -0400 (Mon, 14 Jun 2010)
New Revision: 3331
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java
Log:
- WSRPProducerBaseTest shouldn't define the producer instance but leave it up to subclasses to get the proper instance.
- V1ProducerBaseTest now properly retrieve the v1 producer. This also removes the shadowed producer variable from WSRPProducerBaseTest.
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java 2010-06-14 20:43:13 UTC (rev 3330)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/WSRPProducerBaseTest.java 2010-06-14 22:52:05 UTC (rev 3331)
@@ -32,8 +32,6 @@
*/
public abstract class WSRPProducerBaseTest extends TestCase
{
- protected WSRPProducerImpl producer = WSRPProducerImpl.getInstance();
-
protected WSRPProducerBaseTest(String name) throws Exception
{
super(name);
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java 2010-06-14 20:43:13 UTC (rev 3330)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java 2010-06-14 22:52:05 UTC (rev 3331)
@@ -28,6 +28,7 @@
import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.producer.ProducerHolder;
import org.gatein.wsrp.producer.WSRPProducerBaseTest;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.producer.v1.WSRP1Producer;
@@ -58,7 +59,7 @@
public abstract class V1ProducerBaseTest extends WSRPProducerBaseTest
{
private static final String CONSUMER = "test-consumer";
- protected WSRP1Producer producer;
+ protected WSRP1Producer producer = ProducerHolder.getV1Producer();
public V1ProducerBaseTest() throws Exception
14 years, 6 months
gatein SVN: r3330 - in components/wsrp/trunk: consumer/src/main/java/org/gatein/wsrp/services/v1 and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-06-14 16:43:13 -0400 (Mon, 14 Jun 2010)
New Revision: 3330
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java
Log:
- Fixed improper handling of returned values in MarkupService.
- Fixed incorrect StateChange conversion implementation.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-14 19:26:04 UTC (rev 3329)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V1ToV2Converter.java 2010-06-14 20:43:13 UTC (rev 3330)
@@ -31,6 +31,7 @@
import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
+import org.oasis.wsrp.v1.V1CacheControl;
import org.oasis.wsrp.v1.V1ClientData;
import org.oasis.wsrp.v1.V1Contact;
import org.oasis.wsrp.v1.V1CookieProtocol;
@@ -40,6 +41,7 @@
import org.oasis.wsrp.v1.V1InteractionParams;
import org.oasis.wsrp.v1.V1ItemDescription;
import org.oasis.wsrp.v1.V1LocalizedString;
+import org.oasis.wsrp.v1.V1MarkupContext;
import org.oasis.wsrp.v1.V1MarkupParams;
import org.oasis.wsrp.v1.V1MarkupType;
import org.oasis.wsrp.v1.V1ModelDescription;
@@ -60,13 +62,16 @@
import org.oasis.wsrp.v1.V1ResourceList;
import org.oasis.wsrp.v1.V1ResourceValue;
import org.oasis.wsrp.v1.V1RuntimeContext;
+import org.oasis.wsrp.v1.V1SessionContext;
import org.oasis.wsrp.v1.V1StateChange;
import org.oasis.wsrp.v1.V1Telecom;
import org.oasis.wsrp.v1.V1TelephoneNum;
import org.oasis.wsrp.v1.V1Templates;
+import org.oasis.wsrp.v1.V1UpdateResponse;
import org.oasis.wsrp.v1.V1UploadContext;
import org.oasis.wsrp.v1.V1UserContext;
import org.oasis.wsrp.v1.V1UserProfile;
+import org.oasis.wsrp.v2.CacheControl;
import org.oasis.wsrp.v2.ClientData;
import org.oasis.wsrp.v2.Contact;
import org.oasis.wsrp.v2.CookieProtocol;
@@ -76,6 +81,7 @@
import org.oasis.wsrp.v2.InteractionParams;
import org.oasis.wsrp.v2.ItemDescription;
import org.oasis.wsrp.v2.LocalizedString;
+import org.oasis.wsrp.v2.MarkupContext;
import org.oasis.wsrp.v2.MarkupParams;
import org.oasis.wsrp.v2.MarkupType;
import org.oasis.wsrp.v2.ModelDescription;
@@ -96,11 +102,13 @@
import org.oasis.wsrp.v2.ResourceList;
import org.oasis.wsrp.v2.ResourceValue;
import org.oasis.wsrp.v2.RuntimeContext;
+import org.oasis.wsrp.v2.SessionContext;
import org.oasis.wsrp.v2.SessionParams;
import org.oasis.wsrp.v2.StateChange;
import org.oasis.wsrp.v2.Telecom;
import org.oasis.wsrp.v2.TelephoneNum;
import org.oasis.wsrp.v2.Templates;
+import org.oasis.wsrp.v2.UpdateResponse;
import org.oasis.wsrp.v2.UploadContext;
import org.oasis.wsrp.v2.UserContext;
import org.oasis.wsrp.v2.UserProfile;
@@ -555,7 +563,7 @@
{
if (v1StateChange != null)
{
- return StateChange.valueOf((v1StateChange.value()));
+ return StateChange.fromValue((v1StateChange.value()));
}
else
{
@@ -730,6 +738,103 @@
}
}
+ public static MarkupContext toV2MarkupContext(V1MarkupContext v1MarkupContext)
+ {
+ if (v1MarkupContext != null)
+ {
+ MarkupContext result;
+
+ byte[] binary = v1MarkupContext.getMarkupBinary();
+ String string = v1MarkupContext.getMarkupString();
+
+ if (string != null)
+ {
+ result = WSRPTypeFactory.createMarkupContext(v1MarkupContext.getMimeType(), string);
+ }
+ else
+ {
+ result = WSRPTypeFactory.createMarkupContext(v1MarkupContext.getMimeType(), binary);
+ }
+ result.setCacheControl(toV2CacheControl(v1MarkupContext.getCacheControl()));
+ result.setLocale(v1MarkupContext.getLocale());
+ result.setMimeType(v1MarkupContext.getMimeType());
+ result.setPreferredTitle(v1MarkupContext.getPreferredTitle());
+ result.setRequiresRewriting(v1MarkupContext.isRequiresUrlRewriting());
+ result.setUseCachedItem(v1MarkupContext.isUseCachedMarkup());
+
+ List<V1Extension> extensions = v1MarkupContext.getExtensions();
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private static CacheControl toV2CacheControl(V1CacheControl v1CacheControl)
+ {
+ if (v1CacheControl != null)
+ {
+ CacheControl result = WSRPTypeFactory.createCacheControl(v1CacheControl.getExpires(), v1CacheControl.getUserScope());
+ result.setValidateTag(v1CacheControl.getValidateTag());
+
+ List<V1Extension> extensions = v1CacheControl.getExtensions();
+ if (extensions != null)
+ {
+ result.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
+ }
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static SessionContext toV2SessionContext(V1SessionContext sessionContext)
+ {
+ if (sessionContext != null)
+ {
+ SessionContext result = WSRPTypeFactory.createSessionContext(sessionContext.getSessionID(), sessionContext.getExpires());
+ result.getExtensions().addAll(Lists.transform(sessionContext.getExtensions(), EXTENSION));
+
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static UpdateResponse toV2UpdateResponse(V1UpdateResponse updateResponse)
+ {
+ if (updateResponse != null)
+ {
+ UpdateResponse result = WSRPTypeFactory.createUpdateResponse();
+ result.setMarkupContext(toV2MarkupContext(updateResponse.getMarkupContext()));
+ String state = updateResponse.getNavigationalState();
+ if (state != null)
+ {
+ result.setNavigationalContext(WSRPTypeFactory.createNavigationalContextOrNull(new OpaqueStateString(state), null));
+ }
+ result.setNewWindowState(updateResponse.getNewWindowState());
+ result.setPortletContext(toV2PortletContext(updateResponse.getPortletContext()));
+ result.setSessionContext(toV2SessionContext(updateResponse.getSessionContext()));
+ result.setNewMode(updateResponse.getNewMode());
+ return result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public static class V1ToV2Extension implements Function<V1Extension, Extension>
{
public Extension apply(V1Extension from)
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-14 19:26:04 UTC (rev 3329)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-14 20:43:13 UTC (rev 3330)
@@ -99,6 +99,7 @@
import org.oasis.wsrp.v2.ResourceValue;
import org.oasis.wsrp.v2.RuntimeContext;
import org.oasis.wsrp.v2.SessionContext;
+import org.oasis.wsrp.v2.SessionParams;
import org.oasis.wsrp.v2.StateChange;
import org.oasis.wsrp.v2.Telecom;
import org.oasis.wsrp.v2.TelephoneNum;
@@ -223,7 +224,11 @@
V1RuntimeContext v1RuntimeContext = WSRP1TypeFactory.createRuntimeContext(runtimeContext.getUserAuthentication());
v1RuntimeContext.setNamespacePrefix(runtimeContext.getNamespacePrefix());
v1RuntimeContext.setPortletInstanceKey(runtimeContext.getPortletInstanceKey());
- v1RuntimeContext.setSessionID(runtimeContext.getSessionParams().getSessionID());
+ SessionParams sessionParams = runtimeContext.getSessionParams();
+ if (sessionParams != null)
+ {
+ v1RuntimeContext.setSessionID(sessionParams.getSessionID());
+ }
v1RuntimeContext.setTemplates(V2ToV1Converter.toV1Templates(runtimeContext.getTemplates()));
List<Extension> extensions = runtimeContext.getExtensions();
@@ -489,9 +494,17 @@
{
if (markupContext != null)
{
- V1MarkupContext v1MarkupContext = new V1MarkupContext();
- v1MarkupContext.setMarkupBinary(markupContext.getItemBinary());
- v1MarkupContext.setMarkupString(markupContext.getItemString());
+ byte[] binary = markupContext.getItemBinary();
+ String string = markupContext.getItemString();
+ V1MarkupContext v1MarkupContext;
+ if (string != null)
+ {
+ v1MarkupContext = WSRP1TypeFactory.createMarkupContext(markupContext.getMimeType(), string);
+ }
+ else
+ {
+ v1MarkupContext = WSRP1TypeFactory.createMarkupContext(markupContext.getMimeType(), binary);
+ }
v1MarkupContext.setCacheControl(toV1CacheControl(markupContext.getCacheControl()));
v1MarkupContext.setLocale(markupContext.getLocale());
v1MarkupContext.setMimeType(markupContext.getMimeType());
@@ -685,7 +698,7 @@
{
if (stateChange != null)
{
- return V1StateChange.valueOf(stateChange.value());
+ return V1StateChange.fromValue(stateChange.value());
}
else
{
@@ -721,7 +734,7 @@
{
if (sessionContext != null)
{
- V1SessionContext v1SessionContext = WSRP1TypeFactory.createSessionContext(sessionContext.getSessionID(), sessionContext.getExpires().intValue());
+ V1SessionContext v1SessionContext = WSRP1TypeFactory.createSessionContext(sessionContext.getSessionID(), sessionContext.getExpires());
v1SessionContext.getExtensions().addAll(Lists.transform(sessionContext.getExtensions(), EXTENSION));
return v1SessionContext;
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java 2010-06-14 19:26:04 UTC (rev 3329)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java 2010-06-14 20:43:13 UTC (rev 3330)
@@ -112,9 +112,9 @@
v1SessionContext,
v1Extensions);
- v1MarkupContext.value = V2ToV1Converter.toV1MarkupContext(markupContext.value);
- v1SessionContext.value = V2ToV1Converter.toV1SessionContext(sessionContext.value);
- v1Extensions.value = WSRPUtils.transform(extensions.value, V2ToV1Converter.EXTENSION);
+ markupContext.value = V1ToV2Converter.toV2MarkupContext(v1MarkupContext.value);
+ sessionContext.value = V1ToV2Converter.toV2SessionContext(v1SessionContext.value);
+ extensions.value = WSRPUtils.transform(v1Extensions.value, V1ToV2Converter.EXTENSION);
}
catch (V1AccessDenied accessDenied)
{
@@ -195,8 +195,8 @@
redirectURL,
v1Extensions);
- v1UpdateResponse.value = V2ToV1Converter.toV1UpdateResponse(updateResponse.value);
- v1Extensions.value = WSRPUtils.transform(extensions.value, V2ToV1Converter.EXTENSION);
+ updateResponse.value = V1ToV2Converter.toV2UpdateResponse(v1UpdateResponse.value);
+ extensions.value = WSRPUtils.transform(v1Extensions.value, V1ToV2Converter.EXTENSION);
}
catch (V1AccessDenied accessDenied)
{
14 years, 6 months
gatein SVN: r3328 - in components/wsrp/trunk/common/src: test/java/org/gatein/wsrp/spec/v1 and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-06-14 14:04:39 -0400 (Mon, 14 Jun 2010)
New Revision: 3328
Added:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V1ToV2ConverterTestCase.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2ToV1ConverterTestCase.java
Removed:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2V1ConverterTestCase.java
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
Log:
- Fixed wrong toV1Exception implementation.
- Added test cases.
- Renamed V2V1ConverterTestCase to more appropriate V1ToV2ConverterTestCase.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-14 12:43:09 UTC (rev 3327)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/spec/v1/V2ToV1Converter.java 2010-06-14 18:04:39 UTC (rev 3328)
@@ -561,13 +561,13 @@
}
Class<? extends Exception> v2ExceptionClass = v2Exception.getClass();
- String v1Name = v2ExceptionClass.getSimpleName();
+ String v2Name = v2ExceptionClass.getSimpleName();
if (!"org.oasis.wsrp.v2".equals(v2ExceptionClass.getPackage().getName()))
{
throw new IllegalArgumentException("Specified exception is not a WSRP 2 exception: " + v2Exception);
}
- String v2Name = v2ExceptionClass.getSimpleName();
+ String v1Name = v1ExceptionClass.getSimpleName();
// V1 class name should match V2 class name plus "V1"
if (!v2Name.equals(v1Name.substring(2)))
{
Copied: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V1ToV2ConverterTestCase.java (from rev 3305, components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2V1ConverterTestCase.java)
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V1ToV2ConverterTestCase.java (rev 0)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V1ToV2ConverterTestCase.java 2010-06-14 18:04:39 UTC (rev 3328)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp.spec.v1;
+
+import junit.framework.TestCase;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v1.V1OperationFailedFault;
+import org.oasis.wsrp.v2.InvalidSession;
+import org.oasis.wsrp.v2.OperationFailed;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class V1ToV2ConverterTestCase extends TestCase
+{
+ public void testToV2Exception() throws Exception
+ {
+ Throwable throwable = new Throwable();
+ V1OperationFailed v1OF = new V1OperationFailed("foo", new V1OperationFailedFault(), throwable);
+ OperationFailed operationFailed = V1ToV2Converter.toV2Exception(OperationFailed.class, v1OF);
+ assertNotNull(operationFailed);
+ assertEquals("foo", operationFailed.getMessage());
+ assertEquals(throwable, operationFailed.getCause());
+ }
+
+ public void testToV2ExceptionMismatch()
+ {
+ Throwable throwable = new Throwable();
+ V1OperationFailed v1OF = new V1OperationFailed("foo", new V1OperationFailedFault(), throwable);
+
+ try
+ {
+ V1ToV2Converter.toV2Exception(InvalidSession.class, v1OF);
+ fail("Should have failed as requested v2 exception doesn't match specified v1");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testToV2ExceptionWrongRequestedException()
+ {
+ Throwable throwable = new Throwable();
+ V1OperationFailed v1OF = new V1OperationFailed("foo", new V1OperationFailedFault(), throwable);
+
+ try
+ {
+ V1ToV2Converter.toV2Exception(IllegalArgumentException.class, v1OF);
+ fail("Should have failed as requested exception is not a WSRP 2 exception class");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testToV2ExceptionWrongV1Exception()
+ {
+ try
+ {
+ V1ToV2Converter.toV2Exception(OperationFailed.class, new IllegalArgumentException());
+ fail("Should have failed as specified exception is not a WSRP 1 exception");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+}
Added: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2ToV1ConverterTestCase.java
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2ToV1ConverterTestCase.java (rev 0)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2ToV1ConverterTestCase.java 2010-06-14 18:04:39 UTC (rev 3328)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp.spec.v1;
+
+import junit.framework.TestCase;
+import org.oasis.wsrp.v1.V1InvalidSession;
+import org.oasis.wsrp.v1.V1OperationFailed;
+import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.OperationFailedFault;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class V2ToV1ConverterTestCase extends TestCase
+{
+ public void testException() throws Exception
+ {
+ Throwable throwable = new Throwable();
+ OperationFailed operationFailed = new OperationFailed("foo", new OperationFailedFault(), throwable);
+ V1OperationFailed v1OperationFailed = V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
+ assertNotNull(v1OperationFailed);
+ assertEquals("foo", v1OperationFailed.getMessage());
+ assertEquals(throwable, v1OperationFailed.getCause());
+ }
+
+ public void testExceptionMismatch()
+ {
+ Throwable throwable = new Throwable();
+ OperationFailed operationFailed = new OperationFailed("foo", new OperationFailedFault(), throwable);
+
+ try
+ {
+ V2ToV1Converter.toV1Exception(V1InvalidSession.class, operationFailed);
+ fail("Should have failed as requested v1 exception doesn't match specified v2");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testExceptionWrongRequestedException()
+ {
+ Throwable throwable = new Throwable();
+ OperationFailed operationFailed = new OperationFailed("foo", new OperationFailedFault(), throwable);
+
+ try
+ {
+ V2ToV1Converter.toV1Exception(IllegalArgumentException.class, operationFailed);
+ fail("Should have failed as requested exception is not a WSRP 1 exception class");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testExceptionWrongException()
+ {
+ try
+ {
+ V2ToV1Converter.toV1Exception(V1OperationFailed.class, new IllegalArgumentException());
+ fail("Should have failed as specified exception is not a WSRP 1 exception");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+}
Deleted: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2V1ConverterTestCase.java
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2V1ConverterTestCase.java 2010-06-14 12:43:09 UTC (rev 3327)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/spec/v1/V2V1ConverterTestCase.java 2010-06-14 18:04:39 UTC (rev 3328)
@@ -1,92 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.wsrp.spec.v1;
-
-import junit.framework.TestCase;
-import org.oasis.wsrp.v1.V1OperationFailed;
-import org.oasis.wsrp.v1.V1OperationFailedFault;
-import org.oasis.wsrp.v2.InvalidSession;
-import org.oasis.wsrp.v2.OperationFailed;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class V2V1ConverterTestCase extends TestCase
-{
- public void testToV2Exception() throws Exception
- {
- Throwable throwable = new Throwable();
- V1OperationFailed v1OF = new V1OperationFailed("foo", new V1OperationFailedFault(), throwable);
- OperationFailed operationFailed = V1ToV2Converter.toV2Exception(OperationFailed.class, v1OF);
- assertNotNull(operationFailed);
- assertEquals("foo", operationFailed.getMessage());
- assertEquals(throwable, operationFailed.getCause());
- }
-
- public void testToV2ExceptionMismatch()
- {
- Throwable throwable = new Throwable();
- V1OperationFailed v1OF = new V1OperationFailed("foo", new V1OperationFailedFault(), throwable);
-
- try
- {
- V1ToV2Converter.toV2Exception(InvalidSession.class, v1OF);
- fail("Should have failed as requested v2 exception doesn't match specified v1");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- public void testToV2ExceptionWrongRequestedException()
- {
- Throwable throwable = new Throwable();
- V1OperationFailed v1OF = new V1OperationFailed("foo", new V1OperationFailedFault(), throwable);
-
- try
- {
- V1ToV2Converter.toV2Exception(IllegalArgumentException.class, v1OF);
- fail("Should have failed as requested exception is not a WSRP 2 exception class");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- public void testToV2ExceptionWrongV1Exception()
- {
- try
- {
- V1ToV2Converter.toV2Exception(OperationFailed.class, new IllegalArgumentException());
- fail("Should have failed as specified exception is not a WSRP 1 exception");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-}
14 years, 6 months
gatein SVN: r3327 - components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-06-14 08:43:09 -0400 (Mon, 14 Jun 2010)
New Revision: 3327
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/ServiceDescriptionEndpoint.java
Log:
- GTNWSRP-43: more replacement of direct constructor calls to factory method.
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-06-14 10:51:37 UTC (rev 3326)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java 2010-06-14 12:43:09 UTC (rev 3327)
@@ -24,6 +24,7 @@
package org.gatein.wsrp.endpoints.v1;
import com.google.common.collect.Lists;
+import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
import org.gatein.wsrp.spec.v1.V2ToV1Converter;
@@ -112,11 +113,12 @@
forceSessionAccess();
- PerformBlockingInteraction performBlockingInteraction = new PerformBlockingInteraction();
- performBlockingInteraction.setPortletContext(V1ToV2Converter.toV2PortletContext(portletContext));
- performBlockingInteraction.setRuntimeContext(V1ToV2Converter.toV2RuntimeContext(runtimeContext));
- performBlockingInteraction.setMarkupParams(V1ToV2Converter.toV2MarkupParams(markupParams));
- performBlockingInteraction.setInteractionParams(V1ToV2Converter.toV2InteractionParams(interactionParams));
+ PerformBlockingInteraction performBlockingInteraction = WSRPTypeFactory.createPerformBlockingInteraction(
+ V1ToV2Converter.toV2PortletContext(portletContext),
+ V1ToV2Converter.toV2RuntimeContext(runtimeContext),
+ V1ToV2Converter.toV2MarkupParams(markupParams),
+ V1ToV2Converter.toV2InteractionParams(interactionParams)
+ );
performBlockingInteraction.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
performBlockingInteraction.setUserContext(V1ToV2Converter.toV2UserContext(userContext));
@@ -196,9 +198,10 @@
{
forceSessionAccess();
- ReleaseSessions releaseSessions = new ReleaseSessions();
- releaseSessions.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
- releaseSessions.getSessionIDs().addAll(sessionIDs);
+ ReleaseSessions releaseSessions = WSRPTypeFactory.createReleaseSessions(
+ V1ToV2Converter.toV2RegistrationContext(registrationContext),
+ sessionIDs
+ );
ReturnAny returnAny;
try
@@ -240,12 +243,13 @@
{
forceSessionAccess();
- GetMarkup getMarkup = new GetMarkup();
+ GetMarkup getMarkup = WSRPTypeFactory.createMarkupRequest(
+ V1ToV2Converter.toV2PortletContext(portletContext),
+ V1ToV2Converter.toV2RuntimeContext(runtimeContext),
+ V1ToV2Converter.toV2MarkupParams(markupParams)
+ );
getMarkup.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
- getMarkup.setPortletContext(V1ToV2Converter.toV2PortletContext(portletContext));
- getMarkup.setRuntimeContext(V1ToV2Converter.toV2RuntimeContext(runtimeContext));
getMarkup.setUserContext(V1ToV2Converter.toV2UserContext(userContext));
- getMarkup.setMarkupParams(V1ToV2Converter.toV2MarkupParams(markupParams));
MarkupResponse response;
try
@@ -316,8 +320,7 @@
{
forceSessionAccess();
- InitCookie initCookie = new InitCookie();
- initCookie.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
+ InitCookie initCookie = WSRPTypeFactory.createInitCookie(V1ToV2Converter.toV2RegistrationContext(registrationContext));
ReturnAny returnAny;
try
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-06-14 10:51:37 UTC (rev 3326)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java 2010-06-14 12:43:09 UTC (rev 3327)
@@ -23,6 +23,7 @@
package org.gatein.wsrp.endpoints.v1;
+import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.endpoints.WSRPBaseEndpoint;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
@@ -78,7 +79,7 @@
@WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<V1Extension>> extensions
) throws V1InvalidRegistration, V1OperationFailed
{
- GetServiceDescription getServiceDescription = new GetServiceDescription();
+ GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription();
getServiceDescription.setRegistrationContext(V1ToV2Converter.toV2RegistrationContext(registrationContext));
getServiceDescription.getDesiredLocales().addAll(desiredLocales);
14 years, 6 months
gatein SVN: r3326 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-06-14 06:51:37 -0400 (Mon, 14 Jun 2010)
New Revision: 3326
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java
Log:
- Fixed improper handling of WS holders.
- Throw UnsupporterOperationException instead of NotYetImplemented.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java 2010-06-14 10:46:16 UTC (rev 3325)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/v1/V1MarkupService.java 2010-06-14 10:51:37 UTC (rev 3326)
@@ -23,7 +23,7 @@
package org.gatein.wsrp.services.v1;
-import org.gatein.common.NotYetImplemented;
+import org.gatein.wsrp.WSRPExceptionFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.services.MarkupService;
import org.gatein.wsrp.spec.v1.V1ToV2Converter;
@@ -98,15 +98,23 @@
{
try
{
+ Holder<V1MarkupContext> v1MarkupContext = new Holder<V1MarkupContext>();
+ Holder<V1SessionContext> v1SessionContext = new Holder<V1SessionContext>();
+ Holder<List<V1Extension>> v1Extensions = new Holder<List<V1Extension>>();
+
service.getMarkup(
V2ToV1Converter.toV1RegistrationContext(registrationContext),
V2ToV1Converter.toV1PortletContext(portletContext),
V2ToV1Converter.toV1RuntimeContext(runtimeContext),
V2ToV1Converter.toV1UserContext(userContext),
V2ToV1Converter.toV1MarkupParams(markupParams),
- new Holder<V1MarkupContext>(V2ToV1Converter.toV1MarkupContext(markupContext.value)),
- new Holder<V1SessionContext>(V2ToV1Converter.toV1SessionContext(sessionContext.value)),
- new Holder<List<V1Extension>>(WSRPUtils.transform(extensions.value, V2ToV1Converter.EXTENSION)));
+ v1MarkupContext,
+ v1SessionContext,
+ v1Extensions);
+
+ v1MarkupContext.value = V2ToV1Converter.toV1MarkupContext(markupContext.value);
+ v1SessionContext.value = V2ToV1Converter.toV1SessionContext(sessionContext.value);
+ v1Extensions.value = WSRPUtils.transform(extensions.value, V2ToV1Converter.EXTENSION);
}
catch (V1AccessDenied accessDenied)
{
@@ -166,8 +174,7 @@
@Override
public void getResource(RegistrationContext registrationContext, Holder<PortletContext> portletContext, RuntimeContext runtimeContext, UserContext userContext, ResourceParams resourceParams, Holder<ResourceContext> resourceContext, Holder<SessionContext> sessionContext, Holder<List<Extension>> extensions) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
{
-
- throw new NotYetImplemented();
+ throw WSRPExceptionFactory.createWSException(UnsupportedOperationException.class, "getResource is not supported in WSRP 1", null);
}
@Override
@@ -175,6 +182,8 @@
{
try
{
+ Holder<V1UpdateResponse> v1UpdateResponse = new Holder<V1UpdateResponse>();
+ Holder<List<V1Extension>> v1Extensions = new Holder<List<V1Extension>>();
service.performBlockingInteraction(
V2ToV1Converter.toV1RegistrationContext(registrationContext),
V2ToV1Converter.toV1PortletContext(portletContext),
@@ -182,9 +191,12 @@
V2ToV1Converter.toV1UserContext(userContext),
V2ToV1Converter.toV1MarkupParams(markupParams),
V2ToV1Converter.toV1InteractionParams(interactionParams),
- new Holder<V1UpdateResponse>(V2ToV1Converter.toV1UpdateResponse(updateResponse.value)),
+ v1UpdateResponse,
redirectURL,
- new Holder<List<V1Extension>>(WSRPUtils.transform(extensions.value, V2ToV1Converter.EXTENSION)));
+ v1Extensions);
+
+ v1UpdateResponse.value = V2ToV1Converter.toV1UpdateResponse(updateResponse.value);
+ v1Extensions.value = WSRPUtils.transform(extensions.value, V2ToV1Converter.EXTENSION);
}
catch (V1AccessDenied accessDenied)
{
@@ -247,7 +259,7 @@
@Override
public void handleEvents(RegistrationContext registrationContext, PortletContext portletContext, RuntimeContext runtimeContext, UserContext userContext, MarkupParams markupParams, EventParams eventParams, Holder<UpdateResponse> updateResponse, Holder<List<HandleEventsFailed>> failedEvents, Holder<List<Extension>> extensions) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, PortletStateChangeRequired, ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
{
- throw new NotYetImplemented();
+ throw WSRPExceptionFactory.createWSException(UnsupportedOperationException.class, "handleEvents is not supported in WSRP 1", null);
}
@Override
14 years, 6 months