gatein SVN: r1803 - portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-22 08:36:23 -0500 (Mon, 22 Feb 2010)
New Revision: 1803
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
Log:
- Fixed typo.
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2010-02-22 13:33:49 UTC (rev 1802)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2010-02-22 13:36:23 UTC (rev 1803)
@@ -457,7 +457,7 @@
//
log.info("Importing portlet (" + portletApplicationName + "," + portletName + ") in categories " + categoryNames);
- // Process categoriy names
+ // Process category names
for (String categoryName : categoryNames)
{
CategoryDefinition category = registry.getCategory(categoryName);
14 years, 10 months
gatein SVN: r1802 - portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-22 08:33:49 -0500 (Mon, 22 Feb 2010)
New Revision: 1802
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
Log:
- GTNPORTAL-711: added (remote) suffix to remote portlet display names.
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2010-02-22 13:29:58 UTC (rev 1801)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2010-02-22 13:33:49 UTC (rev 1802)
@@ -79,6 +79,7 @@
/** . */
final POMSessionManager mopManager;
+ private static final String REMOTE_DISPLAY_NAME_SUFFIX = " (remote)";
public ApplicationRegistryServiceImpl(ChromatticManager manager, POMSessionManager mopManager)
{
@@ -447,7 +448,8 @@
}
// Additionally categorise the portlet as remote
- if (portlet.isRemote())
+ boolean remote = portlet.isRemote();
+ if (remote)
{
categoryNames.add(REMOTE_CATEGORY_NAME);
}
@@ -471,14 +473,19 @@
ContentDefinition app = category.getContentMap().get(portletName);
if (app == null)
{
- LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
- LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ MetaInfo metaInfo = portlet.getInfo().getMeta();
+ LocalizedString descriptionLS = metaInfo.getMetaValue(MetaInfo.DESCRIPTION);
+
+ LocalizedString displayNameLS = metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME);
+ String displayName = getLocalizedStringValue(displayNameLS, portletName);
+
ContentType<?> contentType;
String contentId;
- if (portlet.isRemote())
+ if (remote)
{
contentType = WSRP.CONTENT_TYPE;
contentId = portlet.getContext().getId();
+ displayName += REMOTE_DISPLAY_NAME_SUFFIX; // add remote to display name to make it more obvious that the portlet is remote
}
else
{
@@ -488,7 +495,7 @@
//
app = category.createContent(portletName, contentType, contentId);
- app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
+ app.setDisplayName(displayName);
app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
}
}
14 years, 10 months
gatein SVN: r1801 - portal/branches/EPP_5_0_0_ER03_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core.
by do-not-reply@jboss.org
Author: mpodolin
Date: 2010-02-22 08:29:58 -0500 (Mon, 22 Feb 2010)
New Revision: 1801
Modified:
portal/branches/EPP_5_0_0_ER03_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java
Log:
GTNPORTAL-708: fixed an encryption key lookup method
Modified: portal/branches/EPP_5_0_0_ER03_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java
===================================================================
--- portal/branches/EPP_5_0_0_ER03_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java 2010-02-22 13:06:28 UTC (rev 1800)
+++ portal/branches/EPP_5_0_0_ER03_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java 2010-02-22 13:29:58 UTC (rev 1801)
@@ -19,16 +19,17 @@
package org.exoplatform.portal.gadget.core;
+import java.io.File;
+import java.io.IOException;
+
import org.apache.shindig.auth.BlobCrypterSecurityToken;
import org.apache.shindig.common.crypto.BasicBlobCrypter;
import org.apache.shindig.common.crypto.BlobCrypter;
import org.apache.shindig.common.crypto.BlobCrypterException;
import org.apache.shindig.common.util.TimeSource;
+import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
import org.exoplatform.web.application.RequestContext;
-import java.io.File;
-import java.io.IOException;
-
public class ExoDefaultSecurityTokenGenerator implements SecurityTokenGenerator
{
private String containerKey;
@@ -39,7 +40,8 @@
{
// TODO should be moved to config
// generateKeys("RSA", 1024);
- this.containerKey = "key.txt";
+
+ this.containerKey = getKeyFilePath();
this.timeSource = new TimeSource();
}
@@ -128,5 +130,26 @@
c.timeSource = timeSource;
return c;
}
+
+ /**
+ * Method returns a path to the file containing the encryption key
+ */
+ private String getKeyFilePath(){
+ J2EEServerInfo info = new J2EEServerInfo();
+ String confPath = info.getExoConfigurationDirectory();
+ File keyFile = null;
+
+ if (confPath != null) {
+ File confDir = new File(confPath);
+ if (confDir.exists() && confDir.isDirectory()) {
+ keyFile = new File(confDir, "gadgets/key.txt");
+ }
+ }
+ if (keyFile == null) {
+ keyFile = new File("key.txt");
+ }
+
+ return keyFile.getAbsolutePath();
+ }
}
14 years, 10 months
gatein SVN: r1800 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-22 08:06:28 -0500 (Mon, 22 Feb 2010)
New Revision: 1800
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
Log:
- Slightly improved error reporting.
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-02-22 13:05:53 UTC (rev 1799)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-02-22 13:06:28 UTC (rev 1800)
@@ -142,8 +142,9 @@
}
catch (Exception e)
{
- log.error(e.getMessage());
- Object[] args = {e.getMessage()};
+ String message = e.getLocalizedMessage();
+ log.error("Error processing the action: " + message, e);
+ Object[] args = {message};
context.addUIComponentToUpdateByAjax(uicomponent);
throw new MessageException(new ApplicationMessage("UIPortletLifecycle.msg.process-error", args, ApplicationMessage.ERROR));
}
14 years, 10 months
gatein SVN: r1799 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-22 08:05:53 -0500 (Mon, 22 Feb 2010)
New Revision: 1799
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
- Do not attempt to setup PRPs if there are no request parameters (otherwise, this'll lead to an NPE).
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-02-22 11:42:26 UTC (rev 1798)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-02-22 13:05:53 UTC (rev 1799)
@@ -36,6 +36,7 @@
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
import org.gatein.common.util.MultiValuedPropertyMap;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.PortletContext;
@@ -617,9 +618,7 @@
setupPublicRenderParams(uiPortlet, request.getParameterMap());
//set render params
- String navState =
- ((PortalRequestContext)event.getRequestContext())
- .getRequestParameter(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME);
+ String navState = event.getRequestContext().getRequestParameter(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME);
uiPortlet.setNavigationalState(ParametersStateString.create(navState));
}
}
@@ -633,23 +632,26 @@
*/
static public void setupPublicRenderParams(UIPortlet uiPortlet, Map<String, String[]> requestParams)
{
- UIPortal uiPortal = Util.getUIPortal();
- Map<String, String[]> publicParams = uiPortal.getPublicParameters();
+ if (ParameterValidation.existsAndIsNotEmpty(requestParams))
+ {
+ UIPortal uiPortal = Util.getUIPortal();
+ Map<String, String[]> publicParams = uiPortal.getPublicParameters();
- for (String key : requestParams.keySet())
- {
- String[] value = requestParams.get(key);
- if (uiPortlet.supportsPublicParam(key))
- {
- if (value.length > 0)
- {
- publicParams.put(key, value);
- }
- else
- {
- publicParams.remove(key);
- }
- }
+ for (String key : requestParams.keySet())
+ {
+ String[] value = requestParams.get(key);
+ if (uiPortlet.supportsPublicParam(key))
+ {
+ if (value.length > 0)
+ {
+ publicParams.put(key, value);
+ }
+ else
+ {
+ publicParams.remove(key);
+ }
+ }
+ }
}
}
14 years, 10 months
gatein SVN: r1798 - in portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium: ko and 1 other directory.
by do-not-reply@jboss.org
Author: dbaeli
Date: 2010-02-22 06:42:26 -0500 (Mon, 22 Feb 2010)
New Revision: 1798
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/ko/Test_SNF_PRL_29.html
Removed:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_29.html
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/TestSuite_SNF_PRL.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_09.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17.html
Log:
GTNPORTAL-509: Selenium Tests implementation
* Fixed 09 check on Tomcat (WSRP is not the right portlet to check, because WSRP is not in Tomcat)
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/TestSuite_SNF_PRL.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/TestSuite_SNF_PRL.html 2010-02-22 11:29:35 UTC (rev 1797)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/TestSuite_SNF_PRL.html 2010-02-22 11:42:26 UTC (rev 1798)
@@ -23,7 +23,6 @@
<tr><td><a href="Test_SNF_PRL_17.html">SNF_PRL_17</a></td></tr>
<tr><td><a href="Test_SNF_PRL_19.html">SNF_PRL_19</a></td></tr>
<tr><td><a href="Test_SNF_PRL_23.html">SNF_PRL_23</a></td></tr>
-<tr><td><a href="Test_SNF_PRL_29.html">SNF_PRL_29</a></td></tr>
<tr><td><a href="Test_SNF_PRL_31.html">SNF_PRL_31</a></td></tr>
<tr><td><a href="Test_SNF_PRL_32.html">SNF_PRL_32</a></td></tr>
<tr><td><a href="Test_SNF_PRL_33.html">SNF_PRL_33</a></td></tr>
@@ -41,6 +40,7 @@
<tr><td><a href="ko/Test_SNF_PRL_26.html">SNF_PRL_26 Not working</a></td></tr>
<tr><td><a href="ko/Test_SNF_PRL_27.html">SNF_PRL_27 Not working</a></td></tr>
<tr><td><a href="ko/Test_SNF_PRL_28.html">SNF_PRL_28 Not working</a></td></tr>
+<tr><td><a href="ko/Test_SNF_PRL_29.html">SNF_PRL_29 Not working</a></td></tr>
<tr><td><a href="ko/Test_SNF_PRL_30.html">SNF_PRL_30 Not working</a></td></tr>
</tbody></table>
</body>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_09.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_09.html 2010-02-22 11:29:35 UTC (rev 1797)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_09.html 2010-02-22 11:42:26 UTC (rev 1798)
@@ -68,7 +68,7 @@
</tr>
<tr>
<td>verifyTextNotPresent</td>
- <td>WSRP Configuration</td>
+ <td>Register Portlet</td>
<td></td>
</tr>
<tr>
@@ -83,22 +83,22 @@
</tr>
<tr>
<td>waitForTextPresent</td>
- <td>WSRP Configuration</td>
+ <td>Register Portlet</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
- <td>WSRP Configuration</td>
+ <td>Register Portlet</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//a[contains(@onclick,'op=RemoveApplication&objectId=WSRPConfigurationPortlet&ajaxRequest=true')]</td>
+ <td>//a[contains(@onclick,'op=RemoveApplication&objectId=RegisterPortlet&ajaxRequest=true')]</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
- <td>//a[contains(@onclick,'op=RemoveApplication&objectId=WSRPConfigurationPortlet&ajaxRequest=true')]</td>
+ <td>//a[contains(@onclick,'op=RemoveApplication&objectId=RegisterPortlet&ajaxRequest=true')]</td>
<td></td>
</tr>
<tr>
@@ -108,7 +108,7 @@
</tr>
<tr>
<td>verifyTextNotPresent</td>
- <td>WSRP Configuration</td>
+ <td>Register Portlet</td>
<td></td>
</tr>
<tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17.html 2010-02-22 11:29:35 UTC (rev 1797)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_17.html 2010-02-22 11:42:26 UTC (rev 1798)
@@ -27,6 +27,11 @@
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
<td>type</td>
<td>username</td>
<td>root</td>
Deleted: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_29.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_29.html 2010-02-22 11:29:35 UTC (rev 1797)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_29.html 2010-02-22 11:42:26 UTC (rev 1798)
@@ -1,317 +0,0 @@
-<?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>SNF_PRL_29</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">SNF_PRL_29</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/portal/public/classic</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>-AddEditPageEditLayoutDashboard-</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</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>clickAt</td>
- <td>link=Dashboard</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Add new page in dashboard</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Add New Page</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=Add New Page</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Choose "root" node</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>pageName</td>
- <td></td>
-</tr>
-<tr>
- <td>type</td>
- <td>pageName</td>
- <td>test_dashboardpage_29</td>
-</tr>
-<tr>
- <td>type</td>
- <td>pageDisplayName</td>
- <td>test_dashboardpage_name_29</td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Click Next to move to step 2</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[@id='UIPageCreationWizard']//div[@class='UIAction']//div[2]</td>
- <td>1,1</td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Click Next to move to step 3, keep Empty layout</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForTextPresent</td>
- <td>Select a Page Layout Template</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@id='UIPageCreationWizard']//div[@class='UIAction']//div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[@id='UIPageCreationWizard']//div[@class='UIAction']//div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Open Editor pane</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@onclick='eXo.portal.UIPortal.toggleComposer(this)']</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[@onclick='eXo.portal.UIPortal.toggleComposer(this)']</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Click Save to complete adding page</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForTextPresent</td>
- <td>test_dashboardpage_name_29</td>
- <td></td>
-</tr>
-<!--tr>
- <td>verifyTextPresent</td>
- <td>test_dashboardpage_name_29</td>
- <td></td>
-</tr-->
-<tr>
- <td>echo</td>
- <td>--Edit page in dashboard</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--------To fast</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//span</td>
- <td></td>
-</tr>
-<tr>
- <td>componentExoDoubleClick</td>
- <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//span</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//input</td>
- <td></td>
-</tr>
-<tr>
- <td>type</td>
- <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//input</td>
- <td>test_dashboardpage_edit_29</td>
-</tr>
-<tr>
- <td>keyPress</td>
- <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//input</td>
- <td>\13</td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=Site</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Edit Dashboard layout</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=test_dashboardpage_edit_29</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=test_dashboardpage_edit_29</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@class='UITab GrayTabStyle']/div[@class='NormalTab']//span</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--------To fast</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Edit Layout</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=Edit Layout</td>
- <td>1,1</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Portal Properties</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=Portal Properties</td>
- <td>1,1</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>locale</td>
- <td></td>
-</tr>
-<tr>
- <td>select</td>
- <td>locale</td>
- <td>label=English</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[(a)onclick="eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, 'UIPortalForm', 'Properties');javascript:eXo.webui.UIForm.submitEvent('UIPortalForm','SelectTab','&objectId=Properties')"]</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[(a)onclick="eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, 'UIPortalForm', 'Properties');javascript:eXo.webui.UIForm.submitEvent('UIPortalForm','SelectTab','&objectId=Properties')"]</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=Save</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@id='UIPortalComposer']//a[@class='EdittedSaveButton']</td>
- <td>1,1</td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[@id='UIPortalComposer']//a[@class='EdittedSaveButton']</td>
- <td>1,1</td>
-</tr>
-<tr>
- <td>echo</td>
- <td>--Delete page</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@class='SelectedTab']//img[@class='CloseIcon']</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>//div[@class='SelectedTab']//img[@class='CloseIcon']</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForConfirmation</td>
- <td>Really want to remove this dashboard?</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForTextNotPresent</td>
- <td>test_dashboardpage_edit_29</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyTextNotPresent</td>
- <td>test_dashboardpage_edit_29</td>
- <td></td>
-</tr>
-<tr>
- <td>clickAt</td>
- <td>link=Sign out</td>
- <td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
Copied: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/ko/Test_SNF_PRL_29.html (from rev 1794, portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_29.html)
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/ko/Test_SNF_PRL_29.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/ko/Test_SNF_PRL_29.html 2010-02-22 11:42:26 UTC (rev 1798)
@@ -0,0 +1,317 @@
+<?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>SNF_PRL_29</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">SNF_PRL_29</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-AddEditPageEditLayoutDashboard-</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</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>clickAt</td>
+ <td>link=Dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Add new page in dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add New Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Add New Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Choose "root" node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>pageName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageName</td>
+ <td>test_dashboardpage_29</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageDisplayName</td>
+ <td>test_dashboardpage_name_29</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Click Next to move to step 2</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[@id='UIPageCreationWizard']//div[@class='UIAction']//div[2]</td>
+ <td>1,1</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Click Next to move to step 3, keep Empty layout</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Select a Page Layout Template</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageCreationWizard']//div[@class='UIAction']//div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[@id='UIPageCreationWizard']//div[@class='UIAction']//div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Open Editor pane</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@onclick='eXo.portal.UIPortal.toggleComposer(this)']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[@onclick='eXo.portal.UIPortal.toggleComposer(this)']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Click Save to complete adding page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>test_dashboardpage_name_29</td>
+ <td></td>
+</tr>
+<!--tr>
+ <td>verifyTextPresent</td>
+ <td>test_dashboardpage_name_29</td>
+ <td></td>
+</tr-->
+<tr>
+ <td>echo</td>
+ <td>--Edit page in dashboard</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--------To fast</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//span</td>
+ <td></td>
+</tr>
+<tr>
+ <td>componentExoDoubleClick</td>
+ <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//span</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//input</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//input</td>
+ <td>test_dashboardpage_edit_29</td>
+</tr>
+<tr>
+ <td>keyPress</td>
+ <td>//div[@class='TabsContainer ClearFix']//div[@class='SelectedTab']//input</td>
+ <td>\13</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Site</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Edit Dashboard layout</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=test_dashboardpage_edit_29</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=test_dashboardpage_edit_29</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@class='UITab GrayTabStyle']/div[@class='NormalTab']//span</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--------To fast</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Layout</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Edit Layout</td>
+ <td>1,1</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Portal Properties</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Portal Properties</td>
+ <td>1,1</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>locale</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>locale</td>
+ <td>label=English</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[(a)onclick="eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, 'UIPortalForm', 'Properties');javascript:eXo.webui.UIForm.submitEvent('UIPortalForm','SelectTab','&objectId=Properties')"]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[(a)onclick="eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, 'UIPortalForm', 'Properties');javascript:eXo.webui.UIForm.submitEvent('UIPortalForm','SelectTab','&objectId=Properties')"]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPortalComposer']//a[@class='EdittedSaveButton']</td>
+ <td>1,1</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[@id='UIPortalComposer']//a[@class='EdittedSaveButton']</td>
+ <td>1,1</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Delete page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@class='SelectedTab']//img[@class='CloseIcon']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>//div[@class='SelectedTab']//img[@class='CloseIcon']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForConfirmation</td>
+ <td>Really want to remove this dashboard?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextNotPresent</td>
+ <td>test_dashboardpage_edit_29</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextNotPresent</td>
+ <td>test_dashboardpage_edit_29</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 10 months
gatein SVN: r1797 - in components/mop/trunk: core/src/main/java/org/gatein/mop/core/api/workspace/content and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-22 06:29:35 -0500 (Mon, 22 Feb 2010)
New Revision: 1797
Added:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/StateContainerImpl.java
Modified:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
Log:
better integration of content provider SPI
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java 2010-02-22 09:42:13 UTC (rev 1796)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -41,7 +41,7 @@
providers = new HashMap<String, ContentRegistration>();
}
- public synchronized <S> void register(ContentType<S> contentType, ContentProvider<S> contentProvider)
+ public synchronized <E> void register(ContentType<E> contentType, ContentProvider<E, ?> contentProvider)
{
if (contentType == null)
{
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java 2010-02-22 09:42:13 UTC (rev 1796)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -71,22 +71,6 @@
/** . */
public ChromatticSession session;
- /** . */
- private StateContainer container = new StateContainer() {
- public Object getState() {
- return getCustomizationState();
- }
-
- public void setState(Object state) {
- setCustomizationState((AbstractCustomizationState)state);
- }
- public <T> T create(Class<T> type) {
- T t = session.create(type);
- setCustomizationState((AbstractCustomizationState)t);
- return t;
- }
- };
-
@Id
public abstract String getId();
@@ -110,24 +94,19 @@
public abstract AbstractCustomization getParent();
- public Object getVirtualState()
+ private <E, I> E getVirtualState(ContentProvider<E, I> provider)
{
+ StateContainerImpl<E, I> container = new StateContainerImpl<E, I>(provider, this);
- ContentType contentType = getType();
-
- String mimeType = contentType.getMimeType();
-
- ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
-
//
- Object childPayload = contentProvider.getState(container);
+ E childPayload = provider.getState(container);
//
- Object parentPayload = null;
+ E parentPayload = null;
AbstractCustomization parent = getParent();
if (parent != null)
{
- parentPayload = parent.getVirtualState();
+ parentPayload = parent.getVirtualState(provider);
}
//
@@ -135,7 +114,7 @@
{
if (childPayload != null)
{
- return contentProvider.combine(Arrays.asList(parentPayload, childPayload));
+ return provider.combine(Arrays.asList(parentPayload, childPayload));
}
else
{
@@ -148,12 +127,32 @@
}
}
+ private <E, I> E getState(ContentProvider<E, I> provider)
+ {
+ StateContainerImpl<E, I> container = new StateContainerImpl<E, I>(provider, this);
+ return provider.getState(container);
+ }
+
+ private <E, I> void setState(ContentProvider<E, I> provider, E state)
+ {
+ StateContainerImpl<E, I> container = new StateContainerImpl<E, I>(provider, this);
+ provider.setState(container, state);
+ }
+
+ public Object getVirtualState()
+ {
+ ContentType contentType = getType();
+ String mimeType = contentType.getMimeType();
+ ContentProvider<?, ?> provider = registry.providers.get(mimeType).getProvider();
+ return getVirtualState(provider);
+ }
+
public Object getState()
{
ContentType contentType = getType();
String mimeType = contentType.getMimeType();
- ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- return contentProvider.getState(container);
+ ContentProvider<?, ?> provider = registry.providers.get(mimeType).getProvider();
+ return getState(provider);
}
public void setState(Object state)
@@ -161,7 +160,7 @@
ContentType contentType = getType();
String mimeType = contentType.getMimeType();
ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- contentProvider.setState(container, state);
+ setState(contentProvider, state);
}
public Customization<Object> getCustomization(Set<CustomizationContext> contexts)
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/StateContainerImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/StateContainerImpl.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/StateContainerImpl.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.mop.core.api.workspace.content;
+
+import org.gatein.mop.spi.content.ContentProvider;
+import org.gatein.mop.spi.content.StateContainer;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class StateContainerImpl<E, I> implements StateContainer<I> {
+
+ /** . */
+ private final AbstractCustomization customization;
+
+ /** . */
+ private final ContentProvider<E, I> provider;
+
+ /** . */
+ private final Class<I> stateType;
+
+ public StateContainerImpl(ContentProvider<E, I> provider, AbstractCustomization customization) {
+ this.provider = provider;
+ this.stateType = provider.getInternalType();
+ this.customization = customization;
+ }
+
+ public I getState() {
+ return stateType.cast(customization.getCustomizationState());
+ }
+
+ public void setState(I state) {
+ customization.setCustomizationState((AbstractCustomizationState)state);
+ }
+
+ public I create() {
+ I i = customization.session.create(stateType);
+ setState(i);
+ return i;
+ }
+}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2010-02-22 09:42:13 UTC (rev 1796)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -27,7 +27,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class GadgetContentProvider implements ContentProvider<Gadget>
+public class GadgetContentProvider implements ContentProvider<Gadget, GadgetState>
{
public Gadget combine(List<Gadget> states)
@@ -35,9 +35,8 @@
throw new UnsupportedOperationException();
}
- public void setState(StateContainer container, Gadget state)
- {
- GadgetState prefs = (GadgetState)container.getState();
+ public void setState(StateContainer<GadgetState> container, Gadget state) {
+ GadgetState prefs = container.getState();
if (prefs != null)
{
if (state == null)
@@ -49,15 +48,15 @@
{
if (state != null)
{
- prefs = container.create(GadgetState.class);
+ prefs = container.create();
prefs.setUserPrefs(state.getUserPref());
}
}
}
- public Gadget getState(StateContainer container)
+ public Gadget getState(StateContainer<GadgetState> container)
{
- GadgetState prefs = (GadgetState)container.getState();
+ GadgetState prefs = container.getState();
if (prefs != null)
{
Gadget gadget = new Gadget();
@@ -70,8 +69,12 @@
}
}
- public Class<Gadget> getStateType()
+ public Class<Gadget> getExternalType()
{
return Gadget.class;
}
+
+ public Class<GadgetState> getInternalType() {
+ return GadgetState.class;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2010-02-22 09:42:13 UTC (rev 1796)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class PortletContentProvider implements ContentProvider<Preferences>
+public class PortletContentProvider implements ContentProvider<Preferences, PortletPreferencesState>
{
public Preferences combine(List<Preferences> states)
@@ -53,9 +53,9 @@
return new Preferences(entries);
}
- public void setState(StateContainer container, Preferences state)
+ public void setState(StateContainer<PortletPreferencesState> container, Preferences state)
{
- PortletPreferencesState prefs = (PortletPreferencesState)container.getState();
+ PortletPreferencesState prefs = container.getState();
//
if (prefs != null)
@@ -73,15 +73,15 @@
{
if (state != null)
{
- prefs = container.create(PortletPreferencesState.class);
+ prefs = container.create();
prefs.setPayload(state);
}
}
}
- public Preferences getState(StateContainer container)
+ public Preferences getState(StateContainer<PortletPreferencesState> container)
{
- PortletPreferencesState prefs = (PortletPreferencesState)container.getState();
+ PortletPreferencesState prefs = container.getState();
if (prefs != null)
{
return prefs.getPayload();
@@ -92,8 +92,12 @@
}
}
- public Class<Preferences> getStateType()
+ public Class<Preferences> getExternalType()
{
return Preferences.class;
}
+
+ public Class<PortletPreferencesState> getInternalType() {
+ return PortletPreferencesState.class;
+ }
}
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2010-02-22 09:42:13 UTC (rev 1796)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -23,8 +23,10 @@
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
+ * @param <E> the external state type
+ * @param <I> the internal state type
*/
-public interface ContentProvider<S>
+public interface ContentProvider<E, I>
{
/**
@@ -33,7 +35,7 @@
* @param states the various states to combine
* @return the combined state
*/
- S combine(List<S> states);
+ E combine(List<E> states);
/**
* Update the state container with the provided state.
@@ -41,7 +43,7 @@
* @param container the state container
* @param state the state
*/
- void setState(StateContainer container, S state);
+ void setState(StateContainer<I> container, E state);
/**
* Returns the state attached to the provided container.
@@ -49,13 +51,20 @@
* @param container the container
* @return the state
*/
- S getState(StateContainer container);
+ E getState(StateContainer<I> container);
/**
* Returns the class the represents the state as seen by the framework client.
*
* @return the external state class
*/
- Class<S> getStateType();
+ Class<E> getExternalType();
+ /**
+ * Returns the class that represents the state as seen by the provider.
+ *
+ * @return the internal state class
+ */
+ Class<I> getInternalType();
+
}
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2010-02-22 09:42:13 UTC (rev 1796)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2010-02-22 11:29:35 UTC (rev 1797)
@@ -22,13 +22,13 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface StateContainer
+public interface StateContainer<I>
{
- Object getState();
+ I getState();
- void setState(Object state);
+ void setState(I state);
- <T> T create(Class<T> type);
+ I create();
}
14 years, 10 months
gatein SVN: r1796 - in components/mop/trunk: core/src/test/java/org/gatein/mop/core/support/content/gadget and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-22 04:42:13 -0500 (Mon, 22 Feb 2010)
New Revision: 1796
Added:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomizationState.java
Modified:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
Log:
better spi integration with content state
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java 2010-02-22 09:19:12 UTC (rev 1795)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -49,7 +49,7 @@
*/
@FormattedBy(MOPFormatter.class)
@PrimaryType(name = "mop:customization")
-public abstract class AbstractCustomization implements Customization<Object>, StateContainer
+public abstract class AbstractCustomization implements Customization<Object>
{
/** . */
@@ -71,6 +71,22 @@
/** . */
public ChromatticSession session;
+ /** . */
+ private StateContainer container = new StateContainer() {
+ public Object getState() {
+ return getCustomizationState();
+ }
+
+ public void setState(Object state) {
+ setCustomizationState((AbstractCustomizationState)state);
+ }
+ public <T> T create(Class<T> type) {
+ T t = session.create(type);
+ setCustomizationState((AbstractCustomizationState)t);
+ return t;
+ }
+ };
+
@Id
public abstract String getId();
@@ -84,6 +100,12 @@
@Create
abstract ContextSpecialization createContextSpecialization();
+ @OneToOne
+ @MappedBy("mop:state")
+ public abstract AbstractCustomizationState getCustomizationState();
+
+ public abstract void setCustomizationState(AbstractCustomizationState customizationState);
+
public abstract CustomizationContext getContext();
public abstract AbstractCustomization getParent();
@@ -98,7 +120,7 @@
ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
//
- Object childPayload = contentProvider.getState(this);
+ Object childPayload = contentProvider.getState(container);
//
Object parentPayload = null;
@@ -131,7 +153,7 @@
ContentType contentType = getType();
String mimeType = contentType.getMimeType();
ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- return contentProvider.getState(this);
+ return contentProvider.getState(container);
}
public void setState(Object state)
@@ -139,7 +161,7 @@
ContentType contentType = getType();
String mimeType = contentType.getMimeType();
ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- contentProvider.setState(this, state);
+ contentProvider.setState(container, state);
}
public Customization<Object> getCustomization(Set<CustomizationContext> contexts)
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomizationState.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomizationState.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomizationState.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.mop.core.api.workspace.content;
+
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.RelatedMappedBy;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:customizationstate")
+public abstract class AbstractCustomizationState {
+
+ @OneToOne
+ @RelatedMappedBy("mop:state")
+ public abstract AbstractCustomization getCustomization();
+
+}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2010-02-22 09:19:12 UTC (rev 1795)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -20,12 +20,7 @@
import org.gatein.mop.spi.content.ContentProvider;
import org.gatein.mop.spi.content.StateContainer;
-import org.gatein.mop.core.api.workspace.content.AbstractCustomization;
-import org.chromattic.api.ChromatticSession;
-import org.chromattic.api.UndeclaredRepositoryException;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
import java.util.List;
/**
@@ -42,72 +37,36 @@
public void setState(StateContainer container, Gadget state)
{
- try
+ GadgetState prefs = (GadgetState)container.getState();
+ if (prefs != null)
{
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
-
- //
- GadgetState prefs;
- if (node.hasNode("mop:state"))
+ if (state == null)
{
- Node stateNode = node.getNode("mop:state");
- prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
- if (state == null)
- {
- session.remove(prefs);
- return;
- }
+ container.setState(null);
}
- else
+ }
+ else
+ {
+ if (state != null)
{
- if (state == null)
- {
- return;
- }
- else
- {
- Node stateNode = node.addNode("mop:state", "mop:gadget");
- prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
- }
+ prefs = container.create(GadgetState.class);
+ prefs.setUserPrefs(state.getUserPref());
}
-
- //
- prefs.setUserPrefs(state.getUserPref());
}
- catch (RepositoryException e)
- {
- throw new UndeclaredRepositoryException(e);
- }
}
public Gadget getState(StateContainer container)
{
- try
+ GadgetState prefs = (GadgetState)container.getState();
+ if (prefs != null)
{
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
-
- //
- GadgetState prefs;
- if (node.hasNode("mop:state"))
- {
- Node stateNode = node.getNode("mop:state");
- prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
- Gadget gadget = new Gadget();
- gadget.setUserPref(prefs.getUserPrefs());
- return gadget;
- }
- else
- {
- return null;
- }
+ Gadget gadget = new Gadget();
+ gadget.setUserPref(prefs.getUserPrefs());
+ return gadget;
}
- catch (RepositoryException e)
+ else
{
- throw new UndeclaredRepositoryException(e);
+ return null;
}
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2010-02-22 09:19:12 UTC (rev 1795)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -20,13 +20,14 @@
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
+import org.gatein.mop.core.api.workspace.content.AbstractCustomizationState;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
@PrimaryType(name = "mop:gadget")
-public abstract class GadgetState
+public abstract class GadgetState extends AbstractCustomizationState
{
@Property(name = "mop:prefs")
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2010-02-22 09:19:12 UTC (rev 1795)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -20,12 +20,7 @@
import org.gatein.mop.spi.content.ContentProvider;
import org.gatein.mop.spi.content.StateContainer;
-import org.gatein.mop.core.api.workspace.content.AbstractCustomization;
-import org.chromattic.api.ChromatticSession;
-import org.chromattic.api.UndeclaredRepositoryException;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
@@ -60,70 +55,40 @@
public void setState(StateContainer container, Preferences state)
{
- try
- {
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
+ PortletPreferencesState prefs = (PortletPreferencesState)container.getState();
- //
- PortletPreferencesState prefs;
- if (node.hasNode("mop:state"))
+ //
+ if (prefs != null)
+ {
+ if (state == null)
{
- Node stateNode = node.getNode("mop:state");
- prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
- if (state == null)
- {
- session.remove(prefs);
- return;
- }
+ container.setState(null);
}
else
{
- if (state == null)
- {
- return;
- }
- else
- {
- Node stateNode = node.addNode("mop:state", "mop:portletpreferences");
- prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
- }
+ prefs.setPayload(state);
}
-
- //
- prefs.setPayload(state);
}
- catch (RepositoryException e)
+ else
{
- throw new UndeclaredRepositoryException(e);
+ if (state != null)
+ {
+ prefs = container.create(PortletPreferencesState.class);
+ prefs.setPayload(state);
+ }
}
}
public Preferences getState(StateContainer container)
{
- try
+ PortletPreferencesState prefs = (PortletPreferencesState)container.getState();
+ if (prefs != null)
{
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
-
- //
- PortletPreferencesState prefs;
- if (node.hasNode("mop:state"))
- {
- Node stateNode = node.getNode("mop:state");
- prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
- return (Preferences)prefs.getPayload();
- }
- else
- {
- return null;
- }
+ return prefs.getPayload();
}
- catch (RepositoryException e)
+ else
{
- throw new UndeclaredRepositoryException(e);
+ return null;
}
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java 2010-02-22 09:19:12 UTC (rev 1795)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -20,10 +20,8 @@
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.RelatedMappedBy;
-import org.gatein.mop.core.api.workspace.content.AbstractCustomization;
+import org.gatein.mop.core.api.workspace.content.AbstractCustomizationState;
import java.util.Map;
@@ -32,7 +30,7 @@
* @version $Revision$
*/
@PrimaryType(name = "mop:portletpreferences")
-public abstract class PortletPreferencesState
+public abstract class PortletPreferencesState extends AbstractCustomizationState
{
/** . */
@@ -44,11 +42,7 @@
@Create
public abstract PortletPreferenceState create();
- @OneToOne
- @RelatedMappedBy("mop:state")
- public abstract AbstractCustomization getCustomization();
-
- private void setPayload(Preferences payload)
+ public void setPayload(Preferences payload)
{
this.payload = payload;
@@ -66,13 +60,8 @@
}
}
- public void setPayload(Object payload)
+ public Preferences getPayload()
{
- setPayload((Preferences)payload);
- }
-
- public Object getPayload()
- {
if (payload == null)
{
PreferencesBuilder builder = new PreferencesBuilder();
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2010-02-22 09:19:12 UTC (rev 1795)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2010-02-22 09:42:13 UTC (rev 1796)
@@ -24,4 +24,11 @@
*/
public interface StateContainer
{
+
+ Object getState();
+
+ void setState(Object state);
+
+ <T> T create(Class<T> type);
+
}
14 years, 10 months
gatein SVN: r1795 - portal/trunk/testsuite/selenium-snifftests.
by do-not-reply@jboss.org
Author: dbaeli
Date: 2010-02-22 04:19:12 -0500 (Mon, 22 Feb 2010)
New Revision: 1795
Modified:
portal/trunk/testsuite/selenium-snifftests/pom.xml
Log:
GTNPORTAL-509 fixed selenium plugin version
Modified: portal/trunk/testsuite/selenium-snifftests/pom.xml
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/pom.xml 2010-02-22 08:51:45 UTC (rev 1794)
+++ portal/trunk/testsuite/selenium-snifftests/pom.xml 2010-02-22 09:19:12 UTC (rev 1795)
@@ -96,6 +96,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
+ <version>${org.selenium.maven-plugin.version}</version>
<executions>
<execution>
<phase>pre-integration-test</phase>
14 years, 10 months
gatein SVN: r1794 - components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-22 03:51:45 -0500 (Mon, 22 Feb 2010)
New Revision: 1794
Modified:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java
Log:
fix wrong relationship @ManyToOne -> @OneTone @RelatedMappedBy
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java 2010-02-22 02:38:07 UTC (rev 1793)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java 2010-02-22 08:51:45 UTC (rev 1794)
@@ -18,10 +18,7 @@
*/
package org.gatein.mop.core.api.workspace.content;
-import org.chromattic.api.annotations.FormattedBy;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.*;
import org.gatein.mop.core.api.MOPFormatter;
import java.util.Map;
@@ -38,7 +35,8 @@
@OneToMany
public abstract Map<String, ContextType> getContextTypes();
- @ManyToOne
+ @OneToOne
+ @RelatedMappedBy("mop:contexttypes")
public abstract AbstractCustomization getCustomization();
}
14 years, 10 months