Author: julien_viet
Date: 2009-11-11 15:51:06 -0500 (Wed, 11 Nov 2009)
New Revision: 572
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
Log:
- re enable commented dashboard unit test (by me, forgot to uncomment)
- start to test again the model changes returned by the mop portal layer to use it for
cache eviction
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -22,14 +22,12 @@
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.POMTask;
import java.util.Comparator;
import java.util.List;
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -24,7 +24,7 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -23,7 +23,7 @@
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
Deleted:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -1,81 +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.config.model;
-
-import org.exoplatform.portal.pom.data.ModelData;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public abstract class ModelChange
-{
-
- public static class Create extends ModelChange
- {
-
- /** . */
- private final ModelData object;
-
- public Create(ModelData object)
- {
- this.object = object;
- }
-
- public ModelData getObject()
- {
- return object;
- }
- }
-
- public static class Update extends ModelChange
- {
-
- /** . */
- private final ModelData object;
-
- public Update(ModelData object)
- {
- this.object = object;
- }
-
- public ModelData getObject()
- {
- return object;
- }
- }
-
- public static class Destroy extends ModelChange
- {
-
- /** . */
- private final String objectId;
-
- public Destroy(String objectId)
- {
- this.objectId = objectId;
- }
-
- public String getObjectId()
- {
- return objectId;
- }
- }
-}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -28,7 +28,7 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.pom.config.cache.DataCache;
import org.exoplatform.portal.pom.config.tasks.DashboardTask;
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -22,9 +22,9 @@
import org.exoplatform.portal.pom.config.cache.DataAccessMode;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
import org.exoplatform.portal.pom.data.Mapper;
+import org.exoplatform.portal.pom.data.ModelChange;
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.data.PageKey;
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -23,7 +23,7 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.PersistentApplicationState;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
Copied:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java
(from rev 558,
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java)
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -0,0 +1,79 @@
+/**
+ * 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 ModelChange
+{
+
+ public static class Create extends ModelChange
+ {
+
+ /** . */
+ private final ModelData object;
+
+ public Create(ModelData object)
+ {
+ this.object = object;
+ }
+
+ public ModelData getObject()
+ {
+ return object;
+ }
+ }
+
+ public static class Update extends ModelChange
+ {
+
+ /** . */
+ private final ModelData object;
+
+ public Update(ModelData object)
+ {
+ this.object = object;
+ }
+
+ public ModelData getObject()
+ {
+ return object;
+ }
+ }
+
+ public static class Destroy extends ModelChange
+ {
+
+ /** . */
+ private final String objectId;
+
+ public Destroy(String objectId)
+ {
+ this.objectId = objectId;
+ }
+
+ public String getObjectId()
+ {
+ return objectId;
+ }
+ }
+}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -23,13 +23,10 @@
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.ApplicationType;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.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;
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-11
17:48:34 UTC (rev 571)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-11
20:51:06 UTC (rev 572)
@@ -29,7 +29,7 @@
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -321,17 +321,17 @@
List<ModelChange> changes = storage_.save(page);
assertEquals(6, changes.size());
ModelChange.Update c0 = (ModelChange.Update)changes.get(0);
-// assertSame(page, c0.getObject());
+ assertSame(page.getStorageId(), c0.getObject().getStorageId());
ModelChange.Update c1 = (ModelChange.Update)changes.get(1);
-// assertSame(page.getChildren().get(0), c1.getObject());
+ assertSame(page.getChildren().get(0).getStorageId(),
c1.getObject().getStorageId());
ModelChange.Update c2 = (ModelChange.Update)changes.get(2);
-// assertSame(page.getChildren().get(1), c2.getObject());
+ assertSame(page.getChildren().get(1).getStorageId(),
c2.getObject().getStorageId());
ModelChange.Update c3 = (ModelChange.Update)changes.get(3);
-// assertSame(container.getChildren().get(0), c3.getObject());
+ assertSame(container.getChildren().get(0).getStorageId(),
c3.getObject().getStorageId());
ModelChange.Create c4 = (ModelChange.Create)changes.get(4);
-// assertSame(container.getChildren().get(1), c4.getObject());
+ assertSame(container.getChildren().get(1).getStorageId(),
c4.getObject().getStorageId());
ModelChange.Update c5 = (ModelChange.Update)changes.get(5);
-// assertSame(container.getChildren().get(2), c5.getObject());
+ assertSame(container.getChildren().get(2).getStorageId(),
c5.getObject().getStorageId());
// Check it is existing at the correct location
// and also that the ids are still the same
@@ -432,7 +432,7 @@
// assertEquals(banner2.getInstanceId(), banner1.getInstanceId());
}
- public void _testDashboard() throws Exception
+ public void testDashboard() throws Exception
{
Page page = new Page();
page.setPageId("portal::test::foo");
@@ -470,7 +470,7 @@
assertEquals("foo/bar", storage_.getId(app.getState()));
}
- public void _testDashboardLayout() throws Exception
+ public void testDashboardLayout() throws Exception
{
Application<Portlet> dashboardPortlet =
Application.createPortletApplication();
ApplicationState<Portlet> state = new
TransientApplicationState<Portlet>("dashboard/DashboardPortlet");
@@ -498,7 +498,7 @@
assertEquals(3, dashboard.getChildren().size());
}
- public void _testDashboardMoveRight() throws Exception
+ public void testDashboardMoveRight() throws Exception
{
Page page = new Page();
page.setPageId("portal::test::foo");
@@ -542,7 +542,7 @@
assertEquals("foo", storage_.getId(gadgetApp.getState()));
}
- public void _testDashboardMoveLeft() throws Exception
+ public void testDashboardMoveLeft() throws Exception
{
Page page = new Page();
page.setPageId("portal::test::foo");