Author: julien_viet
Date: 2009-11-24 11:13:25 -0500 (Tue, 24 Nov 2009)
New Revision: 791
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java
Modified:
portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.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/spi/gadget/GadgetContentProvider.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
portal/trunk/component/scripting/pom.xml
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
Log:
- update to mop 1.0.0-Beta10
- update to Chromattic 1.0.0-beta8
- update to Reflext 1.0.0-beta4
- added version property for Groovy, Rhino, SLF4J
Modified: portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml
===================================================================
---
portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml 2009-11-24
16:13:25 UTC (rev 791)
@@ -91,6 +91,46 @@
</propertyDefinitions>
</nodeType>
+ <nodeType name="mop:portletpreferences" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="mop:portletpreference" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY" protected="false"
sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:portletpreference</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:portletpreference" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="readonly" requiredType="Boolean"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:gadget" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="prefs" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
<nodeType name="mop:wsrpstate" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>mop:customizationstate</supertype>
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -24,7 +24,7 @@
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.jdbc.GroupDAOImpl;
+import org.exoplatform.services.organization.GroupHandler;
/**
* Created by The eXo Platform SARL
@@ -32,11 +32,11 @@
* tung.pham(a)exoplatform.com
* Jul 31, 2007
*/
-public class RemoveGroupPortalConfigListener extends Listener<GroupDAOImpl, Group>
+public class RemoveGroupPortalConfigListener extends Listener<GroupHandler, Group>
{
@Override
- public void onEvent(Event<GroupDAOImpl, Group> event) throws Exception
+ public void onEvent(Event<GroupHandler, Group> event) throws Exception
{
Group group = event.getData();
ExoContainer container = ExoContainerContext.getCurrentContainer();
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -24,7 +24,7 @@
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
import org.exoplatform.services.organization.User;
-import org.exoplatform.services.organization.jdbc.UserDAOImpl;
+import org.exoplatform.services.organization.UserHandler;
/**
* Created by The eXo Platform SARL
@@ -32,11 +32,11 @@
* tung.pham(a)exoplatform.com
* Aug 1, 2007
*/
-public class RemoveUserPortalConfigListener extends Listener<UserDAOImpl, User>
+public class RemoveUserPortalConfigListener extends Listener<UserHandler, User>
{
@Override
- public void onEvent(Event<UserDAOImpl, User> event) throws Exception
+ public void onEvent(Event<UserHandler, User> event) throws Exception
{
User user = event.getData();
ExoContainer container = ExoContainerContext.getCurrentContainer();
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -19,61 +19,19 @@
package org.exoplatform.portal.pom.config;
-import org.chromattic.api.ChromatticBuilder;
import org.chromattic.api.ChromatticSession;
-import org.chromattic.apt.InstrumentorImpl;
-import org.exoplatform.portal.pom.registry.CategoryDefinition;
-import org.exoplatform.portal.pom.registry.ContentDefinition;
-import org.exoplatform.portal.pom.registry.ContentRegistry;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-import org.exoplatform.portal.pom.spi.gadget.GadgetContentProvider;
-import org.exoplatform.portal.pom.spi.gadget.GadgetState;
-import org.exoplatform.portal.pom.spi.portlet.Portlet;
-import org.exoplatform.portal.pom.spi.portlet.PortletContentProvider;
-import org.exoplatform.portal.pom.spi.portlet.PreferenceState;
-import org.exoplatform.portal.pom.spi.portlet.PortletState;
-import org.exoplatform.portal.pom.spi.wsrp.WSRP;
-import org.exoplatform.portal.pom.spi.wsrp.WSRPContentProvider;
-import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.ExoCache;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.ext.registry.RegistryService;
import org.gatein.mop.core.api.MOPService;
-import org.gatein.mop.core.api.content.ContentManagerRegistry;
-import org.gatein.mop.core.api.content.CustomizationContextProviderRegistry;
-import org.gatein.mop.core.api.workspace.GroupSite;
-import org.gatein.mop.core.api.workspace.GroupSiteContainer;
-import org.gatein.mop.core.api.workspace.NavigationContainer;
-import org.gatein.mop.core.api.workspace.NavigationImpl;
-import org.gatein.mop.core.api.workspace.PageContainer;
-import org.gatein.mop.core.api.workspace.PageImpl;
-import org.gatein.mop.core.api.workspace.PageLinkImpl;
-import org.gatein.mop.core.api.workspace.PortalSite;
-import org.gatein.mop.core.api.workspace.PortalSiteContainer;
-import org.gatein.mop.core.api.workspace.UIBodyImpl;
-import org.gatein.mop.core.api.workspace.UIContainerImpl;
-import org.gatein.mop.core.api.workspace.UIWindowImpl;
-import org.gatein.mop.core.api.workspace.URLLinkImpl;
-import org.gatein.mop.core.api.workspace.UserSite;
-import org.gatein.mop.core.api.workspace.UserSiteContainer;
-import org.gatein.mop.core.api.workspace.WorkspaceImpl;
-import org.gatein.mop.core.api.workspace.content.ContextSpecialization;
-import org.gatein.mop.core.api.workspace.content.ContextType;
-import org.gatein.mop.core.api.workspace.content.ContextTypeContainer;
-import org.gatein.mop.core.api.workspace.content.CustomizationContainer;
-import org.gatein.mop.core.api.workspace.content.WorkspaceClone;
-import org.gatein.mop.core.api.workspace.content.WorkspaceSpecialization;
import javax.jcr.Credentials;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.Set;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
@@ -146,91 +104,20 @@
{
if (pomService == null)
{
+ PortalMOPService mopService = new PortalMOPService();
+
+ //
try
{
- MOPService pomService = new MOPService();
- pomService.setOption(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME,
PortalSessionLifeCycle.class.getName());
- pomService.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
InstrumentorImpl.class.getName());
-
- //
- Field chromeField = MOPService.class.getDeclaredField("chrome");
- Field builderField = MOPService.class.getDeclaredField("builder");
- Field contentManagerRegistryField =
MOPService.class.getDeclaredField("contentManagerRegistry");
- Field customizationContextResolversField =
-
MOPService.class.getDeclaredField("customizationContextResolvers");
- chromeField.setAccessible(true);
- builderField.setAccessible(true);
- contentManagerRegistryField.setAccessible(true);
- customizationContextResolversField.setAccessible(true);
-
- // Perform a manual start of the MOPService until the real .start() is
cleaned in a new beta
- ChromatticBuilder builder = (ChromatticBuilder)builderField.get(pomService);
-
- //
- Field classesField =
ChromatticBuilder.class.getDeclaredField("classes");
- classesField.setAccessible(true);
- Set<Class<?>> classes =
(Set<Class<?>>)classesField.get(builder);
- classes.clear();
-
- //
- builder.add(WorkspaceImpl.class);
- builder.add(UIContainerImpl.class);
- builder.add(UIWindowImpl.class);
- builder.add(UIBodyImpl.class);
- builder.add(PageImpl.class);
- builder.add(PageContainer.class);
- builder.add(NavigationImpl.class);
- builder.add(NavigationContainer.class);
- builder.add(PageLinkImpl.class);
- builder.add(URLLinkImpl.class);
- builder.add(PortalSiteContainer.class);
- builder.add(PortalSite.class);
- builder.add(GroupSiteContainer.class);
- builder.add(GroupSite.class);
- builder.add(UserSiteContainer.class);
- builder.add(UserSite.class);
-
- //
- builder.add(CustomizationContainer.class);
- builder.add(ContextTypeContainer.class);
- builder.add(ContextType.class);
- builder.add(ContextSpecialization.class);
- builder.add(WorkspaceClone.class);
- builder.add(WorkspaceSpecialization.class);
-
- //
- builder.add(PortletState.class);
- builder.add(PreferenceState.class);
- builder.add(GadgetState.class);
- builder.add(WSRPState.class);
-
- //
- builder.add(ContentRegistry.class);
- builder.add(CategoryDefinition.class);
- builder.add(ContentDefinition.class);
-
- //
- CustomizationContextProviderRegistry customizationContextResolvers =
- new CustomizationContextProviderRegistry();
-
- //
- ContentManagerRegistry contentManagerRegistry = new
ContentManagerRegistry();
- contentManagerRegistry.register(Portlet.CONTENT_TYPE, new
PortletContentProvider());
- contentManagerRegistry.register(Gadget.CONTENT_TYPE, new
GadgetContentProvider());
- contentManagerRegistry.register(WSRP.CONTENT_TYPE, new
WSRPContentProvider());
-
- //
- chromeField.set(pomService, builder.build());
- contentManagerRegistryField.set(pomService, contentManagerRegistry);
- customizationContextResolversField.set(pomService,
customizationContextResolvers);
-
- //
- this.pomService = pomService;
+ mopService.start();
}
catch (Exception e)
{
- throw new UndeclaredThrowableException(e);
+ throw new RuntimeException(e);
}
+
+ //
+ this.pomService = mopService;
}
return pomService;
}
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java
(rev 0)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -0,0 +1,69 @@
+/*
+ * 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;
+
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.apt.InstrumentorImpl;
+import org.exoplatform.portal.pom.registry.CategoryDefinition;
+import org.exoplatform.portal.pom.registry.ContentDefinition;
+import org.exoplatform.portal.pom.registry.ContentRegistry;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
+import org.exoplatform.portal.pom.spi.gadget.GadgetContentProvider;
+import org.exoplatform.portal.pom.spi.gadget.GadgetState;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.portlet.PortletContentProvider;
+import org.exoplatform.portal.pom.spi.portlet.PortletState;
+import org.exoplatform.portal.pom.spi.portlet.PreferenceState;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
+import org.exoplatform.portal.pom.spi.wsrp.WSRPContentProvider;
+import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
+import org.gatein.mop.core.api.MOPService;
+import org.gatein.mop.core.api.content.ContentManagerRegistry;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class PortalMOPService extends MOPService
+{
+
+ @Override
+ protected void configure(ChromatticBuilder builder)
+ {
+ builder.setOption(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME,
PortalSessionLifeCycle.class.getName());
+ builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
InstrumentorImpl.class.getName());
+
+ //
+ builder.add(PortletState.class);
+ builder.add(PreferenceState.class);
+ builder.add(GadgetState.class);
+ builder.add(WSRPState.class);
+
+ //
+ builder.add(ContentRegistry.class);
+ builder.add(CategoryDefinition.class);
+ builder.add(ContentDefinition.class);
+ }
+
+ @Override
+ protected void configure(ContentManagerRegistry registry)
+ {
+ registry.register(Portlet.CONTENT_TYPE, new PortletContentProvider());
+ registry.register(Gadget.CONTENT_TYPE, new GadgetContentProvider());
+ registry.register(WSRP.CONTENT_TYPE, new WSRPContentProvider());
+ }
+}
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-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -216,6 +216,7 @@
}
//
+ final List<String> orders = new ArrayList<String>();
Set<String> savedSet = new HashSet<String>();
for (NavigationNodeData node : src.getNodes())
{
@@ -236,6 +237,7 @@
}
save(node, dstChild);
savedSet.add(srcId);
+ orders.add(dstChild.getObjectId());
}
for (Iterator<? extends Navigation> i = dst.getChildren().iterator();
i.hasNext();)
{
@@ -245,6 +247,22 @@
i.remove();
}
}
+ // 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
+ Navigation[] a = dst.getChildren().toArray(new
Navigation[dst.getChildren().size()]);
+ Arrays.sort(a, new Comparator<Navigation>()
+ {
+ public int compare(Navigation o1, Navigation 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.getChildren().add(j, a[j]);
+ }
}
public PortalData load(Site src)
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.util.List;
@@ -34,11 +33,6 @@
public class GadgetContentProvider implements ContentProvider<Gadget>,
HelpableContentProvider<GadgetState, Gadget>
{
- public GetState<Gadget> getState(String contentId)
- {
- throw new UnsupportedOperationException();
- }
-
public Gadget combine(List<Gadget> states)
{
throw new UnsupportedOperationException();
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.util.HashMap;
@@ -41,11 +40,6 @@
{
}
- public GetState<Portlet> getState(String contentId)
- {
- throw new UnsupportedOperationException();
- }
-
public Portlet combine(List<Portlet> states)
{
Map<String, Preference> entries = new HashMap<String, Preference>();
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -23,7 +23,6 @@
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
import org.gatein.common.io.IOTools;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.io.ByteArrayInputStream;
@@ -38,11 +37,6 @@
public class WSRPContentProvider implements ContentProvider<WSRP>,
HelpableContentProvider<WSRPState, WSRP>
{
- public GetState<WSRP> getState(String s)
- {
- throw new UnsupportedOperationException("todo");
- }
-
public WSRP combine(List<WSRP> wsrpStates)
{
throw new UnsupportedOperationException("todo");
Modified: portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml
===================================================================
---
portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-11-24
16:13:25 UTC (rev 791)
@@ -79,7 +79,7 @@
<values-param>
<name>autoCreatedInNewRepository</name>
<description>Node types configuration file</description>
- <value>jar:/conf/standalone/nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/portal/portal-nodetypes.xml</value>
</values-param>
</init-params>
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-24
15:09:09 UTC (rev 790)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-24
16:13:25 UTC (rev 791)
@@ -29,6 +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.PageNode;
import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -294,6 +295,48 @@
assertNull(navigation);
}
+ public void testNavigationOrder() throws Exception
+ {
+ PortalConfig portal = new PortalConfig("portal");
+ portal.setName("test_nav");
+ storage_.create(portal);
+
+ //
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("portal");
+ nav.setOwnerId("test_nav");
+ PageNode node1 = new PageNode();
+ node1.setName("n1");
+ PageNode node2 = new PageNode();
+ node2.setName("n2");
+ PageNode node3 = new PageNode();
+ node3.setName("n3");
+ nav.addNode(node1);
+ nav.addNode(node2);
+ nav.addNode(node3);
+
+ //
+ storage_.save(nav);
+
+ //
+ nav = storage_.getPageNavigation("portal", "test_nav");
+ assertEquals(3, nav.getNodes().size());
+ assertEquals("n1", nav.getNodes().get(0).getName());
+ assertEquals("n2", nav.getNodes().get(1).getName());
+ assertEquals("n3", nav.getNodes().get(2).getName());
+
+ //
+ nav.getNodes().add(0, nav.getNodes().remove(1));
+ storage_.save(nav);
+
+ //
+ nav = storage_.getPageNavigation("portal", "test_nav");
+ assertEquals(3, nav.getNodes().size());
+ assertEquals("n2", nav.getNodes().get(0).getName());
+ assertEquals("n1", nav.getNodes().get(1).getName());
+ assertEquals("n3", nav.getNodes().get(2).getName());
+ }
+
public void testCreatePortletPreferences() throws Exception
{
ArrayList<Preference> prefs = new ArrayList<Preference>();
Modified: portal/trunk/component/scripting/pom.xml
===================================================================
--- portal/trunk/component/scripting/pom.xml 2009-11-24 15:09:09 UTC (rev 790)
+++ portal/trunk/component/scripting/pom.xml 2009-11-24 16:13:25 UTC (rev 791)
@@ -53,13 +53,13 @@
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
- <version>1.6R5</version>
+ <version>${rhino.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
- <version>1.5.7</version>
+ <version>${org.codehaus.groovy.version}</version>
</dependency>
</dependencies>
</project>
Modified: portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
---
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-24
16:13:25 UTC (rev 791)
@@ -43,6 +43,8 @@
var commonVersion = "${org.gatein.common.version}";
var wsrpVersion = "${org.gatein.wsrp.version}";
var shindigVersion = "${org.shindig.version}";
+ var groovyVersion = "${org.codehaus.groovy.version}";
+ var rhinoVersion = "${rhino.version}";
//TODO versions for gatein components
@@ -89,8 +91,8 @@
module.component.scripting =
new Project("org.exoplatform.portal",
"exo.portal.component.scripting", "jar", module.version).
addDependency(module.component.xmlParser).
- addDependency(new Project("rhino", "js", "jar",
"1.6R5")).
- addDependency(new Project("org.codehaus.groovy", "groovy-all",
"jar", "1.6.5"));
+ addDependency(new Project("rhino", "js", "jar",
rhinoVersion)).
+ addDependency(new Project("org.codehaus.groovy", "groovy-all",
"jar", groovyVersion));
module.component.web =
new Project("org.exoplatform.portal", "exo.portal.component.web",
"jar", module.version).
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-11-24 15:09:09 UTC (rev 790)
+++ portal/trunk/pom.xml 2009-11-24 16:13:25 UTC (rev 791)
@@ -48,10 +48,13 @@
<org.gatein.pc.version>2.1.0-Beta02</org.gatein.pc.version>
<org.jboss.identity.idm>1.0.0.Beta3</org.jboss.identity.idm>
<org.gatein.wsrp.version>1.0.0-Beta01</org.gatein.wsrp.version>
- <org.gatein.mop.version>1.0.0-Beta09</org.gatein.mop.version>
- <version.chromattic>1.0.0-beta6</version.chromattic>
- <version.reflect>1.0.0-beta3</version.reflect>
-
+ <org.gatein.mop.version>1.0.0-Beta10</org.gatein.mop.version>
+ <org.slf4j.version>1.5.6</org.slf4j.version>
+ <rhino.version>1.6R5</rhino.version>
+ <org.codehaus.groovy.version>1.6.5</org.codehaus.groovy.version>
+ <version.chromattic>1.0.0-beta8</version.chromattic>
+ <version.reflect>1.0.0-beta4</version.reflect>
+
<!-- ************** -->
<!-- Build settings -->
<!-- ************** -->
@@ -86,7 +89,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
- <version>1.5.6</version>
+ <version>${org.slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-11-24
16:13:25 UTC (rev 791)
@@ -119,7 +119,7 @@
<description>Node types configuration file</description>
<value>jar:/conf/ext-nodetypes-config.xml</value>
<value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/standalone/nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/portal/portal-nodetypes.xml</value>
</values-param>
</init-params>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-11-24
15:09:09 UTC (rev 790)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-11-24
16:13:25 UTC (rev 791)
@@ -119,7 +119,7 @@
<description>Node types configuration file</description>
<value>jar:/conf/ext-nodetypes-config.xml</value>
<value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/standalone/nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/portal/portal-nodetypes.xml</value>
</values-param>
</init-params>