Author: julien_viet
Date: 2009-10-24 04:32:00 -0400 (Sat, 24 Oct 2009)
New Revision: 414
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeContainerData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java
Removed:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationContainer.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java
Modified:
portal/branches/performance/component/portal/src/main/java/conf/portal/configuration.xml
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Dashboard.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelObject.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/SiteBody.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/gadget/GadgetApplication.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/portlet/PortletApplication.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/wsrp/WSRPApplication.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortletPreferencesTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
portal/branches/performance/component/portal/src/test/java/conf/portal/test-configuration.xml
portal/branches/performance/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalSelector.java
Log:
move mop data to a better location
Modified:
portal/branches/performance/component/portal/src/main/java/conf/portal/configuration.xml
===================================================================
---
portal/branches/performance/component/portal/src/main/java/conf/portal/configuration.xml 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/conf/portal/configuration.xml 2009-10-24
08:32:00 UTC (rev 414)
@@ -36,7 +36,7 @@
</component>
<component>
- <key>org.exoplatform.portal.pom.config.data.ModelDataStorage</key>
+ <key>org.exoplatform.portal.pom.data.ModelDataStorage</key>
<type>org.exoplatform.portal.pom.config.POMDataStorage</type>
</component>
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,8 +20,8 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.pom.config.Utils;
-import org.exoplatform.portal.pom.config.data.ApplicationData;
-import org.exoplatform.portal.pom.config.data.ModelData;
+import org.exoplatform.portal.pom.data.ApplicationData;
+import org.exoplatform.portal.pom.data.ModelData;
/**
* May 13, 2004
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,9 +20,9 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.pom.config.Utils;
-import org.exoplatform.portal.pom.config.data.ComponentData;
-import org.exoplatform.portal.pom.config.data.ContainerData;
-import org.exoplatform.portal.pom.config.data.ModelData;
+import org.exoplatform.portal.pom.data.ComponentData;
+import org.exoplatform.portal.pom.data.ContainerData;
+import org.exoplatform.portal.pom.data.ModelData;
import java.util.ArrayList;
import java.util.Collections;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Dashboard.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Dashboard.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Dashboard.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,8 +20,8 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.pom.config.Utils;
-import org.exoplatform.portal.pom.config.data.ComponentData;
-import org.exoplatform.portal.pom.config.data.DashboardData;
+import org.exoplatform.portal.pom.data.ComponentData;
+import org.exoplatform.portal.pom.data.DashboardData;
import java.util.List;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.config.model;
-import org.exoplatform.portal.pom.config.data.ModelData;
+import org.exoplatform.portal.pom.data.ModelData;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelObject.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelObject.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelObject.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -25,11 +25,11 @@
import org.exoplatform.portal.config.model.portlet.PortletId;
import org.exoplatform.portal.config.model.wsrp.WSRPApplication;
import org.exoplatform.portal.config.model.wsrp.WSRPId;
-import org.exoplatform.portal.pom.config.data.ApplicationData;
-import org.exoplatform.portal.pom.config.data.BodyData;
-import org.exoplatform.portal.pom.config.data.ContainerData;
-import org.exoplatform.portal.pom.config.data.ModelData;
-import org.exoplatform.portal.pom.config.data.PageData;
+import org.exoplatform.portal.pom.data.ApplicationData;
+import org.exoplatform.portal.pom.data.BodyData;
+import org.exoplatform.portal.pom.data.ContainerData;
+import org.exoplatform.portal.pom.data.ModelData;
+import org.exoplatform.portal.pom.data.PageData;
import org.exoplatform.portal.pom.spi.gadget.Gadget;
import org.exoplatform.portal.pom.spi.portlet.Preferences;
import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,8 +20,8 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.pom.config.Utils;
-import org.exoplatform.portal.pom.config.data.ComponentData;
-import org.exoplatform.portal.pom.config.data.PageData;
+import org.exoplatform.portal.pom.data.ComponentData;
+import org.exoplatform.portal.pom.data.PageData;
import java.util.ArrayList;
import java.util.List;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,9 +19,9 @@
package org.exoplatform.portal.config.model;
-import org.exoplatform.portal.pom.config.data.BodyData;
-import org.exoplatform.portal.pom.config.data.BodyType;
-import org.exoplatform.portal.pom.config.data.ModelData;
+import org.exoplatform.portal.pom.data.BodyData;
+import org.exoplatform.portal.pom.data.BodyType;
+import org.exoplatform.portal.pom.data.ModelData;
/**
* Created by The eXo Platform SAS
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.config.model;
-import org.exoplatform.portal.pom.config.data.NavigationData;
-import org.exoplatform.portal.pom.config.data.NavigationNodeData;
+import org.exoplatform.portal.pom.data.NavigationData;
+import org.exoplatform.portal.pom.data.NavigationNodeData;
import java.util.ArrayList;
import java.util.LinkedHashMap;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,7 +20,7 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.commons.utils.ExpressionUtil;
-import org.exoplatform.portal.pom.config.data.NavigationNodeData;
+import org.exoplatform.portal.pom.data.NavigationNodeData;
import java.util.ArrayList;
import java.util.Date;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,8 +20,8 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.config.model.ModelObject;
-import org.exoplatform.portal.pom.config.data.NavigationNodeContainerData;
-import org.exoplatform.portal.pom.config.data.NavigationNodeData;
+import org.exoplatform.portal.pom.data.NavigationNodeContainerData;
+import org.exoplatform.portal.pom.data.NavigationNodeData;
import java.util.ArrayList;
import java.util.Collections;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,7 +20,7 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.pom.config.Utils;
-import org.exoplatform.portal.pom.config.data.PortalData;
+import org.exoplatform.portal.pom.data.PortalData;
import java.util.ArrayList;
import java.util.List;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/SiteBody.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/SiteBody.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/SiteBody.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,9 +19,9 @@
package org.exoplatform.portal.config.model;
-import org.exoplatform.portal.pom.config.data.BodyData;
-import org.exoplatform.portal.pom.config.data.BodyType;
-import org.exoplatform.portal.pom.config.data.ModelData;
+import org.exoplatform.portal.pom.data.BodyData;
+import org.exoplatform.portal.pom.data.BodyType;
+import org.exoplatform.portal.pom.data.ModelData;
public class SiteBody extends ModelObject
{
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/gadget/GadgetApplication.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/gadget/GadgetApplication.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/gadget/GadgetApplication.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,7 +20,7 @@
package org.exoplatform.portal.config.model.gadget;
import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.pom.config.data.ApplicationData;
+import org.exoplatform.portal.pom.data.ApplicationData;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.pom.spi.gadget.Gadget;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/portlet/PortletApplication.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/portlet/PortletApplication.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/portlet/PortletApplication.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,7 +20,7 @@
package org.exoplatform.portal.config.model.portlet;
import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.pom.config.data.ApplicationData;
+import org.exoplatform.portal.pom.data.ApplicationData;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.pom.spi.portlet.Preferences;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/wsrp/WSRPApplication.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/wsrp/WSRPApplication.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/wsrp/WSRPApplication.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,7 +20,7 @@
package org.exoplatform.portal.config.model.wsrp;
import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.pom.config.data.ApplicationData;
+import org.exoplatform.portal.pom.data.ApplicationData;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -29,14 +29,14 @@
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
-import org.exoplatform.portal.pom.config.data.ModelDataStorage;
-import org.exoplatform.portal.pom.config.data.NavigationData;
-import org.exoplatform.portal.pom.config.data.NavigationKey;
-import org.exoplatform.portal.pom.config.data.PageData;
+import org.exoplatform.portal.pom.data.ModelDataStorage;
+import org.exoplatform.portal.pom.data.NavigationData;
+import org.exoplatform.portal.pom.data.NavigationKey;
+import org.exoplatform.portal.pom.data.PageData;
import org.exoplatform.portal.config.model.PersistentApplicationState;
-import org.exoplatform.portal.pom.config.data.PageKey;
-import org.exoplatform.portal.pom.config.data.PortalData;
-import org.exoplatform.portal.pom.config.data.PortalKey;
+import org.exoplatform.portal.pom.data.PageKey;
+import org.exoplatform.portal.pom.data.PortalData;
+import org.exoplatform.portal.pom.data.PortalKey;
import org.exoplatform.portal.config.model.TransientApplicationState;
import org.exoplatform.portal.pom.config.tasks.PageNavigationTask;
import org.exoplatform.portal.pom.config.tasks.PageTask;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -21,7 +21,7 @@
import org.chromattic.api.ChromatticSession;
import org.exoplatform.portal.application.PortletPreferences;
-import org.exoplatform.portal.pom.config.data.Mapper;
+import org.exoplatform.portal.pom.data.Mapper;
import org.gatein.mop.api.Model;
import org.gatein.mop.api.content.Customization;
import org.gatein.mop.api.workspace.ObjectType;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.pom.config.tasks;
-import org.exoplatform.portal.pom.config.data.DashboardData;
-import org.exoplatform.portal.pom.config.data.Mapper;
+import org.exoplatform.portal.pom.data.DashboardData;
+import org.exoplatform.portal.pom.data.Mapper;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
import org.gatein.mop.api.workspace.ObjectType;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,12 +19,12 @@
package org.exoplatform.portal.pom.config.tasks;
-import org.exoplatform.portal.pom.config.data.Mapper;
+import org.exoplatform.portal.pom.data.Mapper;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.data.NavigationData;
-import org.exoplatform.portal.pom.config.data.NavigationKey;
+import org.exoplatform.portal.pom.data.NavigationData;
+import org.exoplatform.portal.pom.data.NavigationKey;
import org.gatein.mop.api.workspace.Navigation;
import org.gatein.mop.api.workspace.ObjectType;
import org.gatein.mop.api.workspace.Site;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -19,13 +19,13 @@
package org.exoplatform.portal.pom.config.tasks;
-import org.exoplatform.portal.pom.config.data.Mapper;
-import org.exoplatform.portal.pom.config.data.PageData;
+import org.exoplatform.portal.pom.data.Mapper;
+import org.exoplatform.portal.pom.data.PageData;
import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.data.PageKey;
+import org.exoplatform.portal.pom.data.PageKey;
import org.gatein.mop.api.Attributes;
import org.gatein.mop.api.content.ContentType;
import org.gatein.mop.api.content.Customization;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -20,11 +20,11 @@
package org.exoplatform.portal.pom.config.tasks;
import org.exoplatform.portal.application.PortletPreferences;
-import org.exoplatform.portal.pom.config.data.Mapper;
-import org.exoplatform.portal.pom.config.data.PortalData;
+import org.exoplatform.portal.pom.data.Mapper;
+import org.exoplatform.portal.pom.data.PortalData;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.data.PortalKey;
+import org.exoplatform.portal.pom.data.PortalKey;
import org.gatein.mop.api.workspace.ObjectType;
import org.gatein.mop.api.workspace.Page;
import org.gatein.mop.api.workspace.Site;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortletPreferencesTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortletPreferencesTask.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortletPreferencesTask.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -21,7 +21,7 @@
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.application.Preference;
-import org.exoplatform.portal.pom.config.data.Mapper;
+import org.exoplatform.portal.pom.data.Mapper;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.spi.portlet.Preferences;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -23,11 +23,11 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.Query;
-import org.exoplatform.portal.pom.config.data.Mapper;
-import org.exoplatform.portal.pom.config.data.NavigationData;
-import org.exoplatform.portal.pom.config.data.PageData;
-import org.exoplatform.portal.pom.config.data.PortalData;
-import org.exoplatform.portal.pom.config.data.PortalKey;
+import org.exoplatform.portal.pom.data.Mapper;
+import org.exoplatform.portal.pom.data.NavigationData;
+import org.exoplatform.portal.pom.data.PageData;
+import org.exoplatform.portal.pom.data.PortalData;
+import org.exoplatform.portal.pom.data.PortalKey;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
import org.gatein.mop.api.workspace.Navigation;
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data
(from rev 412,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data)
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ApplicationData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.ApplicationType;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class ApplicationData<S, I> extends ComponentData
-{
-
- /** . */
- private final ApplicationType<S, I> type;
-
- /** . */
- private final ApplicationState<S> state;
-
- /** . */
- private final I ref;
-
- /** . */
- private final String id;
-
- /** . */
- private final String title;
-
- /** . */
- private final String icon;
-
- /** . */
- private final String description;
-
- /** . */
- private final boolean showInfoBar;
-
- /** . */
- private final boolean showApplicationState;
-
- /** . */
- private final boolean showApplicationMode;
-
- /** . */
- private final String theme;
-
- /** . */
- private final String width;
-
- /** . */
- private final String height;
-
- /** . */
- private final Map<String, String> properties;
-
- /** . */
- private final List<String> accessPermissions;
-
- public ApplicationData(
- String storageId,
- String storageName,
- ApplicationType<S, I> type,
- ApplicationState<S> state,
- I ref,
- String id,
- String title,
- String icon,
- String description,
- boolean showInfoBar,
- boolean showApplicationState,
- boolean showApplicationMode,
- String theme, String width,
- String height,
- Map<String, String> properties,
- List<String> accessPermissions)
- {
- super(storageId, storageName);
-
- //
- this.type = type;
- this.state = state;
- this.ref = ref;
- this.id = id;
- this.title = title;
- this.icon = icon;
- this.description = description;
- this.showInfoBar = showInfoBar;
- this.showApplicationState = showApplicationState;
- this.showApplicationMode = showApplicationMode;
- this.theme = theme;
- this.width = width;
- this.height = height;
- this.properties = properties;
- this.accessPermissions = accessPermissions;
- }
-
- public ApplicationType<S, I> getType()
- {
- return type;
- }
-
- public ApplicationState<S> getState()
- {
- return state;
- }
-
- public I getRef()
- {
- return ref;
- }
-
- public String getId()
- {
- return id;
- }
-
- public String getTitle()
- {
- return title;
- }
-
- public String getIcon()
- {
- return icon;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public boolean isShowInfoBar()
- {
- return showInfoBar;
- }
-
- public boolean isShowApplicationState()
- {
- return showApplicationState;
- }
-
- public boolean isShowApplicationMode()
- {
- return showApplicationMode;
- }
-
- public String getTheme()
- {
- return theme;
- }
-
- public String getWidth()
- {
- return width;
- }
-
- public String getHeight()
- {
- return height;
- }
-
- public Map<String, String> getProperties()
- {
- return properties;
- }
-
- public List<String> getAccessPermissions()
- {
- return accessPermissions;
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ApplicationData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ApplicationData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.ApplicationType;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class ApplicationData<S, I> extends ComponentData
+{
+
+ /** . */
+ private final ApplicationType<S, I> type;
+
+ /** . */
+ private final ApplicationState<S> state;
+
+ /** . */
+ private final I ref;
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final String icon;
+
+ /** . */
+ private final String description;
+
+ /** . */
+ private final boolean showInfoBar;
+
+ /** . */
+ private final boolean showApplicationState;
+
+ /** . */
+ private final boolean showApplicationMode;
+
+ /** . */
+ private final String theme;
+
+ /** . */
+ private final String width;
+
+ /** . */
+ private final String height;
+
+ /** . */
+ private final Map<String, String> properties;
+
+ /** . */
+ private final List<String> accessPermissions;
+
+ public ApplicationData(
+ String storageId,
+ String storageName,
+ ApplicationType<S, I> type,
+ ApplicationState<S> state,
+ I ref,
+ String id,
+ String title,
+ String icon,
+ String description,
+ boolean showInfoBar,
+ boolean showApplicationState,
+ boolean showApplicationMode,
+ String theme, String width,
+ String height,
+ Map<String, String> properties,
+ List<String> accessPermissions)
+ {
+ super(storageId, storageName);
+
+ //
+ this.type = type;
+ this.state = state;
+ this.ref = ref;
+ this.id = id;
+ this.title = title;
+ this.icon = icon;
+ this.description = description;
+ this.showInfoBar = showInfoBar;
+ this.showApplicationState = showApplicationState;
+ this.showApplicationMode = showApplicationMode;
+ this.theme = theme;
+ this.width = width;
+ this.height = height;
+ this.properties = properties;
+ this.accessPermissions = accessPermissions;
+ }
+
+ public ApplicationType<S, I> getType()
+ {
+ return type;
+ }
+
+ public ApplicationState<S> getState()
+ {
+ return state;
+ }
+
+ public I getRef()
+ {
+ return ref;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getIcon()
+ {
+ return icon;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public boolean isShowInfoBar()
+ {
+ return showInfoBar;
+ }
+
+ public boolean isShowApplicationState()
+ {
+ return showApplicationState;
+ }
+
+ public boolean isShowApplicationMode()
+ {
+ return showApplicationMode;
+ }
+
+ public String getTheme()
+ {
+ return theme;
+ }
+
+ public String getWidth()
+ {
+ return width;
+ }
+
+ public String getHeight()
+ {
+ return height;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ public List<String> getAccessPermissions()
+ {
+ return accessPermissions;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/BodyData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.pom.config.data.BodyType;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class BodyData extends ComponentData
-{
-
- /** . */
- private final BodyType type;
-
- public BodyData(String storageId, BodyType type)
- {
- super(storageId, null);
-
- //
- this.type = type;
- }
-
- public BodyType getType()
- {
- return type;
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/BodyData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.pom.data.BodyType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class BodyData extends ComponentData
+{
+
+ /** . */
+ private final BodyType type;
+
+ public BodyData(String storageId, BodyType type)
+ {
+ super(storageId, null);
+
+ //
+ this.type = type;
+ }
+
+ public BodyType getType()
+ {
+ return type;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/BodyType.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public enum BodyType
-{
-
- SITE, PAGE
-
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/BodyType.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/BodyType.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public enum BodyType
+{
+
+ SITE, PAGE
+
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ComponentData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class ComponentData extends ModelData
-{
-
- public ComponentData(String storageId, String storageName)
- {
- super(storageId, storageName);
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ComponentData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ComponentData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class ComponentData extends ModelData
+{
+
+ public ComponentData(String storageId, String storageName)
+ {
+ super(storageId, storageName);
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ContainerData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class ContainerData extends ComponentData
-{
-
- /** . */
- private final String id;
-
- /** . */
- private final String name;
-
- /** . */
- private final String icon;
-
- /** . */
- private final String decorator;
-
- /** . */
- private final String template;
-
- /** . */
- private final String factoryId;
-
- /** . */
- private final String title;
-
- /** . */
- private final String description;
-
- /** . */
- private final String width;
-
- /** . */
- private final String height;
-
- /** . */
- private final List<String> accessPermissions;
-
- /** . */
- private final List<ComponentData> children;
-
- public ContainerData(
- String storageId,
- String id,
- String name,
- String icon,
- String decorator,
- String template,
- String factoryId,
- String title,
- String description,
- String width,
- String height,
- List<String> accessPermissions,
- List<ComponentData> children)
- {
- super(storageId, null);
-
- //
- this.id = id;
- this.name = name;
- this.icon = icon;
- this.decorator = decorator;
- this.template = template;
- this.factoryId = factoryId;
- this.title = title;
- this.description = description;
- this.width = width;
- this.height = height;
- this.accessPermissions = accessPermissions;
- this.children = children;
- }
-
- public String getId()
- {
- return id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getIcon()
- {
- return icon;
- }
-
- public String getDecorator()
- {
- return decorator;
- }
-
- public String getTemplate()
- {
- return template;
- }
-
- public String getFactoryId()
- {
- return factoryId;
- }
-
- public String getTitle()
- {
- return title;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public String getWidth()
- {
- return width;
- }
-
- public String getHeight()
- {
- return height;
- }
-
- public List<String> getAccessPermissions()
- {
- return accessPermissions;
- }
-
- public List<ComponentData> getChildren()
- {
- return children;
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ContainerData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ContainerData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class ContainerData extends ComponentData
+{
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final String icon;
+
+ /** . */
+ private final String decorator;
+
+ /** . */
+ private final String template;
+
+ /** . */
+ private final String factoryId;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final String description;
+
+ /** . */
+ private final String width;
+
+ /** . */
+ private final String height;
+
+ /** . */
+ private final List<String> accessPermissions;
+
+ /** . */
+ private final List<ComponentData> children;
+
+ public ContainerData(
+ String storageId,
+ String id,
+ String name,
+ String icon,
+ String decorator,
+ String template,
+ String factoryId,
+ String title,
+ String description,
+ String width,
+ String height,
+ List<String> accessPermissions,
+ List<ComponentData> children)
+ {
+ super(storageId, null);
+
+ //
+ this.id = id;
+ this.name = name;
+ this.icon = icon;
+ this.decorator = decorator;
+ this.template = template;
+ this.factoryId = factoryId;
+ this.title = title;
+ this.description = description;
+ this.width = width;
+ this.height = height;
+ this.accessPermissions = accessPermissions;
+ this.children = children;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getIcon()
+ {
+ return icon;
+ }
+
+ public String getDecorator()
+ {
+ return decorator;
+ }
+
+ public String getTemplate()
+ {
+ return template;
+ }
+
+ public String getFactoryId()
+ {
+ return factoryId;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public String getWidth()
+ {
+ return width;
+ }
+
+ public String getHeight()
+ {
+ return height;
+ }
+
+ public List<String> getAccessPermissions()
+ {
+ return accessPermissions;
+ }
+
+ public List<ComponentData> getChildren()
+ {
+ return children;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/DashboardData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class DashboardData extends ContainerData
-{
-
- public DashboardData(
- String storageId,
- String id,
- String name,
- String icon,
- String decorator,
- String template,
- String factoryId,
- String title,
- String description,
- String width,
- String height,
- List<String> accessPermissions,
- List<ComponentData> children)
- {
- super(
- storageId,
- id,
- name,
- icon,
- decorator,
- template,
- factoryId,
- title,
- description,
- width,
- height,
- accessPermissions,
- children);
- }
-
- /** . */
- static final DashboardData INITIAL_DASHBOARD;
-
- static
- {
- List<ComponentData> children = new ArrayList<ComponentData>();
- for (int i = 0; i < 3; i++)
- {
- ContainerData row = new ContainerData(
- null,
- null,
- null,
- null,
- null,
- "classpath:groovy/dashboard/webui/component/UIContainer.gtmpl",
- null,
- null,
- null,
- null,
- null,
- Collections.<String>emptyList(),
- Collections.<ComponentData>emptyList());
- children.add(row);
- }
-
- INITIAL_DASHBOARD = new DashboardData(
- null,
- null,
- null,
- null,
- null,
- "classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl",
- null,
- null,
- null,
- null,
- null,
- Collections.<String>emptyList(),
- Collections.unmodifiableList(children)
- );
- }
-
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/DashboardData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/DashboardData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class DashboardData extends ContainerData
+{
+
+ public DashboardData(
+ String storageId,
+ String id,
+ String name,
+ String icon,
+ String decorator,
+ String template,
+ String factoryId,
+ String title,
+ String description,
+ String width,
+ String height,
+ List<String> accessPermissions,
+ List<ComponentData> children)
+ {
+ super(
+ storageId,
+ id,
+ name,
+ icon,
+ decorator,
+ template,
+ factoryId,
+ title,
+ description,
+ width,
+ height,
+ accessPermissions,
+ children);
+ }
+
+ /** . */
+ static final DashboardData INITIAL_DASHBOARD;
+
+ static
+ {
+ List<ComponentData> children = new ArrayList<ComponentData>();
+ for (int i = 0; i < 3; i++)
+ {
+ ContainerData row = new ContainerData(
+ null,
+ null,
+ null,
+ null,
+ null,
+ "classpath:groovy/dashboard/webui/component/UIContainer.gtmpl",
+ null,
+ null,
+ null,
+ null,
+ null,
+ Collections.<String>emptyList(),
+ Collections.<ComponentData>emptyList());
+ children.add(row);
+ }
+
+ INITIAL_DASHBOARD = new DashboardData(
+ null,
+ null,
+ null,
+ null,
+ null,
+ "classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl",
+ null,
+ null,
+ null,
+ null,
+ null,
+ Collections.<String>emptyList(),
+ Collections.unmodifiableList(children)
+ );
+ }
+
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/MappedAttributes.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,126 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.portal.pom.config.data;
-
-import org.gatein.mop.api.Key;
-import org.gatein.mop.api.ValueType;
-
-import java.util.Date;
-
-/**
- * A class to hold the various attributes mapped between the model and the mop layer.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-class MappedAttributes
-{
-
- private MappedAttributes()
- {
- }
-
- /** . */
- public static final Key<String> ID = Key.create("id",
ValueType.STRING);
-
- /** . */
- public static final Key<String> NAME = Key.create("name",
ValueType.STRING);
-
- /** . */
- public static final Key<Boolean> SHOW_MAX_WINDOW =
Key.create("show-max-window", ValueType.BOOLEAN);
-
- /** . */
- public static final Key<String> TITLE = Key.create("title",
ValueType.STRING);
-
- /** . */
- public static final Key<String> FACTORY_ID = Key.create("factory-id",
ValueType.STRING);
-
- /** . */
- public static final Key<String> ACCESS_PERMISSIONS =
Key.create("access-permissions", ValueType.STRING);
-
- /** . */
- public static final Key<String> EDIT_PERMISSION =
Key.create("edit-permission", ValueType.STRING);
-
- /** . */
- public static final Key<String> CREATOR = Key.create("creator",
ValueType.STRING);
-
- /** . */
- public static final Key<String> MODIFIER = Key.create("modifier",
ValueType.STRING);
-
- /** . */
- public static final Key<String> DESCRIPTION =
Key.create("description", ValueType.STRING);
-
- /** . */
- public static final Key<String> DECORATOR = Key.create("decorator",
ValueType.STRING);
-
- /** . */
- public static final Key<Integer> PRIORITY = Key.create("priority",
ValueType.INTEGER);
-
- /** . */
- public static final Key<String> LABEL = Key.create("label",
ValueType.STRING);
-
- /** . */
- public static final Key<String> ICON = Key.create("icon",
ValueType.STRING);
-
- /** . */
- public static final Key<String> URI = Key.create("uri",
ValueType.STRING);
-
- /** . */
- public static final Key<Date> START_PUBLICATION_DATE =
Key.create("start-publication-date", ValueType.DATE);
-
- /** . */
- public static final Key<Date> END_PUBLICATION_DATE =
Key.create("end-publication-date", ValueType.DATE);
-
- /** . */
- public static final Key<Boolean> VISIBLE = Key.create("visible",
ValueType.BOOLEAN);
-
- /** . */
- public static final Key<String> TEMPLATE = Key.create("template",
ValueType.STRING);
-
- /** . */
- public static final Key<Boolean> SHOW_PUBLICATION_DATE =
Key.create("show-publication-date", ValueType.BOOLEAN);
-
- /** . */
- public static final Key<Boolean> SHOW_INFO_BAR =
Key.create("show-info-bar", ValueType.BOOLEAN);
-
- /** . */
- public static final Key<Boolean> SHOW_STATE = Key.create("show-state",
ValueType.BOOLEAN);
-
- /** . */
- public static final Key<Boolean> SHOW_MODE = Key.create("show-mode",
ValueType.BOOLEAN);
-
- /** . */
- public static final Key<String> LOCALE = Key.create("locale",
ValueType.STRING);
-
- /** . */
- public static final Key<String> SKIN = Key.create("skin",
ValueType.STRING);
-
- /** . */
- public static final Key<String> WIDTH = Key.create("width",
ValueType.STRING);
-
- /** . */
- public static final Key<String> HEIGHT = Key.create("height",
ValueType.STRING);
-
- /** . */
- public static final Key<String> TYPE = Key.create("type",
ValueType.STRING);
-
- /** . */
- public static final Key<String> THEME = Key.create("theme",
ValueType.STRING);
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/MappedAttributes.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,126 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.pom.data;
+
+import org.gatein.mop.api.Key;
+import org.gatein.mop.api.ValueType;
+
+import java.util.Date;
+
+/**
+ * A class to hold the various attributes mapped between the model and the mop layer.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+class MappedAttributes
+{
+
+ private MappedAttributes()
+ {
+ }
+
+ /** . */
+ public static final Key<String> ID = Key.create("id",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> NAME = Key.create("name",
ValueType.STRING);
+
+ /** . */
+ public static final Key<Boolean> SHOW_MAX_WINDOW =
Key.create("show-max-window", ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<String> TITLE = Key.create("title",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> FACTORY_ID = Key.create("factory-id",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> ACCESS_PERMISSIONS =
Key.create("access-permissions", ValueType.STRING);
+
+ /** . */
+ public static final Key<String> EDIT_PERMISSION =
Key.create("edit-permission", ValueType.STRING);
+
+ /** . */
+ public static final Key<String> CREATOR = Key.create("creator",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> MODIFIER = Key.create("modifier",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> DESCRIPTION =
Key.create("description", ValueType.STRING);
+
+ /** . */
+ public static final Key<String> DECORATOR = Key.create("decorator",
ValueType.STRING);
+
+ /** . */
+ public static final Key<Integer> PRIORITY = Key.create("priority",
ValueType.INTEGER);
+
+ /** . */
+ public static final Key<String> LABEL = Key.create("label",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> ICON = Key.create("icon",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> URI = Key.create("uri",
ValueType.STRING);
+
+ /** . */
+ public static final Key<Date> START_PUBLICATION_DATE =
Key.create("start-publication-date", ValueType.DATE);
+
+ /** . */
+ public static final Key<Date> END_PUBLICATION_DATE =
Key.create("end-publication-date", ValueType.DATE);
+
+ /** . */
+ public static final Key<Boolean> VISIBLE = Key.create("visible",
ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<String> TEMPLATE = Key.create("template",
ValueType.STRING);
+
+ /** . */
+ public static final Key<Boolean> SHOW_PUBLICATION_DATE =
Key.create("show-publication-date", ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<Boolean> SHOW_INFO_BAR =
Key.create("show-info-bar", ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<Boolean> SHOW_STATE = Key.create("show-state",
ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<Boolean> SHOW_MODE = Key.create("show-mode",
ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<String> LOCALE = Key.create("locale",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> SKIN = Key.create("skin",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> WIDTH = Key.create("width",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> HEIGHT = Key.create("height",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> TYPE = Key.create("type",
ValueType.STRING);
+
+ /** . */
+ public static final Key<String> THEME = Key.create("theme",
ValueType.STRING);
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/Mapper.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,1085 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.pom.config.data.BodyType;
-import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
-import org.exoplatform.portal.config.model.PersistentApplicationState;
-import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.config.model.gadget.GadgetId;
-import org.exoplatform.portal.pom.config.Utils;
-import static org.exoplatform.portal.pom.config.Utils.join;
-import static org.exoplatform.portal.pom.config.Utils.split;
-
-import org.exoplatform.portal.config.model.portlet.PortletId;
-import org.exoplatform.portal.config.model.wsrp.WSRPId;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.data.ApplicationData;
-import org.exoplatform.portal.pom.config.data.BodyData;
-import org.exoplatform.portal.pom.config.data.ComponentData;
-import org.exoplatform.portal.pom.config.data.ContainerData;
-import org.exoplatform.portal.pom.config.data.DashboardData;
-import org.exoplatform.portal.pom.config.data.ModelData;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
-import org.exoplatform.portal.pom.config.data.PageData;
-import org.exoplatform.portal.pom.config.data.PortalData;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-import org.exoplatform.portal.pom.spi.portlet.Preferences;
-import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
-import org.gatein.mop.api.Attributes;
-import org.gatein.mop.api.content.ContentType;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.mop.api.workspace.Navigation;
-import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.workspace.Site;
-import org.gatein.mop.api.workspace.Workspace;
-import org.gatein.mop.api.workspace.WorkspaceObject;
-import org.gatein.mop.api.workspace.link.Link;
-import org.gatein.mop.api.workspace.link.PageLink;
-import org.gatein.mop.api.workspace.ui.UIBody;
-import org.gatein.mop.api.workspace.ui.UIComponent;
-import org.gatein.mop.api.workspace.ui.UIContainer;
-import org.gatein.mop.api.workspace.ui.UIWindow;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class Mapper
-{
-
- /** . */
- private static final Set<String> portalPropertiesBlackList =
- new HashSet<String>(Arrays.asList("jcr:uuid",
"jcr:primaryType", MappedAttributes.LOCALE.getName(),
- MappedAttributes.ACCESS_PERMISSIONS.getName(),
MappedAttributes.EDIT_PERMISSION.getName(),
- MappedAttributes.SKIN.getName(), MappedAttributes.TITLE.getName(),
MappedAttributes.CREATOR.getName(),
- MappedAttributes.MODIFIER.getName()));
-
- /** . */
- private static final Set<String> windowPropertiesBlackList =
- new HashSet<String>(Arrays.asList("jcr:uuid",
"jcr:primaryType", MappedAttributes.TYPE.getName(),
- MappedAttributes.THEME.getName(), MappedAttributes.TITLE.getName(),
MappedAttributes.ACCESS_PERMISSIONS
- .getName(), MappedAttributes.SHOW_INFO_BAR.getName(),
MappedAttributes.SHOW_STATE.getName(),
- MappedAttributes.SHOW_MODE.getName(), MappedAttributes.DESCRIPTION.getName(),
MappedAttributes.ICON.getName(),
- MappedAttributes.WIDTH.getName(), MappedAttributes.HEIGHT.getName()));
-
- /** . */
- private final POMSession session;
-
- public Mapper(POMSession session)
- {
- this.session = session;
- }
-
- public NavigationContainer.Page load(Navigation src)
- {
- return load(src, NavigationContainer.Page.class);
- }
-
- private <T extends NavigationContainer> T load(Navigation src, Class<T>
type)
- {
-
- //
- ArrayList<NavigationContainer.Node> children = new
ArrayList<NavigationContainer.Node>(src.getChildren().size());
- for (Navigation srcChild : src.getChildren())
- {
- NavigationContainer.Node dstChild = load(srcChild,
NavigationContainer.Node.class);
- children.add(dstChild);
- }
-
- //
- T dst;
- if (type == NavigationContainer.Page.class)
- {
- Site site = src.getSite();
- String ownerType = getOwnerType(site.getObjectType());
- String ownerId = site.getName();
- Attributes attrs = src.getAttributes();
- NavigationContainer.Page dstNav = new NavigationContainer.Page(
- src.getObjectId(),
- ownerType,
- ownerId,
- attrs.getValue(MappedAttributes.DESCRIPTION),
- attrs.getValue(MappedAttributes.CREATOR),
- attrs.getValue(MappedAttributes.MODIFIER),
- attrs.getValue(MappedAttributes.PRIORITY, 1),
- children);
- dst = (T)dstNav;
- }
- else if (type == NavigationContainer.Node.class)
- {
- Attributes attrs = src.getAttributes();
- String pageReference = null;
- Link link = src.getLink();
- if (link instanceof PageLink)
- {
- PageLink pageLink = (PageLink)link;
- org.gatein.mop.api.workspace.Page target = pageLink.getPage();
- if (target != null)
- {
- Site site = target.getSite();
- ObjectType<? extends Site> siteType = site.getObjectType();
- pageReference = getOwnerType(siteType) + "::" + site.getName() +
"::" + target.getName();
- }
- }
- NavigationContainer.Node dstNode = new NavigationContainer.Node(
- src.getObjectId(),
- attrs.getValue(MappedAttributes.URI),
- attrs.getValue(MappedAttributes.LABEL),
- attrs.getValue(MappedAttributes.ICON),
- src.getName(),
- attrs.getValue(MappedAttributes.START_PUBLICATION_DATE),
- attrs.getValue(MappedAttributes.END_PUBLICATION_DATE),
- attrs.getValue(MappedAttributes.SHOW_PUBLICATION_DATE, false),
- attrs.getValue(MappedAttributes.VISIBLE, true),
- pageReference,
- children
- );
-
- dst = (T)dstNode;
- }
- else
- {
- throw new AssertionError();
- }
-
- //
- return dst;
- }
-
- public void save(NavigationContainer.Page src, Navigation dst)
- {
- save((NavigationContainer)src, dst);
- }
-
- private void save(NavigationContainer src, Navigation dst)
- {
- if (src instanceof NavigationContainer.Node)
- {
- NavigationContainer.Node node = (NavigationContainer.Node)src;
- Workspace workspace = dst.getSite().getWorkspace();
- String reference = node.getPageReference();
- if (reference != null)
- {
- String[] pageChunks = split("::", reference);
- ObjectType<? extends Site> siteType = parseSiteType(pageChunks[0]);
- Site site = workspace.getSite(siteType, pageChunks[1]);
- org.gatein.mop.api.workspace.Page target =
site.getRootPage().getChild("pages").getChild(pageChunks[2]);
- PageLink link = dst.linkTo(ObjectType.PAGE_LINK);
- link.setPage(target);
- }
-
- //
- Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.URI, node.getURI());
- attrs.setValue(MappedAttributes.LABEL, node.getLabel());
- attrs.setValue(MappedAttributes.ICON, node.getIcon());
- attrs.setValue(MappedAttributes.START_PUBLICATION_DATE,
node.getStartPublicationDate());
- attrs.setValue(MappedAttributes.END_PUBLICATION_DATE,
node.getEndPublicationDate());
- attrs.setValue(MappedAttributes.SHOW_PUBLICATION_DATE,
node.getShowPublicationDate());
- attrs.setValue(MappedAttributes.VISIBLE, node.isVisible());
- }
- else if (src instanceof NavigationContainer.Page)
- {
- NavigationContainer.Page pageNav = (NavigationContainer.Page)src;
-
- //
- Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.PRIORITY, pageNav.getPriority());
- attrs.setValue(MappedAttributes.CREATOR, pageNav.getCreator());
- attrs.setValue(MappedAttributes.MODIFIER, pageNav.getModifier());
- attrs.setValue(MappedAttributes.DESCRIPTION, pageNav.getDescription());
- }
- else
- {
- throw new AssertionError();
- }
-
- //
- Set<String> savedSet = new HashSet<String>();
- for (NavigationContainer.Node node : src.getChildren())
- {
- String srcId = node.getStorageId();
- Navigation dstChild;
- if (srcId != null)
- {
- dstChild = session.findObjectById(ObjectType.NAVIGATION, srcId);
- }
- else
- {
- dstChild = dst.getChild(node.getName());
- if (dstChild == null)
- {
- dstChild = dst.addChild(node.getName());
- }
- srcId = dstChild.getObjectId();
- }
- save(node, dstChild);
- savedSet.add(srcId);
- }
- for (Iterator<? extends Navigation> i = dst.getChildren().iterator();
i.hasNext();)
- {
- Navigation dstChild = i.next();
- if (!savedSet.contains(dstChild.getObjectId()))
- {
- i.remove();
- }
- }
- }
-
- public PortalData load(Site src)
- {
- String type = Mapper.getOwnerType(src.getObjectType());
- Attributes attrs = src.getAttributes();
-
- //
- org.gatein.mop.api.workspace.Page template =
src.getRootNavigation().getTemplate();
- UIContainer srcLayout = template.getRootComponent();
-
- //
- Map<String, String> properties = new HashMap<String, String>();
- load(attrs, properties, portalPropertiesBlackList);
-
- //
- List<ComponentData> layoutChildren = loadChildren(srcLayout);
- ContainerData layout = load(srcLayout, layoutChildren);
-
- //
- return new PortalData(
- src.getObjectId(),
- src.getName(),
- type,
- attrs.getValue(MappedAttributes.LOCALE),
- Collections.unmodifiableList(Arrays.asList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS, "")))),
- attrs.getValue(MappedAttributes.EDIT_PERMISSION),
- Collections.unmodifiableMap(properties),
- attrs.getValue(MappedAttributes.SKIN),
- attrs.getValue(MappedAttributes.TITLE),
- layout,
- attrs.getValue(MappedAttributes.CREATOR),
- attrs.getValue(MappedAttributes.MODIFIER));
- }
-
- public void save(PortalData src, Site dst)
- {
- if (src.getStorageId() != null &&
!src.getStorageId().equals(dst.getObjectId()))
- {
- String msg =
- "Attempt to save a site " + src.getType() + "/" +
src.getName() + " on the wrong target site "
- + dst.getObjectType() + "/" + dst.getName();
- throw new IllegalArgumentException(msg);
- }
-
- //
- Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.LOCALE, src.getLocale());
- attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
- attrs.setValue(MappedAttributes.EDIT_PERMISSION, src.getEditPermission());
- attrs.setValue(MappedAttributes.SKIN, src.getSkin());
- attrs.setValue(MappedAttributes.TITLE, src.getTitle());
- attrs.setValue(MappedAttributes.CREATOR, src.getCreator());
- attrs.setValue(MappedAttributes.MODIFIER, src.getModifier());
- if (src.getProperties() != null)
- {
- save(src.getProperties(), attrs);
- }
-
- //
- org.gatein.mop.api.workspace.Page templates =
dst.getRootPage().getChild("templates");
- org.gatein.mop.api.workspace.Page template =
templates.getChild("default");
- if (template == null)
- {
- template = templates.addChild("default");
- }
-
- //
- ContainerData srcContainer = src.getPortalLayout();
- UIContainer dstContainer = template.getRootComponent();
-
- //
- save(srcContainer, dstContainer);
- saveChildren(srcContainer, dstContainer);
-
- //
- dst.getRootNavigation().setTemplate(template);
- }
-
- public PageData load(org.gatein.mop.api.workspace.Page src)
- {
- Site site = src.getSite();
- String ownerType = getOwnerType(site.getObjectType());
- String ownerId = site.getName();
- String name = src.getName();
- List<ComponentData> children = loadChildren(src.getRootComponent());
- Attributes attrs = src.getAttributes();
-
- //
- return new PageData(
- src.getObjectId(),
- null,
- name,
- null,
- null,
- null,
- attrs.getValue(MappedAttributes.FACTORY_ID),
- attrs.getValue(MappedAttributes.TITLE),
- null,
- null,
- null,
- Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS))),
- children,
- ownerType,
- ownerId,
- attrs.getValue(MappedAttributes.EDIT_PERMISSION),
- attrs.getValue(MappedAttributes.SHOW_MAX_WINDOW, false),
- attrs.getValue(MappedAttributes.CREATOR),
- attrs.getValue(MappedAttributes.MODIFIER)
- );
- }
-
- public List<ModelChange> save(PageData src, Site site, String name)
- {
- org.gatein.mop.api.workspace.Page root = site.getRootPage();
- org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
- org.gatein.mop.api.workspace.Page dst = pages.getChild(name);
-
- //
- LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
-
- //
- if (dst == null)
- {
- dst = pages.addChild(name);
- changes.add(new ModelChange.Create(src));
- }
- else
- {
- changes.add(new ModelChange.Update(src));
- }
-
- //
- Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.TITLE, src.getTitle());
- attrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
- attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
- attrs.setValue(MappedAttributes.EDIT_PERMISSION, src.getEditPermission());
- attrs.setValue(MappedAttributes.SHOW_MAX_WINDOW, src.isShowMaxWindow());
- attrs.setValue(MappedAttributes.CREATOR, src.getCreator());
- attrs.setValue(MappedAttributes.MODIFIER, src.getModifier());
-
- //
- changes.addAll(saveChildren(src, dst.getRootComponent()));
-
- //
- return changes;
- }
-
- private ContainerData load(UIContainer src, List<ComponentData> children)
- {
- Attributes attrs = src.getAttributes();
- return new ContainerData(
- src.getObjectId(),
- attrs.getValue(MappedAttributes.ID),
- attrs.getValue(MappedAttributes.NAME),
- attrs.getValue(MappedAttributes.ICON),
- attrs.getValue(MappedAttributes.DECORATOR),
- attrs.getValue(MappedAttributes.TEMPLATE),
- attrs.getValue(MappedAttributes.FACTORY_ID),
- attrs.getValue(MappedAttributes.TITLE),
- attrs.getValue(MappedAttributes.DESCRIPTION),
- attrs.getValue(MappedAttributes.WIDTH),
- attrs.getValue(MappedAttributes.HEIGHT),
- Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS))),
- children
- );
- }
-
- private List<ComponentData> loadChildren(UIContainer src)
- {
- ArrayList<ComponentData> children = new
ArrayList<ComponentData>(src.size());
- for (UIComponent component : src)
- {
-
- // Obtain a model object from the ui component
- ComponentData mo;
- if (component instanceof UIContainer)
- {
- UIContainer srcContainer = (UIContainer)component;
- Attributes attrs = srcContainer.getAttributes();
- String type = attrs.getValue(MappedAttributes.TYPE);
- if ("dashboard".equals(type))
- {
- TransientApplicationState<Preferences> state = new
TransientApplicationState<Preferences>();
- Site owner = src.getPage().getSite();
- state.setOwnerType(getOwnerType(owner.getObjectType()));
- state.setOwnerId(owner.getName());
- mo = new ApplicationData<Preferences, PortletId>(
- srcContainer.getObjectId(),
- component.getName(),
- ApplicationType.PORTLET,
- state,
- new PortletId("dashboard", "DashboardPortlet"),
- null,
- null,
- null,
- null,
- false,
- false,
- false,
- null,
- null,
- null,
- Collections.<String, String>emptyMap(),
- Collections.<String>emptyList());
- }
- else
- {
- List<ComponentData> dstChildren = loadChildren(srcContainer);
- mo = load(srcContainer, dstChildren);
- }
- }
- else if (component instanceof UIWindow)
- {
- UIWindow window = (UIWindow)component;
- ApplicationData application = load(window);
- mo = application;
- }
- else if (component instanceof UIBody)
- {
- mo = new BodyData(component.getObjectId(), BodyType.PAGE);
- }
- else
- {
- throw new AssertionError();
- }
-
- // Add among children
- children.add(mo);
- }
- return children;
- }
-
- private void save(ContainerData src, UIContainer dst)
- {
- Attributes dstAttrs = dst.getAttributes();
- dstAttrs.setValue(MappedAttributes.ID, src.getId());
- dstAttrs.setValue(MappedAttributes.TYPE, src instanceof DashboardData ?
"dashboard" : null);
- dstAttrs.setValue(MappedAttributes.TITLE, src.getTitle());
- dstAttrs.setValue(MappedAttributes.ICON, src.getIcon());
- dstAttrs.setValue(MappedAttributes.TEMPLATE, src.getTemplate());
- dstAttrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
- dstAttrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
- dstAttrs.setValue(MappedAttributes.DECORATOR, src.getDecorator());
- dstAttrs.setValue(MappedAttributes.DESCRIPTION, src.getDescription());
- dstAttrs.setValue(MappedAttributes.WIDTH, src.getWidth());
- dstAttrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
- dstAttrs.setValue(MappedAttributes.NAME, src.getName());
- }
-
- private void save(ModelData src, WorkspaceObject dst, LinkedList<ModelChange>
changes,
- Map<String, String> hierarchyRelationships)
- {
- if (src instanceof ContainerData)
- {
- save((ContainerData)src, (UIContainer)dst);
- saveChildren((ContainerData)src, (UIContainer)dst, changes,
hierarchyRelationships);
- }
- else if (src instanceof ApplicationData)
- {
- save((ApplicationData<?, ?>)src, (UIWindow)dst);
- }
- else if (src instanceof BodyData)
- {
- // Stateless
- }
- else
- {
- throw new AssertionError("Was not expecting child " + src);
- }
- }
-
- /** . */
- private static final PortletId DASHBOARD_ID = new PortletId("dashboard",
"DashboardPortlet");
-
- private LinkedList<ModelChange> saveChildren(final ContainerData src,
UIContainer dst)
- {
-
- //
- LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
-
- //
- Map<String, String> hierarchyRelationships = new HashMap<String,
String>();
-
- //
- build(src, hierarchyRelationships);
-
- //
- saveChildren(src, dst, changes,
Collections.unmodifiableMap(hierarchyRelationships));
-
- //
- return changes;
- }
-
- private void build(ContainerData parent, Map<String, String>
hierarchyRelationships)
- {
- String parentId = parent.getStorageId();
- if (parentId != null)
- {
- for (ModelData child : parent.getChildren())
- {
- String childId = child.getStorageId();
- if (childId != null)
- {
- if (hierarchyRelationships.put(childId, parentId) != null)
- {
- throw new AssertionError("The same object is present two times in
the object hierarchy");
- }
- if (child instanceof ContainerData)
- {
- build((ContainerData)child, hierarchyRelationships);
- }
- }
- }
- }
- }
-
- private void saveChildren(final ContainerData src, UIContainer dst,
LinkedList<ModelChange> changes,
- Map<String, String> hierarchyRelationships)
- {
- final List<String> orders = new ArrayList<String>();
- final Map<String, ModelData> modelObjectMap = new HashMap<String,
ModelData>();
-
- //
- for (ModelData srcChild : src.getChildren())
- {
- String srcId = srcChild.getStorageId();
-
- // Replace dashboard application by container if needed
- if (srcChild instanceof ApplicationData)
- {
- ApplicationData app = (ApplicationData)srcChild;
- if (app.getType() == ApplicationType.PORTLET)
- {
- PortletId ref = (PortletId)app.getRef();
- if (DASHBOARD_ID.equals(ref))
- {
- if (app.getStorageId() != null)
- {
- UIContainer dstDashboard =
session.findObjectById(ObjectType.CONTAINER, app.getStorageId());
- srcChild = loadDashboard(dstDashboard);
- }
- else
- {
- srcChild = DashboardData.INITIAL_DASHBOARD;
- }
- }
- }
- }
-
- //
- UIComponent dstChild;
- if (srcId != null)
- {
- dstChild = session.findObjectById(ObjectType.COMPONENT, srcId);
- if (dstChild == null)
- {
- throw new AssertionError("Could not find supposed present child with
id " + srcId);
- }
- // julien : this can fail due to a bug in chromattic not implementing equals
method properly
- // and is replaced with the foreach below
- /*
- if (!dst.contains(dstChild)) {
- throw new IllegalArgumentException("Attempt for updating a ui
component " + session.pathOf(dstChild) +
- "that is not present in the target ui container " +
session.pathOf(dst));
- }
- */
- boolean found = false;
- for (UIComponent child : dst)
- {
- if (child.getObjectId().equals(srcId))
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- if (hierarchyRelationships.containsKey(srcId))
- {
- // It's a move operation, so we move the node first
- dst.add(dstChild);
- }
- else
- {
- throw new IllegalArgumentException("Attempt for updating a ui
component " + session.pathOf(dstChild)
- + "that is not present in the target ui container " +
session.pathOf(dst));
- }
- }
-
- //
- changes.add(new ModelChange.Update(srcChild));
- }
- else
- {
- String name = srcChild.getStorageName();
- if (name == null)
- {
- // We manufacture one name
- name = UUID.randomUUID().toString();
- }
- if (srcChild instanceof ContainerData)
- {
- dstChild = dst.add(ObjectType.CONTAINER, name);
- }
- else if (srcChild instanceof ApplicationData)
- {
- dstChild = dst.add(ObjectType.WINDOW, name);
- }
- else if (srcChild instanceof BodyData)
- {
- dstChild = dst.add(ObjectType.BODY, name);
- }
- else
- {
- throw new AssertionError("Was not expecting child " +
srcChild);
- }
- changes.add(new ModelChange.Create(srcChild));
- }
-
- //
- save(srcChild, dstChild, changes, hierarchyRelationships);
-
- //
- String dstId = dstChild.getObjectId();
- modelObjectMap.put(dstId, srcChild);
- orders.add(dstId);
- }
-
- // Take care of move operation that could be seen as a remove
- for (UIComponent dstChild : dst)
- {
- String dstId = dstChild.getObjectId();
- if (!modelObjectMap.containsKey(dstId) &&
hierarchyRelationships.containsKey(dstId))
- {
- String parentId = hierarchyRelationships.get(dstId);
-
- // Get the new parent
- UIContainer parent = session.findObjectById(ObjectType.CONTAINER, parentId);
-
- // Perform the move
- parent.add(dstChild);
-
- //
- changes.add(new ModelChange.Destroy(dstId));
- }
- }
-
- // Delete removed children
- for (Iterator<UIComponent> i = dst.iterator(); i.hasNext();)
- {
- UIComponent dstChild = i.next();
- String dstId = dstChild.getObjectId();
- if (!modelObjectMap.containsKey(dstId))
- {
- i.remove();
- changes.add(new ModelChange.Destroy(dstId));
- }
- }
-
- // Now sort children according to the order provided by the container
- // need to replace that with Collections.sort once the set(int index, E element) is
implemented in Chromattic lists
- UIComponent[] a = dst.toArray(new UIComponent[dst.size()]);
- Arrays.sort(a, new Comparator<UIComponent>()
- {
- public int compare(UIComponent o1, UIComponent o2)
- {
- int i1 = orders.indexOf(o1.getObjectId());
- int i2 = orders.indexOf(o2.getObjectId());
- return i1 - i2;
- }
- });
- for (int j = 0; j < a.length; j++)
- {
- dst.add(j, a[j]);
- }
- }
-
- private <S, I> ApplicationData<S, I> load(UIWindow src)
- {
- Attributes attrs = src.getAttributes();
-
- //
- Customization<?> customization = src.getCustomization();
-
- //
- ContentType<?> contentType = customization.getType();
-
- //
- String customizationid = customization.getId();
-
- //
- String contentId = customization.getContentId();
-
- //
- I ref;
- ApplicationType<S, I> type;
- if (contentType == null || contentType == Preferences.CONTENT_TYPE)
- {
- int pos = contentId.indexOf('/');
- String applicationName = contentId.substring(0, pos);
- String portletName = contentId.substring(pos + 1);
- ref = (I)new PortletId(applicationName, portletName);
- type = (ApplicationType<S,I>)ApplicationType.PORTLET;
- }
- else if (contentType == Gadget.CONTENT_TYPE)
- {
- ref = (I)new GadgetId(contentId);
- type = (ApplicationType<S,I>)ApplicationType.GADGET;
- }
- else if (contentType == WSRPState.CONTENT_TYPE)
- {
- ref = (I)new WSRPId(contentId);
- type = (ApplicationType<S,I>)ApplicationType.WSRP_PORTLET;
- }
- else
- {
- throw new AssertionError("Unknown type: " + contentType);
- }
-
- //
- PersistentApplicationState<S> instanceState = new
PersistentApplicationState<S>(customizationid);
-
- //
- HashMap<String, String> properties = new HashMap<String, String>();
- load(attrs, properties, windowPropertiesBlackList);
-
- //
- return new ApplicationData<S,I>(
- src.getObjectId(),
- src.getName(),
- type,
- instanceState,
- ref,
- null,
- attrs.getValue(MappedAttributes.TITLE),
- attrs.getValue(MappedAttributes.ICON),
- attrs.getValue(MappedAttributes.DESCRIPTION),
- attrs.getValue(MappedAttributes.SHOW_INFO_BAR),
- attrs.getValue(MappedAttributes.SHOW_STATE),
- attrs.getValue(MappedAttributes.SHOW_MODE),
- attrs.getValue(MappedAttributes.THEME),
- attrs.getValue(MappedAttributes.WIDTH),
- attrs.getValue(MappedAttributes.HEIGHT),
- Utils.safeImmutableMap(properties),
- Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS)))
- );
- }
-
- public <S, I> void save(ApplicationData<S, I> src, UIWindow dst)
- {
- Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.THEME, src.getTheme());
- attrs.setValue(MappedAttributes.TITLE, src.getTitle());
- attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
- attrs.setValue(MappedAttributes.SHOW_INFO_BAR, src.isShowInfoBar());
- attrs.setValue(MappedAttributes.SHOW_STATE, src.isShowApplicationState());
- attrs.setValue(MappedAttributes.SHOW_MODE, src.isShowApplicationMode());
- attrs.setValue(MappedAttributes.DESCRIPTION, src.getDescription());
- attrs.setValue(MappedAttributes.ICON, src.getIcon());
- attrs.setValue(MappedAttributes.WIDTH, src.getWidth());
- attrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
- save(src.getProperties(), attrs);
-
- //
- ApplicationState<S> instanceState = src.getState();
-
- // We modify only transient portlet state
- // and we ignore any persistent portlet state
- if (instanceState instanceof TransientApplicationState)
- {
-
- //
- TransientApplicationState<S> transientState =
(TransientApplicationState<S>)instanceState;
-
- // Attempt to get a site from the instance state
- Site site = null;
- if (transientState.getOwnerType() != null && transientState.getOwnerId()
!= null)
- {
- ObjectType<Site> siteType =
parseSiteType(transientState.getOwnerType());
- site = session.getWorkspace().getSite(siteType,
transientState.getOwnerId());
- }
-
- // The current site
- Site currentSite = dst.getPage().getSite();
-
- // If it is the same site than the current page
- // set null
- if (site == dst.getPage().getSite())
- {
- site = null;
- }
-
- // The content id
- String contentId;
- ContentType<S> contentType = src.getType().getContentType();
- if (contentType == Preferences.CONTENT_TYPE)
- {
- PortletId id = (PortletId)src.getRef();
- contentId = id.getApplicationName() + "/" + id.getPortletName();
- }
- else if (contentType == Gadget.CONTENT_TYPE)
- {
- GadgetId id = (GadgetId)src.getRef();
- contentId = id.getGadgetName();
- }
- else if (contentType == WSRPState.CONTENT_TYPE)
- {
- WSRPId id = (WSRPId)src.getRef();
- contentId = id.getUri();
- }
- else
- {
- throw new UnsupportedOperationException("Unsupported content
type");
- }
-
- // The customization that we will inherit from if not null
- Customization<?> customization = null;
-
- // Now inspect the unique id
- String uniqueId = transientState.getUniqueId();
- if (uniqueId != null)
- {
-
- // This is a customized window
- if (uniqueId.startsWith("@"))
- {
- String id = uniqueId.substring(1);
-
- // It's another window, we get its customization
- if (!dst.getObjectId().equals(id))
- {
- UIWindow window = session.findObjectById(ObjectType.WINDOW, id);
- Customization<?> windowCustomization =
window.getCustomization();
- if (windowCustomization.getType().equals(contentType))
- {
- customization = windowCustomization;
- }
- }
- }
- else
- {
- int pos = uniqueId.indexOf('#');
- if (pos == -1)
- {
-
- // If it's a different site than the page one (it has to be at this
point)
- // then we get its customization
- if (site != null)
- {
- customization = site.getCustomization(uniqueId);
- }
- else
- {
- customization = currentSite.getCustomization(uniqueId);
-
- // If it does not exist we create it
- if (customization == null)
- {
- customization = currentSite.customize(uniqueId, contentType,
contentId, null);
- }
- }
- }
- else
- {
-
- // Otherwise we get the page customization
- String a = uniqueId.substring(0, pos);
- String b = uniqueId.substring(pos + 1);
- org.gatein.mop.api.workspace.Page page =
site.getRootPage().getChild("pages").getChild(b);
- customization = page.getCustomization(a);
- }
- }
- }
-
- // Destroy existing window previous customization
- if (dst.getCustomization() != null)
- {
- dst.getCustomization().destroy();
- }
-
- // If the existing customization is not null and matches the content id
- Customization<S> dstCustomization;
- if (customization != null &&
customization.getType().equals(contentType)
- && customization.getContentId().equals(contentId))
- {
-
- // Cast is ok as content type matches
- @SuppressWarnings("unchecked")
- Customization<S> bilto = (Customization<S>)customization;
-
- // If it's a customization of the current site we extend it
- if (bilto.getContext() == currentSite)
- {
- dstCustomization = dst.customize(bilto);
- }
- else
- {
- // Otherwise we clone it propertly
- S state = bilto.getVirtualState();
- dstCustomization = dst.customize(contentType, contentId, state);
- }
- }
- else
- {
- // Otherwise we create an empty customization
- dstCustomization = dst.customize(contentType, contentId, null);
- }
-
- // At this point we have customized the window
- // now if we have any additional state payload we must merge it
- // with the current state
- S state =
((TransientApplicationState<S>)instanceState).getContentState();
- if (state != null)
- {
- dstCustomization.setState(state);
- }
- }
- }
-
- public DashboardData loadDashboard(UIContainer container)
- {
- Attributes attrs = container.getAttributes();
- List<ComponentData> children = loadChildren(container);
- return new DashboardData(
- container.getObjectId(),
- attrs.getValue(MappedAttributes.ID),
- attrs.getValue(MappedAttributes.NAME),
- attrs.getValue(MappedAttributes.ICON),
- attrs.getValue(MappedAttributes.DECORATOR),
- attrs.getValue(MappedAttributes.TEMPLATE),
- attrs.getValue(MappedAttributes.FACTORY_ID),
- attrs.getValue(MappedAttributes.TITLE),
- attrs.getValue(MappedAttributes.DESCRIPTION),
- attrs.getValue(MappedAttributes.WIDTH),
- attrs.getValue(MappedAttributes.HEIGHT),
- Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS))),
- children
- );
- }
-
- public void saveDashboard(DashboardData dashboard, UIContainer dst)
- {
- save(dashboard, dst);
- saveChildren(dashboard, dst);
- }
-
- public static String[] parseWindowId(String windowId)
- {
- int i0 = windowId.indexOf("#");
- int i1 = windowId.indexOf(":/", i0 + 1);
- String ownerType = windowId.substring(0, i0);
- String ownerId = windowId.substring(i0 + 1, i1);
- String persistenceid = windowId.substring(i1 + 2);
- String[] chunks = split("/", 2, persistenceid);
- chunks[0] = ownerType;
- chunks[1] = ownerId;
- return chunks;
- }
-
- private static void load(Attributes src, Map<String, String> dst,
Set<String> blackList)
- {
- for (String name : src.getKeys())
- {
- if (!blackList.contains(name))
- {
- Object value = src.getObject(name);
- if (value instanceof String)
- {
- dst.put(name, (String)value);
- }
- }
- }
- }
-
- public static void save(Map<String, String> src, Attributes dst)
- {
- for (Map.Entry<String, String> property : src.entrySet())
- {
- dst.setString(property.getKey(), property.getValue());
- }
- }
-
- public static String getOwnerType(ObjectType<? extends Site> siteType)
- {
- if (siteType == ObjectType.PORTAL_SITE)
- {
- return PortalConfig.PORTAL_TYPE;
- }
- else if (siteType == ObjectType.GROUP_SITE)
- {
- return PortalConfig.GROUP_TYPE;
- }
- else if (siteType == ObjectType.USER_SITE)
- {
- return PortalConfig.USER_TYPE;
- }
- else
- {
- throw new IllegalArgumentException("Invalid site type " + siteType);
- }
- }
-
- public static ObjectType<Site> parseSiteType(String ownerType)
- {
- if (ownerType.equals(PortalConfig.PORTAL_TYPE))
- {
- return ObjectType.PORTAL_SITE;
- }
- else if (ownerType.equals(PortalConfig.GROUP_TYPE))
- {
- return ObjectType.GROUP_SITE;
- }
- else if (ownerType.equals(PortalConfig.USER_TYPE))
- {
- return ObjectType.USER_SITE;
- }
- else
- {
- throw new IllegalArgumentException("Invalid owner type " +
ownerType);
- }
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/Mapper.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,1084 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.ApplicationType;
+import org.exoplatform.portal.pom.data.BodyType;
+import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.config.model.PersistentApplicationState;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.config.model.TransientApplicationState;
+import org.exoplatform.portal.config.model.gadget.GadgetId;
+import org.exoplatform.portal.pom.config.Utils;
+import static org.exoplatform.portal.pom.config.Utils.join;
+import static org.exoplatform.portal.pom.config.Utils.split;
+
+import org.exoplatform.portal.config.model.portlet.PortletId;
+import org.exoplatform.portal.config.model.wsrp.WSRPId;
+import org.exoplatform.portal.pom.config.POMSession;
+import org.exoplatform.portal.pom.data.ApplicationData;
+import org.exoplatform.portal.pom.data.BodyData;
+import org.exoplatform.portal.pom.data.ComponentData;
+import org.exoplatform.portal.pom.data.ContainerData;
+import org.exoplatform.portal.pom.data.DashboardData;
+import org.exoplatform.portal.pom.data.ModelData;
+import org.exoplatform.portal.pom.data.NavigationNodeContainerData;
+import org.exoplatform.portal.pom.data.PageData;
+import org.exoplatform.portal.pom.data.PortalData;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
+import org.exoplatform.portal.pom.spi.portlet.Preferences;
+import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
+import org.gatein.mop.api.Attributes;
+import org.gatein.mop.api.content.ContentType;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.mop.api.workspace.Navigation;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.api.workspace.Site;
+import org.gatein.mop.api.workspace.Workspace;
+import org.gatein.mop.api.workspace.WorkspaceObject;
+import org.gatein.mop.api.workspace.link.Link;
+import org.gatein.mop.api.workspace.link.PageLink;
+import org.gatein.mop.api.workspace.ui.UIBody;
+import org.gatein.mop.api.workspace.ui.UIComponent;
+import org.gatein.mop.api.workspace.ui.UIContainer;
+import org.gatein.mop.api.workspace.ui.UIWindow;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class Mapper
+{
+
+ /** . */
+ private static final Set<String> portalPropertiesBlackList =
+ new HashSet<String>(Arrays.asList("jcr:uuid",
"jcr:primaryType", MappedAttributes.LOCALE.getName(),
+ MappedAttributes.ACCESS_PERMISSIONS.getName(),
MappedAttributes.EDIT_PERMISSION.getName(),
+ MappedAttributes.SKIN.getName(), MappedAttributes.TITLE.getName(),
MappedAttributes.CREATOR.getName(),
+ MappedAttributes.MODIFIER.getName()));
+
+ /** . */
+ private static final Set<String> windowPropertiesBlackList =
+ new HashSet<String>(Arrays.asList("jcr:uuid",
"jcr:primaryType", MappedAttributes.TYPE.getName(),
+ MappedAttributes.THEME.getName(), MappedAttributes.TITLE.getName(),
MappedAttributes.ACCESS_PERMISSIONS
+ .getName(), MappedAttributes.SHOW_INFO_BAR.getName(),
MappedAttributes.SHOW_STATE.getName(),
+ MappedAttributes.SHOW_MODE.getName(), MappedAttributes.DESCRIPTION.getName(),
MappedAttributes.ICON.getName(),
+ MappedAttributes.WIDTH.getName(), MappedAttributes.HEIGHT.getName()));
+
+ /** . */
+ private final POMSession session;
+
+ public Mapper(POMSession session)
+ {
+ this.session = session;
+ }
+
+ public NavigationData load(Navigation src)
+ {
+ return load(src, NavigationData.class);
+ }
+
+ private <T extends NavigationNodeContainerData> T load(Navigation src,
Class<T> type)
+ {
+
+ //
+ ArrayList<NavigationNodeData> children = new
ArrayList<NavigationNodeData>(src.getChildren().size());
+ for (Navigation srcChild : src.getChildren())
+ {
+ NavigationNodeData dstChild = load(srcChild, NavigationNodeData.class);
+ children.add(dstChild);
+ }
+
+ //
+ T dst;
+ if (type == NavigationData.class)
+ {
+ Site site = src.getSite();
+ String ownerType = getOwnerType(site.getObjectType());
+ String ownerId = site.getName();
+ Attributes attrs = src.getAttributes();
+ NavigationData dstNav = new NavigationData(
+ src.getObjectId(),
+ ownerType,
+ ownerId,
+ attrs.getValue(MappedAttributes.DESCRIPTION),
+ attrs.getValue(MappedAttributes.CREATOR),
+ attrs.getValue(MappedAttributes.MODIFIER),
+ attrs.getValue(MappedAttributes.PRIORITY, 1),
+ children);
+ dst = (T)dstNav;
+ }
+ else if (type == NavigationNodeData.class)
+ {
+ Attributes attrs = src.getAttributes();
+ String pageReference = null;
+ Link link = src.getLink();
+ if (link instanceof PageLink)
+ {
+ PageLink pageLink = (PageLink)link;
+ org.gatein.mop.api.workspace.Page target = pageLink.getPage();
+ if (target != null)
+ {
+ Site site = target.getSite();
+ ObjectType<? extends Site> siteType = site.getObjectType();
+ pageReference = getOwnerType(siteType) + "::" + site.getName() +
"::" + target.getName();
+ }
+ }
+ NavigationNodeData dstNode = new NavigationNodeData(
+ src.getObjectId(),
+ attrs.getValue(MappedAttributes.URI),
+ attrs.getValue(MappedAttributes.LABEL),
+ attrs.getValue(MappedAttributes.ICON),
+ src.getName(),
+ attrs.getValue(MappedAttributes.START_PUBLICATION_DATE),
+ attrs.getValue(MappedAttributes.END_PUBLICATION_DATE),
+ attrs.getValue(MappedAttributes.SHOW_PUBLICATION_DATE, false),
+ attrs.getValue(MappedAttributes.VISIBLE, true),
+ pageReference,
+ children
+ );
+
+ dst = (T)dstNode;
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+
+ //
+ return dst;
+ }
+
+ public void save(NavigationData src, Navigation dst)
+ {
+ save((NavigationNodeContainerData)src, dst);
+ }
+
+ private void save(NavigationNodeContainerData src, Navigation dst)
+ {
+ if (src instanceof NavigationNodeData)
+ {
+ NavigationNodeData node = (NavigationNodeData)src;
+ Workspace workspace = dst.getSite().getWorkspace();
+ String reference = node.getPageReference();
+ if (reference != null)
+ {
+ String[] pageChunks = split("::", reference);
+ ObjectType<? extends Site> siteType = parseSiteType(pageChunks[0]);
+ Site site = workspace.getSite(siteType, pageChunks[1]);
+ org.gatein.mop.api.workspace.Page target =
site.getRootPage().getChild("pages").getChild(pageChunks[2]);
+ PageLink link = dst.linkTo(ObjectType.PAGE_LINK);
+ link.setPage(target);
+ }
+
+ //
+ Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.URI, node.getURI());
+ attrs.setValue(MappedAttributes.LABEL, node.getLabel());
+ attrs.setValue(MappedAttributes.ICON, node.getIcon());
+ attrs.setValue(MappedAttributes.START_PUBLICATION_DATE,
node.getStartPublicationDate());
+ attrs.setValue(MappedAttributes.END_PUBLICATION_DATE,
node.getEndPublicationDate());
+ attrs.setValue(MappedAttributes.SHOW_PUBLICATION_DATE,
node.getShowPublicationDate());
+ attrs.setValue(MappedAttributes.VISIBLE, node.isVisible());
+ }
+ else if (src instanceof NavigationData)
+ {
+ NavigationData pageNav = (NavigationData)src;
+
+ //
+ Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.PRIORITY, pageNav.getPriority());
+ attrs.setValue(MappedAttributes.CREATOR, pageNav.getCreator());
+ attrs.setValue(MappedAttributes.MODIFIER, pageNav.getModifier());
+ attrs.setValue(MappedAttributes.DESCRIPTION, pageNav.getDescription());
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+
+ //
+ Set<String> savedSet = new HashSet<String>();
+ for (NavigationNodeData node : src.getNodes())
+ {
+ String srcId = node.getStorageId();
+ Navigation dstChild;
+ if (srcId != null)
+ {
+ dstChild = session.findObjectById(ObjectType.NAVIGATION, srcId);
+ }
+ else
+ {
+ dstChild = dst.getChild(node.getName());
+ if (dstChild == null)
+ {
+ dstChild = dst.addChild(node.getName());
+ }
+ srcId = dstChild.getObjectId();
+ }
+ save(node, dstChild);
+ savedSet.add(srcId);
+ }
+ for (Iterator<? extends Navigation> i = dst.getChildren().iterator();
i.hasNext();)
+ {
+ Navigation dstChild = i.next();
+ if (!savedSet.contains(dstChild.getObjectId()))
+ {
+ i.remove();
+ }
+ }
+ }
+
+ public PortalData load(Site src)
+ {
+ String type = Mapper.getOwnerType(src.getObjectType());
+ Attributes attrs = src.getAttributes();
+
+ //
+ org.gatein.mop.api.workspace.Page template =
src.getRootNavigation().getTemplate();
+ UIContainer srcLayout = template.getRootComponent();
+
+ //
+ Map<String, String> properties = new HashMap<String, String>();
+ load(attrs, properties, portalPropertiesBlackList);
+
+ //
+ List<ComponentData> layoutChildren = loadChildren(srcLayout);
+ ContainerData layout = load(srcLayout, layoutChildren);
+
+ //
+ return new PortalData(
+ src.getObjectId(),
+ src.getName(),
+ type,
+ attrs.getValue(MappedAttributes.LOCALE),
+ Collections.unmodifiableList(Arrays.asList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS, "")))),
+ attrs.getValue(MappedAttributes.EDIT_PERMISSION),
+ Collections.unmodifiableMap(properties),
+ attrs.getValue(MappedAttributes.SKIN),
+ attrs.getValue(MappedAttributes.TITLE),
+ layout,
+ attrs.getValue(MappedAttributes.CREATOR),
+ attrs.getValue(MappedAttributes.MODIFIER));
+ }
+
+ public void save(PortalData src, Site dst)
+ {
+ if (src.getStorageId() != null &&
!src.getStorageId().equals(dst.getObjectId()))
+ {
+ String msg =
+ "Attempt to save a site " + src.getType() + "/" +
src.getName() + " on the wrong target site "
+ + dst.getObjectType() + "/" + dst.getName();
+ throw new IllegalArgumentException(msg);
+ }
+
+ //
+ Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.LOCALE, src.getLocale());
+ attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
+ attrs.setValue(MappedAttributes.EDIT_PERMISSION, src.getEditPermission());
+ attrs.setValue(MappedAttributes.SKIN, src.getSkin());
+ attrs.setValue(MappedAttributes.TITLE, src.getTitle());
+ attrs.setValue(MappedAttributes.CREATOR, src.getCreator());
+ attrs.setValue(MappedAttributes.MODIFIER, src.getModifier());
+ if (src.getProperties() != null)
+ {
+ save(src.getProperties(), attrs);
+ }
+
+ //
+ org.gatein.mop.api.workspace.Page templates =
dst.getRootPage().getChild("templates");
+ org.gatein.mop.api.workspace.Page template =
templates.getChild("default");
+ if (template == null)
+ {
+ template = templates.addChild("default");
+ }
+
+ //
+ ContainerData srcContainer = src.getPortalLayout();
+ UIContainer dstContainer = template.getRootComponent();
+
+ //
+ save(srcContainer, dstContainer);
+ saveChildren(srcContainer, dstContainer);
+
+ //
+ dst.getRootNavigation().setTemplate(template);
+ }
+
+ public PageData load(org.gatein.mop.api.workspace.Page src)
+ {
+ Site site = src.getSite();
+ String ownerType = getOwnerType(site.getObjectType());
+ String ownerId = site.getName();
+ String name = src.getName();
+ List<ComponentData> children = loadChildren(src.getRootComponent());
+ Attributes attrs = src.getAttributes();
+
+ //
+ return new PageData(
+ src.getObjectId(),
+ null,
+ name,
+ null,
+ null,
+ null,
+ attrs.getValue(MappedAttributes.FACTORY_ID),
+ attrs.getValue(MappedAttributes.TITLE),
+ null,
+ null,
+ null,
+ Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS))),
+ children,
+ ownerType,
+ ownerId,
+ attrs.getValue(MappedAttributes.EDIT_PERMISSION),
+ attrs.getValue(MappedAttributes.SHOW_MAX_WINDOW, false),
+ attrs.getValue(MappedAttributes.CREATOR),
+ attrs.getValue(MappedAttributes.MODIFIER)
+ );
+ }
+
+ public List<ModelChange> save(PageData src, Site site, String name)
+ {
+ org.gatein.mop.api.workspace.Page root = site.getRootPage();
+ org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
+ org.gatein.mop.api.workspace.Page dst = pages.getChild(name);
+
+ //
+ LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
+
+ //
+ if (dst == null)
+ {
+ dst = pages.addChild(name);
+ changes.add(new ModelChange.Create(src));
+ }
+ else
+ {
+ changes.add(new ModelChange.Update(src));
+ }
+
+ //
+ Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.TITLE, src.getTitle());
+ attrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
+ attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
+ attrs.setValue(MappedAttributes.EDIT_PERMISSION, src.getEditPermission());
+ attrs.setValue(MappedAttributes.SHOW_MAX_WINDOW, src.isShowMaxWindow());
+ attrs.setValue(MappedAttributes.CREATOR, src.getCreator());
+ attrs.setValue(MappedAttributes.MODIFIER, src.getModifier());
+
+ //
+ changes.addAll(saveChildren(src, dst.getRootComponent()));
+
+ //
+ return changes;
+ }
+
+ private ContainerData load(UIContainer src, List<ComponentData> children)
+ {
+ Attributes attrs = src.getAttributes();
+ return new ContainerData(
+ src.getObjectId(),
+ attrs.getValue(MappedAttributes.ID),
+ attrs.getValue(MappedAttributes.NAME),
+ attrs.getValue(MappedAttributes.ICON),
+ attrs.getValue(MappedAttributes.DECORATOR),
+ attrs.getValue(MappedAttributes.TEMPLATE),
+ attrs.getValue(MappedAttributes.FACTORY_ID),
+ attrs.getValue(MappedAttributes.TITLE),
+ attrs.getValue(MappedAttributes.DESCRIPTION),
+ attrs.getValue(MappedAttributes.WIDTH),
+ attrs.getValue(MappedAttributes.HEIGHT),
+ Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS))),
+ children
+ );
+ }
+
+ private List<ComponentData> loadChildren(UIContainer src)
+ {
+ ArrayList<ComponentData> children = new
ArrayList<ComponentData>(src.size());
+ for (UIComponent component : src)
+ {
+
+ // Obtain a model object from the ui component
+ ComponentData mo;
+ if (component instanceof UIContainer)
+ {
+ UIContainer srcContainer = (UIContainer)component;
+ Attributes attrs = srcContainer.getAttributes();
+ String type = attrs.getValue(MappedAttributes.TYPE);
+ if ("dashboard".equals(type))
+ {
+ TransientApplicationState<Preferences> state = new
TransientApplicationState<Preferences>();
+ Site owner = src.getPage().getSite();
+ state.setOwnerType(getOwnerType(owner.getObjectType()));
+ state.setOwnerId(owner.getName());
+ mo = new ApplicationData<Preferences, PortletId>(
+ srcContainer.getObjectId(),
+ component.getName(),
+ ApplicationType.PORTLET,
+ state,
+ new PortletId("dashboard", "DashboardPortlet"),
+ null,
+ null,
+ null,
+ null,
+ false,
+ false,
+ false,
+ null,
+ null,
+ null,
+ Collections.<String, String>emptyMap(),
+ Collections.<String>emptyList());
+ }
+ else
+ {
+ List<ComponentData> dstChildren = loadChildren(srcContainer);
+ mo = load(srcContainer, dstChildren);
+ }
+ }
+ else if (component instanceof UIWindow)
+ {
+ UIWindow window = (UIWindow)component;
+ ApplicationData application = load(window);
+ mo = application;
+ }
+ else if (component instanceof UIBody)
+ {
+ mo = new BodyData(component.getObjectId(), BodyType.PAGE);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+
+ // Add among children
+ children.add(mo);
+ }
+ return children;
+ }
+
+ private void save(ContainerData src, UIContainer dst)
+ {
+ Attributes dstAttrs = dst.getAttributes();
+ dstAttrs.setValue(MappedAttributes.ID, src.getId());
+ dstAttrs.setValue(MappedAttributes.TYPE, src instanceof DashboardData ?
"dashboard" : null);
+ dstAttrs.setValue(MappedAttributes.TITLE, src.getTitle());
+ dstAttrs.setValue(MappedAttributes.ICON, src.getIcon());
+ dstAttrs.setValue(MappedAttributes.TEMPLATE, src.getTemplate());
+ dstAttrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
+ dstAttrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
+ dstAttrs.setValue(MappedAttributes.DECORATOR, src.getDecorator());
+ dstAttrs.setValue(MappedAttributes.DESCRIPTION, src.getDescription());
+ dstAttrs.setValue(MappedAttributes.WIDTH, src.getWidth());
+ dstAttrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
+ dstAttrs.setValue(MappedAttributes.NAME, src.getName());
+ }
+
+ private void save(ModelData src, WorkspaceObject dst, LinkedList<ModelChange>
changes,
+ Map<String, String> hierarchyRelationships)
+ {
+ if (src instanceof ContainerData)
+ {
+ save((ContainerData)src, (UIContainer)dst);
+ saveChildren((ContainerData)src, (UIContainer)dst, changes,
hierarchyRelationships);
+ }
+ else if (src instanceof ApplicationData)
+ {
+ save((ApplicationData<?, ?>)src, (UIWindow)dst);
+ }
+ else if (src instanceof BodyData)
+ {
+ // Stateless
+ }
+ else
+ {
+ throw new AssertionError("Was not expecting child " + src);
+ }
+ }
+
+ /** . */
+ private static final PortletId DASHBOARD_ID = new PortletId("dashboard",
"DashboardPortlet");
+
+ private LinkedList<ModelChange> saveChildren(final ContainerData src,
UIContainer dst)
+ {
+
+ //
+ LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
+
+ //
+ Map<String, String> hierarchyRelationships = new HashMap<String,
String>();
+
+ //
+ build(src, hierarchyRelationships);
+
+ //
+ saveChildren(src, dst, changes,
Collections.unmodifiableMap(hierarchyRelationships));
+
+ //
+ return changes;
+ }
+
+ private void build(ContainerData parent, Map<String, String>
hierarchyRelationships)
+ {
+ String parentId = parent.getStorageId();
+ if (parentId != null)
+ {
+ for (ModelData child : parent.getChildren())
+ {
+ String childId = child.getStorageId();
+ if (childId != null)
+ {
+ if (hierarchyRelationships.put(childId, parentId) != null)
+ {
+ throw new AssertionError("The same object is present two times in
the object hierarchy");
+ }
+ if (child instanceof ContainerData)
+ {
+ build((ContainerData)child, hierarchyRelationships);
+ }
+ }
+ }
+ }
+ }
+
+ private void saveChildren(final ContainerData src, UIContainer dst,
LinkedList<ModelChange> changes,
+ Map<String, String> hierarchyRelationships)
+ {
+ final List<String> orders = new ArrayList<String>();
+ final Map<String, ModelData> modelObjectMap = new HashMap<String,
ModelData>();
+
+ //
+ for (ModelData srcChild : src.getChildren())
+ {
+ String srcId = srcChild.getStorageId();
+
+ // Replace dashboard application by container if needed
+ if (srcChild instanceof ApplicationData)
+ {
+ ApplicationData app = (ApplicationData)srcChild;
+ if (app.getType() == ApplicationType.PORTLET)
+ {
+ PortletId ref = (PortletId)app.getRef();
+ if (DASHBOARD_ID.equals(ref))
+ {
+ if (app.getStorageId() != null)
+ {
+ UIContainer dstDashboard =
session.findObjectById(ObjectType.CONTAINER, app.getStorageId());
+ srcChild = loadDashboard(dstDashboard);
+ }
+ else
+ {
+ srcChild = DashboardData.INITIAL_DASHBOARD;
+ }
+ }
+ }
+ }
+
+ //
+ UIComponent dstChild;
+ if (srcId != null)
+ {
+ dstChild = session.findObjectById(ObjectType.COMPONENT, srcId);
+ if (dstChild == null)
+ {
+ throw new AssertionError("Could not find supposed present child with
id " + srcId);
+ }
+ // julien : this can fail due to a bug in chromattic not implementing equals
method properly
+ // and is replaced with the foreach below
+ /*
+ if (!dst.contains(dstChild)) {
+ throw new IllegalArgumentException("Attempt for updating a ui
component " + session.pathOf(dstChild) +
+ "that is not present in the target ui container " +
session.pathOf(dst));
+ }
+ */
+ boolean found = false;
+ for (UIComponent child : dst)
+ {
+ if (child.getObjectId().equals(srcId))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ if (hierarchyRelationships.containsKey(srcId))
+ {
+ // It's a move operation, so we move the node first
+ dst.add(dstChild);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Attempt for updating a ui
component " + session.pathOf(dstChild)
+ + "that is not present in the target ui container " +
session.pathOf(dst));
+ }
+ }
+
+ //
+ changes.add(new ModelChange.Update(srcChild));
+ }
+ else
+ {
+ String name = srcChild.getStorageName();
+ if (name == null)
+ {
+ // We manufacture one name
+ name = UUID.randomUUID().toString();
+ }
+ if (srcChild instanceof ContainerData)
+ {
+ dstChild = dst.add(ObjectType.CONTAINER, name);
+ }
+ else if (srcChild instanceof ApplicationData)
+ {
+ dstChild = dst.add(ObjectType.WINDOW, name);
+ }
+ else if (srcChild instanceof BodyData)
+ {
+ dstChild = dst.add(ObjectType.BODY, name);
+ }
+ else
+ {
+ throw new AssertionError("Was not expecting child " +
srcChild);
+ }
+ changes.add(new ModelChange.Create(srcChild));
+ }
+
+ //
+ save(srcChild, dstChild, changes, hierarchyRelationships);
+
+ //
+ String dstId = dstChild.getObjectId();
+ modelObjectMap.put(dstId, srcChild);
+ orders.add(dstId);
+ }
+
+ // Take care of move operation that could be seen as a remove
+ for (UIComponent dstChild : dst)
+ {
+ String dstId = dstChild.getObjectId();
+ if (!modelObjectMap.containsKey(dstId) &&
hierarchyRelationships.containsKey(dstId))
+ {
+ String parentId = hierarchyRelationships.get(dstId);
+
+ // Get the new parent
+ UIContainer parent = session.findObjectById(ObjectType.CONTAINER, parentId);
+
+ // Perform the move
+ parent.add(dstChild);
+
+ //
+ changes.add(new ModelChange.Destroy(dstId));
+ }
+ }
+
+ // Delete removed children
+ for (Iterator<UIComponent> i = dst.iterator(); i.hasNext();)
+ {
+ UIComponent dstChild = i.next();
+ String dstId = dstChild.getObjectId();
+ if (!modelObjectMap.containsKey(dstId))
+ {
+ i.remove();
+ changes.add(new ModelChange.Destroy(dstId));
+ }
+ }
+
+ // Now sort children according to the order provided by the container
+ // need to replace that with Collections.sort once the set(int index, E element) is
implemented in Chromattic lists
+ UIComponent[] a = dst.toArray(new UIComponent[dst.size()]);
+ Arrays.sort(a, new Comparator<UIComponent>()
+ {
+ public int compare(UIComponent o1, UIComponent o2)
+ {
+ int i1 = orders.indexOf(o1.getObjectId());
+ int i2 = orders.indexOf(o2.getObjectId());
+ return i1 - i2;
+ }
+ });
+ for (int j = 0; j < a.length; j++)
+ {
+ dst.add(j, a[j]);
+ }
+ }
+
+ private <S, I> ApplicationData<S, I> load(UIWindow src)
+ {
+ Attributes attrs = src.getAttributes();
+
+ //
+ Customization<?> customization = src.getCustomization();
+
+ //
+ ContentType<?> contentType = customization.getType();
+
+ //
+ String customizationid = customization.getId();
+
+ //
+ String contentId = customization.getContentId();
+
+ //
+ I ref;
+ ApplicationType<S, I> type;
+ if (contentType == null || contentType == Preferences.CONTENT_TYPE)
+ {
+ int pos = contentId.indexOf('/');
+ String applicationName = contentId.substring(0, pos);
+ String portletName = contentId.substring(pos + 1);
+ ref = (I)new PortletId(applicationName, portletName);
+ type = (ApplicationType<S,I>)ApplicationType.PORTLET;
+ }
+ else if (contentType == Gadget.CONTENT_TYPE)
+ {
+ ref = (I)new GadgetId(contentId);
+ type = (ApplicationType<S,I>)ApplicationType.GADGET;
+ }
+ else if (contentType == WSRPState.CONTENT_TYPE)
+ {
+ ref = (I)new WSRPId(contentId);
+ type = (ApplicationType<S,I>)ApplicationType.WSRP_PORTLET;
+ }
+ else
+ {
+ throw new AssertionError("Unknown type: " + contentType);
+ }
+
+ //
+ PersistentApplicationState<S> instanceState = new
PersistentApplicationState<S>(customizationid);
+
+ //
+ HashMap<String, String> properties = new HashMap<String, String>();
+ load(attrs, properties, windowPropertiesBlackList);
+
+ //
+ return new ApplicationData<S,I>(
+ src.getObjectId(),
+ src.getName(),
+ type,
+ instanceState,
+ ref,
+ null,
+ attrs.getValue(MappedAttributes.TITLE),
+ attrs.getValue(MappedAttributes.ICON),
+ attrs.getValue(MappedAttributes.DESCRIPTION),
+ attrs.getValue(MappedAttributes.SHOW_INFO_BAR),
+ attrs.getValue(MappedAttributes.SHOW_STATE),
+ attrs.getValue(MappedAttributes.SHOW_MODE),
+ attrs.getValue(MappedAttributes.THEME),
+ attrs.getValue(MappedAttributes.WIDTH),
+ attrs.getValue(MappedAttributes.HEIGHT),
+ Utils.safeImmutableMap(properties),
+ Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS)))
+ );
+ }
+
+ public <S, I> void save(ApplicationData<S, I> src, UIWindow dst)
+ {
+ Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.THEME, src.getTheme());
+ attrs.setValue(MappedAttributes.TITLE, src.getTitle());
+ attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|",
src.getAccessPermissions()));
+ attrs.setValue(MappedAttributes.SHOW_INFO_BAR, src.isShowInfoBar());
+ attrs.setValue(MappedAttributes.SHOW_STATE, src.isShowApplicationState());
+ attrs.setValue(MappedAttributes.SHOW_MODE, src.isShowApplicationMode());
+ attrs.setValue(MappedAttributes.DESCRIPTION, src.getDescription());
+ attrs.setValue(MappedAttributes.ICON, src.getIcon());
+ attrs.setValue(MappedAttributes.WIDTH, src.getWidth());
+ attrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
+ save(src.getProperties(), attrs);
+
+ //
+ ApplicationState<S> instanceState = src.getState();
+
+ // We modify only transient portlet state
+ // and we ignore any persistent portlet state
+ if (instanceState instanceof TransientApplicationState)
+ {
+
+ //
+ TransientApplicationState<S> transientState =
(TransientApplicationState<S>)instanceState;
+
+ // Attempt to get a site from the instance state
+ Site site = null;
+ if (transientState.getOwnerType() != null && transientState.getOwnerId()
!= null)
+ {
+ ObjectType<Site> siteType =
parseSiteType(transientState.getOwnerType());
+ site = session.getWorkspace().getSite(siteType,
transientState.getOwnerId());
+ }
+
+ // The current site
+ Site currentSite = dst.getPage().getSite();
+
+ // If it is the same site than the current page
+ // set null
+ if (site == dst.getPage().getSite())
+ {
+ site = null;
+ }
+
+ // The content id
+ String contentId;
+ ContentType<S> contentType = src.getType().getContentType();
+ if (contentType == Preferences.CONTENT_TYPE)
+ {
+ PortletId id = (PortletId)src.getRef();
+ contentId = id.getApplicationName() + "/" + id.getPortletName();
+ }
+ else if (contentType == Gadget.CONTENT_TYPE)
+ {
+ GadgetId id = (GadgetId)src.getRef();
+ contentId = id.getGadgetName();
+ }
+ else if (contentType == WSRPState.CONTENT_TYPE)
+ {
+ WSRPId id = (WSRPId)src.getRef();
+ contentId = id.getUri();
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Unsupported content
type");
+ }
+
+ // The customization that we will inherit from if not null
+ Customization<?> customization = null;
+
+ // Now inspect the unique id
+ String uniqueId = transientState.getUniqueId();
+ if (uniqueId != null)
+ {
+
+ // This is a customized window
+ if (uniqueId.startsWith("@"))
+ {
+ String id = uniqueId.substring(1);
+
+ // It's another window, we get its customization
+ if (!dst.getObjectId().equals(id))
+ {
+ UIWindow window = session.findObjectById(ObjectType.WINDOW, id);
+ Customization<?> windowCustomization =
window.getCustomization();
+ if (windowCustomization.getType().equals(contentType))
+ {
+ customization = windowCustomization;
+ }
+ }
+ }
+ else
+ {
+ int pos = uniqueId.indexOf('#');
+ if (pos == -1)
+ {
+
+ // If it's a different site than the page one (it has to be at this
point)
+ // then we get its customization
+ if (site != null)
+ {
+ customization = site.getCustomization(uniqueId);
+ }
+ else
+ {
+ customization = currentSite.getCustomization(uniqueId);
+
+ // If it does not exist we create it
+ if (customization == null)
+ {
+ customization = currentSite.customize(uniqueId, contentType,
contentId, null);
+ }
+ }
+ }
+ else
+ {
+
+ // Otherwise we get the page customization
+ String a = uniqueId.substring(0, pos);
+ String b = uniqueId.substring(pos + 1);
+ org.gatein.mop.api.workspace.Page page =
site.getRootPage().getChild("pages").getChild(b);
+ customization = page.getCustomization(a);
+ }
+ }
+ }
+
+ // Destroy existing window previous customization
+ if (dst.getCustomization() != null)
+ {
+ dst.getCustomization().destroy();
+ }
+
+ // If the existing customization is not null and matches the content id
+ Customization<S> dstCustomization;
+ if (customization != null &&
customization.getType().equals(contentType)
+ && customization.getContentId().equals(contentId))
+ {
+
+ // Cast is ok as content type matches
+ @SuppressWarnings("unchecked")
+ Customization<S> bilto = (Customization<S>)customization;
+
+ // If it's a customization of the current site we extend it
+ if (bilto.getContext() == currentSite)
+ {
+ dstCustomization = dst.customize(bilto);
+ }
+ else
+ {
+ // Otherwise we clone it propertly
+ S state = bilto.getVirtualState();
+ dstCustomization = dst.customize(contentType, contentId, state);
+ }
+ }
+ else
+ {
+ // Otherwise we create an empty customization
+ dstCustomization = dst.customize(contentType, contentId, null);
+ }
+
+ // At this point we have customized the window
+ // now if we have any additional state payload we must merge it
+ // with the current state
+ S state =
((TransientApplicationState<S>)instanceState).getContentState();
+ if (state != null)
+ {
+ dstCustomization.setState(state);
+ }
+ }
+ }
+
+ public DashboardData loadDashboard(UIContainer container)
+ {
+ Attributes attrs = container.getAttributes();
+ List<ComponentData> children = loadChildren(container);
+ return new DashboardData(
+ container.getObjectId(),
+ attrs.getValue(MappedAttributes.ID),
+ attrs.getValue(MappedAttributes.NAME),
+ attrs.getValue(MappedAttributes.ICON),
+ attrs.getValue(MappedAttributes.DECORATOR),
+ attrs.getValue(MappedAttributes.TEMPLATE),
+ attrs.getValue(MappedAttributes.FACTORY_ID),
+ attrs.getValue(MappedAttributes.TITLE),
+ attrs.getValue(MappedAttributes.DESCRIPTION),
+ attrs.getValue(MappedAttributes.WIDTH),
+ attrs.getValue(MappedAttributes.HEIGHT),
+ Utils.safeImmutableList(split("|",
attrs.getValue(MappedAttributes.ACCESS_PERMISSIONS))),
+ children
+ );
+ }
+
+ public void saveDashboard(DashboardData dashboard, UIContainer dst)
+ {
+ save(dashboard, dst);
+ saveChildren(dashboard, dst);
+ }
+
+ public static String[] parseWindowId(String windowId)
+ {
+ int i0 = windowId.indexOf("#");
+ int i1 = windowId.indexOf(":/", i0 + 1);
+ String ownerType = windowId.substring(0, i0);
+ String ownerId = windowId.substring(i0 + 1, i1);
+ String persistenceid = windowId.substring(i1 + 2);
+ String[] chunks = split("/", 2, persistenceid);
+ chunks[0] = ownerType;
+ chunks[1] = ownerId;
+ return chunks;
+ }
+
+ private static void load(Attributes src, Map<String, String> dst,
Set<String> blackList)
+ {
+ for (String name : src.getKeys())
+ {
+ if (!blackList.contains(name))
+ {
+ Object value = src.getObject(name);
+ if (value instanceof String)
+ {
+ dst.put(name, (String)value);
+ }
+ }
+ }
+ }
+
+ public static void save(Map<String, String> src, Attributes dst)
+ {
+ for (Map.Entry<String, String> property : src.entrySet())
+ {
+ dst.setString(property.getKey(), property.getValue());
+ }
+ }
+
+ public static String getOwnerType(ObjectType<? extends Site> siteType)
+ {
+ if (siteType == ObjectType.PORTAL_SITE)
+ {
+ return PortalConfig.PORTAL_TYPE;
+ }
+ else if (siteType == ObjectType.GROUP_SITE)
+ {
+ return PortalConfig.GROUP_TYPE;
+ }
+ else if (siteType == ObjectType.USER_SITE)
+ {
+ return PortalConfig.USER_TYPE;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Invalid site type " + siteType);
+ }
+ }
+
+ public static ObjectType<Site> parseSiteType(String ownerType)
+ {
+ if (ownerType.equals(PortalConfig.PORTAL_TYPE))
+ {
+ return ObjectType.PORTAL_SITE;
+ }
+ else if (ownerType.equals(PortalConfig.GROUP_TYPE))
+ {
+ return ObjectType.GROUP_SITE;
+ }
+ else if (ownerType.equals(PortalConfig.USER_TYPE))
+ {
+ return ObjectType.USER_SITE;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Invalid owner type " +
ownerType);
+ }
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,50 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.portal.pom.config.data;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public abstract class ModelData
-{
-
- /** Storage id. */
- private final String storageId;
-
- /** The storage name that is unique among a container context. */
- private final String storageName;
-
- protected ModelData(String storageId, String storageName)
- {
- this.storageId = storageId;
- this.storageName = storageName;
- }
-
- public String getStorageId()
- {
- return storageId;
- }
-
- public String getStorageName()
- {
- return storageName;
- }
-}
\ No newline at end of file
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,50 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.pom.data;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public abstract class ModelData
+{
+
+ /** Storage id. */
+ private final String storageId;
+
+ /** The storage name that is unique among a container context. */
+ private final String storageName;
+
+ protected ModelData(String storageId, String storageName)
+ {
+ this.storageId = storageId;
+ this.storageName = storageName;
+ }
+
+ public String getStorageId()
+ {
+ return storageId;
+ }
+
+ public String getStorageName()
+ {
+ return storageName;
+ }
+}
\ No newline at end of file
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelDataStorage.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,107 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.commons.utils.LazyPageList;
-import org.exoplatform.portal.application.PortletPreferences;
-import org.exoplatform.portal.config.Query;
-import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.ModelChange;
-import org.exoplatform.portal.pom.config.data.NavigationContainer;
-import org.exoplatform.portal.pom.config.data.PageData;
-import org.exoplatform.portal.pom.config.data.PortalData;
-import org.exoplatform.portal.pom.config.POMTask;
-
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * Created by The eXo Platform SAS
- * Apr 19, 2007
- *
- * This interface is used to load the PortalConfig, Page config and Navigation config
from the
- * database
- */
-public interface ModelDataStorage
-{
-
- public <T extends POMTask> T execute(T task) throws Exception;
-
- public void create(PortalData config) throws Exception;
-
- public void save(PortalData config) throws Exception;
-
- public PortalData getPortalConfig(PortalKey key) throws Exception;
-
- public void remove(PortalData config) throws Exception;
-
- public PageData getPage(PageKey key) throws Exception;
-
- /**
- * Clones a page.
- *
- * @param key the key of the page to clone
- * @param cloneKey the key of the clone
- * @return the cloned page
- * @throws Exception any exception
- */
- public PageData clonePage(PageKey key, PageKey cloneKey)
- throws Exception;
-
- public void remove(PageData page) throws Exception;
-
- public void create(PageData page) throws Exception;
-
- /**
- * Saves a page. If a page with the same id already exists then a merge operation will
occur, otherwise
- * a new page will be created from the provided argument.
- *
- * The operation returns a list of the change object that describes the changes that
occured during the
- * save operation.
- *
- * @param page the page to save
- * @return the list of model changes that occured during the save operation
- * @throws Exception any exception
- */
- public List<ModelChange> save(PageData page) throws Exception;
-
- public NavigationContainer.Page getPageNavigation(NavigationKey key) throws
Exception;
-
- public void save(NavigationContainer.Page navigation) throws Exception;
-
- public void create(NavigationContainer.Page navigation) throws Exception;
-
- public void remove(NavigationContainer.Page navigation) throws Exception;
-
- public void save(PortletPreferences portletPreferences) throws Exception;
-
- public <S> S load(ApplicationState<S> state) throws Exception;
-
- public <S> ApplicationState<S> save(ApplicationState<S> state, S
preferences) throws Exception;
-
- public PortletPreferences getPortletPreferences(String windowID) throws Exception;
-
- public <T> LazyPageList<T> find(Query<T> q) throws Exception;
-
- public <T> LazyPageList<T> find(Query<T> q, Comparator<T>
sortComparator) throws Exception;
-
- public Container getSharedLayout() throws Exception;
-}
\ No newline at end of file
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/ModelDataStorage.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,106 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.Query;
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.PageData;
+import org.exoplatform.portal.pom.data.PortalData;
+import org.exoplatform.portal.pom.config.POMTask;
+
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS
+ * Apr 19, 2007
+ *
+ * This interface is used to load the PortalConfig, Page config and Navigation config
from the
+ * database
+ */
+public interface ModelDataStorage
+{
+
+ public <T extends POMTask> T execute(T task) throws Exception;
+
+ public void create(PortalData config) throws Exception;
+
+ public void save(PortalData config) throws Exception;
+
+ public PortalData getPortalConfig(PortalKey key) throws Exception;
+
+ public void remove(PortalData config) throws Exception;
+
+ public PageData getPage(PageKey key) throws Exception;
+
+ /**
+ * Clones a page.
+ *
+ * @param key the key of the page to clone
+ * @param cloneKey the key of the clone
+ * @return the cloned page
+ * @throws Exception any exception
+ */
+ public PageData clonePage(PageKey key, PageKey cloneKey)
+ throws Exception;
+
+ public void remove(PageData page) throws Exception;
+
+ public void create(PageData page) throws Exception;
+
+ /**
+ * Saves a page. If a page with the same id already exists then a merge operation will
occur, otherwise
+ * a new page will be created from the provided argument.
+ *
+ * The operation returns a list of the change object that describes the changes that
occured during the
+ * save operation.
+ *
+ * @param page the page to save
+ * @return the list of model changes that occured during the save operation
+ * @throws Exception any exception
+ */
+ public List<ModelChange> save(PageData page) throws Exception;
+
+ public NavigationData getPageNavigation(NavigationKey key) throws Exception;
+
+ public void save(NavigationData navigation) throws Exception;
+
+ public void create(NavigationData navigation) throws Exception;
+
+ public void remove(NavigationData navigation) throws Exception;
+
+ public void save(PortletPreferences portletPreferences) throws Exception;
+
+ public <S> S load(ApplicationState<S> state) throws Exception;
+
+ public <S> ApplicationState<S> save(ApplicationState<S> state, S
preferences) throws Exception;
+
+ public PortletPreferences getPortletPreferences(String windowID) throws Exception;
+
+ public <T> LazyPageList<T> find(Query<T> q) throws Exception;
+
+ public <T> LazyPageList<T> find(Query<T> q, Comparator<T>
sortComparator) throws Exception;
+
+ public Container getSharedLayout() throws Exception;
+}
\ No newline at end of file
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationContainer.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationContainer.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationContainer.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,261 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.pom.config.data.ModelData;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class NavigationContainer extends ModelData
-{
-
- /** . */
- private final List<NavigationContainer.Node> children;
-
- public NavigationContainer(String storageId, List<NavigationContainer.Node>
children)
- {
- super(storageId, null);
-
- //
- this.children = children;
- }
-
- public List<NavigationContainer.Node> getChildren()
- {
- return children;
- }
-
- public static class Node extends NavigationContainer
- {
-
- /** . */
- private final String uri;
-
- /** . */
- private final String label;
-
- /** . */
- private final String icon;
-
- /** . */
- private final String name;
-
- /** . */
- private final Date startPublicationDate;
-
- /** . */
- private final Date endPublicationDate;
-
- /** . */
- private final boolean showPublicationDate;
-
- /** . */
- private final boolean visible;
-
- /** . */
- private final String pageReference;
-
- public Node(
- String uri,
- String label,
- String icon,
- String name,
- Date startPublicationDate,
- Date endPublicationDate,
- Boolean showPublicationDate,
- Boolean visible,
- String pageReference,
- List<NavigationContainer.Node> children)
- {
- this(null, uri, label, icon, name, startPublicationDate, endPublicationDate,
showPublicationDate, visible, pageReference, children);
- }
-
- public Node(
- String storageId,
- String uri,
- String label,
- String icon,
- String name,
- Date startPublicationDate,
- Date endPublicationDate,
- Boolean showPublicationDate,
- Boolean visible,
- String pageReference,
- List<NavigationContainer.Node> children)
- {
- super(storageId, children);
-
- //
- this.uri = uri;
- this.label = label;
- this.icon = icon;
- this.name = name;
- this.startPublicationDate = startPublicationDate;
- this.endPublicationDate = endPublicationDate;
- this.showPublicationDate = showPublicationDate != null ? showPublicationDate :
false;
- this.visible = visible != null ? visible : true;
- this.pageReference = pageReference;
- }
- public String getURI()
- {
- return uri;
- }
-
- public String getLabel()
- {
- return label;
- }
-
- public String getIcon()
- {
- return icon;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Date getStartPublicationDate()
- {
- return startPublicationDate;
- }
-
- public Date getEndPublicationDate()
- {
- return endPublicationDate;
- }
-
- public boolean getShowPublicationDate()
- {
- return showPublicationDate;
- }
-
- public boolean isVisible()
- {
- return visible;
- }
-
- public String getPageReference()
- {
- return pageReference;
- }
- }
-
- public static class Page extends NavigationContainer
- {
-
- /** . */
- private final NavigationKey key;
-
- /** . */
- private final String description;
-
- /** . */
- private final String creator;
-
- /** . */
- private final String modifier;
-
- /** . */
- private final int priority;
-
- public Page(
- String ownerType,
- String ownerId,
- String description,
- String creator,
- String modifier,
- Integer priority,
- List<NavigationContainer.Node> children)
- {
- this(null, ownerType, ownerId, description, creator, modifier, priority,
children);
- }
-
- public Page(
- String storageId,
- String ownerType,
- String ownerId,
- String description,
- String creator,
- String modifier,
- Integer priority,
- List<NavigationContainer.Node> children)
- {
- super(storageId, children);
-
- //
- if (ownerType == null)
- {
- throw new NullPointerException("No null owner type");
- }
- if (ownerId == null)
- {
- throw new NullPointerException("No null owner id");
- }
-
- //
- this.key = new NavigationKey(ownerType, ownerId);
- this.description = description;
- this.creator = creator;
- this.modifier = modifier;
- this.priority = priority != null ? priority : 1;
- }
-
- public NavigationKey getKey()
- {
- return key;
- }
-
- public String getOwnerType()
- {
- return key.getOwnerType();
- }
-
- public String getOwnerId()
- {
- return key.getOwnerId();
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public String getCreator()
- {
- return creator;
- }
-
- public String getModifier()
- {
- return modifier;
- }
-
- public int getPriority()
- {
- return priority;
- }
- }
-
-
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.util.List;
+
+/**
+* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+* @version $Revision$
+*/
+public class NavigationData extends NavigationNodeContainerData
+{
+
+ /** . */
+ private final NavigationKey key;
+
+ /** . */
+ private final String description;
+
+ /** . */
+ private final String creator;
+
+ /** . */
+ private final String modifier;
+
+ /** . */
+ private final int priority;
+
+ public NavigationData(
+ String ownerType,
+ String ownerId,
+ String description,
+ String creator,
+ String modifier,
+ Integer priority,
+ List<NavigationNodeData> children)
+ {
+ this(null, ownerType, ownerId, description, creator, modifier, priority,
children);
+ }
+
+ public NavigationData(
+ String storageId,
+ String ownerType,
+ String ownerId,
+ String description,
+ String creator,
+ String modifier,
+ Integer priority,
+ List<NavigationNodeData> children)
+ {
+ super(storageId, children);
+
+ //
+ if (ownerType == null)
+ {
+ throw new NullPointerException("No null owner type");
+ }
+ if (ownerId == null)
+ {
+ throw new NullPointerException("No null owner id");
+ }
+
+ //
+ this.key = new NavigationKey(ownerType, ownerId);
+ this.description = description;
+ this.creator = creator;
+ this.modifier = modifier;
+ this.priority = priority != null ? priority : 1;
+ }
+
+ public NavigationKey getKey()
+ {
+ return key;
+ }
+
+ public String getOwnerType()
+ {
+ return key.getOwnerType();
+ }
+
+ public String getOwnerId()
+ {
+ return key.getOwnerId();
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public String getCreator()
+ {
+ return creator;
+ }
+
+ public String getModifier()
+ {
+ return modifier;
+ }
+
+ public int getPriority()
+ {
+ return priority;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationKey.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.pom.config.Utils;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class NavigationKey extends OwnerKey
-{
-
- public NavigationKey(String ownerType, String ownerId)
- {
- super(ownerType, ownerId);
- }
-
- public static NavigationKey create(String compositeId)
- {
- if (compositeId == null)
- {
- throw new NullPointerException();
- }
- String[] components = Utils.split("::", compositeId);
- if (components.length != 2)
- {
- throw new IllegalArgumentException("Wrong navigation id key format " +
compositeId);
- }
- return new NavigationKey(components[0], components[1]);
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationKey.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.pom.config.Utils;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class NavigationKey extends OwnerKey
+{
+
+ public NavigationKey(String ownerType, String ownerId)
+ {
+ super(ownerType, ownerId);
+ }
+
+ public static NavigationKey create(String compositeId)
+ {
+ if (compositeId == null)
+ {
+ throw new NullPointerException();
+ }
+ String[] components = Utils.split("::", compositeId);
+ if (components.length != 2)
+ {
+ throw new IllegalArgumentException("Wrong navigation id key format " +
compositeId);
+ }
+ return new NavigationKey(components[0], components[1]);
+ }
+}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeContainerData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeContainerData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeContainerData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeContainerData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.pom.data.ModelData;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class NavigationNodeContainerData extends ModelData
+{
+
+ /** . */
+ private final List<NavigationNodeData> nodes;
+
+ public NavigationNodeContainerData(String storageId, List<NavigationNodeData>
nodes)
+ {
+ super(storageId, null);
+
+ //
+ this.nodes = nodes;
+ }
+
+ public List<NavigationNodeData> getNodes()
+ {
+ return nodes;
+ }
+}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/NavigationNodeData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/NavigationNodeData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+* @version $Revision$
+*/
+public class NavigationNodeData extends NavigationNodeContainerData
+{
+
+ /** . */
+ private final String uri;
+
+ /** . */
+ private final String label;
+
+ /** . */
+ private final String icon;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final Date startPublicationDate;
+
+ /** . */
+ private final Date endPublicationDate;
+
+ /** . */
+ private final boolean showPublicationDate;
+
+ /** . */
+ private final boolean visible;
+
+ /** . */
+ private final String pageReference;
+
+ public NavigationNodeData(
+ String uri,
+ String label,
+ String icon,
+ String name,
+ Date startPublicationDate,
+ Date endPublicationDate,
+ Boolean showPublicationDate,
+ Boolean visible,
+ String pageReference,
+ List<NavigationNodeData> children)
+ {
+ this(null, uri, label, icon, name, startPublicationDate, endPublicationDate,
showPublicationDate, visible, pageReference, children);
+ }
+
+ public NavigationNodeData(
+ String storageId,
+ String uri,
+ String label,
+ String icon,
+ String name,
+ Date startPublicationDate,
+ Date endPublicationDate,
+ Boolean showPublicationDate,
+ Boolean visible,
+ String pageReference,
+ List<NavigationNodeData> children)
+ {
+ super(storageId, children);
+
+ //
+ this.uri = uri;
+ this.label = label;
+ this.icon = icon;
+ this.name = name;
+ this.startPublicationDate = startPublicationDate;
+ this.endPublicationDate = endPublicationDate;
+ this.showPublicationDate = showPublicationDate != null ? showPublicationDate :
false;
+ this.visible = visible != null ? visible : true;
+ this.pageReference = pageReference;
+ }
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public String getIcon()
+ {
+ return icon;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Date getStartPublicationDate()
+ {
+ return startPublicationDate;
+ }
+
+ public Date getEndPublicationDate()
+ {
+ return endPublicationDate;
+ }
+
+ public boolean getShowPublicationDate()
+ {
+ return showPublicationDate;
+ }
+
+ public boolean isVisible()
+ {
+ return visible;
+ }
+
+ public String getPageReference()
+ {
+ return pageReference;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/OwnerKey.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class OwnerKey implements Serializable
-{
-
- /** . */
- private final String ownerType;
-
- /** . */
- private final String ownerId;
-
- public OwnerKey(String ownerType, String ownerId)
- {
- if (ownerType == null)
- {
- throw new NullPointerException();
- }
- if (ownerId == null)
- {
- throw new NullPointerException();
- }
- this.ownerType = ownerType;
- this.ownerId = ownerId;
- }
-
- public String getOwnerType()
- {
- return ownerType;
- }
-
- public String getOwnerId()
- {
- return ownerId;
- }
-
- @Override
- public int hashCode()
- {
- return ownerId.hashCode() ^ ownerType.hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof OwnerKey)
- {
- OwnerKey that = (OwnerKey)obj;
- return ownerType.equals(that.ownerType) &&
ownerId.equals(that.ownerId);
- }
- return false;
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/OwnerKey.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class OwnerKey implements Serializable
+{
+
+ /** . */
+ private final String ownerType;
+
+ /** . */
+ private final String ownerId;
+
+ public OwnerKey(String ownerType, String ownerId)
+ {
+ if (ownerType == null)
+ {
+ throw new NullPointerException();
+ }
+ if (ownerId == null)
+ {
+ throw new NullPointerException();
+ }
+ this.ownerType = ownerType;
+ this.ownerId = ownerId;
+ }
+
+ public String getOwnerType()
+ {
+ return ownerType;
+ }
+
+ public String getOwnerId()
+ {
+ return ownerId;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ownerId.hashCode() ^ ownerType.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof OwnerKey)
+ {
+ OwnerKey that = (OwnerKey)obj;
+ return ownerType.equals(that.ownerType) &&
ownerId.equals(that.ownerId);
+ }
+ return false;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PageData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class PageData extends ContainerData
-{
-
- /** . */
- private final PageKey key;
-
- /** . */
- private final String editPermission;
-
- /** . */
- private final boolean showMaxWindow;
-
- /** . */
- private final String creator;
-
- /** . */
- private final String modifier;
-
- public PageData(
- String storageId,
- String id,
- String name,
- String icon,
- String decorator,
- String template,
- String factoryId,
- String title,
- String description,
- String width,
- String height,
- List<String> accessPermissions,
- List<ComponentData> children,
- String ownerType,
- String ownerId,
- String editPermission,
- boolean showMaxWindow,
- String creator,
- String modifier)
- {
- super(storageId, id, name, icon, decorator, template, factoryId, title,
description, width, height, accessPermissions, children);
-
- //
- this.key = new PageKey(ownerType, ownerId, name);
- this.editPermission = editPermission;
- this.showMaxWindow = showMaxWindow;
- this.creator = creator;
- this.modifier = modifier;
- }
-
- public PageKey getKey()
- {
- return key;
- }
-
- public String getOwnerType()
- {
- return key.getOwnerType();
- }
-
- public String getOwnerId()
- {
- return key.getOwnerId();
- }
-
- public String getEditPermission()
- {
- return editPermission;
- }
-
- public boolean isShowMaxWindow()
- {
- return showMaxWindow;
- }
-
- public String getCreator()
- {
- return creator;
- }
-
- public String getModifier()
- {
- return modifier;
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PageData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class PageData extends ContainerData
+{
+
+ /** . */
+ private final PageKey key;
+
+ /** . */
+ private final String editPermission;
+
+ /** . */
+ private final boolean showMaxWindow;
+
+ /** . */
+ private final String creator;
+
+ /** . */
+ private final String modifier;
+
+ public PageData(
+ String storageId,
+ String id,
+ String name,
+ String icon,
+ String decorator,
+ String template,
+ String factoryId,
+ String title,
+ String description,
+ String width,
+ String height,
+ List<String> accessPermissions,
+ List<ComponentData> children,
+ String ownerType,
+ String ownerId,
+ String editPermission,
+ boolean showMaxWindow,
+ String creator,
+ String modifier)
+ {
+ super(storageId, id, name, icon, decorator, template, factoryId, title,
description, width, height, accessPermissions, children);
+
+ //
+ this.key = new PageKey(ownerType, ownerId, name);
+ this.editPermission = editPermission;
+ this.showMaxWindow = showMaxWindow;
+ this.creator = creator;
+ this.modifier = modifier;
+ }
+
+ public PageKey getKey()
+ {
+ return key;
+ }
+
+ public String getOwnerType()
+ {
+ return key.getOwnerType();
+ }
+
+ public String getOwnerId()
+ {
+ return key.getOwnerId();
+ }
+
+ public String getEditPermission()
+ {
+ return editPermission;
+ }
+
+ public boolean isShowMaxWindow()
+ {
+ return showMaxWindow;
+ }
+
+ public String getCreator()
+ {
+ return creator;
+ }
+
+ public String getModifier()
+ {
+ return modifier;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PageKey.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.pom.config.Utils;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class PageKey extends OwnerKey
-{
-
- /** . */
- private final String name;
-
- public PageKey(String ownerType, String ownerId, String name)
- {
- super(ownerType, ownerId);
-
- //
- if (name == null)
- {
- throw new NullPointerException();
- }
-
- //
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- @Override
- public int hashCode()
- {
- return super.hashCode() ^ name.hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof PageKey)
- {
- PageKey that = (PageKey)obj;
- return super.equals(that) &&name.equals(that.name);
- }
- return false;
- }
-
- public static PageKey create(String compositeId)
- {
- if (compositeId == null)
- {
- throw new NullPointerException();
- }
- String[] components = Utils.split("::", compositeId);
- if (components.length != 3)
- {
- throw new IllegalArgumentException("Wrong page id key format " +
compositeId);
- }
- return new PageKey(components[0], components[1], components[2]);
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PageKey.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PageKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.pom.config.Utils;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class PageKey extends OwnerKey
+{
+
+ /** . */
+ private final String name;
+
+ public PageKey(String ownerType, String ownerId, String name)
+ {
+ super(ownerType, ownerId);
+
+ //
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+
+ //
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return super.hashCode() ^ name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof PageKey)
+ {
+ PageKey that = (PageKey)obj;
+ return super.equals(that) &&name.equals(that.name);
+ }
+ return false;
+ }
+
+ public static PageKey create(String compositeId)
+ {
+ if (compositeId == null)
+ {
+ throw new NullPointerException();
+ }
+ String[] components = Utils.split("::", compositeId);
+ if (components.length != 3)
+ {
+ throw new IllegalArgumentException("Wrong page id key format " +
compositeId);
+ }
+ return new PageKey(components[0], components[1], components[2]);
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PortalData.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class PortalData extends ModelData
-{
-
- /** . */
- private final PortalKey key;
-
- /** . */
- private final String locale;
-
- /** . */
- private final List<String> accessPermissions;
-
- /** . */
- private final String editPermission;
-
- /** . */
- private final Map<String, String> properties;
-
- /** . */
- private final String skin;
-
- /** . */
- private final String title;
-
- /** . */
- private final ContainerData portalLayout;
-
- /** . */
- private final String creator;
-
- /** . */
- private final String modifier;
-
- public PortalData(
- String storageId,
- String name,
- String type,
- String locale,
- List<String> accessPermissions,
- String editPermission,
- Map<String, String> properties,
- String skin,
- String title,
- ContainerData portalLayout,
- String creator,
- String modifier)
- {
- super(storageId, null);
-
- //
- this.key = new PortalKey(type, name);
- this.locale = locale;
- this.accessPermissions = accessPermissions;
- this.editPermission = editPermission;
- this.properties = properties;
- this.skin = skin;
- this.title = title;
- this.portalLayout = portalLayout;
- this.creator = creator;
- this.modifier = modifier;
- }
-
- public PortalKey getKey()
- {
- return key;
- }
-
- public String getName()
- {
- return key.getOwnerId();
- }
-
- public String getType()
- {
- return key.getOwnerType();
- }
-
- public String getLocale()
- {
- return locale;
- }
-
- public List<String> getAccessPermissions()
- {
- return accessPermissions;
- }
-
- public String getEditPermission()
- {
- return editPermission;
- }
-
- public Map<String, String> getProperties()
- {
- return properties;
- }
-
- public String getSkin()
- {
- return skin;
- }
-
- public String getTitle()
- {
- return title;
- }
-
- public ContainerData getPortalLayout()
- {
- return portalLayout;
- }
-
- public String getCreator()
- {
- return creator;
- }
-
- public String getModifier()
- {
- return modifier;
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PortalData.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalData.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class PortalData extends ModelData
+{
+
+ /** . */
+ private final PortalKey key;
+
+ /** . */
+ private final String locale;
+
+ /** . */
+ private final List<String> accessPermissions;
+
+ /** . */
+ private final String editPermission;
+
+ /** . */
+ private final Map<String, String> properties;
+
+ /** . */
+ private final String skin;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final ContainerData portalLayout;
+
+ /** . */
+ private final String creator;
+
+ /** . */
+ private final String modifier;
+
+ public PortalData(
+ String storageId,
+ String name,
+ String type,
+ String locale,
+ List<String> accessPermissions,
+ String editPermission,
+ Map<String, String> properties,
+ String skin,
+ String title,
+ ContainerData portalLayout,
+ String creator,
+ String modifier)
+ {
+ super(storageId, null);
+
+ //
+ this.key = new PortalKey(type, name);
+ this.locale = locale;
+ this.accessPermissions = accessPermissions;
+ this.editPermission = editPermission;
+ this.properties = properties;
+ this.skin = skin;
+ this.title = title;
+ this.portalLayout = portalLayout;
+ this.creator = creator;
+ this.modifier = modifier;
+ }
+
+ public PortalKey getKey()
+ {
+ return key;
+ }
+
+ public String getName()
+ {
+ return key.getOwnerId();
+ }
+
+ public String getType()
+ {
+ return key.getOwnerType();
+ }
+
+ public String getLocale()
+ {
+ return locale;
+ }
+
+ public List<String> getAccessPermissions()
+ {
+ return accessPermissions;
+ }
+
+ public String getEditPermission()
+ {
+ return editPermission;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ public String getSkin()
+ {
+ return skin;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public ContainerData getPortalLayout()
+ {
+ return portalLayout;
+ }
+
+ public String getCreator()
+ {
+ return creator;
+ }
+
+ public String getModifier()
+ {
+ return modifier;
+ }
+}
Deleted:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PortalKey.java 2009-10-24
07:50:41 UTC (rev 412)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.portal.pom.config.data;
-
-import org.exoplatform.portal.pom.config.Utils;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class PortalKey extends OwnerKey
-{
-
- public PortalKey(String ownerType, String ownerId)
- {
- super(ownerType, ownerId);
- }
-
- public static PortalKey create(String compositeId)
- {
- if (compositeId == null)
- {
- throw new NullPointerException();
- }
- String[] components = Utils.split("::", compositeId);
- if (components.length != 2)
- {
- throw new IllegalArgumentException("Wrong navigation id key format " +
compositeId);
- }
- return new PortalKey(components[0], components[1]);
- }
-}
Copied:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java
(from rev 413,
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/data/PortalKey.java)
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/data/PortalKey.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.data;
+
+import org.exoplatform.portal.pom.config.Utils;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class PortalKey extends OwnerKey
+{
+
+ public PortalKey(String ownerType, String ownerId)
+ {
+ super(ownerType, ownerId);
+ }
+
+ public static PortalKey create(String compositeId)
+ {
+ if (compositeId == null)
+ {
+ throw new NullPointerException();
+ }
+ String[] components = Utils.split("::", compositeId);
+ if (components.length != 2)
+ {
+ throw new IllegalArgumentException("Wrong navigation id key format " +
compositeId);
+ }
+ return new PortalKey(components[0], components[1]);
+ }
+}
Modified:
portal/branches/performance/component/portal/src/test/java/conf/portal/test-configuration.xml
===================================================================
---
portal/branches/performance/component/portal/src/test/java/conf/portal/test-configuration.xml 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/component/portal/src/test/java/conf/portal/test-configuration.xml 2009-10-24
08:32:00 UTC (rev 414)
@@ -28,7 +28,7 @@
<type>org.exoplatform.portal.pom.config.POMSessionManager</type>
</component>
<component>
- <key>org.exoplatform.portal.pom.config.data.ModelDataStorage</key>
+ <key>org.exoplatform.portal.pom.data.ModelDataStorage</key>
<type>org.exoplatform.portal.pom.config.POMDataStorage</type>
</component>
<component>
Modified:
portal/branches/performance/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
---
portal/branches/performance/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2009-10-24
08:32:00 UTC (rev 414)
@@ -31,7 +31,7 @@
</component>
<component>
- <key>org.exoplatform.portal.pom.config.data.ModelDataStorage</key>
+ <key>org.exoplatform.portal.pom.data.ModelDataStorage</key>
<type>org.exoplatform.portal.pom.config.POMDataStorage</type>
</component>
Modified:
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
---
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -29,7 +29,6 @@
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.data.PortalData;
import org.exoplatform.portal.webui.application.UIGadget;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.navigation.PageNavigationUtils;
Modified:
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -25,7 +25,6 @@
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.data.PortalData;
import org.exoplatform.portal.config.model.PortalProperties;
import org.exoplatform.portal.skin.SkinService;
import org.exoplatform.portal.webui.util.Util;
Modified:
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalSelector.java
===================================================================
---
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalSelector.java 2009-10-24
08:22:11 UTC (rev 413)
+++
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalSelector.java 2009-10-24
08:32:00 UTC (rev 414)
@@ -24,7 +24,7 @@
import org.exoplatform.portal.config.Query;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.data.PortalData;
+import org.exoplatform.portal.pom.data.PortalData;
import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.webui.config.annotation.ComponentConfig;