Author: julien_viet
Date: 2010-02-06 07:20:23 -0500 (Sat, 06 Feb 2010)
New Revision: 1538
Added:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java
components/mop/trunk/core/src/test/resources/conf/test-nodetypes.xml
Removed:
components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java
components/mop/trunk/core/pom.xml
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
components/mop/trunk/core/src/test/resources/conf/configuration.xml
Log:
GTNMOP-16 : Adapter pattern for workspace object
GTNMOP-15 : Update to Chromattic 1.0.0-beta17
Added: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java
(rev 0)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.mop.api;
+
+/**
+ * The adapter pattern for the MOP.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public interface Adaptable
+{
+
+ /**
+ * Returns an adapter for the specified type.
+ *
+ * @param adaptedType the adapted type class
+ * @param <A> the adapted type
+ * @return the adapter or null
+ */
+ <A> A adapt(Class<A> adaptedType);
+
+ /**
+ * Returns true if the workspace object is adapted to the specified type.
+ *
+ * @param adaptedType the adapted type
+ * @return the adaptability of the current object
+ */
+ boolean isAdapted(Class<?> adaptedType);
+}
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java
===================================================================
---
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java 2010-02-05
08:15:36 UTC (rev 1537)
+++
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -18,6 +18,7 @@
*/
package org.gatein.mop.api.workspace;
+import org.gatein.mop.api.Adaptable;
import org.gatein.mop.api.Attributes;
/**
@@ -26,7 +27,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public interface WorkspaceObject
+public interface WorkspaceObject extends Adaptable
{
/**
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2010-02-05 08:15:36 UTC (rev 1537)
+++ components/mop/trunk/core/pom.xml 2010-02-06 12:20:23 UTC (rev 1538)
@@ -38,7 +38,7 @@
<description>Model Object for Portal Core</description>
<properties>
- <org.chromattic.version>1.0.0-beta15</org.chromattic.version>
+ <org.chromattic.version>1.0.0-beta17</org.chromattic.version>
</properties>
<dependencies>
@@ -66,6 +66,12 @@
<dependency>
<groupId>org.chromattic</groupId>
+ <version>${org.chromattic.version}</version>
+ <artifactId>chromattic.ext</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.chromattic</groupId>
<artifactId>chromattic.apt</artifactId>
<version>${org.chromattic.version}</version>
<scope>compile</scope>
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java
===================================================================
---
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java 2010-02-05
08:15:36 UTC (rev 1537)
+++
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -32,10 +32,10 @@
{
/** . */
- private ContentManagerRegistry contentManagerRegistry;
+ ContentManagerRegistry contentManagerRegistry;
/** . */
- private CustomizationContextProviderRegistry customizationContextResolvers;
+ CustomizationContextProviderRegistry customizationContextResolvers;
public MOPService()
{
@@ -78,6 +78,10 @@
//
}
+ protected <A> Class<? extends A> getConcreteAdapterType(Class<A>
adapterType) {
+ return null;
+ }
+
protected abstract Chromattic getChromattic();
public void start() throws Exception
@@ -103,8 +107,7 @@
Chromattic chromattic = getChromattic();
ChromatticSession chromeSession = chromattic.openSession();
return new ModelImpl(
- chromeSession,
- contentManagerRegistry,
- customizationContextResolvers);
+ this, chromeSession
+ );
}
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
===================================================================
---
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2010-02-05
08:15:36 UTC (rev 1537)
+++
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -18,8 +18,6 @@
*/
package org.gatein.mop.core.api;
-import org.gatein.mop.core.api.content.ContentManagerRegistry;
-import org.gatein.mop.core.api.content.CustomizationContextProviderRegistry;
import org.gatein.mop.core.api.content.CustomizationContextResolver;
import org.gatein.mop.core.api.workspace.WorkspaceImpl;
import org.gatein.mop.core.api.workspace.SiteImpl;
@@ -85,15 +83,12 @@
private final ChromatticSession session;
/** . */
- private final ContentManagerRegistry contentManagers;
+ private WorkspaceImpl workspace;
/** . */
- private final CustomizationContextProviderRegistry customizationContextResolvers;
+ private final MOPService mop;
/** . */
- private WorkspaceImpl workspace;
-
- /** . */
private final CustomizationContextResolver customizationContextResolver = new
CustomizationContextResolver()
{
public CustomizationContext resolve(String contextType, String contextId)
@@ -104,18 +99,15 @@
}
else
{
- return customizationContextResolvers.resolve(contextType, contextId);
+ return mop.customizationContextResolvers.resolve(contextType, contextId);
}
}
};
- public ModelImpl(ChromatticSession session, ContentManagerRegistry contentManagers,
CustomizationContextProviderRegistry customizationContextResolvers)
+ public ModelImpl(MOPService mop, ChromatticSession session)
{
-
- //
this.session = session;
- this.contentManagers = contentManagers;
- this.customizationContextResolvers = customizationContextResolvers;
+ this.mop = mop;
//
session.addEventListener(contextualizer);
@@ -131,6 +123,24 @@
return getWorkspaceImpl();
}
+ public <A> A getAdapter(Object o, Class<A> adaptedType, boolean adapt)
+ {
+ Class<? extends A> adapterType = mop.getConcreteAdapterType(adaptedType);
+ if (adapterType == null) {
+ adapterType = adaptedType;
+ }
+ return _getAdapter(o, adapterType, adapt);
+ }
+
+ private <A> A _getAdapter(Object o, Class<A> type, boolean adapt) {
+ A a = session.getEmbedded(o, type);
+ if (a == null && adapt) {
+ a = session.create(type);
+ session.setEmbedded(o, type, a);
+ }
+ return a;
+ }
+
private WorkspaceImpl getWorkspaceImpl()
{
if (workspace == null)
@@ -183,8 +193,8 @@
public <O extends WorkspaceObject> Iterator<O>
findObject(ObjectType<O> type, String statement)
{
- Class<? extends WorkspaceObjectImpl> impl = typeToClassImpl.get(type);
- return
session.createQueryBuilder().from(impl).<O>where(statement).get().objects();
+ Class<O> impl = (Class<O>)typeToClassImpl.get(type);
+ return session.createQueryBuilder(impl).where(statement).get().objects();
}
public String pathOf(WorkspaceObject o)
@@ -203,12 +213,16 @@
if (o instanceof AbstractCustomization)
{
((AbstractCustomization)o).session = session;
- ((AbstractCustomization)o).registry = contentManagers;
+ ((AbstractCustomization)o).registry = mop.contentManagerRegistry;
}
- if (o instanceof ContextSpecialization)
+ else if (o instanceof ContextSpecialization)
{
((ContextSpecialization)o).setCustomizationContextResolver(customizationContextResolver);
}
+ else if (o instanceof WorkspaceObjectImpl)
+ {
+ ((WorkspaceObjectImpl)o).model = this;
+ }
}
public <O extends WorkspaceObject> O findObjectById(ObjectType<O> type,
String id)
Modified:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
===================================================================
---
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2010-02-05
08:15:36 UTC (rev 1537)
+++
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -19,16 +19,17 @@
package org.gatein.mop.core.api.workspace;
import org.chromattic.api.annotations.FormattedBy;
+import org.chromattic.common.collection.AbstractFilterIterator;
import org.gatein.mop.api.workspace.WorkspaceObject;
import org.gatein.mop.api.workspace.ObjectType;
import org.gatein.mop.api.Attributes;
import org.gatein.mop.api.content.CustomizationContext;
import org.gatein.mop.core.api.MOPFormatter;
+import org.gatein.mop.core.api.ModelImpl;
import org.gatein.mop.core.util.AbstractAttributes;
import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.Name;
import org.chromattic.api.annotations.Properties;
-import org.chromattic.common.AbstractFilterIterator;
import java.util.Map;
import java.util.Set;
@@ -44,6 +45,9 @@
{
/** . */
+ public ModelImpl model;
+
+ /** . */
private final Set<String> keys = new AbstractSet<String>()
{
@Override
@@ -120,6 +124,16 @@
@Properties
public abstract Map<String, Object> getProperties();
+ public <A> A adapt(Class<A> adaptedType)
+ {
+ return model.getAdapter(this, adaptedType, true);
+ }
+
+ public boolean isAdapted(Class<?> adaptedType)
+ {
+ return model.getAdapter(this, adaptedType, false) != null;
+ }
+
@Override
public String toString()
{
Modified:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java
===================================================================
---
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java 2010-02-05
08:15:36 UTC (rev 1537)
+++
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -20,12 +20,7 @@
import junit.framework.TestCase;
-import java.util.Collections;
-
import org.gatein.mop.core.support.TestMOPService;
-import org.gatein.mop.core.support.content.portlet.Preference;
-import org.gatein.mop.core.support.content.portlet.Preferences;
-import org.gatein.mop.core.support.content.portlet.PortletContentProvider;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
@@ -35,24 +30,16 @@
{
/** . */
- protected MOPService pomService;
+ protected TestMOPService pomService;
@Override
protected void setUp() throws Exception
{
- Preferences weatherPreferences = new Preferences(Collections.<String,
Preference>singletonMap(
- "zip", new Preference("zip",
Collections.singletonList("marseille"), false)));
- PortletContentProvider portletContentProvider = new PortletContentProvider();
+ TestMOPService pomService = new TestMOPService();
//
- MOPService pomService = new TestMOPService();
-
- //
pomService.start();
- // Not needed for now
- // pomService.getContentManagerRegistry().register(Preferences.CONTENT_TYPE,
portletContentProvider);
-
//
this.pomService = pomService;
}
Added:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java
===================================================================
---
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java
(rev 0)
+++
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.mop.core.api.workspace;
+
+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.core.api.AbstractPOMTestCase;
+import org.gatein.mop.core.api.ModelImpl;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class AdapterTestCase extends AbstractPOMTestCase
+{
+
+ public void testSecured() throws Exception
+ {
+ pomService.addAdapter(Secured.class, SecuredImpl.class);
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ Site site = workspace.addSite(ObjectType.PORTAL_SITE, "adaptablefoo");
+ assertFalse(site.isAdapted(Secured.class));
+ Secured secured = site.adapt(Secured.class);
+ assertNotNull(secured);
+ assertTrue(site.isAdapted(Secured.class));
+ assertTrue(secured.getPermissions().isEmpty());
+ secured.getPermissions().add("FOO");
+ model.save();
+ }
+}
Added:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java
===================================================================
---
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java
(rev 0)
+++
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.mop.core.api.workspace;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public interface Secured
+{
+
+ List<String> getPermissions();
+
+}
Added:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java
===================================================================
---
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java
(rev 0)
+++
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.annotations.MixinType;
+import org.chromattic.api.annotations.Property;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+@MixinType(name = "mop:secured")
+public abstract class SecuredImpl implements Secured
+{
+
+ @Property(name = "mop:permissions")
+ public abstract List<String> getPermissions();
+
+}
Modified:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
===================================================================
---
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2010-02-05
08:15:36 UTC (rev 1537)
+++
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2010-02-06
12:20:23 UTC (rev 1538)
@@ -31,6 +31,7 @@
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.SecuredImpl;
import org.gatein.mop.core.api.workspace.UIBodyImpl;
import org.gatein.mop.core.api.workspace.UIContainerImpl;
import org.gatein.mop.core.api.workspace.UIWindowImpl;
@@ -52,6 +53,9 @@
import org.gatein.mop.core.support.content.portlet.PortletPreferencesState;
import org.gatein.mop.core.support.content.portlet.Preferences;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
@@ -62,12 +66,15 @@
/** . */
private final Chromattic chromattic;
+ /** . */
+ private final Map<Class<?>, Class<?>> adapterMap;
+
public TestMOPService() throws Exception
{
ChromatticBuilder builder = ChromatticBuilder.create();
//
- builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
"org.chromattic.apt.InstrumentorImpl");
+ builder.setOptionValue(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
"org.chromattic.apt.InstrumentorImpl");
//
builder.add(WorkspaceImpl.class);
@@ -103,10 +110,24 @@
builder.add(GadgetState.class);
//
+ builder.add(SecuredImpl.class);
+
+ //
this.chromattic = builder.build();
+ this.adapterMap = new HashMap<Class<?>, Class<?>>();
}
+ public <A> void addAdapter(Class<A> adaptedType, Class<? extends A>
adapterType) {
+ adapterMap.put(adaptedType, adapterType);
+ }
+
@Override
+ protected <A> Class<? extends A> getConcreteAdapterType(Class<A>
adapterType)
+ {
+ return (Class<A>)adapterMap.get(adapterType);
+ }
+
+ @Override
protected Chromattic getChromattic()
{
return chromattic;
Modified: components/mop/trunk/core/src/test/resources/conf/configuration.xml
===================================================================
--- components/mop/trunk/core/src/test/resources/conf/configuration.xml 2010-02-05
08:15:36 UTC (rev 1537)
+++ components/mop/trunk/core/src/test/resources/conf/configuration.xml 2010-02-06
12:20:23 UTC (rev 1538)
@@ -57,7 +57,7 @@
<values-param>
<name>autoCreatedInNewRepository</name>
<description>Node types configuration file</description>
- <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/test-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Deleted: components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml
===================================================================
--- components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml 2010-02-05
08:15:36 UTC (rev 1537)
+++ components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml 2010-02-06
12:20:23 UTC (rev 1538)
@@ -1,63 +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.
-
--->
-<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
-
- <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="mop:value" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="mop: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="mop:prefs" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
-</nodeTypes>
Copied: components/mop/trunk/core/src/test/resources/conf/test-nodetypes.xml (from rev
1174, components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml)
===================================================================
--- components/mop/trunk/core/src/test/resources/conf/test-nodetypes.xml
(rev 0)
+++ components/mop/trunk/core/src/test/resources/conf/test-nodetypes.xml 2010-02-06
12:20:23 UTC (rev 1538)
@@ -0,0 +1,71 @@
+<!--
+
+ 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.
+
+-->
+<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <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="mop:value" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="mop: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="mop:prefs" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:secured" isMixin="true"
hasOrderableChildNodes="false" primaryItemName="">
+ <propertyDefinitions>
+ <propertyDefinition name="mop:permissions"
requiredType="String" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>