gatein SVN: r6922 - in portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl: content and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-07-23 14:45:44 -0400 (Sat, 23 Jul 2011)
New Revision: 6922
Added:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableCollection.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableIdentifiableCollection.java
Removed:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableResult.java
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PageImpl.java
Log:
- Adapted to API changes.
- Fixed implementation of GateInImpl.getGroupSites
- Added implementations for ContentRegistry.getCategoryNames and getAllCategories.
- Renamed AdaptedIterableResult to AdaptedIterableCollection and added AdaptedIterableIdentifiableCollection class.
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -40,6 +40,7 @@
import org.exoplatform.portal.pom.data.PortalData;
import org.exoplatform.portal.pom.data.PortalKey;
import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupHandler;
import org.exoplatform.services.organization.OrganizationService;
import org.gatein.api.GateIn;
import org.gatein.api.content.Application;
@@ -53,21 +54,18 @@
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Portal;
import org.gatein.api.portal.Site;
-import org.gatein.api.util.IterableResult;
+import org.gatein.api.util.IterableIdentifiableCollection;
import org.gatein.api.util.Type;
import org.gatein.common.util.ParameterValidation;
import org.gatein.portal.api.impl.portal.GroupSiteImpl;
import org.gatein.portal.api.impl.portal.PageImpl;
import org.gatein.portal.api.impl.portal.PortalImpl;
-import org.gatein.portal.api.impl.util.AdaptedIterableResult;
+import org.gatein.portal.api.impl.util.AdaptedIterableIdentifiableCollection;
import org.picocontainer.Startable;
import java.net.URI;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
-import java.util.SortedMap;
-import java.util.TreeMap;
import java.util.regex.Pattern;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
@@ -99,14 +97,14 @@
container = context.getContainer();
}
- public IterableResult<Portal> getPortals()
+ public IterableIdentifiableCollection<Portal> getPortals()
{
try
{
begin();
final List<PortalData> portals = dataStorage.find(PORTALS).getAll();
- return new AdaptedIterableResult<PortalData, Portal>(portals.size(), portals.iterator())
+ return new AdaptedIterableIdentifiableCollection<PortalData, Portal>(portals.size(), portals.iterator())
{
public Portal adapt(PortalData old)
{
@@ -145,39 +143,36 @@
return getPortal(siteId(Site.PORTAL, "classic")); // todo: check
}
- public IterableResult<Site> getSites()
+ public IterableIdentifiableCollection<Site> getSites()
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
- public IterableResult<Site> getGroupSites()
+ public IterableIdentifiableCollection<Site> getGroupSites()
{
try
{
- Collection groups = organizationService.getGroupHandler().getAllGroups(); // todo: a method that would just retrieve the group names would be a lot better for performance...
- final SortedMap<Id<Site>, Site> groupSites = new TreeMap<Id<Site>, Site>();
- for (Object o : groups)
- {
- Group group = (Group)o;
- Site site = getGroupSite(Id.parse(GROUP_CONTEXT, group.getId()));
- groupSites.put(site.getId(), site);
- }
+ final GroupHandler groupHandler = organizationService.getGroupHandler();
+ Collection groups = groupHandler.getAllGroups();
- return new IterableResult<Site>()
+ return new AdaptedIterableIdentifiableCollection<Object, Site>(groups.size(), groups.iterator())
{
- public int size()
- {
- return groupSites.size();
- }
-
public boolean contains(Id<Site> siteId)
{
- return groupSites.containsKey(siteId);
+ try
+ {
+ return groupHandler.findGroupById(siteId.toString()) != null;
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
}
- public Iterator<Site> iterator()
+ public Site adapt(Object old)
{
- return groupSites.values().iterator();
+ Group group = (Group)old;
+ return getGroupSite(Id.parse(GROUP_CONTEXT, group.getId()));
}
};
}
@@ -195,12 +190,12 @@
return new GroupSiteImpl(siteId, groupName, this);
}
- public IterableResult<Site> getGroupSites(Id userId)
+ public IterableIdentifiableCollection<Site> getGroupSites(Id userId)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
- public IterableResult<Portal> getPortalSites(Id userId)
+ public IterableIdentifiableCollection<Portal> getPortalSites(Id userId)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -32,14 +32,16 @@
import org.gatein.api.content.Content;
import org.gatein.api.content.ManagedContent;
import org.gatein.api.id.Id;
+import org.gatein.api.util.IterableCollection;
import org.gatein.api.util.Type;
import org.gatein.mop.api.content.ContentType;
import org.gatein.portal.api.impl.GateInImpl;
+import org.gatein.portal.api.impl.util.AdaptedIterableCollection;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class CategoryImpl implements Category
@@ -54,6 +56,19 @@
this.gateIn = gateIn;
}
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder("Category '").append(getName()).append("':\n");
+
+ for (ManagedContent content : managed.values())
+ {
+ sb.append('\t').append(content).append('\n');
+ }
+
+ return sb.toString();
+ }
+
public boolean contains(String managedContentName)
{
return getApplication(managedContentName) != null;
@@ -147,9 +162,21 @@
return managed.get(name);
}
- public Collection<String> getKnownManagedContentNames()
+ public IterableCollection<String> getKnownManagedContentNames()
{
- return managed.keySet();
+ Set<String> strings = managed.keySet();
+ return new AdaptedIterableCollection<String, String>(strings.size(), strings.iterator())
+ {
+ public String adapt(String old)
+ {
+ return old;
+ }
+
+ public boolean contains(String s)
+ {
+ return managed.containsKey(s);
+ }
+ };
}
public Id<Category> getId()
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -32,10 +32,15 @@
import org.gatein.api.content.ManagedContent;
import org.gatein.api.id.Id;
import org.gatein.api.util.Filter;
-import org.gatein.api.util.IterableResult;
+import org.gatein.api.util.IterableCollection;
+import org.gatein.api.util.IterableIdentifiableCollection;
import org.gatein.api.util.Query;
import org.gatein.portal.api.impl.GateInImpl;
+import org.gatein.portal.api.impl.util.AdaptedIterableCollection;
+import org.gatein.portal.api.impl.util.AdaptedIterableIdentifiableCollection;
+import java.util.List;
+
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class ContentRegistryImpl implements ContentRegistry
{
@@ -56,6 +61,54 @@
return getOrCreateCategory(name, false);
}
+ public IterableCollection<String> getCategoryNames()
+ {
+ try
+ {
+ final List<ApplicationCategory> categories = gateIn.getRegistryService().getApplicationCategories();
+ return new AdaptedIterableCollection<ApplicationCategory, String>(categories.size(), categories.iterator())
+ {
+ public String adapt(ApplicationCategory old)
+ {
+ return old.getName();
+ }
+
+ public boolean contains(String s)
+ {
+ return doesCategoryExist(s);
+ }
+ };
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public IterableIdentifiableCollection<Category> getAllCategories()
+ {
+ try
+ {
+ final List<ApplicationCategory> categories = gateIn.getRegistryService().getApplicationCategories();
+ return new AdaptedIterableIdentifiableCollection<ApplicationCategory, Category>(categories.size(), categories.iterator())
+ {
+ public Category adapt(ApplicationCategory old)
+ {
+ return new CategoryImpl(old, gateIn);
+ }
+
+ public boolean contains(Id<Category> t)
+ {
+ return doesCategoryExist(t.toString());
+ }
+ };
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
private Category getOrCreateCategory(String name, boolean forceCreate)
{
try
@@ -84,6 +137,18 @@
}
}
+ private boolean doesCategoryExist(String name)
+ {
+ try
+ {
+ return gateIn.getRegistryService().getApplicationCategory(name) != null;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
public <T extends Content> T get(Id<T> id)
{
Class<T> type = id.getIdentifiableType();
@@ -117,7 +182,7 @@
return type.cast(result);
}
- public IterableResult<ManagedContent> getManagedContents(Query<ManagedContent> query)
+ public IterableIdentifiableCollection<ManagedContent> getManagedContents(Query<ManagedContent> query)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@@ -127,7 +192,7 @@
return null; //To change body of implemented methods use File | Settings | File Templates.
}
- public IterableResult<Content> getAll()
+ public IterableIdentifiableCollection<Content> getAll()
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@@ -142,12 +207,12 @@
return false; //To change body of implemented methods use File | Settings | File Templates.
}
- public <U extends Content> IterableResult<U> getAllWhere(Filter<U> filter)
+ public <U extends Content> IterableIdentifiableCollection<U> getAllWhere(Filter<U> filter)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
- public <U extends Content> IterableResult<U> getAllSatisfying(Query<U> query)
+ public <U extends Content> IterableIdentifiableCollection<U> getAllSatisfying(Query<U> query)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -58,6 +58,12 @@
this.category = category;
}
+ @Override
+ public String toString()
+ {
+ return "ManagedContent '" + name + "' =>" + content;
+ }
+
public Id<ManagedContent<T>> getId()
{
return id;
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -35,10 +35,10 @@
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
import org.gatein.api.util.Filter;
-import org.gatein.api.util.IterableResult;
+import org.gatein.api.util.IterableIdentifiableCollection;
import org.gatein.api.util.Query;
import org.gatein.portal.api.impl.GateInImpl;
-import org.gatein.portal.api.impl.util.AdaptedIterableResult;
+import org.gatein.portal.api.impl.util.AdaptedIterableIdentifiableCollection;
import java.util.Iterator;
import java.util.regex.Pattern;
@@ -119,11 +119,11 @@
return getGateIn().get(site);
}
- public IterableResult<Navigation> getAll()
+ public IterableIdentifiableCollection<Navigation> getAll()
{
loadChildrenIfNeeded();
- return new AdaptedIterableResult<NavigationImpl, Navigation>(size(), context.iterator())
+ return new AdaptedIterableIdentifiableCollection<NavigationImpl, Navigation>(size(), context.iterator())
{
public Navigation adapt(NavigationImpl old)
{
@@ -196,12 +196,12 @@
return site.getIdforChild(key);
}
- public <U extends Navigation> IterableResult<U> getAllWhere(Filter<U> filter)
+ public <U extends Navigation> IterableIdentifiableCollection<U> getAllWhere(Filter<U> filter)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
- public <U extends Navigation> IterableResult<U> getAllSatisfying(Query<U> query)
+ public <U extends Navigation> IterableIdentifiableCollection<U> getAllSatisfying(Query<U> query)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PageImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PageImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PageImpl.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -27,7 +27,7 @@
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
-import org.gatein.api.util.IterableResult;
+import org.gatein.api.util.IterableIdentifiableCollection;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
@@ -59,7 +59,7 @@
this.title = title;
}
- public IterableResult<Navigation> getInboundNavigations()
+ public IterableIdentifiableCollection<Navigation> getInboundNavigations()
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
Copied: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableCollection.java (from rev 6876, portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableResult.java)
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableCollection.java (rev 0)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableCollection.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -0,0 +1,56 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.portal.api.impl.util;
+
+import org.gatein.api.util.IterableCollection;
+
+import java.util.Iterator;
+
+/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
+public abstract class AdaptedIterableCollection<O, N> implements IterableCollection<N>, Adaptor<O, N>
+{
+ private final int size;
+ private final Iterator<O> adaptee;
+
+ public AdaptedIterableCollection(int size, Iterator<O> adaptee)
+ {
+ this.size = size;
+ this.adaptee = adaptee;
+ }
+
+ public int size()
+ {
+ return size;
+ }
+
+ public Iterator<N> iterator()
+ {
+ return new AdaptedIterator<O, N>(adaptee)
+ {
+ public N adapt(O old)
+ {
+ return AdaptedIterableCollection.this.adapt(old);
+ }
+ };
+ }
+}
Added: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableIdentifiableCollection.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableIdentifiableCollection.java (rev 0)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableIdentifiableCollection.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -0,0 +1,43 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.portal.api.impl.util;
+
+
+import org.gatein.api.id.Identifiable;
+import org.gatein.api.util.IterableIdentifiableCollection;
+
+import java.util.Iterator;
+
+/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
+public abstract class AdaptedIterableIdentifiableCollection<O, N extends Identifiable> extends AdaptedIterableCollection<O, N> implements IterableIdentifiableCollection<N>
+{
+ public AdaptedIterableIdentifiableCollection(int size, Iterator<O> adaptee)
+ {
+ super(size, adaptee);
+ }
+
+ public boolean contains(N n)
+ {
+ return this.contains(n.getId());
+ }
+}
Deleted: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableResult.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableResult.java 2011-07-23 13:50:44 UTC (rev 6921)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableResult.java 2011-07-23 18:45:44 UTC (rev 6922)
@@ -1,57 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.portal.api.impl.util;
-
-import org.gatein.api.id.Identifiable;
-import org.gatein.api.util.IterableResult;
-
-import java.util.Iterator;
-
-/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public abstract class AdaptedIterableResult<O, N extends Identifiable> implements IterableResult<N>, Adaptor<O, N>
-{
- private final int size;
- private final Iterator<O> adaptee;
-
- public AdaptedIterableResult(int size, Iterator<O> adaptee)
- {
- this.size = size;
- this.adaptee = adaptee;
- }
-
- public int size()
- {
- return size;
- }
-
- public Iterator<N> iterator()
- {
- return new AdaptedIterator<O, N>(adaptee)
- {
- public N adapt(O old)
- {
- return AdaptedIterableResult.this.adapt(old);
- }
- };
- }
-}
13 years, 5 months
gatein SVN: r6921 - in portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl: content and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-07-23 09:50:44 -0400 (Sat, 23 Jul 2011)
New Revision: 6921
Added:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java
Log:
- Adapted for API changes.
- Finished implementation of Category.
- Added ManagedContent implementation.
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -23,6 +23,7 @@
package org.gatein.portal.api.impl;
import org.exoplatform.application.gadget.GadgetRegistryService;
+import org.exoplatform.application.gadget.SourceStorage;
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
@@ -53,7 +54,8 @@
import org.gatein.api.portal.Portal;
import org.gatein.api.portal.Site;
import org.gatein.api.util.IterableResult;
-import org.gatein.api.util.ParameterValidation;
+import org.gatein.api.util.Type;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.portal.api.impl.portal.GroupSiteImpl;
import org.gatein.portal.api.impl.portal.PageImpl;
import org.gatein.portal.api.impl.portal.PortalImpl;
@@ -76,7 +78,7 @@
private static final Query<PageData> GROUPS = new Query<PageData>(SiteType.GROUP.getName(), null, PageData.class);
private static final String GROUP_CHARS = "\\w|-|_";
public static final Context CONTEXT = Context.builder()
- .requiredComponent("owner", Site.class, Pattern.compile(Site.Type.PORTAL_NAME + "|" + Site.Type.GROUP_NAME + "|" + Site.Type.DASHBOARD_NAME))
+ .requiredComponent("owner", Site.class, Pattern.compile(Site.PORTAL_NAME + "|" + Site.GROUP_NAME + "|" + Site.DASHBOARD_NAME))
.requiredComponent("portal", Portal.class, Pattern.compile("(" + GROUP_CHARS + "|\\/)+"))
.optionalComponent("page", Page.class, Pattern.compile("\\w+"))
.withDefaultSeparator("::").build();
@@ -90,6 +92,7 @@
private OrganizationService organizationService;
private ApplicationRegistryService registryService;
private GadgetRegistryService gadgetService;
+ private SourceStorage sourceStorage;
public GateInImpl(ExoContainerContext context, InitParams params, ConfigurationManager configurationManager)
{
@@ -139,7 +142,7 @@
public Portal getDefaultPortal()
{
- return getPortal(siteId(Site.Type.PORTAL, "classic")); // todo: check
+ return getPortal(siteId(Site.PORTAL, "classic")); // todo: check
}
public IterableResult<Site> getSites()
@@ -187,7 +190,7 @@
public Site getGroupSite(Id groupId)
{
String groupName = groupId.toString();
- Id<Site> siteId = siteId(Site.Type.GROUP, groupName);
+ Id<Site> siteId = siteId(Site.GROUP, groupName);
return new GroupSiteImpl(siteId, groupName, this);
}
@@ -244,7 +247,7 @@
return type.cast(result);
}
- public <T extends Site> T getSite(Id<T> siteId, Site.Type<T> type)
+ public <T extends Site> T getSite(Id<T> siteId, Type<T, Site> type)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@@ -289,7 +292,7 @@
return null;
}
- public <T extends Site> Id<T> siteId(Site.Type<T> siteType, String siteName)
+ public <T extends Site> Id<T> siteId(Type<T, Site> siteType, String siteName)
{
return Id.create(CONTEXT, siteType.getValueType(), siteType.getName(), siteName);
}
@@ -307,6 +310,7 @@
organizationService = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
registryService = (ApplicationRegistryService)container.getComponentInstanceOfType(ApplicationRegistryService.class);
gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ sourceStorage = (SourceStorage)container.getComponentInstanceOfType(SourceStorage.class);
}
public void stop()
@@ -329,6 +333,11 @@
return registryService;
}
+ public SourceStorage getSourceStorage()
+ {
+ return sourceStorage;
+ }
+
private PortalData getPortalDataFor(Id<Portal> portalId)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portalId, "Portal Id");
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -23,7 +23,9 @@
package org.gatein.portal.api.impl.content;
import org.exoplatform.application.registry.Application;
+import org.gatein.api.content.Content;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
@@ -37,4 +39,9 @@
super(Id.parse(GateInImpl.APPLICATION_CONTEXT, application.getId()), application.getApplicationName(), gateIn);
this.application = application;
}
+
+ public Type<org.gatein.api.content.Application, Content> getType()
+ {
+ return Content.PORTLET;
+ }
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -22,21 +22,31 @@
package org.gatein.portal.api.impl.content;
+import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.gatein.api.GateIn;
import org.gatein.api.content.Category;
import org.gatein.api.content.Content;
import org.gatein.api.content.ManagedContent;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Type;
+import org.gatein.mop.api.content.ContentType;
import org.gatein.portal.api.impl.GateInImpl;
-import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class CategoryImpl implements Category
{
private final ApplicationCategory category;
private final GateInImpl gateIn;
+ private Map<String, ManagedContent> managed = new HashMap<String, ManagedContent>(7);
public CategoryImpl(ApplicationCategory category, GateInImpl gateIn)
{
@@ -44,26 +54,79 @@
this.gateIn = gateIn;
}
- public <T extends Content<T>> ManagedContent<T> getContent(Id<ManagedContent<T>> contentId)
+ public boolean contains(String managedContentName)
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return getApplication(managedContentName) != null;
}
- public boolean contains(Id<? extends ManagedContent> contentId)
+ private Application getApplication(String managedContentName)
{
- return false; //To change body of implemented methods use File | Settings | File Templates.
+ try
+ {
+ return gateIn.getRegistryService().getApplication(category.getName(), managedContentName);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
}
- public <T extends Content<T>> ManagedContent<T> addContent(Id<T> contentId)
+ public <T extends Content> ManagedContent<T> addContent(Id<T> contentId)
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ T t = gateIn.get(contentId);
+ Type type = t.getType();
+ ContentType<?> contentType = getContentTypeFor(type);
+ ArrayList<String> permissions = new ArrayList<String>();
+ permissions.add(UserACL.EVERYONE);
+ gateIn.getRegistryService().createOrReplaceContentIn(category.getName(), t.getName(), contentType, t.getId().toString(), t.getDisplayName(), null, permissions);
+
+ ManagedContent<T> managedContent = new ManagedContentImpl<T>(t, this);
+ managed.put(managedContent.getName(), managedContent);
+
+ return managedContent;
}
- public List<Id<? extends ManagedContent>> getKnownManagedContentIds()
+ private ContentType<?> getContentTypeFor(Type type)
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ if (Content.GADGET.equals(type))
+ {
+ return org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE;
+ }
+ else if (Content.PORTLET.equals(type))
+ {
+ return Portlet.CONTENT_TYPE;
+ }
+ else if (Content.WSRP.equals(type))
+ {
+ return WSRP.CONTENT_TYPE;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown Content type: " + type);
+ }
}
+ private <T extends Content> String getContentIdFor(T content)
+ {
+ Type type = content.getType();
+ if (Content.GADGET.equals(type))
+ {
+ return content.getName();
+ }
+ else if (Content.PORTLET.equals(type))
+ {
+ return content.getId().toString();
+ }
+ else if (Content.WSRP.equals(type))
+ {
+ return content.getId().toString();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown Content type: " + type);
+ }
+ }
+
public String getDescription()
{
return category.getDescription();
@@ -74,11 +137,21 @@
category.setDescription(description);
}
- public <T extends Content<T>> void removeContent(Id<ManagedContent<T>> id)
+ public void removeContent(String managedContentName)
{
- //To change body of implemented methods use File | Settings | File Templates.
+ managed.remove(managedContentName);
}
+ public <T extends Content> ManagedContent<T> getManagedContent(String name)
+ {
+ return managed.get(name);
+ }
+
+ public Collection<String> getKnownManagedContentNames()
+ {
+ return managed.keySet();
+ }
+
public Id<Category> getId()
{
return gateIn.categoryId(getName());
@@ -98,4 +171,13 @@
{
return gateIn;
}
+
+ void renameManagedContent(String oldName, String newName)
+ {
+ ManagedContent removed = managed.remove(oldName);
+ if (removed != null)
+ {
+ managed.put(newName, removed);
+ }
+ }
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -31,6 +31,7 @@
import org.gatein.api.content.Gadget;
import org.gatein.api.content.ManagedContent;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Filter;
import org.gatein.api.util.IterableResult;
import org.gatein.api.util.Query;
import org.gatein.portal.api.impl.GateInImpl;
@@ -83,7 +84,7 @@
}
}
- public <T extends Content<T>> T getContent(Id<T> id)
+ public <T extends Content> T get(Id<T> id)
{
Class<T> type = id.getIdentifiableType();
Object result;
@@ -125,4 +126,29 @@
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
+
+ public IterableResult<Content> getAll()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int size()
+ {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public <U extends Content> boolean contains(Id<U> id)
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public <U extends Content> IterableResult<U> getAllWhere(Filter<U> filter)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public <U extends Content> IterableResult<U> getAllSatisfying(Query<U> query)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -23,13 +23,14 @@
package org.gatein.portal.api.impl.content;
import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.Source;
+import org.gatein.api.content.Content;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
-import java.net.MalformedURLException;
import java.net.URI;
-import java.net.URL;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class GadgetImpl extends IdentifiableImpl<org.gatein.api.content.Gadget> implements org.gatein.api.content.Gadget
@@ -42,34 +43,86 @@
this.gadget = gadget;
}
- public URL getViewURL()
+ public URI getReferenceURI()
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return URI.create(gadget.getReferenceUrl());
}
- public URL getEditURL()
+ public URI getURI()
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return URI.create(gadget.getUrl());
}
- public URL getReferenceURL()
+ public Data getData()
{
+ if (isLocal())
+ {
+ return new LocalData()
+ {
+
+ public String getSource()
+ {
+ try
+ {
+ return GadgetImpl.this.getSource().getTextContent();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void setSource(String source)
+ {
+ Source initial = GadgetImpl.this.getSource();
+ try
+ {
+ initial.setTextContent(source);
+ getGateInImpl().getSourceStorage().saveSource(gadget, initial);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+ else
+ {
+ return new RemoteData()
+ {
+ public URI getURI()
+ {
+ return GadgetImpl.this.getURI();
+ }
+
+ public void setURI(URI uri)
+ {
+ gadget.setUrl(uri.toString());
+ }
+ };
+ }
+ }
+
+ private Source getSource()
+ {
try
{
- return URI.create(gadget.getReferenceUrl()).toURL();
+ return getGateInImpl().getSourceStorage().getSource(gadget);
}
- catch (MalformedURLException e)
+ catch (Exception e)
{
throw new RuntimeException(e);
}
}
- public String getSource()
+ public boolean isLocal()
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return gadget.isLocal();
}
- public void setSource(String source)
+ public Type<org.gatein.api.content.Gadget, Content> getType()
{
+ return Content.GADGET;
}
}
Added: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java (rev 0)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * 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.portal.api.impl.content;
+
+import org.gatein.api.GateIn;
+import org.gatein.api.content.Content;
+import org.gatein.api.content.ManagedContent;
+import org.gatein.api.id.Context;
+import org.gatein.api.id.Id;
+import org.gatein.common.util.ParameterValidation;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class ManagedContentImpl<T extends Content> implements ManagedContent<T>
+{
+ private final T content;
+ private final Id<ManagedContent<T>> id;
+ private final CategoryImpl category;
+ private String name;
+ private String displayName;
+ private String description;
+ private static final String MANAGED = "managed";
+ private static final Context CONTEXT = Context.builder()
+ .requiredComponent(MANAGED, ManagedContentImpl.class, Pattern.compile(MANAGED))
+ .requiredComponent("content", Content.class, Pattern.compile(".+"))
+ .build();
+
+ public ManagedContentImpl(T content, CategoryImpl category)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(content, "Content");
+ this.content = content;
+ this.id = Id.create(CONTEXT, MANAGED, content.getId().toString());
+ this.category = category;
+ }
+
+ public Id<ManagedContent<T>> getId()
+ {
+ return id;
+ }
+
+ public String getName()
+ {
+ if (name != null)
+ {
+ return name;
+ }
+ return content.getName();
+ }
+
+ public void setName(String name)
+ {
+ category.renameManagedContent(this.name, name);
+ this.name = name;
+ }
+
+ public String getDisplayName()
+ {
+ if (displayName != null)
+ {
+ return displayName;
+ }
+ return content.getDisplayName();
+ }
+
+ public GateIn getGateIn()
+ {
+ return content.getGateIn();
+ }
+
+ public void setDisplayName(String displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ public T getContent()
+ {
+ return content;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -25,6 +25,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.gatein.api.id.Id;
import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
@@ -43,6 +44,6 @@
public Type getType()
{
- return Type.DASHBOARD;
+ return Site.DASHBOARD;
}
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -25,6 +25,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.gatein.api.id.Id;
import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
@@ -43,6 +44,6 @@
public Type getType()
{
- return Type.GROUP;
+ return Site.GROUP;
}
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -164,7 +164,7 @@
return contains(getIdForChild(key));
}
- public boolean contains(Id<Navigation> navigationId)
+ public <U extends Navigation> boolean contains(Id<U> navigationId)
{
loadChildrenIfNeeded();
@@ -176,7 +176,7 @@
return createAndAdd(getIdForChild(key));
}
- public Navigation createAndAdd(Id<Navigation> navigationId)
+ public <U extends Navigation> U createAndAdd(Id<U> navigationId)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@@ -186,7 +186,7 @@
return get(getIdForChild(key));
}
- public Navigation get(Id<Navigation> navigationId)
+ public <U extends Navigation> U get(Id<U> navigationId)
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -27,6 +27,7 @@
import org.gatein.api.content.ContentRegistry;
import org.gatein.api.portal.Portal;
import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.content.ContentRegistryImpl;
@@ -36,7 +37,7 @@
public PortalImpl(PortalData portal, GateInImpl gateIn)
{
- super(gateIn.siteId(Site.Type.forName(portal.getKey().getType()), portal.getKey().getId()), portal.getName(), gateIn);
+ super(gateIn.siteId(Type.forName(portal.getKey().getType(), Site.class), portal.getKey().getId()), portal.getName(), gateIn);
}
public ContentRegistry getContentRegistry()
@@ -46,7 +47,7 @@
public Type getType()
{
- return Type.PORTAL;
+ return Site.PORTAL;
}
protected SiteKey getSiteKey()
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java 2011-07-23 13:50:44 UTC (rev 6921)
@@ -32,7 +32,7 @@
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
-import org.gatein.api.util.Container;
+import org.gatein.api.util.HierarchicalContainer;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
@@ -44,7 +44,7 @@
super(siteId, name, gateIn);
}
- public Container<String, Page> getPageRegistry()
+ public HierarchicalContainer<String, Page> getPageRegistry()
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
13 years, 5 months
gatein SVN: r6920 - in portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry: impl and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-07-23 09:48:27 -0400 (Sat, 23 Jul 2011)
New Revision: 6920
Modified:
portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java
portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
Log:
- Added createdOrReplaceContentIn method to be able to create content from the API implementation without needing to depend on lower-level classes.
Modified: portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java
===================================================================
--- portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java 2011-07-22 15:28:32 UTC (rev 6919)
+++ portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/ApplicationRegistryService.java 2011-07-23 13:48:27 UTC (rev 6920)
@@ -21,6 +21,7 @@
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.portal.config.model.ApplicationType;
+import org.gatein.mop.api.content.ContentType;
import java.util.Comparator;
import java.util.List;
@@ -31,21 +32,21 @@
String REMOTE_DISPLAY_NAME_SUFFIX = " (remote)";
/**
- * Return list of ApplicationCatgory (and applications in each category)
+ * Return list of ApplicationCatgory (and applications in each category)
+ *
* @param accessUser
- * @param appTypes - array of ApplicationType, used to filter applications in each application category
- */
+ * @param appTypes - array of ApplicationType, used to filter applications in each application category
+ */
public List<ApplicationCategory> getApplicationCategories(String accessUser, ApplicationType<?>... appTypes) throws Exception;
public void initListener(ComponentPlugin com) throws Exception;
- /**
- * Return list of all current application categories (unsorted, all Application in all ApplicationType)
- */
+ /** Return list of all current application categories (unsorted, all Application in all ApplicationType) */
public List<ApplicationCategory> getApplicationCategories() throws Exception;
/**
* Return list of all current application categories (sorted, all applications in all types)
+ *
* @param sortComparator - Comparator used to sort the returned list
*/
public List<ApplicationCategory> getApplicationCategories(Comparator<ApplicationCategory> sortComparator)
@@ -54,6 +55,7 @@
/**
* Return ApplicationCategory with name provided <br/>
* if not found, return null
+ *
* @param name - ApplicationCategory's name
*/
public ApplicationCategory getApplicationCategory(String name) throws Exception;
@@ -61,6 +63,7 @@
/**
* Save an ApplicationCategory to database <br/>
* If it doesn't exist, a new one will be created, if not, it will be updated
+ *
* @param category - ApplicationCategory object that will be saved
*/
public void save(ApplicationCategory category) throws Exception;
@@ -68,12 +71,14 @@
/**
* Remove application category (and all application in it) from database <br/>
* If it doesn't exist, it will be ignored
+ *
* @param category - ApplicationCategory object that will be removed
*/
public void remove(ApplicationCategory category) throws Exception;
/**
* Return list of applications (unsorted) in specific category and have specific type
+ *
* @param category - ApplicationCategory that you want to list applications
* @param appTypes - array of application type
*/
@@ -81,12 +86,14 @@
/**
* Return list of applications (sorted) in specific category and have specific type
- * @param category - ApplicationCategory that you want to list applications
+ *
+ * @param category - ApplicationCategory that you want to list applications
* @param sortComparator - comparator used to sort application list
- * @param appTypes - array of application type
+ * @param appTypes - array of application type
*/
public List<Application> getApplications(ApplicationCategory category, Comparator<Application> sortComparator,
ApplicationType<?>... appTypes) throws Exception;
+
/**
* Return list of all Application in database (unsorted) <br/>
* If there are not any Application in database, return an empty list
@@ -95,6 +102,7 @@
/**
* Return Application with id provided
+ *
* @param id - must be valid applicationId (catgoryname/applicationName), if not, this will throw exception
*/
public Application getApplication(String id) throws Exception;
@@ -102,8 +110,9 @@
/**
* Return Application in specific category and have name provided in param <br/>
* If it can't be found, return null
+ *
* @param category - name of application category
- * @param name - name of application
+ * @param name - name of application
*/
public Application getApplication(String category, String name) throws Exception;
@@ -111,14 +120,16 @@
* Save Application in an ApplicationCategory <br/>
* If ApplicationCategory or Application don't exist, they'll be created <br/>
* If Application has been already existed, it will be updated <br/>
- * @param category - ApplicationCategory that your application'll be saved to
- * @param application - Application that will be saved
+ *
+ * @param category - ApplicationCategory that your application'll be saved to
+ * @param application - Application that will be saved
*/
public void save(ApplicationCategory category, Application application) throws Exception;
/**
* Update an Application <br/>
* It must be existed in database, if not, this will throw an IllegalStateException
+ *
* @param application - Application that you want to update
*/
public void update(Application application) throws Exception;
@@ -126,6 +137,7 @@
/**
* Remove an Application from database <br/>
* If it can't be found, it will be ignored (no exception)
+ *
* @param app - Application that you want to remove, must not be null
*/
public void remove(Application app) throws Exception;
@@ -133,16 +145,19 @@
/**
* Get all deployed portlet, add to portlet's ApplicationCategory <br/>
* If ApplicationCategory currently doesn't exist, it'll be created <br/>
- * If Application've already existed, it'll be ignored
+ * If Application've already existed, it'll be ignored
*/
public void importAllPortlets() throws Exception;
//TODO: dang.tung
+
/**
* Get all Gadget, add to eXoGadgets application category <br/>
* When first added, it's access permission will be Everyone <br/>
* If ApplicationCategory currently doesn't exist, it'll be created <br/>
- * Gadget that has been imported will be ignored
+ * Gadget that has been imported will be ignored
*/
public void importExoGadgets() throws Exception;
+
+ void createOrReplaceContentIn(String categoryName, String definitionName, ContentType<?> contentType, String contentId, String displayName, String description, List<String> permissions);
}
\ No newline at end of file
Modified: portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2011-07-22 15:28:32 UTC (rev 6919)
+++ portal/branches/api/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2011-07-23 13:48:27 UTC (rev 6920)
@@ -259,7 +259,7 @@
// If the application name contained a beginning slash (which can happen with WSRP), we need to hack around the
// hardcoding of portlet id expectations >_<
- if(fragments.length == 3 && applicationName.length() == 0)
+ if (fragments.length == 3 && applicationName.length() == 0)
{
applicationName = "/" + fragments[2];
}
@@ -371,8 +371,6 @@
public void importExoGadgets() throws Exception
{
- ContentRegistry registry = getContentRegistry();
-
//
ExoContainer container = ExoContainerContext.getCurrentContainer();
GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
@@ -386,22 +384,16 @@
String categoryName = "Gadgets";
//
- CategoryDefinition category = registry.getCategory(categoryName);
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- category.setDescription(categoryName);
- category.setAccessPermissions(permissions);
- }
+ CategoryDefinition category = getOrCreateCategoryDefinition(categoryName, permissions);
//
for (Gadget ele : eXoGadgets)
{
- ContentDefinition app = category.getContentMap().get(ele.getName());
+ String name = ele.getName();
+ ContentDefinition app = category.getContentMap().get(name);
if (app == null)
{
- app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
+ app = category.createContent(name, org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, name);
app.setDisplayName(ele.getTitle());
app.setDescription(ele.getDescription());
app.setAccessPermissions(permissions);
@@ -410,6 +402,33 @@
}
}
+ public void createOrReplaceContentIn(String categoryName, String definitionName, ContentType<?> contentType, String contentId, String displayName, String description, List<String> permissions)
+ {
+ CategoryDefinition definition = getOrCreateCategoryDefinition(categoryName, permissions);
+ ContentDefinition content = definition.getContentMap().get(definitionName);
+ if (content == null)
+ {
+ content = definition.createContent(definitionName, contentType, contentId);
+ content.setDisplayName(displayName);
+ content.setDescription(description);
+ content.setAccessPermissions(permissions);
+ }
+ }
+
+ private CategoryDefinition getOrCreateCategoryDefinition(String categoryName, List<String> permissions)
+ {
+ ContentRegistry registry = getContentRegistry();
+ CategoryDefinition category = registry.getCategory(categoryName);
+ if (category == null)
+ {
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ category.setDescription(categoryName);
+ category.setAccessPermissions(permissions);
+ }
+ return category;
+ }
+
public void importAllPortlets() throws Exception
{
ContentRegistry registry = getContentRegistry();
@@ -492,17 +511,9 @@
// Process category names
for (String categoryName : categoryNames)
{
- CategoryDefinition category = registry.getCategory(categoryName);
+ CategoryDefinition category = getOrCreateCategoryDefinition(categoryName, permissions);
//
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- category.setAccessPermissions(permissions);
- }
-
- //
ContentDefinition app = category.getContentMap().get(portletName);
if (app == null)
{
@@ -535,7 +546,7 @@
break;
}
}
-
+
if (!isExist)
{
app = category.createContent(portletName, contentType, contentId);
13 years, 5 months
gatein SVN: r6919 - portal/branches.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-07-22 11:28:32 -0400 (Fri, 22 Jul 2011)
New Revision: 6919
Added:
portal/branches/gatein-management/
Log:
Creating branch for mop management extension
13 years, 5 months
gatein SVN: r6918 - portal/branches.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-07-22 11:26:24 -0400 (Fri, 22 Jul 2011)
New Revision: 6918
Removed:
portal/branches/gatein-management/
Log:
Redoing branch
13 years, 5 months
gatein SVN: r6916 - portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/test/java/org/exoplatform/application/registry.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-07-22 06:49:09 -0400 (Fri, 22 Jul 2011)
New Revision: 6916
Removed:
portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryServiceCache.java
Log:
GTNPORTAL-1959: Remove no-longer used tests
Deleted: portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryServiceCache.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryServiceCache.java 2011-07-22 10:46:32 UTC (rev 6915)
+++ portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryServiceCache.java 2011-07-22 10:49:09 UTC (rev 6916)
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2011 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.application.registry;
-
-import org.exoplatform.application.AbstractApplicationRegistryTest;
-import org.exoplatform.commons.chromattic.ChromatticManager;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.component.RequestLifeCycle;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * For the moment, we cache only list of all categories in ApplicationRegistryService. Hence, this test suite
- * handles only ApplicationCategory entities
- *
- * @author <a href="hoang281283(a)gmail.com">Minh Hoang TO</a>
- * @date 7/21/11
- */
-public class TestApplicationRegistryServiceCache extends AbstractApplicationRegistryTest
-{
-
- private PortalContainer portalContainer;
-
- private ChromatticManager cManager;
-
- private ApplicationRegistryService appResService;
-
- @Override
- protected void setUp() throws Exception
- {
- portalContainer = getContainer();
- cManager = (ChromatticManager)portalContainer.getComponentInstanceOfType(ChromatticManager.class);
- appResService = (ApplicationRegistryService)portalContainer.getComponentInstanceOfType(ApplicationRegistryService.class);
- begin();
- }
-
- public void testConcurrentReadAndWrite() throws Exception
- {
- //As current test suite is inteferenced by TestApplicationRegistryService testsuite, we could not
- //give an explicit number of existing categories
- final int numberOfCategories = appResService.getApplicationCategories().size();
-
- final CountDownLatch latch = new CountDownLatch(5);
- for (int i = 0; i < 5; i++)
- {
- new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- RequestLifeCycle.begin(portalContainer);
- List<ApplicationCategory> categories = appResService.getApplicationCategories();
- assertEquals(numberOfCategories, categories.size());
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- finally
- {
- //Synchronize ChromatticSession with JCR Session in this thread
- cManager.getSynchronization().setSaveOnClose(true);
- RequestLifeCycle.end();
- latch.countDown();
- }
- }
- }).start();
- }
-
- final CountDownLatch finishWriteTask = new CountDownLatch(1);
- Thread writeTask = new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- latch.await();
-
- RequestLifeCycle.begin(portalContainer);
- ApplicationCategory category = new ApplicationCategory();
- category.setName("ABC");
- category.setDisplayName("ABC");
- category.setDescription("ABC");
-
- appResService.save(category);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- finally
- {
- cManager.getSynchronization().setSaveOnClose(true);
- RequestLifeCycle.end();
- finishWriteTask.countDown();
- }
- }
- });
-
- writeTask.start();
-
- //REMARK: We could not check the update from main thread as the ChromatticSession associated with current thread
- //had been openned before the writeTask thread terminates its execution
- new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- finishWriteTask.await();
-
- RequestLifeCycle.begin(portalContainer);
- List<ApplicationCategory> categories = appResService.getApplicationCategories();
-
- assertEquals(numberOfCategories + 1, categories.size());
- ApplicationCategory abcCategory = null;
- //We use this loop instead of direct query to check if the cache works properly
- for (ApplicationCategory category : categories)
- {
- if ("ABC".equals(category.getName()))
- {
- abcCategory = category;
- break;
- }
- }
- assertNotNull(abcCategory);
- appResService.remove(abcCategory);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- finally
- {
- cManager.getSynchronization().setSaveOnClose(true);
- RequestLifeCycle.end();
- }
- }
- }).start();
-
- //Hack to overcome the delay problem, which leads to failure in other testsuites
- try
- {
- Thread.sleep(3000);
- }
- catch(InterruptedException inEx)
- {
- inEx.printStackTrace();
- }
- }
-
-
- @Override
- protected void tearDown() throws Exception
- {
- //ChromatticSession is not synchronized with JCR Session in the main thread
- cManager.getSynchronization().setSaveOnClose(false);
- end();
- }
-
-}
13 years, 5 months
gatein SVN: r6915 - in portal/branches/branch-GTNPORTAL-1963: webui/portal/src/main/java/org/exoplatform/portal/webui/portal and 1 other directory.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-07-22 06:46:32 -0400 (Fri, 22 Jul 2011)
New Revision: 6915
Modified:
portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
portal/branches/branch-GTNPORTAL-1963/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIApplicationList.java
Log:
GTNPORTAL-1959: Use lazy query from UI instead of cache on service component
Modified: portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2011-07-22 10:09:29 UTC (rev 6914)
+++ portal/branches/branch-GTNPORTAL-1963/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2011-07-22 10:46:32 UTC (rev 6915)
@@ -52,7 +52,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
/**
* The fundamental reason that motives to use tasks is because of the JMX access that does not setup a context and
@@ -86,8 +85,6 @@
/** . */
final POMSessionManager mopManager;
- private final AtomicReference<List<ApplicationCategory>> allCategories;
-
/** Should match WSRPPortletInfo.PRODUCER_NAME_META_INFO_KEY */
private static final String PRODUCER_NAME_META_INFO_KEY = "producer-name";
public static final String PRODUCER_CATEGORY_NAME_SUFFIX = " Producer";
@@ -101,8 +98,6 @@
this.manager = manager;
this.lifeCycle = lifeCycle;
this.mopManager = mopManager;
-
- this.allCategories = new AtomicReference<List<ApplicationCategory>>();
}
public ContentRegistry getContentRegistry()
@@ -133,11 +128,6 @@
String accessUser,
final ApplicationType<?>... appTypes) throws Exception
{
- if(appTypes == null || appTypes.length == 0)
- {
- return getAllApplicationCategories(sortComparator);
- }
-
final List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
//
@@ -160,38 +150,6 @@
return categories;
}
- private List<ApplicationCategory> getAllApplicationCategories(Comparator<ApplicationCategory> comparator) throws Exception
- {
- if(allCategories.get() == null)
- {
- List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
- ContentRegistry registry = getContentRegistry();
-
- for(CategoryDefinition categoryDef : registry.getCategoryList())
- {
- ApplicationCategory category = new ApplicationCategory();
-
- category.setName(categoryDef.getName());
- category.setDisplayName(categoryDef.getDisplayName());
- category.setDescription(categoryDef.getDescription());
- category.setAccessPermissions(categoryDef.getAccessPermissions());
- category.setCreatedDate(categoryDef.getCreationDate());
- category.setModifiedDate(categoryDef.getLastModificationDate());
-
- for(ContentDefinition contentDef : categoryDef.getContentList())
- {
- category.getApplications().add(load(contentDef));
- }
-
- categories.add(category);
- }
-
- allCategories.compareAndSet(null, categories);
- }
-
- return allCategories.get();
- }
-
public List<ApplicationCategory> getApplicationCategories(String accessUser, ApplicationType<?>... appTypes) throws Exception
{
return getApplicationCategories(null, accessUser, appTypes);
@@ -225,8 +183,6 @@
public void save(final ApplicationCategory category) throws Exception
{
- allCategories.set(null);
-
ContentRegistry registry = getContentRegistry();
//
@@ -249,8 +205,6 @@
public void remove(final ApplicationCategory category) throws Exception
{
- allCategories.set(null);
-
ContentRegistry registry = getContentRegistry();
registry.getCategoryMap().remove(category.getName());
}
@@ -333,8 +287,6 @@
public void save(final ApplicationCategory category, final Application application) throws Exception
{
- allCategories.set(null);
-
ContentRegistry registry = getContentRegistry();
//
@@ -373,9 +325,6 @@
public void update(final Application application) throws Exception
{
- //Invalidate the categories cache
- allCategories.set(null);
-
ContentRegistry registry = getContentRegistry();
//
@@ -399,9 +348,6 @@
public void remove(final Application app) throws Exception
{
- //Invalidate the categories cache
- allCategories.set(null);
-
if (app == null)
{
throw new NullPointerException();
@@ -425,9 +371,6 @@
public void importExoGadgets() throws Exception
{
- //Invalidate the categories cache
- allCategories.set(null);
-
ContentRegistry registry = getContentRegistry();
//
@@ -469,9 +412,6 @@
public void importAllPortlets() throws Exception
{
- //Invalidate the categories cache
- allCategories.set(null);
-
ContentRegistry registry = getContentRegistry();
//
Modified: portal/branches/branch-GTNPORTAL-1963/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIApplicationList.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1963/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIApplicationList.java 2011-07-22 10:09:29 UTC (rev 6914)
+++ portal/branches/branch-GTNPORTAL-1963/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIApplicationList.java 2011-07-22 10:46:32 UTC (rev 6915)
@@ -54,51 +54,11 @@
public UIApplicationList() throws Exception
{
- ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
- String remoteUser = Util.getPortalRequestContext().getRemoteUser();
- if (remoteUser == null || remoteUser.equals(""))
- return;
- UserACL userACL = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
-
- PortletComparator portletComparator = new PortletComparator();
- categories = service.getApplicationCategories(remoteUser);
-
- Iterator<ApplicationCategory> cateItr = categories.iterator();
- while (cateItr.hasNext())
- {
- ApplicationCategory cate = cateItr.next();
- List<Application> applications = cate.getApplications();
- boolean hasPermission = false;
- List<String> accessPermission = cate.getAccessPermissions();
- if (accessPermission == null)
- {
- accessPermission = new ArrayList<String>();
- }
- if (accessPermission.size() == 0)
- {
- accessPermission.add(null);
- }
- for (String permssion : accessPermission)
- {
- hasPermission = userACL.hasPermission(permssion);
- if (hasPermission)
- break;
- }
-
- if (!hasPermission || applications.size() < 1)
- cateItr.remove();
- else
- Collections.sort(applications, portletComparator);
- }
- if (categories.size() > 0)
- setSelectedCategory(categories.get(0).getName());
-
- Collections.sort(categories, new PortletCategoryComparator());
}
public Application getApplication(String id) throws Exception
{
- for (ApplicationCategory category : categories)
+ for (ApplicationCategory category : getCategories())
{
List<Application> items = category.getApplications();
for (Application item : items)
@@ -117,7 +77,7 @@
public void setSelectedCategory(String categoryName)
{
- for (ApplicationCategory category : categories)
+ for (ApplicationCategory category : getCategories())
{
if (category.getName().equals(categoryName))
{
@@ -155,22 +115,76 @@
public List<ApplicationCategory> getCategories()
{
- return categories;
+ try
+ {
+ //TODO: Handle concurrent requests associated with current session
+ if (categories == null)
+ {
+ initAllCategories();
+ }
+ return categories;
+ }
+ catch (Exception ex)
+ {
+ return null;
+ }
}
- static class PortletCategoryComparator implements Comparator<ApplicationCategory>
+ private void initAllCategories() throws Exception
{
- public int compare(ApplicationCategory cat1, ApplicationCategory cat2)
+ String remoteUser = Util.getPortalRequestContext().getRemoteUser();
+ if (remoteUser == null || remoteUser.equals(""))
+ { return; }
+
+ ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
+ UserACL userACL = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
+
+ final Comparator<Application> appComparator = new Comparator<Application>()
{
- return cat1.getDisplayName().compareToIgnoreCase(cat2.getDisplayName());
+ public int compare(Application p_1, Application p_2)
+ {
+ return p_1.getDisplayName().compareToIgnoreCase(p_2.getDisplayName());
+ }
+ };
+ final Comparator<ApplicationCategory> cateComparator = new Comparator<ApplicationCategory>()
+ {
+ public int compare(ApplicationCategory p_1, ApplicationCategory p_2)
+ {
+ return p_1.getDisplayName().compareToIgnoreCase(p_2.getDisplayName());
+ }
+ };
+
+ List<ApplicationCategory> allCategories = service.getApplicationCategories(remoteUser);
+ categories = new ArrayList<ApplicationCategory>();
+
+ for (ApplicationCategory category : allCategories)
+ {
+ List<Application> apps = category.getApplications();
+ List<String> accessPermission = category.getAccessPermissions();
+ if(accessPermission == null)
+ {
+ continue;
+ }
+
+ accessCheck:
+ for (String p : accessPermission)
+ {
+ if (userACL.hasPermission(p))
+ {
+ if (apps.size() > 0)
+ {
+ Collections.sort(apps, appComparator);
+ }
+ categories.add(category);
+ }
+ break accessCheck;
+ }
}
- }
- static class PortletComparator implements Comparator<Application>
- {
- public int compare(Application p1, Application p2)
+ if (categories.size() > 0)
{
- return p1.getDisplayName().compareToIgnoreCase(p2.getDisplayName());
+ Collections.sort(categories, cateComparator);
+ selectedCategory = categories.get(0);
}
}
13 years, 5 months
gatein SVN: r6914 - portal/branches/branch-GTNPORTAL-1963/web/eXoResources/src/main/webapp/javascript/eXo/webui.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2011-07-22 06:09:29 -0400 (Fri, 22 Jul 2011)
New Revision: 6914
Modified:
portal/branches/branch-GTNPORTAL-1963/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
Log:
GTNPORTAL-1951 Javascript error when switch View Mode during edit Dashboard page
Modified: portal/branches/branch-GTNPORTAL-1963/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
===================================================================
--- portal/branches/branch-GTNPORTAL-1963/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2011-07-22 04:52:05 UTC (rev 6913)
+++ portal/branches/branch-GTNPORTAL-1963/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2011-07-22 10:09:29 UTC (rev 6914)
@@ -254,9 +254,12 @@
}
};
- UIDashboard.prototype.onLoad = function(windowId, canEdit) {
- var portletWindow = document.getElementById(windowId) ? document.getElementById(windowId) : document.getElementById("UIPortlet-" + windowId);
- if(!portletWindow) return;
+ UIDashboard.prototype.onLoad = function(windowId, canEdit) {
+ var portletWindow = document.getElementById(windowId);
+ if(!portletWindow) {
+ windowId = "UIPortlet-" + windowId;
+ portletWindow = document.getElementById(windowId);
+ }
var DOMUtil = eXo.core.DOMUtil;
var uiDashboard = DOMUtil.findFirstDescendantByClass(portletWindow, "div", "UIDashboard");
13 years, 5 months
gatein SVN: r6913 - in portal/trunk: component/application-registry and 21 other directories.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-07-22 00:52:05 -0400 (Fri, 22 Jul 2011)
New Revision: 6913
Added:
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestBootstrap.java
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganization.java
portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-configuration.xml
portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-picketlink-idm-config.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObject.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttribute.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredential.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialType.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationship.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipName.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipType.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectType.hbm.xml
portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateRealm.hbm.xml
portal/trunk/component/identity/src/test/resources/org/
portal/trunk/component/identity/src/test/resources/org/exoplatform/
portal/trunk/component/identity/src/test/resources/org/exoplatform/services/
portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/
portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganization-configuration.xml
portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelBootstrap.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelTestSuite.java
portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/KernelBootstrapTestCase.java
Removed:
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java
portal/trunk/component/identity/src/test/resources/conf/portal/idm-configuration.xml
portal/trunk/component/identity/src/test/resources/conf/portal/organization-configuration.xml
portal/trunk/component/identity/src/test/resources/conf/portal/test-configuration.xml
portal/trunk/component/test/organization/
Modified:
portal/trunk/component/application-registry/pom.xml
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java
portal/trunk/component/common/pom.xml
portal/trunk/component/identity/pom.xml
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
portal/trunk/component/resources/pom.xml
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/GateInTestClassLoader.java
portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
portal/trunk/component/test/pom.xml
portal/trunk/pom.xml
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UINavigationPortlet.java
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UISitemapPortlet.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
Log:
GTNPORTAL-1962 The navigation import should be configurable some modes for particular requirement
- Improve testcase initial data on each
Modified: portal/trunk/component/application-registry/pom.xml
===================================================================
--- portal/trunk/component/application-registry/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/application-registry/pom.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -71,7 +71,8 @@
<dependency>
<groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.test.organization</artifactId>
+ <artifactId>exo.portal.component.identity</artifactId>
+ <type>test-jar</type>
<scope>test</scope>
</dependency>
@@ -103,4 +104,19 @@
<artifactId>pc-api</artifactId>
</dependency>
</dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -26,9 +26,9 @@
*/
@ConfiguredBy({
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.organization-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.application-registry-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration1.xml")
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml")
})
public abstract class AbstractApplicationRegistryTest extends AbstractKernelTest
{
Modified: portal/trunk/component/common/pom.xml
===================================================================
--- portal/trunk/component/common/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/common/pom.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -96,4 +96,19 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
Modified: portal/trunk/component/identity/pom.xml
===================================================================
--- portal/trunk/component/identity/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/identity/pom.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -92,4 +92,35 @@
</dependency>
</dependencies>
+
+ <build>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Added: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestBootstrap.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestBootstrap.java (rev 0)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestBootstrap.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 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.services.organization;
+
+import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.database.HibernateService;
+import org.exoplatform.services.organization.impl.UserImpl;
+
+@ConfiguredBy({@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml")})
+public class TestBootstrap extends AbstractKernelTest
+{
+
+ public void testWorkspace() throws Exception
+ {
+ PortalContainer container = PortalContainer.getInstance();
+ HibernateService hibernate = (HibernateService)container.getComponentInstanceOfType(HibernateService.class);
+ assertNotNull(hibernate);
+ OrganizationService organization = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
+ assertNotNull(organization);
+ }
+
+ public void testBasicOperation() throws Exception
+ {
+ PortalContainer container = PortalContainer.getInstance();
+ OrganizationService organization = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
+ assertNotNull(organization);
+
+ begin();
+ User test = new UserImpl("testUser");
+ organization.getUserHandler().createUser(test, false);
+
+ test = organization.getUserHandler().findUserByName("toto");
+ assertNull(test);
+ test = organization.getUserHandler().findUserByName("testUser");
+ assertNotNull(test);
+ end();
+ }
+
+}
\ No newline at end of file
Deleted: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -1,157 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2010, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.services.organization;
-
-import org.exoplatform.commons.utils.PageList;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
-import org.exoplatform.container.component.RequestLifeCycle;
-import org.exoplatform.services.organization.idm.Config;
-import org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by The eXo Platform SAS Author : Hoa Pham hoapham@exoplatform.com,phamvuxuanhoa(a)yahoo.com
- * Oct 27, 2005
- */
-
-public class TestConfigOrganizationService extends AbstractGateInTest
-{
-
- static String Group1 = "Group1";
-
- static String Group2 = "Group2";
-
- static String Group3 = "Group3";
-
- static String Benj = "Benj";
-
- static String Tuan = "Tuan";
-
- OrganizationService service_;
-
- UserHandler userHandler_;
-
- UserProfileHandler profileHandler_;
-
- GroupHandler groupHandler_;
-
- MembershipTypeHandler mtHandler_;
-
- MembershipHandler membershipHandler_;
-
- boolean runtest = true;
-
- private static final String USER = "test";
-
- private static final List<String> USERS;
-
- private static final int USERS_LIST_SIZE = 15;
-
- private PortalContainer manager;
-
- static
- {
- USERS = new ArrayList<String>(USERS_LIST_SIZE);
- for (int i = 0; i < USERS_LIST_SIZE; i++)
- USERS.add(USER + "_" + i);
- }
-
- public TestConfigOrganizationService(String s)
- {
- super(s);
- }
-
- public void setUp() throws Exception
- {
- if (!runtest)
- return;
-
- manager = PortalContainer.getInstance();
- service_ = (OrganizationService)manager.getComponentInstanceOfType(OrganizationService.class);
- userHandler_ = service_.getUserHandler();
- profileHandler_ = service_.getUserProfileHandler();
- groupHandler_ = service_.getGroupHandler();
- mtHandler_ = service_.getMembershipTypeHandler();
- membershipHandler_ = service_.getMembershipHandler();
-
-// ((ComponentRequestLifecycle)service_).startRequest(manager);
- RequestLifeCycle.begin((ComponentRequestLifecycle)service_);
-
- }
-
- public void tearDown() throws Exception
- {
- Query query = new Query();
- query.setUserName(USER + "*");
- PageList users = userHandler_.findUsers(query);
-
- List<User> allUsers = users.getAll();
-
- for (int i = allUsers.size() - 1; i >= 0; i--)
- {
- String userName = allUsers.get(i).getUserName();
- userHandler_.removeUser(userName, true);
- }
-
-// ((ComponentRequestLifecycle)service_).endRequest(manager);
- RequestLifeCycle.end();
- }
-
- public void testSimple() throws Exception
- {
- assertTrue(true);
- Config config = ((PicketLinkIDMOrganizationServiceImpl)service_).getConfiguration();
-
- assertNotNull(config);
- assertNotNull(config.getGroupTypeMappings());
- assertNotNull(config.getGroupTypeMappings().keySet());
-
- assertEquals(config.getGroupTypeMappings().keySet().size(), 5);
- assertEquals(config.getGroupTypeMappings().get("/"), "root_type");
-
- assertEquals(config.getGroupType("/"), "root_type");
- assertEquals(config.getGroupType(null), "root_type");
- assertEquals(config.getGroupType("/platform"), "platform_type");
- assertEquals(config.getGroupType("/platform/administrators"), "platform_type");
- assertEquals(config.getGroupType("/platform/guests"), "platform_type");
- assertEquals(config.getGroupType("/platform/users"), "users_type");
- assertEquals(config.getGroupType("/platform/users/john"), "platform_type");
- assertEquals(config.getGroupType("/organization/acme/france/offices"), ".organization.acme.france.offices");
- assertEquals(config.getGroupType("/organization/acme/france/offices/paris"), ".organization.acme.france.offices.paris");
- assertEquals(config.getGroupType("/organization/acme/france"), "france_type");
- assertEquals(config.getGroupType("/organization/acme"), ".organization.acme");
- assertEquals(config.getGroupType("/foo/bar"), ".foo.bar");
- assertEquals(config.getGroupType("/foo"), ".foo");
- assertEquals(config.getGroupType("/toto"), "toto_type");
- assertEquals(config.getGroupType("/toto/lolo"), "toto_type");
- assertEquals(config.getGroupType("/toto/lolo/tutu"), "toto_type");
-
-
- }
-
-
-
-}
\ No newline at end of file
Added: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganization.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganization.java (rev 0)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganization.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,238 @@
+/**
+ * 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.services.organization;
+
+import junit.framework.Assert;
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.organization.GroupHandler;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserHandler;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
+ * 13, 2007
+ */
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/services/organization/TestOrganization-configuration.xml")
+})
+public class TestOrganization extends AbstractKernelTest
+{
+
+ private static final String GROUP_1 = "testOrganization_group1";
+ private static final String GROUP_2 = "testOrganization_group2";
+ private static final String GROUP_3 = "testOrganization_group3";
+
+ private static final String USER_1 = "testOrganization_user1";
+ private static final String USER_2 = "testOrganization_user2";
+ private static final String USER_3 = "testOrganization_user3";
+ private static final String DEFAULT_PASSWORD = "defaultpassword";
+ private static final String DESCRIPTION = " Description";
+
+ private OrganizationService organizationService;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ begin();
+ PortalContainer container = getContainer();
+ organizationService = (OrganizationService)container.getComponentInstance(OrganizationService.class);
+
+ createGroup(null, GROUP_1);
+ createGroup(GROUP_1, GROUP_2);
+ createGroup(GROUP_1, GROUP_3);
+
+ createUser(USER_1, GROUP_1);
+ createUser(USER_2, GROUP_2);
+ createUser(USER_3, GROUP_1);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ deleteGroup(GROUP_1);
+ deleteGroup(GROUP_2);
+ deleteGroup(GROUP_3);
+
+ deleteUser(USER_1);
+ deleteUser(USER_2);
+ deleteUser(USER_3);
+
+ end();
+ super.tearDown();
+ }
+
+ public void testFindGroupNotFound() throws Exception {
+ GroupHandler groupHander = organizationService.getGroupHandler();
+ Group group = groupHander.findGroupById(GROUP_1 + "NOTFOUND");
+ assertNull(group);
+ }
+
+ public void testFindGroupFromRoot() throws Exception
+ {
+ GroupHandler handler = organizationService.getGroupHandler();
+ Collection allGroups = handler.findGroups(null);
+ Assert.assertTrue(allGroups.size() > 0);
+ }
+
+ public void testFindGroupById() throws Exception
+ {
+ GroupHandler groupHandler = organizationService.getGroupHandler();
+ Group group = groupHandler.findGroupById(GROUP_1);
+ assertNotNull(group);
+ assertEquals(GROUP_1, group.getGroupName());
+ assertEquals(GROUP_1 + DESCRIPTION, group.getDescription());
+
+ group = groupHandler.findGroupById(GROUP_3);
+ assertNotNull(group);
+ assertEquals(GROUP_3, group.getGroupName());
+ }
+
+ public void testFindGroupOfUser() {
+ GroupHandler groupHandler = organizationService.getGroupHandler();
+ try {
+ Collection<Group> groups = groupHandler.findGroupsOfUser(USER_1);
+ assertNotNull(groups);
+ assertTrue(groups.size() >= 1);
+ } catch (Exception e) {
+ fail();
+ }
+ }
+
+ public void testFindUserByGroup() throws Exception
+ {
+ GroupHandler groupHandler = organizationService.getGroupHandler();
+ Group group = groupHandler.findGroupById(GROUP_1);
+ UserHandler uHandler = organizationService.getUserHandler();
+ PageList users = uHandler.findUsersByGroup("/platform/administrators");
+ Assert.assertTrue(users.getAvailable() > 0);
+
+ List iterator = users.getAll();
+ for (Object test : iterator)
+ {
+ User a = (User)test;
+ System.out.println(a.getUserName());
+ }
+ }
+
+ public void testChangePassword() throws Exception
+ {
+ UserHandler uHandler = organizationService.getUserHandler();
+ User user = uHandler.findUserByName("root");
+ Assert.assertNotNull(user);
+ Assert.assertTrue(uHandler.authenticate("root", "gtn"));
+
+ // Test changing password
+ user.setPassword("newPassword");
+ uHandler.saveUser(user, false);
+ user = uHandler.findUserByName("root");
+ Assert.assertNotNull(user);
+ Assert.assertTrue(uHandler.authenticate("root", "newPassword"));
+
+ // Reset to default password
+ user.setPassword("gtn");
+ uHandler.saveUser(user, false);
+
+ }
+
+ private void createGroup(String parent, String name)
+ {
+ GroupHandler groupHandler = organizationService.getGroupHandler();
+ try
+ {
+ Group parentGroup = null;
+ if (parent != null)
+ {
+ parentGroup = groupHandler.findGroupById(parent);
+ }
+ Group newGroup = groupHandler.createGroupInstance();
+ newGroup.setGroupName(name);
+ newGroup.setDescription(name + DESCRIPTION);
+ newGroup.setLabel(name);
+ if (parentGroup != null)
+ {
+ groupHandler.addChild(parentGroup, newGroup, true);
+ }
+ groupHandler.saveGroup(newGroup, true);
+ }
+
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("Error on create group [" + name + "] " + e.getMessage());
+ }
+ }
+ private void deleteGroup(String name)
+ {
+ GroupHandler groupHandler = organizationService.getGroupHandler();
+ try
+ {
+ Group group = groupHandler.findGroupById(name);
+ groupHandler.removeGroup(group, true);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ private void createUser(String username, String... groups)
+ {
+ UserHandler userHandler = organizationService.getUserHandler();
+ User user = userHandler.createUserInstance(username);
+ user.setPassword(DEFAULT_PASSWORD);
+ user.setFirstName("default");
+ user.setLastName("default");
+ user.setEmail("exo(a)exoportal.org");
+ user.setOrganizationId(groups[0]);
+ try
+ {
+ userHandler.createUser(user, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("Error on create user: " + e.getMessage());
+ }
+ }
+
+ private void deleteUser(String username)
+ {
+ UserHandler userHandler = organizationService.getUserHandler();
+ try
+ {
+ userHandler.removeUser(username, true);
+ }
+ catch (Exception e)
+ {
+
+ }
+ }
+}
Modified: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -21,9 +21,15 @@
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.component.test.AbstractGateInTest;
+import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.services.organization.idm.Config;
+import org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl;
import org.exoplatform.services.organization.idm.UserDAOImpl;
import java.util.ArrayList;
@@ -34,7 +40,11 @@
* Oct 27, 2005
*/
-public class TestOrganizationService extends AbstractGateInTest
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/services/organization/TestOrganizationService-configuration.xml")
+})
+public class TestOrganizationService extends AbstractKernelTest
{
static String Group1 = "Group1";
@@ -117,6 +127,36 @@
RequestLifeCycle.end();
}
+ public void testSimple() throws Exception
+ {
+ assertTrue(true);
+ Config config = ((PicketLinkIDMOrganizationServiceImpl)service_).getConfiguration();
+
+ assertNotNull(config);
+ assertNotNull(config.getGroupTypeMappings());
+ assertNotNull(config.getGroupTypeMappings().keySet());
+
+ assertEquals(config.getGroupTypeMappings().keySet().size(), 5);
+ assertEquals(config.getGroupTypeMappings().get("/"), "root_type");
+
+ assertEquals(config.getGroupType("/"), "root_type");
+ assertEquals(config.getGroupType(null), "root_type");
+ assertEquals(config.getGroupType("/platform"), "platform_type");
+ assertEquals(config.getGroupType("/platform/administrators"), "platform_type");
+ assertEquals(config.getGroupType("/platform/guests"), "platform_type");
+ assertEquals(config.getGroupType("/platform/users"), "users_type");
+ assertEquals(config.getGroupType("/platform/users/john"), "platform_type");
+ assertEquals(config.getGroupType("/organization/acme/france/offices"), ".organization.acme.france.offices");
+ assertEquals(config.getGroupType("/organization/acme/france/offices/paris"), ".organization.acme.france.offices.paris");
+ assertEquals(config.getGroupType("/organization/acme/france"), "france_type");
+ assertEquals(config.getGroupType("/organization/acme"), ".organization.acme");
+ assertEquals(config.getGroupType("/foo/bar"), ".foo.bar");
+ assertEquals(config.getGroupType("/foo"), ".foo");
+ assertEquals(config.getGroupType("/toto"), "toto_type");
+ assertEquals(config.getGroupType("/toto/lolo"), "toto_type");
+ assertEquals(config.getGroupType("/toto/lolo/tutu"), "toto_type");
+ }
+
public void testUserPageSize() throws Exception
{
for (String name : USERS)
Added: portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-configuration.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+ <value>jar:/conf/exo.portal.component.identity-picketlink-idm-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>60</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.connection.datasource" value="jdbcidm"/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>conf/mappings/HibernateRealm.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcidm</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param profiles="hsqldb">
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:${gatein.test.tmp.dir}/db/data/jdbcidm"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ <properties-param profiles="mysql">
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
+ <property name="url" value="jdbc:mysql://10.37.129.4/jdbcidm?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8"/>
+ <property name="username" value="root"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Added: portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-picketlink-idm-config.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-picketlink-idm-config.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/exo.portal.component.identity-picketlink-idm-config.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_ga"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_ga identity-config.xsd">
+ <realms>
+ <realm>
+ <id>idm_realm</id>
+ <repository-id-ref>PortalRepository</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>PortalRepository</id>
+ <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>HibernateStore</default-identity-store-id>
+ <default-attribute-store-id>HibernateStore</default-attribute-store-id>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>HibernateStore</id>
+ <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+ <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ <relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>hibernateSessionFactoryRegistryName</name>
+ <value>hibernateSessionFactory</value>
+ </option>
+ <option>
+ <name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObject.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObject.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObject.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject"
+ table="jbid_io">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <set name="attributes"
+ inverse="true"
+ cascade="all, delete-orphan"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key>
+ <column name="IDENTITY_OBJECT_ID" />
+ </key>
+ <one-to-many class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttribute" />
+ </set>
+ <set name="credentials"
+ inverse="true"
+ cascade="all, delete-orphan"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key>
+ <column name="IDENTITY_OBJECT_ID" />
+ </key>
+ <one-to-many class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredential" />
+ </set>
+ <set name="fromRelationships"
+ inverse="true"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key>
+ <column name="FROM_IDENTITY" />
+ </key>
+ <one-to-many class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship" />
+ </set>
+ <many-to-one name="identityType"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectType"
+ access="field"
+ fetch="join"
+ lazy="false">
+ <column name="IDENTITY_TYPE"
+ not-null="true"
+ unique-key="id"/>
+ </many-to-one>
+ <property name="name"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="NAME"
+ not-null="true"
+ unique-key="id"/>
+ </property>
+ <map name="properties"
+ table="jbid_io_props"
+ cascade="all, delete-orphan"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key column="PROP_ID"/>
+ <map-key type="string"
+ column="PROP_NAME"/>
+ <element type="string"
+ column="PROP_VALUE"
+ not-null="true"/>
+ </map>
+ <many-to-one name="realm"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateRealm"
+ access="field"
+ fetch="select">
+ <column name="REALM"
+ not-null="true"
+ unique-key="id"/>
+ </many-to-one>
+ <set name="toRelationships"
+ inverse="true"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key>
+ <column name="TO_IDENTITY" />
+ </key>
+ <one-to-many class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship" />
+ </set>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttribute.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttribute.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttribute.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"
+ table="jbid_io_attr">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ATTRIBUTE_ID" />
+ <generator class="native"/>
+ </id>
+ <many-to-one name="identityObject"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject"
+ access="field"
+ fetch="join">
+ <column name="IDENTITY_OBJECT_ID" not-null="true" unique-key="id"/>
+ </many-to-one>
+ <property name="name"
+ type="java.lang.String"
+ access="property"
+ lazy="false">
+ <column name="NAME"
+ unique-key="id" />
+ </property>
+ <property name="type"
+ type="java.lang.String"
+ access="field"
+ lazy="false"
+ not-null="true">
+ <column name="ATTRIBUTE_TYPE"/>
+ </property>
+ <set name="textValues"
+ table="jbid_io_attr_text_values"
+ cascade="all, delete-orphan"
+ access="field"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key column="TEXT_ATTR_VALUE_ID"/>
+ <element type="string"
+ column="ATTR_VALUE"/>
+ </set>
+ <many-to-one name="binaryValue"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttributeBinaryValue"
+ not-null="false"
+ column="BIN_VALUE_ID"
+ unique="false"
+ lazy="proxy"
+ access="field"
+ fetch="select"
+ cascade="all"/>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttributeBinaryValue"
+ table="jbid_attr_bin_value">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="BIN_VALUE_ID" />
+ <generator class="native"/>
+ </id>
+ <property name="value"
+ type="org.hibernate.type.PrimitiveByteArrayBlobType"
+ access="field"
+ lazy="false"
+ not-null="true">
+ <column name="VALUE" length="10240000"/>
+ </property>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredential.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredential.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredential.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredential"
+ table="jbid_io_creden">
+ <cache usage="read-write"/>
+
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <many-to-one name="binaryValue"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialBinaryValue"
+ not-null="false"
+ column="BIN_VALUE_ID"
+ unique="false"
+ lazy="proxy"
+ access="field"
+ fetch="select"
+ cascade="all"/>
+ <many-to-one name="identityObject"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject"
+ access="field"
+ fetch="select"
+ lazy="proxy">
+ <column name="IDENTITY_OBJECT_ID"
+ not-null="true"
+ unique-key="id" />
+ </many-to-one>
+ <map name="properties"
+ table="jbid_io_creden_props"
+ cascade="all, delete-orphan"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key column="PROP_ID"/>
+ <map-key type="string"
+ column="PROP_NAME"/>
+ <element type="string"
+ column="PROP_VALUE"
+ not-null="true"/>
+ </map>
+ <property name="textValue"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="TEXT" />
+ </property>
+ <many-to-one name="type"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"
+ access="field"
+ fetch="join"
+ lazy="false">
+ <column name="CREDENTIAL_TYPE"
+ not-null="true"
+ unique-key="id"/>
+ </many-to-one>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialBinaryValue"
+ table="jbid_creden_bin_value">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="BIN_VALUE_ID" />
+ <generator class="native"/>
+ </id>
+ <property name="value"
+ type="org.hibernate.type.PrimitiveByteArrayBlobType"
+ access="field"
+ lazy="false"
+ not-null="true">
+ <column name="VALUE" length="10240000"/>
+ </property>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialType.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialType.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectCredentialType.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"
+ table="jbid_io_creden_type">
+ <cache usage="read-write"/>
+
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <property name="name"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="NAME"
+ unique="true" />
+ </property>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationship.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationship.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationship.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"
+ table="jbid_io_rel">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <many-to-one name="fromIdentityObject"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject"
+ access="field"
+ fetch="select"
+ lazy="proxy">
+ <column name="FROM_IDENTITY"
+ not-null="true"
+ unique-key="id"/>
+ </many-to-one>
+ <many-to-one name="name"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"
+ access="field"
+ fetch="join"
+ lazy="proxy">
+ <column name="NAME"
+ unique-key="id"/>
+ </many-to-one>
+ <many-to-one name="toIdentityObject"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject"
+ access="field"
+ fetch="select"
+ lazy="proxy">
+ <column name="TO_IDENTITY"
+ not-null="true"
+ unique-key="id"/>
+ </many-to-one>
+ <many-to-one name="type"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"
+ access="field"
+ fetch="select"
+ lazy="proxy">
+ <column name="REL_TYPE"
+ not-null="true"
+ unique-key="id" />
+ </many-to-one>
+ <map name="properties"
+ table="jbid_io_rel_props"
+ cascade="all, delete-orphan"
+ fetch="subselect"
+ lazy="extra">
+ <cache usage="read-write"/>
+ <key column="PROP_ID"/>
+ <map-key type="string"
+ column="PROP_NAME"/>
+ <element type="string"
+ column="PROP_VALUE"
+ not-null="true"/>
+ </map>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipName.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipName.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipName.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"
+ table="jbid_io_rel_name">
+ <cache usage="read-write"/>
+
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID"/>
+ <generator class="native"/>
+ </id>
+ <property name="name"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="NAME"
+ not-null="true"
+ unique="true"
+ unique-key="id"/>
+ </property>
+ <map name="properties"
+ table="jbid_io_rel_name_props"
+ cascade="all, delete-orphan"
+ lazy="extra"
+ fetch="subselect">
+ <cache usage="read-write"/>
+ <key column="PROP_ID"/>
+ <map-key type="string"
+ column="PROP_NAME"/>
+ <element type="string"
+ column="PROP_VALUE"
+ not-null="true"/>
+ </map>
+ <many-to-one name="realm"
+ class="org.picketlink.idm.impl.model.hibernate.HibernateRealm"
+ access="field"
+ fetch="select"
+ lazy="proxy">
+ <column name="REALM"
+ not-null="true"
+ unique-key="id"/>
+ </many-to-one>
+
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipType.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipType.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectRelationshipType.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"
+ table="jbid_io_rel_type">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <property name="name"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="NAME"
+ not-null="true"
+ unique="true" />
+ </property>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectType.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectType.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateIdentityObjectType.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectType"
+ table="jbid_io_type">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <property name="name"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="NAME"
+ not-null="true"
+ unique="true" />
+ </property>
+ </class>
+</hibernate-mapping>
Added: portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateRealm.hbm.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateRealm.hbm.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/conf/mappings/HibernateRealm.hbm.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.picketlink.idm.impl.model.hibernate.HibernateRealm"
+ table="jbid_realm">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="ID" />
+ <generator class="native"/>
+ </id>
+ <property name="name"
+ type="java.lang.String"
+ access="field"
+ lazy="false">
+ <column name="NAME"
+ not-null="true"
+ unique-key="id"/>
+ </property>
+ <map name="properties"
+ table="jbid_real_props"
+ cascade="all, delete-orphan"
+ fetch="subselect"
+ lazy="extra">
+ <cache usage="read-write"/>
+ <key column="PROP_ID"/>
+ <map-key type="string"
+ column="PROP_NAME"/>
+ <element type="string"
+ column="PROP_VALUE"
+ not-null="true"/>
+ </map>
+ </class>
+</hibernate-mapping>
Deleted: portal/trunk/component/identity/src/test/resources/conf/portal/idm-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/portal/idm-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/identity/src/test/resources/conf/portal/idm-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <key>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
- <init-params>
- <value-param>
- <name>config</name>
- <value>jar:/conf/portal/idm-config.xml</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
- <init-params>
- <object-param>
- <name>configuration</name>
- <object type="org.exoplatform.services.organization.idm.Config">
- <field name="useParentIdAsGroupType">
- <boolean>true</boolean>
- </field>
- <field name="groupTypeMappings">
- <map type="java.util.HashMap">
- <entry>
- <key><string>/</string></key>
- <value><string>root_type</string></value>
- </entry>
- <entry>
- <key><string>/platform/*</string></key>
- <value><string>platform_type</string></value>
- </entry>
- <entry>
- <key><string>/platform/users</string></key>
- <value><string>users_type</string></value>
- </entry>
- <entry>
- <key><string>/organization/acme/france</string></key>
- <value><string>france_type</string></value>
- </entry>
- <entry>
- <key><string>/toto/*</string></key>
- <value><string>toto_type</string></value>
- </entry>
- </map>
- </field>
- <!-- If this option is used then each Membership created with MembrshipType that is
- equal to value specified here will be stored in PicketLink IDM as simple
- Group-User association-->
- <field name="associationMembershipType">
- <string>member</string>
- </field>
- <!-- if "associationMembershipType" option is used and this option is set to true
- then Membership with MembershipType configured to be stored as PicketLink IDM association
- will not be stored as PicketLink IDM Role -->
- <field name="ignoreMappedMembershipType">
- <boolean>false</boolean>
- </field>
- </object>
- </object-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.database.HibernateService</key>
- <jmx-name>database:type=HibernateService</jmx-name>
- <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
- <init-params>
- <properties-param>
- <name>hibernate.properties</name>
- <description>Default Hibernate Service</description>
- <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
- <!--<property name="hibernate.show_sql" value="true"/>-->
- <!--<property name="hibernate.use_sql_comments" value="true"/>-->
- <!--<property name="hibernate.format_sql" value="true"/>-->
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.jdbc.batch_size" value="0"/>
- <property name="hibernate.cache.use_second_level_cache" value="true"/>
- <property name="hibernate.cache.use_query_cache" value="true"/>
- <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:${basedir}/target/temp/data/exodb${container.name.suffix}"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
- </init-params>
- </component>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.database.HibernateService</target-component>
- <component-plugin>
- <name>add.hibernate.mapping</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
- <init-params>
- <values-param>
- <name>hibernate.mapping</name>
- <value>mappings/HibernateRealm.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
- <value>mappings/HibernateIdentityObject.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
- <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
Deleted: portal/trunk/component/identity/src/test/resources/conf/portal/organization-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/portal/organization-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/identity/src/test/resources/conf/portal/organization-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <external-component-plugins>
- <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
- <component-plugin>
- <name>init.service.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
- <description>this listener populate organization data for the first launch</description>
- <init-params>
- <value-param>
- <name>checkDatabaseAlgorithm</name>
- <description>check database</description>
- <value>empty</value>
- </value-param>
- <value-param>
- <name>printInformation</name>
- <description>Print information init database</description>
- <value>true</value>
- </value-param>
- <object-param>
- <name>configuration</name>
- <description>description</description>
- <object type="org.exoplatform.services.organization.OrganizationConfig">
- <field name="membershipType">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
- <field name="type"><string>member</string></field>
- <field name="description"><string>member membershipt type</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>users</string></field>
- <field name="parentId"><string></string></field>
- <!--<field name="type"><string>hierachy</string></field>-->
- <field name="description"><string>the /users group</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="user">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>demo</string></field>
- <field name="password"><string>exo</string></field>
- <field name="firstName"><string>demo</string></field>
- <field name="lastName"><string>demo</string></field>
- <field name="email"><string>demo@localhost</string></field>
- <field name="groups">
- <string>member:/users</string>
- </field>
- </object>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
-
- <component-plugin>
- <name>new.user.event.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
- <description>this listener assign group and membership to a new created user</description>
- <init-params>
- <object-param>
- <name>configuration</name>
- <description>description</description>
- <object type="org.exoplatform.services.organization.impl.NewUserConfig">
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
- <field name="groupId"><string>/users</string></field>
- <field name="membership"><string>member</string></field>
- </object>
- </value>
- </collection>
- </field>
- <field name="ignoredUser">
- <collection type="java.util.HashSet">
- <value><string>demo</string></value>
- <value><string>admin</string></value>
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
Deleted: portal/trunk/component/identity/src/test/resources/conf/portal/test-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/conf/portal/test-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/identity/src/test/resources/conf/portal/test-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
- <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
- <init-params>
- <value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>Log4J properties</description>
- <property name="log4j.rootLogger" value="DEBUG, stdout" />
- <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
- <property name="log4j.appender.stdout.threshold" value="INFO" />
- <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
- <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.cache.CacheService</key>
- <jmx-name>cache:type=CacheService</jmx-name>
- <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
- <init-params>
- <object-param>
- <name>cache.config.default</name>
- <description>The default cache configuration</description>
- <object type="org.exoplatform.services.cache.ExoCacheConfig">
- <field name="name"><string>default</string></field>
- <field name="maxSize"><int>300</int></field>
- <field name="liveTime"><long>300</long></field>
- <field name="distributed"><boolean>false</boolean></field>
- <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
- </object>
- </object-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.database.DatabaseService</key>
- <type>org.exoplatform.services.database.impl.XAPoolTxSupportDatabaseService</type>
- <init-params>
- <properties-param>
- <name>default</name>
- <description>Connection configuration</description>
- <property name='connection.driver' value='org.hsqldb.jdbcDriver' />
- <property name='connection.url' value='jdbc:hsqldb:mem:db/default' />
- <property name='connection.login' value='sa' />
- <property name='connection.password' value='' />
- <property name='connection.min-size' value='3' />
- <property name='connection.max-size' value='5' />
- </properties-param>
- </init-params>
- </component>
-
- <import>classpath:/conf/portal/idm-configuration.xml</import>
- <import>classpath:/conf/portal/organization-configuration.xml</import>
-</configuration>
\ No newline at end of file
Added: portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganization-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganization-configuration.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganization-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
+ <description>this listener assign group and membership to a new created user</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig">
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
+ <field name="groupId"><string>/platform/users</string></field>
+ <field name="membership"><string>member</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="ignoredUser">
+ <collection type="java.util.HashSet">
+ <value><string>root</string></value>
+ <value><string>john</string></value>
+ <value><string>mary</string></value>
+ <value><string>demo</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <description>this listener populate organization data for the first launch</description>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <description>check database</description>
+ <value>entry</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <description>Print information init database</description>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>manager</string></field>
+ <field name="description"><string>manager membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>member</string></field>
+ <field name="description"><string>member membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>validator</string></field>
+ <field name="description"><string>validator membership type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>platform</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /platform group</string></field>
+ <field name="label"><string>Platform</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>administrators</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/administrators group</string></field>
+ <field name="label"><string>Administrators</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>users</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/users group</string></field>
+ <field name="label"><string>Users</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>guests</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/guests group</string></field>
+ <field name="label"><string>Guests</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>organization</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the organization group</string></field>
+ <field name="label"><string>Organization</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>management</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/management group</string></field>
+ <field name="label"><string>Management</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>executive-board</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/executive-board group</string></field>
+ <field name="label"><string>Executive Board</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>human-resources</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/human-resource group</string></field>
+ <field name="label"><string>Human Resources</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>communication</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/communication group</string></field>
+ <field name="label"><string>Communication</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>marketing</string></field>
+ <field name="parentId"><string>/organization/communication</string></field>
+ <field name="description"><string>the /organization/communication/marketing group</string></field>
+ <field name="label"><string>Marketing</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>press-and-media</string></field>
+ <field name="parentId"><string>/organization/communication</string></field>
+ <field name="description"><string>the /organization/communication/press-and-media group</string></field>
+ <field name="label"><string>Press and Media</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>operations</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/operations and media group</string></field>
+ <field name="label"><string>Operations</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>sales</string></field>
+ <field name="parentId"><string>/organization/operations</string></field>
+ <field name="description"><string>the /organization/operations/sales group</string></field>
+ <field name="label"><string>Sales</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>finances</string></field>
+ <field name="parentId"><string>/organization/operations</string></field>
+ <field name="description"><string>the /organization/operations/finances group</string></field>
+ <field name="label"><string>Finances</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>customers</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /customers group</string></field>
+ <field name="label"><string>Customers</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>partners</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /partners group</string></field>
+ <field name="label"><string>Partners</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>root</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Root</string></field>
+ <field name="lastName"><string>Root</string></field>
+ <field name="email"><string>root@localhost</string></field>
+ <field name="groups">
+ <string>
+ manager:/platform/administrators,member:/platform/users,
+ member:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>john</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>John</string></field>
+ <field name="lastName"><string>Anthony</string></field>
+ <field name="email"><string>john@localhost</string></field>
+ <field name="groups">
+ <string>
+ member:/platform/administrators,member:/platform/users,
+ manager:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>mary</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Mary</string></field>
+ <field name="lastName"><string>Kelly</string></field>
+ <field name="email"><string>mary@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>demo</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Demo</string></field>
+ <field name="lastName"><string>gtn</string></field>
+ <field name="email"><string>demo@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/guests,member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>overwritelayout</string></field>
+ <field name="password"><string>whatever</string></field>
+ <field name="firstName"><string>whatever</string></field>
+ <field name="lastName"><string>whatever</string></field>
+ <field name="email"><string>whatever@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/guests</string>
+ </field>
+ </object>
+ </value>
+
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Added: portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml (rev 0)
+++ portal/trunk/component/identity/src/test/resources/org/exoplatform/services/organization/TestOrganizationService-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="DEBUG, stdout" />
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="INFO" />
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>300</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.database.DatabaseService</key>
+ <type>org.exoplatform.services.database.impl.XAPoolTxSupportDatabaseService</type>
+ <init-params>
+ <properties-param>
+ <name>default</name>
+ <description>Connection configuration</description>
+ <property name='connection.driver' value='org.hsqldb.jdbcDriver' />
+ <property name='connection.url' value='jdbc:hsqldb:mem:db/default' />
+ <property name='connection.login' value='sa' />
+ <property name='connection.password' value='' />
+ <property name='connection.min-size' value='3' />
+ <property name='connection.max-size' value='5' />
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMCacheService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+ <value>jar:/conf/portal/idm-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <field name="useParentIdAsGroupType">
+ <boolean>true</boolean>
+ </field>
+ <field name="groupTypeMappings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root_type</string></value>
+ </entry>
+ <entry>
+ <key><string>/platform/*</string></key>
+ <value><string>platform_type</string></value>
+ </entry>
+ <entry>
+ <key><string>/platform/users</string></key>
+ <value><string>users_type</string></value>
+ </entry>
+ <entry>
+ <key><string>/organization/acme/france</string></key>
+ <value><string>france_type</string></value>
+ </entry>
+ <entry>
+ <key><string>/toto/*</string></key>
+ <value><string>toto_type</string></value>
+ </entry>
+ </map>
+ </field>
+ <!-- If this option is used then each Membership created with MembrshipType that is
+ equal to value specified here will be stored in PicketLink IDM as simple
+ Group-User association-->
+ <field name="associationMembershipType">
+ <string>member</string>
+ </field>
+ <!-- if "associationMembershipType" option is used and this option is set to true
+ then Membership with MembershipType configured to be stored as PicketLink IDM association
+ will not be stored as PicketLink IDM Role -->
+ <field name="ignoreMappedMembershipType">
+ <boolean>false</boolean>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <!--<property name="hibernate.show_sql" value="true"/>-->
+ <!--<property name="hibernate.use_sql_comments" value="true"/>-->
+ <!--<property name="hibernate.format_sql" value="true"/>-->
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.jdbc.batch_size" value="0"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:${basedir}/target/temp/data/exodb${container.name.suffix}"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>conf/mappings/HibernateRealm.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>conf/mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <description>this listener populate organization data for the first launch</description>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <description>check database</description>
+ <value>empty</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <description>Print information init database</description>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>member</string></field>
+ <field name="description"><string>member membershipt type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>users</string></field>
+ <field name="parentId"><string></string></field>
+ <!--<field name="type"><string>hierachy</string></field>-->
+ <field name="description"><string>the /users group</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>demo</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>demo</string></field>
+ <field name="lastName"><string>demo</string></field>
+ <field name="email"><string>demo@localhost</string></field>
+ <field name="groups">
+ <string>member:/users</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ <component-plugin>
+ <name>new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
+ <description>this listener assign group and membership to a new created user</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig">
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
+ <field name="groupId"><string>/users</string></field>
+ <field name="membership"><string>member</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="ignoredUser">
+ <collection type="java.util.HashSet">
+ <value><string>demo</string></value>
+ <value><string>admin</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Modified: portal/trunk/component/resources/pom.xml
===================================================================
--- portal/trunk/component/resources/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/resources/pom.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -58,4 +58,19 @@
</dependency>
</dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -19,15 +19,13 @@
package org.exoplatform.component.test;
-import junit.framework.AssertionFailedError;
+import junit.framework.TestSuite;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.EnumMap;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
/**
* An abstract test that takes care of running the unit tests with the semantic described by the
@@ -39,14 +37,11 @@
public class AbstractKernelTest extends AbstractGateInTest
{
- /** The system property for gatein tmp dir. */
- private static final String TMP_DIR = "gatein.test.tmp.dir";
-
/** . */
- private PortalContainer container;
+ private static KernelBootstrap bootstrap;
/** . */
- private ClassLoader realClassLoader;
+ private static final Map<Class<?>, AtomicLong> counters = new HashMap<Class<?>, AtomicLong>();
protected AbstractKernelTest()
{
@@ -60,12 +55,12 @@
public PortalContainer getContainer()
{
- return container;
+ return bootstrap != null ? bootstrap.getContainer() : null;
}
protected void begin()
{
- RequestLifeCycle.begin(container);
+ RequestLifeCycle.begin(getContainer());
}
protected void end()
@@ -76,104 +71,41 @@
@Override
protected void beforeRunBare() throws Exception
{
- realClassLoader = Thread.currentThread().getContextClassLoader();
+ Class<?> key = getClass();
//
- Set<String> rootConfigPaths = new HashSet<String>();
- rootConfigPaths.add("conf/root-configuration.xml");
-
- //
- Set<String> portalConfigPaths = new HashSet<String>();
- portalConfigPaths.add("conf/portal-configuration.xml");
-
- //
- EnumMap<ContainerScope, Set<String>> configs = new EnumMap<ContainerScope, Set<String>>(ContainerScope.class);
- configs.put(ContainerScope.ROOT, rootConfigPaths);
- configs.put(ContainerScope.PORTAL, portalConfigPaths);
-
- //
- ConfiguredBy cfBy = getClass().getAnnotation(ConfiguredBy.class);
- if (cfBy != null)
+ if (!counters.containsKey(key))
{
- for (ConfigurationUnit src : cfBy.value())
- {
- configs.get(src.scope()).add(src.path());
- }
- }
+ counters.put(key, new AtomicLong(new TestSuite(getClass()).testCount()));
- // Take care of creating tmp directory for unit test
- if (System.getProperty(TMP_DIR) == null)
- {
- // Get base dir set by maven or die
- File targetDir = new File(new File(System.getProperty("basedir")), "target");
- if (!targetDir.exists())
- {
- throw new AssertionFailedError("Target dir for unit test does not exist");
- }
- if (!targetDir.isDirectory())
- {
- throw new AssertionFailedError("Target dir is not a directory");
- }
- if (!targetDir.canWrite())
- {
- throw new AssertionFailedError("Target dir is not writable");
- }
-
//
- Set<String> fileNames = new HashSet<String>();
- for (File child : targetDir.listFiles(new FilenameFilter()
- {
- public boolean accept(File dir, String name)
- {
- return name.startsWith("gateintest-");
- }
- }))
- {
- fileNames.add(child.getName());
- }
+ bootstrap = new KernelBootstrap(Thread.currentThread().getContextClassLoader());
- //
- String fileName;
- int count = 0;
- while (true)
- {
- fileName = "gateintest-" + count;
- if (!fileNames.contains(fileName)) {
- break;
- }
- count++;
- }
+ // Configure ourselves
+ bootstrap.addConfiguration(getClass());
//
- File tmp = new File(targetDir, fileName);
- if (!tmp.mkdirs())
- {
- throw new AssertionFailedError("Could not create directory " + tmp.getCanonicalPath());
- }
-
- //
- System.setProperty(TMP_DIR, tmp.getCanonicalPath());
+ bootstrap.boot();
}
//
- ClassLoader testClassLoader = new GateInTestClassLoader(realClassLoader, rootConfigPaths, portalConfigPaths);
- Thread.currentThread().setContextClassLoader(testClassLoader);
-
- // Boot the container
- container = PortalContainer.getInstance();
-
- //
// List<Throwable> failures = new ArrayList<Throwable>();
}
@Override
protected void afterRunBare()
{
- container = null;
+ Class<?> key = getClass();
//
- Thread.currentThread().setContextClassLoader(realClassLoader);
+ if (counters.get(key).decrementAndGet() == 0)
+ {
+ bootstrap.dispose();
+ //
+ bootstrap = null;
+ }
+
/*
if (failures.size() > 0)
{
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/GateInTestClassLoader.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/GateInTestClassLoader.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/GateInTestClassLoader.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -42,7 +42,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public final class GateInTestClassLoader extends ClassLoader
+final class GateInTestClassLoader extends ClassLoader
{
/** . */
Added: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelBootstrap.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelBootstrap.java (rev 0)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelBootstrap.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2011 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.component.test;
+
+import junit.framework.AssertionFailedError;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.lang.reflect.Field;
+import java.util.EnumMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class KernelBootstrap
+{
+
+ /** The system property for gatein tmp dir. */
+ private static final String TMP_DIR = "gatein.test.tmp.dir";
+
+ /** . */
+ private File tmpDir;
+
+ /** . */
+ private File targetDir;
+
+ /** . */
+ private EnumMap<ContainerScope, Set<String>> configs;
+
+ /** . */
+ private ClassLoader realClassLoader;
+
+ /** The portal container available once the kernel is booted. */
+ private PortalContainer container;
+
+ public KernelBootstrap()
+ {
+ this(Thread.currentThread().getContextClassLoader());
+ }
+
+ public KernelBootstrap(ClassLoader realClassLoader)
+ {
+
+ //
+ Set<String> rootConfigPaths = new LinkedHashSet<String>();
+ rootConfigPaths.add("conf/root-configuration.xml");
+ Set<String> portalConfigPaths = new LinkedHashSet<String>();
+ portalConfigPaths.add("conf/portal-configuration.xml");
+ EnumMap<ContainerScope, Set<String>> configs = new EnumMap<ContainerScope, Set<String>>(ContainerScope.class);
+ configs.put(ContainerScope.ROOT, rootConfigPaths);
+ configs.put(ContainerScope.PORTAL, portalConfigPaths);
+
+ //
+ File targetDir = new File(new File(System.getProperty("basedir")), "target");
+ if (!targetDir.exists())
+ {
+ throw new AssertionFailedError("Target dir for unit test does not exist");
+ }
+ if (!targetDir.isDirectory())
+ {
+ throw new AssertionFailedError("Target dir is not a directory");
+ }
+ if (!targetDir.canWrite())
+ {
+ throw new AssertionFailedError("Target dir is not writable");
+ }
+
+
+ //
+ this.configs = configs;
+ this.targetDir = targetDir;
+ this.tmpDir = findTmpDir(targetDir);
+ this.realClassLoader = realClassLoader;
+ }
+
+ private static File findTmpDir(File dir)
+ {
+ Set<String> fileNames = new HashSet<String>();
+ for (File child : dir.listFiles(new FilenameFilter()
+ {
+ public boolean accept(File dir, String name)
+ {
+ return name.startsWith("gateintest-");
+ }
+ }))
+ {
+ fileNames.add(child.getName());
+ }
+
+ //
+ String fileName;
+ int count = 0;
+ while (true)
+ {
+ fileName = "gateintest-" + count;
+ if (!fileNames.contains(fileName)) {
+ break;
+ }
+ count++;
+ }
+
+ //
+ return new File(dir, fileName);
+ }
+
+ public File getTargetDir()
+ {
+ return targetDir;
+ }
+
+ public File getTmpDir()
+ {
+ return tmpDir;
+ }
+
+ /**
+ * Set the tmp dir of the test to a new file location. The new tmp dir must be a strict descendant of the
+ * {@link #targetDir} file.
+ *
+ * @param tmpDir the new tmp dir
+ * @throws IllegalArgumentException if the tmp dir is not a descendant of the target dir
+ */
+ public void setTmpDir(File tmpDir) throws IllegalArgumentException
+ {
+ for (File parent = tmpDir.getParentFile();!targetDir.equals(parent);parent = parent.getParentFile())
+ {
+ if (parent == null)
+ {
+ throw new IllegalArgumentException("Wrong tmp dir " + tmpDir);
+ }
+ }
+
+ //
+ this.tmpDir = tmpDir;
+ }
+
+ public PortalContainer getContainer()
+ {
+ return container;
+ }
+
+ public void addConfiguration(ContainerScope scope, String path)
+ {
+ configs.get(scope).add(path);
+ }
+
+ public void addConfiguration(ConfigurationUnit unit)
+ {
+ addConfiguration(unit.scope(), unit.path());
+ }
+
+ public void addConfiguration(ConfiguredBy configuredBy)
+ {
+ for (ConfigurationUnit unit : configuredBy.value())
+ {
+ addConfiguration(unit);
+ }
+ }
+
+ public void addConfiguration(Class<?> clazz)
+ {
+ ConfiguredBy cfBy = clazz.getAnnotation(ConfiguredBy.class);
+ if (cfBy != null)
+ {
+ addConfiguration(cfBy);
+ }
+ }
+
+ /**
+ * Boot the kernel.
+ *
+ * @throws IllegalStateException if the kernel is already booted
+ */
+ public void boot() throws IllegalStateException
+ {
+ if (container != null)
+ {
+ throw new IllegalStateException("Already booted");
+ }
+ try
+ {
+ // Must clear the top container first otherwise it's not going to work well
+ // it's a bit ugly but I don't want to change anything in the ExoContainerContext class for now
+ // and this is for unit testing
+ Field topContainerField = ExoContainerContext.class.getDeclaredField("topContainer");
+ topContainerField.setAccessible(true);
+ topContainerField.set(null, null);
+
+ // Same remark than above
+ Field singletonField = RootContainer.class.getDeclaredField("singleton_");
+ singletonField.setAccessible(true);
+ singletonField.set(null, null);
+
+ if (!tmpDir.exists())
+ {
+ if (!tmpDir.mkdirs())
+ {
+ throw new AssertionFailedError("Could not create directory " + tmpDir.getAbsolutePath());
+ }
+ }
+
+ // Set property globally available for configuration XML
+ System.setProperty(TMP_DIR, tmpDir.getCanonicalPath());
+
+ //
+ ClassLoader testClassLoader = new GateInTestClassLoader(
+ realClassLoader,
+ configs.get(ContainerScope.ROOT),
+ configs.get(ContainerScope.PORTAL));
+ Thread.currentThread().setContextClassLoader(testClassLoader);
+
+ // Boot the container
+ this.container = PortalContainer.getInstance();
+ }
+ catch (Exception e)
+ {
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(e);
+ throw afe;
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(realClassLoader);
+ }
+ }
+
+ public void dispose()
+ {
+ if (container != null)
+ {
+ RootContainer.getInstance().stop();
+ container = null;
+ ExoContainerContext.setCurrentContainer(null);
+ }
+ }
+}
Added: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelTestSuite.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelTestSuite.java (rev 0)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/KernelTestSuite.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011 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.component.test;
+
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+final class KernelTestSuite extends TestSuite
+{
+
+ /** . */
+ private final Class<? extends AbstractKernelTest> testClass;
+
+ KernelTestSuite(Class<? extends AbstractKernelTest> testClass)
+ {
+ super(testClass);
+
+ //
+ this.testClass = testClass;
+ }
+
+ @Override
+ public void run(TestResult result)
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap(Thread.currentThread().getContextClassLoader());
+
+ //
+ try
+ {
+ // Configure ourselves
+ bootstrap.addConfiguration(testClass);
+
+ //
+ bootstrap.boot();
+
+ //
+ super.run(result);
+ }
+ finally
+ {
+ bootstrap.dispose();
+ }
+ }
+}
Modified: portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
===================================================================
--- portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -21,8 +21,8 @@
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
<component>
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
@@ -55,14 +55,22 @@
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</value-param>
- <properties-param>
+ <properties-param profiles="hsqldb">
<name>ref-addresses</name>
<description>ref-addresses</description>
- <property name="driverClassName" value="${gatein.test.datasource.driver}"/>
- <property name="url" value="${gatein.test.datasource.url}"/>
- <property name="username" value="${gatein.test.datasource.username}"/>
- <property name="password" value="${gatein.test.datasource.password}"/>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:${gatein.test.tmp.dir}/db/data/jdbcjcr"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
</properties-param>
+ <properties-param profiles="mysql">
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
+ <property name="url" value="jdbc:mysql://10.37.129.4/jdbcjcr?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8"/>
+ <property name="username" value="root"/>
+ <property name="password" value=""/>
+ </properties-param>
</init-params>
</component-plugin>
</external-component-plugins>
Modified: portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -32,10 +32,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@ConfiguredBy({
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/jcr/jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/test-configuration.xml")
-})
+@ConfiguredBy({@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/test-configuration.xml")})
public class BootstrapTestCase extends AbstractKernelTest
{
@@ -100,6 +97,5 @@
assertTrue(f.exists());
assertTrue(f.isDirectory());
assertTrue(f.canWrite());
- assertEquals(0, f.list().length);
}
}
Added: portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/KernelBootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/KernelBootstrapTestCase.java (rev 0)
+++ portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/KernelBootstrapTestCase.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2011 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.component.test;
+
+import junit.framework.TestCase;
+import org.exoplatform.container.PortalContainer;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class KernelBootstrapTestCase extends TestCase
+{
+
+ public void testReboot()
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.boot();
+ PortalContainer container1 = bootstrap.getContainer();
+ bootstrap.dispose();
+ bootstrap.boot();
+ PortalContainer container2 = bootstrap.getContainer();
+ assertNotSame(container1, container2);
+ }
+
+ public void testGetTmpDir()
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ assertEquals(bootstrap.getTargetDir(), bootstrap.getTmpDir().getParentFile());
+ }
+
+ public void testSetTmpDir()
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ try
+ {
+ bootstrap.setTmpDir(new File("a"));
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ try
+ {
+ bootstrap.setTmpDir(bootstrap.getTargetDir());
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ try
+ {
+ bootstrap.setTmpDir(new File(bootstrap.getTargetDir(), "a"));
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testTmpDirLifeCycle()
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ try
+ {
+ File tmp = bootstrap.getTmpDir();
+ assertFalse(tmp.exists());
+ tmp = bootstrap.getTmpDir();
+ bootstrap.boot();
+ assertTrue(tmp.exists());
+ }
+ finally
+ {
+ bootstrap.dispose();
+ }
+ }
+
+ public void testUseExistingTmpDir()
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ File tmp;
+ try
+ {
+ bootstrap.boot();
+ tmp = bootstrap.getTmpDir();
+ }
+ finally
+ {
+ bootstrap.dispose();
+ }
+ try
+ {
+ bootstrap = new KernelBootstrap();
+ bootstrap.setTmpDir(tmp);
+ bootstrap.boot();
+ }
+ finally
+ {
+ bootstrap.dispose();
+ }
+ }
+}
Modified: portal/trunk/component/test/pom.xml
===================================================================
--- portal/trunk/component/test/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/component/test/pom.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -33,7 +33,6 @@
<modules>
<module>core</module>
<module>jcr</module>
- <module>organization</module>
</modules>
</project>
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/pom.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -436,6 +436,12 @@
</dependency>
<dependency>
<groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.identity</artifactId>
+ <version>3.2.0-M02-SNAPSHOT</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component.resources</artifactId>
<version>3.2.0-M02-SNAPSHOT</version>
</dependency>
@@ -513,17 +519,6 @@
</dependency>
<dependency>
<groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.test.organization</artifactId>
- <version>3.2.0-M02-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.test.organization</artifactId>
- <version>3.2.0-M02-SNAPSHOT</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.server.jboss.plugin</artifactId>
<version>3.2.0-Beta01-SNAPSHOT</version>
</dependency>
@@ -892,21 +887,9 @@
<value>${project.build.directory}</value>
</property>
<property>
- <name>gatein.test.datasource.driver</name>
- <value>org.hsqldb.jdbcDriver</value>
+ <name>exo.profiles</name>
+ <value>hsqldb</value>
</property>
- <property>
- <name>gatein.test.datasource.url</name>
- <value>jdbc:hsqldb:mem:gateindb</value>
- </property>
- <property>
- <name>gatein.test.datasource.username</name>
- <value>sa</value>
- </property>
- <property>
- <name>gatein.test.datasource.password</name>
- <value />
- </property>
</systemProperties>
</configuration>
</plugin>
@@ -945,21 +928,9 @@
<value>${project.build.directory}</value>
</property>
<property>
- <name>gatein.test.datasource.driver</name>
- <value>com.mysql.jdbc.Driver</value>
+ <name>exo.profiles</name>
+ <value>mysql</value>
</property>
- <property>
- <name>gatein.test.datasource.url</name>
- <value>jdbc:mysql://10.37.129.4/gatein?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8</value>
- </property>
- <property>
- <name>gatein.test.datasource.username</name>
- <value>root</value>
- </property>
- <property>
- <name>gatein.test.datasource.password</name>
- <value>a</value>
- </property>
</systemProperties>
</configuration>
</plugin>
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -79,7 +79,7 @@
}
else
{
- toolbarScope = new GenericScope(level);
+ toolbarScope = GenericScope.treeShape(level);
}
}
Modified: portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UINavigationPortlet.java
===================================================================
--- portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UINavigationPortlet.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UINavigationPortlet.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -80,7 +80,7 @@
}
else
{
- portalNavigation.setScope(new GenericScope(level));
+ portalNavigation.setScope(GenericScope.treeShape(level));
}
}
Modified: portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UISitemapPortlet.java
===================================================================
--- portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UISitemapPortlet.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UISitemapPortlet.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -90,7 +90,7 @@
}
else
{
- uiPortalNavigation.setScope(new GenericScope(level));
+ uiPortalNavigation.setScope(GenericScope.treeShape(level));
}
}
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-07-22 04:52:05 UTC (rev 6913)
@@ -180,6 +180,7 @@
</field>
<field name="ownerType"><string>portal</string></field>
<field name="templateLocation"><string>war:/conf/portal/</string></field>
+ <field name="importMode"><string>conserve</string></field>
</object>
</object-param>
<object-param>
@@ -194,8 +195,9 @@
<value><string>/organization/management/executive-board</string></value>
</collection>
</field>
- <field name="ownerType"><string>group</string></field>
- <field name="templateLocation"><string>war:/conf/portal</string></field>
+ <field name="ownerType"><string>group</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ <field name="importMode"><string>conserve</string></field>
</object>
</object-param>
<object-param>
@@ -211,8 +213,9 @@
<value><string>user</string></value>
</collection>
</field>
- <field name="ownerType"><string>user</string></field>
- <field name="templateLocation"><string>war:/conf/portal</string></field>
+ <field name="ownerType"><string>user</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ <field name="importMode"><string>conserve</string></field>
</object>
</object-param>
</init-params>
@@ -251,6 +254,8 @@
</value-param>
<values-param>
<name>entities</name>
+
+ <!-- The MOP node types -->
<value>org.gatein.mop.core.api.workspace.WorkspaceImpl</value>
<value>org.gatein.mop.core.api.workspace.UIContainerImpl</value>
<value>org.gatein.mop.core.api.workspace.UIWindowImpl</value>
@@ -281,6 +286,8 @@
<value>org.gatein.mop.core.api.workspace.content.ContextSpecialization</value>
<value>org.gatein.mop.core.api.workspace.content.WorkspaceClone</value>
<value>org.gatein.mop.core.api.workspace.content.WorkspaceSpecialization</value>
+
+ <!-- GateIn node types -->
<value>org.exoplatform.portal.pom.spi.portlet.PortletState</value>
<value>org.exoplatform.portal.pom.spi.portlet.PreferenceState</value>
<value>org.exoplatform.portal.pom.spi.gadget.GadgetState</value>
@@ -291,6 +298,7 @@
<value>org.exoplatform.portal.mop.i18n.I18Nized</value>
<value>org.exoplatform.portal.mop.i18n.LanguageSpace</value>
<value>org.exoplatform.portal.mop.i18n.Language</value>
+ <value>org.exoplatform.portal.mop.importer.Imported</value>
</values-param>
<properties-param>
<name>options</name>
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-07-22 03:13:14 UTC (rev 6912)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-07-22 04:52:05 UTC (rev 6913)
@@ -27,8 +27,10 @@
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.Visibility;
import org.exoplatform.portal.mop.user.UserNavigation;
import org.exoplatform.portal.mop.user.UserNode;
+import org.exoplatform.portal.mop.user.UserNodeFilterConfig;
import org.exoplatform.portal.mop.user.UserPortal;
import org.exoplatform.portal.webui.application.UIGadget;
import org.exoplatform.portal.webui.portal.PageNodeEvent;
@@ -62,7 +64,9 @@
UserPortal userPortal = uiPortalApp.getUserPortalConfig().getUserPortal();
String uri = ((PageNodeEvent<UIPortal>)event).getTargetNodeUri();
- UserNode naviPath = userPortal.resolvePath(null, uri);
+ UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder();
+ builder.withAuthorizationCheck();
+ UserNode naviPath = userPortal.resolvePath(builder.build(), uri);
UserNavigation targetNav = naviPath.getNavigation();
UserNode currentNavPath = showedUIPortal.getNavPath();
13 years, 5 months
gatein SVN: r6912 - in portal/trunk/component/portal: src/main/java and 99 other directories.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-07-21 23:13:14 -0400 (Thu, 21 Jul 2011)
New Revision: 6912
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NString.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NValue.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedString.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationFragment.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportConfig.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportMode.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationFragmentImporter.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNodeListener.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/AbstractPortalTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractConfigTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestMOP.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/Builder.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/FragmentBuilder.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/NodeBuilder.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationFragmentImporter.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationImporter.java
portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml
portal/trunk/component/portal/src/test/resources/jibx/fragment-navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/template/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/template/group/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/template/group/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/container.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/four-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/four-columns/container.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/one-column/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/one-column/container.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/three-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/three-columns/container.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/two-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/two-columns/container.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/page.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/overwritelayout/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/overwritelayout/user.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/user.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/configuration.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/large/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/large/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/configuration.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/group.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portlet-preferences.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/navigation.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/pages.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portal.xml
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portlet-preferences.xml
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/ImportMode.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/NavigationImporter.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestHandleMixin.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/Builder.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/TestNavigationImporter.java
portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration1.xml
portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration2.xml
portal/trunk/component/portal/src/test/resources/portal/
Modified:
portal/trunk/component/portal/pom.xml
portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml
portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedValue.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/LocalizedValueMapper.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/GenericScope.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NodeContext.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/Scope.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/TreeUpdate.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNode.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java
portal/trunk/component/portal/src/main/resources/binding.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSearch.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/description/TestDescriptionService.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/AbstractTestNavigationService.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestNavigationServiceWrapper.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestScope.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java
portal/trunk/component/portal/src/test/resources/conf/test-mop-nodetypes.xml
Log:
GTNPORTAL-1962 The navigation import should be configurable some modes for particular requirement
- Improve testcase initial data on each
Modified: portal/trunk/component/portal/pom.xml
===================================================================
--- portal/trunk/component/portal/pom.xml 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/pom.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -109,14 +109,29 @@
<dependency>
<groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.test.organization</artifactId>
+ <artifactId>exo.portal.component.identity</artifactId>
+ <type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
<plugins>
+
<plugin>
<groupId>org.jibx</groupId>
<artifactId>maven-jibx-plugin</artifactId>
Modified: portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml
===================================================================
--- portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -18,6 +18,20 @@
-->
<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="gtn:imported" isMixin="true" hasOrderableChildNodes="false">
+ <supertypes>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="gtn:creationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="gtn:lastmodificationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions/>
+ </nodeType>
+
<nodeType name="gtn:language" isMixin="false" hasOrderableChildNodes="false">
<supertypes>
<supertype>nt:base</supertype>
Modified: portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd
===================================================================
--- portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd 2011-07-22 03:13:14 UTC (rev 6912)
@@ -60,9 +60,10 @@
<xs:complexType name="nodeNavigationType">
<xs:sequence>
<xs:element name="priority" type="xs:positiveInteger"/>
- <xs:element name="page-nodes" minOccurs="0" maxOccurs="1">
+ <xs:element name="page-nodes" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
+ <xs:element name="parent-uri" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -41,6 +41,8 @@
private String description;
+ private String importMode;
+
/**
* @deprecated use the location instead
*/
@@ -60,6 +62,7 @@
this.description = cfg.description;
this.templateName = cfg.templateName;
this.predefinedOwner = new HashSet<String>(cfg.predefinedOwner);
+ this.importMode = cfg.importMode;
}
public NewPortalConfig(String path)
@@ -152,6 +155,16 @@
this.description = description;
}
+ public String getImportMode()
+ {
+ return importMode;
+ }
+
+ public void setImportMode(String importMode)
+ {
+ this.importMode = importMode;
+ }
+
@Override
public String toString()
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -28,8 +28,10 @@
import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
-import org.exoplatform.portal.config.importer.ImportMode;
-import org.exoplatform.portal.config.importer.NavigationImporter;
+import org.exoplatform.portal.config.model.NavigationFragment;
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.mop.importer.NavigationImporter;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelUnmarshaller;
import org.exoplatform.portal.config.model.Page;
@@ -41,15 +43,18 @@
import org.exoplatform.portal.config.model.Version;
import org.exoplatform.portal.mop.description.DescriptionService;
import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
-import org.jibx.runtime.JiBXException;
+import org.gatein.mop.api.workspace.Workspace;
+import org.jibx.runtime.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
@@ -93,7 +98,7 @@
/**
* If true the portal clear portal metadata from data storage and replace
- * it with new data created from .xml files
+ * it with new data created from .xml files.
*/
private boolean overrideExistingData;
@@ -171,21 +176,66 @@
this.pomMgr = pomMgr;
}
- public void run() throws Exception
+ private void touchImport()
{
- //DANGEROUS! If the user delete the defaultPortal (ie: classic), the next time he restarts
- //the server. Data of predefined owners would be overriden
RequestLifeCycle.begin(PortalContainer.getInstance());
try
{
- if (dataStorage_.getPortalConfig(defaultPortal) != null && !overrideExistingData)
- return;
+ POMSession session = pomMgr.getSession();
+ Workspace workspace = session.getWorkspace();
+ Imported imported = workspace.adapt(Imported.class);
+ imported.setLastModificationDate(new Date());
+ session.save();
}
finally
{
RequestLifeCycle.end();
}
+ }
+ private boolean performImport()
+ {
+ RequestLifeCycle.begin(PortalContainer.getInstance());
+ try
+ {
+ if (overrideExistingData)
+ {
+ return true;
+ }
+ else
+ {
+ POMSession session = pomMgr.getSession();
+
+ // Obtain the status
+ Workspace workspace = session.getWorkspace();
+ boolean perform = !workspace.isAdapted(Imported.class);
+
+ // We mark it
+ if (perform)
+ {
+ Imported imported = workspace.adapt(Imported.class);
+ imported.setCreationDate(new Date());
+ session.save();
+ }
+
+ //
+ return perform;
+ }
+ }
+ finally
+ {
+ RequestLifeCycle.end();
+ }
+ }
+
+ public void run() throws Exception
+ {
+ if (!performImport())
+ {
+ return;
+ }
+
+ //
if (isUseTryCatch)
{
RequestLifeCycle.begin(PortalContainer.getInstance());
@@ -260,6 +310,8 @@
}
}
+ //
+ touchImport();
}
else
{
@@ -299,6 +351,9 @@
{
ele.getPredefinedOwner().clear();
}
+
+ //
+ touchImport();
}
}
@@ -483,10 +538,20 @@
//
PageNavigation navigation = obj.getObject();
- ImportMode importMode = overrideExistingData ? ImportMode.REIMPORT : ImportMode.MERGE;
boolean extendedNavigation = obj.getVersion() == Version.V_1_2;
//
+ ImportMode importMode;
+ if (config.getImportMode() != null)
+ {
+ importMode = ImportMode.valueOf(config.getImportMode().trim().toUpperCase());
+ }
+ else
+ {
+ importMode = ImportMode.CONSERVE;
+ }
+
+ //
Locale locale;
PortalConfig portalConfig = dataStorage_.getPortalConfig(config.getOwnerType(), owner);
if (portalConfig != null && portalConfig.getLocale() != null)
@@ -499,7 +564,7 @@
}
//
- NavigationImporter merge = new NavigationImporter(locale, importMode, extendedNavigation, navigation, navigationService_, descriptionService_);
+ NavigationImporter merge = new NavigationImporter(locale, importMode, navigation, navigationService_, descriptionService_);
//
merge.perform();
@@ -761,12 +826,28 @@
private static void fixOwnerName(PageNavigation pageNav)
{
pageNav.setOwnerId(fixOwnerName(pageNav.getOwnerType(), pageNav.getOwnerId()));
- for (PageNode pageNode : pageNav.getNodes())
+ ArrayList<NavigationFragment> fragments = pageNav.getFragments();
+ if (fragments != null)
{
- fixOwnerName(pageNode);
+ for (NavigationFragment fragment : fragments)
+ {
+ fixOwnerName(fragment);
+ }
}
}
+ private static void fixOwnerName(NavigationFragment fragment)
+ {
+ ArrayList<PageNode> nodes = fragment.getNodes();
+ if (nodes != null)
+ {
+ for (PageNode pageNode : nodes)
+ {
+ fixOwnerName(pageNode);
+ }
+ }
+ }
+
private static void fixOwnerName(PageNode pageNode)
{
if (pageNode.getPageReference() != null)
Deleted: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/ImportMode.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/ImportMode.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/ImportMode.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2011 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.importer;
-
-/**
- * The import mode.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-public enum ImportMode
-{
-
- /**
- * Import data when it does not exist, otherwise do nothing.
- */
- CONSERVE,
-
- /**
- * Import data when it does not exist, otherwise try a merge strategy that adds new data but ignore other modifications.
- */
- MERGE,
-
- /**
- * Reimport data whatsoever.
- */
- REIMPORT
-
-}
Deleted: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/NavigationImporter.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/NavigationImporter.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/importer/NavigationImporter.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,384 +0,0 @@
-/*
- * Copyright (C) 2011 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.importer;
-
-import org.exoplatform.portal.config.model.LocalizedValue;
-import org.exoplatform.portal.config.model.PageNavigation;
-import org.exoplatform.portal.config.model.PageNode;
-import org.exoplatform.portal.config.model.PageNodeContainer;
-import org.exoplatform.portal.mop.Described;
-import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.mop.description.DescriptionService;
-import org.exoplatform.portal.mop.navigation.NavigationContext;
-import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.mop.navigation.NavigationState;
-import org.exoplatform.portal.mop.navigation.NodeChangeListener;
-import org.exoplatform.portal.mop.navigation.NodeChangeQueue;
-import org.exoplatform.portal.mop.navigation.NodeContext;
-import org.exoplatform.portal.mop.navigation.NodeModel;
-import org.exoplatform.portal.mop.navigation.NodeState;
-import org.exoplatform.portal.mop.navigation.Scope;
-import org.exoplatform.portal.tree.diff.Adapters;
-import org.exoplatform.portal.tree.diff.ListAdapter;
-import org.exoplatform.portal.tree.diff.ListChangeIterator;
-import org.exoplatform.portal.tree.diff.ListChangeType;
-import org.exoplatform.portal.tree.diff.ListDiff;
-import org.gatein.common.i18n.LocaleFormat;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-public class NavigationImporter
-{
-
- private static final ListAdapter<PageNodeContainer, String> PAGE_NODE_CONTAINER_ADAPTER = new ListAdapter<PageNodeContainer, String>()
- {
- public int size(PageNodeContainer list)
- {
- List<PageNode> nodes = list.getNodes();
- if (nodes == null)
- {
- return 0;
- }
- else
- {
- return nodes.size();
- }
- }
-
- public Iterator<String> iterator(PageNodeContainer list, boolean reverse)
- {
- List<PageNode> nodes = list.getNodes();
- if (nodes == null)
- {
- return Collections.<String>emptyList().iterator();
- }
- else {
- String[] names = new String[nodes.size()];
- int index = 0;
- for (PageNode child : nodes)
- {
- names[index++] = child.getName();
- }
- return Adapters.<String>list().iterator(names, reverse);
- }
- }
- };
-
- private static final ListAdapter<NodeContext<?>, String> NODE_ADAPTER = new ListAdapter<NodeContext<?>, String>()
- {
- public int size(NodeContext<?> list)
- {
- return list.getNodeCount();
- }
-
- public Iterator<String> iterator(NodeContext<?> list, boolean reverse)
- {
- int size = list.getNodeCount();
- String[] names = new String[size];
- int index = 0;
- for (NodeContext<?> child = list.getFirst();child != null;child = child.getNext())
- {
- names[index++] = child.getName();
- }
- return Adapters.<String>list().iterator(names, reverse);
- }
- };
-
- /** . */
- private final Locale portalLocale;
-
- /** . */
- private final boolean extendedNavigation;
-
- /** . */
- private final PageNavigation src;
-
- /** . */
- private final NavigationService service;
-
- /** . */
- private final ImportMode mode;
-
- /** . */
- private final DescriptionService descriptionService;
-
- public NavigationImporter(
- Locale portalLocale,
- ImportMode mode,
- boolean extendedNavigation,
- PageNavigation src,
- NavigationService service,
- DescriptionService descriptionService)
- {
- this.portalLocale = portalLocale;
- this.extendedNavigation = extendedNavigation;
- this.mode = mode;
- this.src = src;
- this.service = service;
- this.descriptionService = descriptionService;
- }
-
- public void perform()
- {
-
- //
- SiteKey key = new SiteKey(src.getOwnerType(), src.getOwnerId());
-
- //
- NavigationContext dst = service.loadNavigation(key);
-
- //
- switch (mode)
- {
- case CONSERVE:
- if (dst == null)
- {
- dst = new NavigationContext(key, new NavigationState(src.getPriority()));
- service.saveNavigation(dst);
- }
- else
- {
- dst = null;
- }
- break;
- case MERGE:
- if (dst == null)
- {
- dst = new NavigationContext(key, new NavigationState(src.getPriority()));
- service.saveNavigation(dst);
- }
- break;
- case REIMPORT:
- if (dst != null)
- {
- service.destroyNavigation(dst);
- }
- else
- {
- dst = new NavigationContext(key, new NavigationState(src.getPriority()));
- }
- service.saveNavigation(dst);
- break;
- }
-
- //
- if (dst != null)
- {
- NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, dst, Scope.SINGLE, null).getNode();
-
- // Collect labels
- Map<NodeContext<?>, Map<Locale, Described.State>> labelMap = new HashMap<NodeContext<?>, Map<Locale, Described.State>>();
-
- // Perform save
- perform(src, node, labelMap);
-
- // Save the node
- service.saveNode(node, null);
-
- //
- for (Map.Entry<NodeContext<?>, Map<Locale, Described.State>> entry : labelMap.entrySet())
- {
- String id = entry.getKey().getId();
- descriptionService.setDescriptions(id, entry.getValue());
- }
- }
- }
-
- private void perform(PageNodeContainer src, final NodeContext<?> dst, final Map<NodeContext<?>, Map<Locale, Described.State>> labelMap)
- {
- service.rebaseNode(dst, Scope.CHILDREN, null);
-
- //
- ListDiff<PageNodeContainer, NodeContext<?>, String> diff = new ListDiff<PageNodeContainer, NodeContext<?>, String>(
- PAGE_NODE_CONTAINER_ADAPTER,
- NODE_ADAPTER);
-
- //
- List<PageNode> srcChildren = src.getNodes();
- ListChangeIterator<PageNodeContainer, NodeContext<?>, String> it = diff.iterator(src, dst);
- NodeChangeQueue<PageNodeContainer> changes = new NodeChangeQueue<PageNodeContainer>();
-
- //
- while (it.hasNext())
- {
- ListChangeType changeType = it.next();
- String name = it.getElement();
- PageNode srcChild = src.getNode(name);
- NodeContext<?> dstChild = dst.get(name);
-
- //
- switch (changeType)
- {
- case SAME:
- perform(srcChild, dstChild, labelMap);
- break;
- case REMOVE:
- if (dst.getNode(name) != null)
- {
- // It's a move we do nothing
- }
- else
- {
- // It's an addition
- int index = srcChildren.indexOf(srcChild);
- PageNode previous = index == 0 ? null : srcChildren.get(index - 1);
- changes.onAdd(srcChild, src, previous);
- }
- break;
- case ADD:
- if (src.getNode(name) != null)
- {
- // It's a move
- int index = srcChildren.indexOf(srcChild);
- PageNode previous = index == 0 ? null : srcChildren.get(index - 1);
- changes.onMove(srcChild, src, src, previous);
- }
- else
- {
- // It's a removal we do nothing
- }
- break;
- }
- }
-
- //
- changes.broadcast(new NodeChangeListener.Base<PageNodeContainer>()
- {
- @Override
- public void onAdd(PageNodeContainer target, PageNodeContainer parent, PageNodeContainer previous)
- {
- add((PageNode)target, (PageNode)previous, dst);
- }
-
- private void add(PageNode target, PageNode previous, NodeContext<?> dst)
- {
-
- //
- LocalizedValue unqualifiedLabel = null;
- List<LocalizedValue> labels = target.getLabels();
- Map<Locale, Described.State> description = null;
- if (labels.size() > 0)
- {
- for (LocalizedValue label : labels)
- {
- Locale lang = label.getLang();
- if (lang != null)
- {
- if (description == null)
- {
- description = new HashMap<Locale, Described.State>(labels.size());
- }
- description.put(lang, new Described.State(label.getValue(), null));
- }
- else
- {
- unqualifiedLabel = label;
- }
- }
- }
-
- //
- String label;
- if (extendedNavigation)
- {
- if (description == null)
- {
- description = new HashMap<Locale, Described.State>();
- }
- if (!description.containsKey(portalLocale))
- {
- if (unqualifiedLabel != null)
- {
- description.put(portalLocale, new Described.State(unqualifiedLabel.getValue(), null));
- }
- }
-
- //
- label = null;
- }
- else
- {
- if (unqualifiedLabel != null)
- {
- label = unqualifiedLabel.getValue();
- }
- else if (description != null && description.containsKey(portalLocale))
- {
- label = description.get(portalLocale).getName();
- }
- else
- {
- label = null;
- }
-
- //
- description = null;
- }
-
- //
- String name = target.getName();
- int index = 0;
- if (previous != null)
- {
- index = dst.get((previous).getName()).getIndex() + 1;
- }
- NodeContext<?> child = dst.add(index, name);
- Date start = target.getStartPublicationDate();
- Date end = target.getEndPublicationDate();
- NodeState state = new NodeState(
- label,
- target.getIcon(),
- start == null ? -1 : start.getTime(),
- end == null ? -1 : end.getTime(),
- target.getVisibility(),
- target.getPageReference()
- );
- child.setState(state);
-
- //
- if (description != null)
- {
- labelMap.put(child, description);
- }
-
- //
- List<PageNode> targetChildren = target.getNodes();
- if (targetChildren != null)
- {
- PageNode targetPrevious = null;
- for (PageNode targetChild : targetChildren)
- {
- add(targetChild, targetPrevious, child);
- targetPrevious = targetChild;
- }
- }
- }
- });
- }
-}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NString.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NString.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NString.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 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 java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class I18NString extends I18NValue<String, LocalizedString>
+{
+
+ public static I18NString create()
+ {
+ return new I18NString();
+ }
+
+ public I18NString()
+ {
+ }
+
+ public I18NString(Collection<? extends LocalizedString> c)
+ {
+ super(c);
+ }
+
+ public I18NString(LocalizedString... c)
+ {
+ super(c);
+ }
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NValue.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NValue.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/I18NValue.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2011 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 java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class I18NValue<V, L extends LocalizedValue<V>> extends ArrayList<L>
+{
+
+ public static I18NValue create()
+ {
+ return new I18NValue();
+ }
+
+ public I18NValue()
+ {
+ }
+
+ public I18NValue(Collection<? extends L> c)
+ {
+ super(c);
+ }
+
+ public I18NValue(L... c)
+ {
+ super(Arrays.asList(c));
+ }
+
+ /**
+ * Returns true when the collection contains exactly one localized value and this value does not have
+ * a locale associated with it.
+ *
+ * @return true if the value is simple
+ */
+ public boolean isSimple()
+ {
+ return size() == 1 && get(0).getLang() == null;
+ }
+
+ /**
+ * Returns true if the collection extended which means that it is not empty and it is not simple.
+ *
+ * @return true if the value is extended
+ */
+ public boolean isExtended()
+ {
+ return !isEmpty() && !isSimple();
+ }
+
+ /**
+ * Returns the simple value or null if the collection is empty or extended.
+ *
+ * @return the simple value
+ */
+ public V getSimple()
+ {
+ if (isSimple())
+ {
+ return get(0).getValue();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Returns a map of the values or null if the collection is empty. The <code>defaultLocale</code> argument
+ * is used as a key when an unqualified value is found, otherwise it is not used
+ *
+ * @param defaultLocale the default locale
+ * @return the extended value map
+ */
+ public Map<Locale, V> getExtended(Locale defaultLocale)
+ {
+ Map<Locale, V> map = Collections.emptyMap();
+ L unqualifiedLocalizedValue = null;
+ for (L localizedValue : this)
+ {
+ if (localizedValue.getLang() != null)
+ {
+ if (map.isEmpty())
+ {
+ map = new HashMap<Locale, V>();
+ }
+ map.put(localizedValue.getLang(), localizedValue.getValue());
+ }
+ else
+ {
+ unqualifiedLocalizedValue = localizedValue;
+ }
+ }
+ if (map.isEmpty())
+ {
+ return null;
+ }
+ else
+ {
+ if (unqualifiedLocalizedValue != null && !map.containsKey(defaultLocale))
+ {
+ map.put(defaultLocale, unqualifiedLocalizedValue.getValue());
+ }
+ return map;
+ }
+ }
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedString.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedString.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedString.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 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 java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class LocalizedString extends LocalizedValue<String>
+{
+
+ public LocalizedString()
+ {
+ }
+
+ public LocalizedString(String value)
+ {
+ super(value);
+ }
+
+ public LocalizedString(String value, Locale lang)
+ {
+ super(value, lang);
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedValue.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedValue.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/LocalizedValue.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -24,11 +24,11 @@
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
*/
-public class LocalizedValue
+public class LocalizedValue<V>
{
/** . */
- private String value;
+ private V value;
/** . */
private Locale lang;
@@ -37,34 +37,40 @@
{
}
- public LocalizedValue(String value)
+ public LocalizedValue(V value)
{
this.value = value;
}
- public LocalizedValue(String value, Locale lang)
+ public LocalizedValue(V value, Locale lang)
{
this.value = value;
this.lang = lang;
}
- public String getValue()
+ public final V getValue()
{
return value;
}
- public void setValue(String value)
+ public final void setValue(V value)
{
this.value = value;
}
- public Locale getLang()
+ public final Locale getLang()
{
return lang;
}
- public void setLang(Locale lang)
+ public final void setLang(Locale lang)
{
this.lang = lang;
}
+
+ @Override
+ public String toString()
+ {
+ return getClass().getSimpleName() + "[value=" + value + ",lang=" + lang + "]";
+ }
}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationFragment.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationFragment.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationFragment.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 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;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class NavigationFragment extends PageNodeContainer
+{
+
+ /** . */
+ private String parentURI;
+
+ public String getParentURI()
+ {
+ return parentURI;
+ }
+
+ public void setParentURI(String parentURI)
+ {
+ this.parentURI = parentURI;
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -21,7 +21,7 @@
import java.util.ArrayList;
-public class PageNavigation extends PageNodeContainer
+public class PageNavigation
{
/** . */
@@ -31,16 +31,23 @@
private String ownerId;
/** . */
- private ArrayList<PageNode> pageNodes;
+ private int priority = 1;
/** . */
- private int priority = 1;
+ private ArrayList<NavigationFragment> fragments;
public PageNavigation()
{
- this.pageNodes = new ArrayList<PageNode>();
+ this(null, null);
}
+ public PageNavigation(String ownerType, String ownerId)
+ {
+ this.ownerType = ownerType;
+ this.ownerId = ownerId;
+ this.fragments = new ArrayList<NavigationFragment>();
+ }
+
public String getOwnerId()
{
return ownerId;
@@ -71,16 +78,26 @@
priority = i;
}
- public ArrayList<PageNode> getNodes()
+ public ArrayList<NavigationFragment> getFragments()
{
- return pageNodes;
+ return fragments;
}
- public void setNodes(ArrayList<PageNode> nodes)
+ public NavigationFragment getFragment()
{
- pageNodes = nodes;
+ return fragments != null && fragments.size() > 0 ? fragments.get(0) : null;
}
+ public PageNavigation addFragment(NavigationFragment fragment)
+ {
+ if (fragments == null)
+ {
+ fragments = new ArrayList<NavigationFragment>();
+ }
+ fragments.add(fragment);
+ return this;
+ }
+
@Override
public String toString()
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -20,28 +20,19 @@
package org.exoplatform.portal.config.model;
import org.exoplatform.portal.mop.Visibility;
+import org.exoplatform.portal.mop.navigation.NodeState;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
-import java.util.HashMap;
import java.util.List;
-import java.util.Locale;
-import java.util.Map;
public class PageNode extends PageNodeContainer
{
/** . */
- private ArrayList<PageNode> children;
+ private I18NString labels;
/** . */
- private String uri;
-
- /** . */
- private ArrayList<LocalizedValue> labels;
-
- /** . */
private String icon;
/** . */
@@ -61,59 +52,25 @@
public PageNode()
{
- this.children = new ArrayList<PageNode>();
}
public String getUri()
{
- return uri;
+ return null;
}
public void setUri(String s)
{
- uri = s;
+ // No op for back war compatibility during unmarshalling
}
- public ArrayList<LocalizedValue> getLabels()
+ public I18NString getLabels()
{
return labels;
}
- public Map<Locale, String> getLocalizedLabel(Locale defaultLocale)
+ public void setLabels(I18NString labels)
{
- Map<Locale, String> map = Collections.emptyMap();
- LocalizedValue portalLocaleLabel = null;
- for (LocalizedValue label : labels)
- {
- if (label.getLang() != null)
- {
- if (map.isEmpty())
- {
- map = new HashMap<Locale, String>();
- }
- map.put(label.getLang(), label.getValue());
- }
- else
- {
- portalLocaleLabel = label;
- }
- }
- if (map.isEmpty())
- {
- return null;
- }
- else
- {
- if (portalLocaleLabel != null && !map.containsKey(defaultLocale))
- {
- map.put(defaultLocale, portalLocaleLabel.getValue());
- }
- return map;
- }
- }
-
- public void setLabels(ArrayList<LocalizedValue> labels)
- {
this.labels = labels;
}
@@ -121,7 +78,7 @@
{
if (labels != null)
{
- for (LocalizedValue label : labels)
+ for (LocalizedString label : labels)
{
if (label.getLang() == null)
{
@@ -136,13 +93,13 @@
{
if (labels == null)
{
- labels = new ArrayList<LocalizedValue>();
+ labels = new I18NString();
}
else
{
labels.clear();
}
- labels.add(new LocalizedValue(s));
+ labels.add(new LocalizedString(s));
}
public String getIcon()
@@ -177,12 +134,12 @@
public List<PageNode> getChildren()
{
- return children;
+ return getNodes();
}
- public void setChildren(ArrayList<PageNode> list)
+ public void setChildren(ArrayList<PageNode> children)
{
- children = list;
+ setNodes(children);
}
public Date getStartPublicationDate()
@@ -217,19 +174,19 @@
public PageNode getChild(String name)
{
- if (children == null)
- return null;
- for (PageNode node : children)
- {
- if (node.getName().equals(name))
- return node;
- }
- return null;
+ return getNode(name);
}
- public List<PageNode> getNodes()
+ public NodeState getState()
{
- return children;
+ return new NodeState(
+ labels.getSimple(),
+ icon,
+ startPublicationDate == null ? -1 : startPublicationDate.getTime(),
+ endPublicationDate == null ? -1 : endPublicationDate.getTime(),
+ visibility,
+ pageReference
+ );
}
@Override
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.config.model;
-import java.util.List;
+import java.util.ArrayList;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -28,18 +28,35 @@
public abstract class PageNodeContainer
{
+ /** . */
+ private ArrayList<PageNode> nodes;
+
public PageNodeContainer()
{
+ this.nodes = new ArrayList<PageNode>();
}
- public abstract List<PageNode> getNodes();
+ public ArrayList<PageNode> getNodes()
+ {
+ return nodes;
+ }
+ public void setNodes(ArrayList<PageNode> nodes)
+ {
+ this.nodes = nodes;
+ }
+
public PageNode getNode(String name)
{
- for (PageNode node : getNodes())
+ if (nodes != null)
{
- if (node.getName().equals(name))
- return node;
+ for (PageNode node : getNodes())
+ {
+ if (node.getName().equals(name))
+ {
+ return node;
+ }
+ }
}
return null;
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/LocalizedValueMapper.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/LocalizedValueMapper.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/LocalizedValueMapper.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -19,9 +19,7 @@
package org.exoplatform.portal.config.serialize;
-import org.exoplatform.portal.config.model.LocalizedValue;
-import org.gatein.common.i18n.LocaleFormat;
-import org.gatein.common.util.ConversionException;
+import org.exoplatform.portal.config.model.LocalizedString;
import org.jibx.runtime.IAliasable;
import org.jibx.runtime.IMarshaller;
import org.jibx.runtime.IMarshallingContext;
@@ -110,7 +108,7 @@
ctx.parsePastStartTag(marshalURI, marshallName);
String value = ctx.getText();
ctx.parsePastEndTag(marshalURI, marshallName);
- return new LocalizedValue(value, lang);
+ return new LocalizedString(value, lang);
}
//
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportConfig.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportConfig.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportConfig.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class ImportConfig
+{
+
+ /** . */
+ final boolean destroyOrphan;
+
+ /** . */
+ final boolean updatedSame;
+
+ /** . */
+ final boolean createMissing;
+
+ public ImportConfig(boolean destroyOrphan, boolean updatedSame, boolean createMissing)
+ {
+ this.destroyOrphan = destroyOrphan;
+ this.updatedSame = updatedSame;
+ this.createMissing = createMissing;
+ }
+
+ /**
+ * Returns true when an orphan node should be destroyed.
+ *
+ * @return the destroy orphan value
+ */
+ public boolean getDestroyOrphan()
+ {
+ return destroyOrphan;
+ }
+
+ public boolean getUpdatedSame()
+ {
+ return updatedSame;
+ }
+
+ public boolean getCreateMissing()
+ {
+ return createMissing;
+ }
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportMode.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportMode.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/ImportMode.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+/**
+ * The import mode.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public enum ImportMode
+{
+
+ /**
+ * Import data when it does not exist, otherwise do nothing.
+ */
+ CONSERVE(new ImportConfig(false, false, true)),
+
+ /**
+ * Import data when it does not exist, otherwise performs a strategy that adds new data only.
+ */
+ INSERT(new ImportConfig(false, false, true)),
+
+ /**
+ * Import data when it does not exist, update data when it exists.
+ */
+ MERGE(new ImportConfig(false, true, true)),
+
+ /**
+ * Overwrite data whatsoever.
+ */
+ OVERWRITE(new ImportConfig(true, true, true));
+
+ /** . */
+ public final ImportConfig config;
+
+ ImportMode(ImportConfig config)
+ {
+ this.config = config;
+ }
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.chromattic.api.annotations.MixinType;
+import org.chromattic.api.annotations.Property;
+
+import java.util.Date;
+
+/**
+ * This mixin denotes the import performed.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+@MixinType(name = "gtn:imported")
+public abstract class Imported
+{
+
+ @Property(name = "gtn:creationdate")
+ public abstract Date getCreationDate();
+
+ public abstract void setCreationDate(Date creationDate);
+
+ @Property(name = "gtn:lastmodificationdate")
+ public abstract Date getLastModificationDate();
+
+ public abstract void setLastModificationDate(Date lastModificationDate);
+
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationFragmentImporter.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationFragmentImporter.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationFragmentImporter.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,365 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.I18NString;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PageNodeContainer;
+import org.exoplatform.portal.mop.Described;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.description.DescriptionService;
+import org.exoplatform.portal.mop.navigation.GenericScope;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeModel;
+import org.exoplatform.portal.mop.navigation.NodeState;
+import org.exoplatform.portal.mop.navigation.Scope;
+import org.exoplatform.portal.tree.diff.Adapters;
+import org.exoplatform.portal.tree.diff.ListAdapter;
+import org.exoplatform.portal.tree.diff.ListChangeIterator;
+import org.exoplatform.portal.tree.diff.ListChangeType;
+import org.exoplatform.portal.tree.diff.ListDiff;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class NavigationFragmentImporter
+{
+
+ private static final ListAdapter<PageNodeContainer, String> PAGE_NODE_CONTAINER_ADAPTER = new ListAdapter<PageNodeContainer, String>()
+ {
+ public int size(PageNodeContainer list)
+ {
+ List<PageNode> nodes = list.getNodes();
+ if (nodes == null)
+ {
+ return 0;
+ }
+ else
+ {
+ return nodes.size();
+ }
+ }
+
+ public Iterator<String> iterator(PageNodeContainer list, boolean reverse)
+ {
+ List<PageNode> nodes = list.getNodes();
+ if (nodes == null)
+ {
+ return Collections.<String>emptyList().iterator();
+ }
+ else {
+ String[] names = new String[nodes.size()];
+ int index = 0;
+ for (PageNode child : nodes)
+ {
+ names[index++] = child.getName();
+ }
+ return Adapters.<String>list().iterator(names, reverse);
+ }
+ }
+ };
+
+ private static final ListAdapter<NodeContext<?>, String> NODE_ADAPTER = new ListAdapter<NodeContext<?>, String>()
+ {
+ public int size(NodeContext<?> list)
+ {
+ return list.getNodeCount();
+ }
+
+ public Iterator<String> iterator(NodeContext<?> list, boolean reverse)
+ {
+ int size = list.getNodeCount();
+ String[] names = new String[size];
+ int index = 0;
+ for (NodeContext<?> child = list.getFirst();child != null;child = child.getNext())
+ {
+ names[index++] = child.getName();
+ }
+ return Adapters.<String>list().iterator(names, reverse);
+ }
+ };
+
+ /** . */
+ private final String[] path;
+
+ /** . */
+ private final NavigationService navigationService;
+
+ /** . */
+ private final SiteKey navigationKey;
+
+ /** . */
+ private final Locale portalLocale;
+
+ /** . */
+ private final DescriptionService descriptionService;
+
+ /** . */
+ private final PageNodeContainer src;
+
+ /** . */
+ private final ImportConfig config;
+
+ public NavigationFragmentImporter(
+ String[] path,
+ NavigationService navigationService,
+ SiteKey navigationKey,
+ Locale portalLocale,
+ DescriptionService descriptionService,
+ PageNodeContainer src,
+ ImportConfig config)
+ {
+ this.path = path;
+ this.navigationService = navigationService;
+ this.navigationKey = navigationKey;
+ this.portalLocale = portalLocale;
+ this.descriptionService = descriptionService;
+ this.src = src;
+ this.config = config;
+ }
+
+ public ImportConfig getConfig()
+ {
+ return config;
+ }
+
+ public NodeContext<?> perform()
+ {
+ NavigationContext navigationCtx = navigationService.loadNavigation(navigationKey);
+
+ //
+ if (navigationCtx != null)
+ {
+ NodeContext root = navigationService.loadNode(NodeModel.SELF_MODEL, navigationCtx, GenericScope.branchShape(path), null);
+
+ //
+ NodeContext from = root;
+ for (String name : path)
+ {
+ NodeContext a = from.get(name);
+ if (a != null)
+ {
+ from = a;
+ }
+ else
+ {
+ from = from.add(null, name);
+ }
+ }
+
+ // Collect labels
+ Map<NodeContext<?>, Map<Locale, Described.State>> labelMap = new HashMap<NodeContext<?>, Map<Locale, Described.State>>();
+
+ // Perform save
+ perform(src, from, labelMap);
+
+ // Save the node
+ navigationService.saveNode(root, null);
+
+ //
+ for (Map.Entry<NodeContext<?>, Map<Locale, Described.State>> entry : labelMap.entrySet())
+ {
+ String id = entry.getKey().getId();
+ descriptionService.setDescriptions(id, entry.getValue());
+ }
+
+ //
+ return from;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private void perform(PageNodeContainer src, final NodeContext<?> dst, final Map<NodeContext<?>, Map<Locale, Described.State>> labelMap)
+ {
+ navigationService.rebaseNode(dst, Scope.CHILDREN, null);
+
+ //
+ ListDiff<PageNodeContainer, NodeContext<?>, String> diff = new ListDiff<PageNodeContainer,NodeContext<?>, String>(
+ PAGE_NODE_CONTAINER_ADAPTER,
+ NODE_ADAPTER
+ );
+
+ //
+ List<PageNode> srcChildren = src.getNodes();
+ ListChangeIterator<PageNodeContainer, NodeContext<?>, String> it = diff.iterator(src, dst);
+
+ class Change
+ {
+ final ListChangeType type;
+ final String name;
+ final int index1;
+ final int index2;
+
+ Change(ListChangeType type, String name, int index1, int index2)
+ {
+ this.type = type;
+ this.name = name;
+ this.index1 = index1;
+ this.index2 = index2;
+ }
+ }
+
+ // Buffer the changes in a list
+ LinkedList<Change> foo = new LinkedList<Change>();
+ while (it.hasNext())
+ {
+ ListChangeType type = it.next();
+ foo.add(new Change(type, it.getElement(), it.getIndex1(), it.getIndex2()));
+ }
+
+ // The last encountered child
+ NodeContext<?> previousChild = null;
+
+ // Replay the changes and apply them
+ for (Change change : foo)
+ {
+ PageNode srcChild = src.getNode(change.name);
+ NodeContext<?> dstChild = dst.get(change.name);
+
+ //
+ switch (change.type)
+ {
+ case SAME:
+ // Perform recursively
+ perform(srcChild, dstChild, labelMap);
+
+ //
+ if (config.updatedSame)
+ {
+ dstChild.setState(srcChild.getState());
+ }
+
+ //
+ previousChild = dstChild;
+ break;
+ case REMOVE:
+ if (dst.getNode(change.name) != null)
+ {
+ }
+ else
+ {
+ if (config.createMissing)
+ {
+ previousChild = add(srcChild, previousChild, dst, labelMap);
+ }
+ }
+ break;
+ case ADD:
+ if (src.getNode(change.name) != null)
+ {
+ if (config.updatedSame)
+ {
+ dstChild.setState(srcChild.getState());
+ }
+ previousChild = dstChild;
+ }
+ else
+ {
+ if (config.destroyOrphan)
+ {
+ dstChild.removeNode();
+ }
+ else
+ {
+ previousChild = dstChild;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ private NodeContext<?> add(
+ PageNode target,
+ NodeContext<?> previous,
+ NodeContext<?> parent,
+ Map<NodeContext<?>, Map<Locale, Described.State>> labelMap)
+ {
+ I18NString labels = target.getLabels();
+
+ //
+ Map<Locale, Described.State> description;
+ if (labels.isSimple())
+ {
+ description = null;
+ }
+ else if (labels.isEmpty())
+ {
+ description = null;
+ }
+ else
+ {
+ description = new HashMap<Locale, Described.State>();
+ for (Map.Entry<Locale, String> entry : labels.getExtended(portalLocale).entrySet())
+ {
+ description.put(entry.getKey(), new Described.State(entry.getValue(), null));
+ }
+ }
+
+ //
+ String name = target.getName();
+ int index;
+ if (previous != null)
+ {
+ index = parent.get((previous).getName()).getIndex() + 1;
+ }
+ else
+ {
+ index = 0;
+ }
+ NodeContext<?> child = parent.add(index, name);
+ NodeState state = target.getState();
+ child.setState(state);
+
+ //
+ if (description != null)
+ {
+ labelMap.put(child, description);
+ }
+
+ // We recurse to create the descendants
+ List<PageNode> targetChildren = target.getNodes();
+ if (targetChildren != null)
+ {
+ NodeContext<?> targetPrevious = null;
+ for (PageNode targetChild : targetChildren)
+ {
+ targetPrevious = add(targetChild, targetPrevious, child, labelMap);
+ }
+ }
+
+ //
+ return child;
+ }
+}
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/importer/NavigationImporter.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.NavigationFragment;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.description.DescriptionService;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.NavigationState;
+import org.exoplatform.portal.pom.config.Utils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class NavigationImporter
+{
+
+ /** . */
+ private final Locale portalLocale;
+
+ /** . */
+ private final PageNavigation src;
+
+ /** . */
+ private final NavigationService service;
+
+ /** . */
+ private final ImportMode mode;
+
+ /** . */
+ private final DescriptionService descriptionService;
+
+ public NavigationImporter(
+ Locale portalLocale,
+ ImportMode mode,
+ PageNavigation src,
+ NavigationService service,
+ DescriptionService descriptionService)
+ {
+ this.portalLocale = portalLocale;
+ this.mode = mode;
+ this.src = src;
+ this.service = service;
+ this.descriptionService = descriptionService;
+ }
+
+ public void perform()
+ {
+
+ //
+ SiteKey key = new SiteKey(src.getOwnerType(), src.getOwnerId());
+
+ //
+ NavigationContext dst = service.loadNavigation(key);
+
+ //
+ switch (mode)
+ {
+ case CONSERVE:
+ if (dst == null)
+ {
+ dst = new NavigationContext(key, new NavigationState(src.getPriority()));
+ service.saveNavigation(dst);
+ }
+ else
+ {
+ dst = null;
+ }
+ break;
+ case MERGE:
+ case INSERT:
+ if (dst == null)
+ {
+ dst = new NavigationContext(key, new NavigationState(src.getPriority()));
+ service.saveNavigation(dst);
+ }
+ break;
+ case OVERWRITE:
+ if (dst == null)
+ {
+ dst = new NavigationContext(key, new NavigationState(src.getPriority()));
+ service.saveNavigation(dst);
+ }
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ //
+ if (dst != null)
+ {
+ ArrayList<NavigationFragment> fragments = src.getFragments();
+ if (fragments != null && fragments.size() > 0)
+ {
+ for (NavigationFragment fragment : fragments)
+ {
+ String parentURI = fragment.getParentURI();
+
+ // Find something better than that for building the path
+ List<String> path;
+ if (parentURI != null)
+ {
+ path = new ArrayList<String>();
+ String[] names = Utils.split("/", parentURI);
+ for (String name : names)
+ {
+ if (name.length() > 0)
+ {
+ path.add(name);
+ }
+ }
+ }
+ else
+ {
+ path = Collections.emptyList();
+ }
+
+ //
+ NavigationFragmentImporter fragmentImporter = new NavigationFragmentImporter(
+ path.toArray(new String[path.size()]),
+ service,
+ dst.getKey(),
+ portalLocale,
+ descriptionService,
+ fragment,
+ mode.config);
+
+ //
+ fragmentImporter.perform();
+ }
+ }
+ }
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/GenericScope.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/GenericScope.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/GenericScope.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -23,24 +23,145 @@
import java.util.List;
/**
-* A flexible scope implementation.
+* Flexible scope implementations.
*/
-public class GenericScope implements Scope
+public class GenericScope
{
- public static Scope branchShape(String[] path)
+ public static abstract class Branch implements Scope
{
- return branchShape(Arrays.asList(path), Scope.CHILDREN);
- }
- public static Scope branchShape(List<String> path)
- {
- return branchShape(path, Scope.CHILDREN);
- }
+ /** . */
+ private final Scope federated;
- public static Scope branchShape(String[] path, Scope federated)
- {
- return branchShape(Arrays.asList(path), federated);
+ /**
+ * Create a new branch scope.
+ *
+ * @param federated the federated scope
+ * @throws NullPointerException if the federated scope is null
+ */
+ public Branch(Scope federated) throws NullPointerException
+ {
+ if (federated == null)
+ {
+ throw new NullPointerException("no null federated scope accepted");
+ }
+
+ //
+ this.federated = federated;
+ }
+
+ protected abstract int getSize();
+
+ protected abstract String getName(int index);
+
+ public Visitor get()
+ {
+ return new Visitor()
+ {
+ @Override
+ protected int getSize()
+ {
+ return GenericScope.Branch.this.getSize();
+ }
+
+ @Override
+ protected String getName(int index)
+ {
+ return GenericScope.Branch.this.getName(index);
+ }
+
+ @Override
+ protected Scope.Visitor getFederated()
+ {
+ return federated.get();
+ }
+ };
+ }
+
+ public static abstract class Visitor implements Scope.Visitor
+ {
+
+ /** . */
+ private Scope.Visitor visitor;
+
+ protected Visitor()
+ {
+ this.visitor = null;
+ }
+
+ protected abstract int getSize();
+
+ protected abstract String getName(int index);
+
+ protected abstract Scope.Visitor getFederated();
+
+ public VisitMode enter(int depth, String id, String name, NodeState state)
+ {
+ int size = getSize();
+
+ //
+ if (depth < size)
+ {
+ if (depth == 0 || name.equals(getName(depth - 1)))
+ {
+ return VisitMode.ALL_CHILDREN;
+ }
+ else
+ {
+ return VisitMode.NO_CHILDREN;
+ }
+ }
+ else if (depth == size)
+ {
+ if (depth == 0 || name.equals(getName(depth - 1)))
+ {
+ Scope.Visitor visitor = getFederated();
+ VisitMode mode = visitor.enter(0, id, name, state);
+ if (mode == VisitMode.ALL_CHILDREN)
+ {
+ this.visitor = visitor;
+ }
+ return mode;
+ }
+ else
+ {
+ return VisitMode.NO_CHILDREN;
+ }
+ }
+ else
+ {
+ return visitor.enter(depth - size, id, name, state);
+ }
+ }
+
+ public void leave(int depth, String id, String name, NodeState state)
+ {
+ int size = getSize();
+
+ //
+ if (depth < size)
+ {
+ // Do nothing
+ }
+ else if (depth == size)
+ {
+ if (depth == 0 || name.equals(getName(depth - 1)))
+ {
+ visitor.leave(0, id, name, state);
+ visitor = null;
+ }
+ else
+ {
+ // Do nothing
+ }
+ }
+ else
+ {
+ visitor.leave(depth - size, id, name, state);
+ }
+ }
+ }
}
/**
@@ -61,102 +182,125 @@
* @return the branch shape scope
* @throws NullPointerException if any argument is null
*/
- public static Scope branchShape(final List<String> path, final Scope federated) throws NullPointerException
+ public static Scope branchShape(final List<String> path, Scope federated) throws NullPointerException
{
if (path == null)
{
- throw new NullPointerException("no null path accepted");
+ throw new NullPointerException("No null path accepted");
}
- if (federated == null)
+ return new Branch(federated)
{
- throw new NullPointerException("no null federated scope accepted");
- }
- return new Scope()
+ @Override
+ protected int getSize()
+ {
+ return path.size();
+ }
+
+ @Override
+ protected String getName(int index)
+ {
+ return path.get(index);
+ }
+ };
+ }
+
+ public static Scope branchShape(final String[] path, Scope federated)
+ {
+ return new Branch(federated)
{
- public Visitor get()
+ @Override
+ protected int getSize()
{
- return new Visitor()
- {
- public VisitMode enter(int depth, String id, String name, NodeState state)
- {
- if (depth == 0)
- {
- return VisitMode.ALL_CHILDREN;
- }
- else if (depth > 0)
- {
- if (depth < path.size())
- {
- if ((name.equals(path.get(depth - 1))))
- {
- return VisitMode.ALL_CHILDREN;
- }
- else
- {
- return VisitMode.NO_CHILDREN;
- }
- }
- else if (depth == path.size())
- {
- if ((name.equals(path.get(path.size() - 1))))
- {
- return federated.get().enter(0, id, name, state);
- }
- else
- {
- return VisitMode.NO_CHILDREN;
- }
- }
- else
- {
- return federated.get().enter(depth - path.size(), id, name, state);
- }
- }
- throw new AssertionError();
- }
+ return path.length;
+ }
- public void leave(int depth, String id, String name, NodeState state)
- {
- }
- };
+ @Override
+ protected String getName(int index)
+ {
+ return path[index];
}
};
}
+ public static Scope branchShape(List<String> path)
+ {
+ return branchShape(path, Scope.CHILDREN);
+ }
+ public static Scope branchShape(String[] path)
+ {
+ return branchShape(Arrays.asList(path), Scope.CHILDREN);
+ }
+
/** . */
- private final Visitor visitor;
+ private static final GenericScope.Tree ALL = new Tree(-1);
- /**
- * Creates a new navigation scope. When the height is positive or null, the tree will be pruned to the specified
- * height, when the height is negative no pruning will occur.
- *
- * @param height the max height of the pruned tree
- */
- public GenericScope(final int height)
+ /** . */
+ private static GenericScope.Tree[] PREDEFINED = {
+ new Tree(0),
+ new Tree(1),
+ new Tree(2),
+ new Tree(3),
+ new Tree(4),
+ new Tree(5),
+ new Tree(6),
+ new Tree(7),
+ new Tree(8),
+ new Tree(9) };
+
+ public static Scope treeShape(int height)
{
- this.visitor = new Visitor()
+ if (height < 0)
{
- public VisitMode enter(int depth, String id, String name, NodeState state)
+ return ALL;
+ }
+ else if (height < PREDEFINED.length)
+ {
+ return PREDEFINED[height];
+ }
+ else
+ {
+ return new Tree(height);
+ }
+ }
+
+ public static class Tree implements Scope
+ {
+
+ /** . */
+ private final Visitor visitor;
+
+ /**
+ * Creates a new navigation scope. When the height is positive or zero, the tree will be pruned to the specified
+ * height, when the height is negative no pruning will occur.
+ *
+ * @param height the max height of the pruned tree
+ */
+ public Tree(final int height)
+ {
+ this.visitor = new Visitor()
{
- if (height < 0 || depth < height)
+ public VisitMode enter(int depth, String id, String name, NodeState state)
{
- return VisitMode.ALL_CHILDREN;
+ if (height < 0 || depth < height)
+ {
+ return VisitMode.ALL_CHILDREN;
+ }
+ else
+ {
+ return VisitMode.NO_CHILDREN;
+ }
}
- else
+
+ public void leave(int depth, String id, String name, NodeState state)
{
- return VisitMode.NO_CHILDREN;
}
- }
+ };
+ }
- public void leave(int depth, String id, String name, NodeState state)
- {
- }
- };
+ public Visitor get()
+ {
+ return visitor;
+ }
}
-
- public Visitor get()
- {
- return visitor;
- }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NodeContext.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NodeContext.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NodeContext.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -135,62 +135,55 @@
}
/**
- * Returns the relative depth of this node with respect to the ancestor argument.
+ * Returns the associated node with this context
*
- * @param ancestor the ancestor
- * @return the depth
- * @throws IllegalArgumentException if the ancestor argument is not an ancestor
- * @throws NullPointerException if the ancestor argument is null
+ * @return the node
*/
- public int getDepth(NodeContext<N> ancestor) throws IllegalArgumentException, NullPointerException
+ public N getNode()
{
- if (ancestor == null)
- {
- throw new NullPointerException();
- }
- int depth = 0;
- for (NodeContext<N> current = this;current != null;current = current.getParent())
- {
- if (current == ancestor)
- {
- return depth;
- }
- else
- {
- depth++;
- }
- }
- throw new IllegalArgumentException("Context " + ancestor + " is not an ancestor of " + this);
+ return node;
}
- public NodeContext<N> getDescendant(String handle) throws NullPointerException
+ /**
+ * Returns the context id or null if the context is not associated with a persistent navigation node.
+ *
+ * @return the id
+ */
+ public String getId()
{
- if (handle == null)
+ return data != null ? data.getId() : null;
+ }
+
+ /**
+ * Returns the context index among its parent.
+ *
+ * @return the index value
+ */
+ public int getIndex()
+ {
+ int count = 0;
+ for (NodeContext<N> node = getPrevious();node != null;node = node.getPrevious())
{
- throw new NullPointerException();
+ count++;
}
+ return count;
+ }
- //
- NodeContext<N> found = null;
- if (this.handle.equals(handle))
+ public boolean isExpanded()
+ {
+ return expanded;
+ }
+
+ void expand()
+ {
+ if (!expanded)
{
- found = this;
+ this.expanded = true;
}
else
{
- if (expanded)
- {
- for (NodeContext<N> current = getFirst();current != null;current = current.getNext())
- {
- found = current.getDescendant(handle);
- if (found != null)
- {
- break;
- }
- }
- }
+ throw new IllegalStateException("Context is already expanded");
}
- return found;
}
/**
@@ -228,63 +221,33 @@
}
}
- /**
- * Applies a filter recursively, the filter will update the hiddent status of the
- * fragment.
- *
- * @param filter the filter to apply
- */
- public void filter(NodeFilter filter)
+ public NodeState getState()
{
- doFilter(0, filter);
- }
-
- private void doFilter(int depth, NodeFilter filter)
- {
- boolean accept = filter.accept(depth, getId(), name, getState());
- setHidden(!accept);
- if (expanded)
+ if (state != null)
{
- for (NodeContext<N> node = getFirst();node != null;node = node.getNext())
- {
- node.doFilter(depth + 1, filter);
- }
+ return state;
}
+ else
+ {
+ return data.getState();
+ }
}
/**
- * Returns the associated node with this context
+ * Update the context state
*
- * @return the node
+ * @param state the new state
+ * @throws NullPointerException if the state is null
*/
- public N getNode()
+ public void setState(NodeState state) throws NullPointerException
{
- return node;
- }
-
- /**
- * Reutrns the context id or null if the context is not associated with a persistent navigation node.
- *
- * @return the id
- */
- public String getId()
- {
- return data != null ? data.getId() : null;
- }
-
- /**
- * Returns the context index among its parent.
- *
- * @return the index value
- */
- public int getIndex()
- {
- int count = 0;
- for (NodeContext<N> node = getPrevious();node != null;node = node.getPrevious())
+ if (state == null)
{
- count++;
+ throw new NullPointerException("No null state accepted");
}
- return count;
+
+ //
+ tree.addChange(new NodeChange.Updated<NodeContext<N>>(this, state));
}
public String getName()
@@ -328,200 +291,111 @@
}
}
- public NodeContext<N> get(String name) throws NullPointerException, IllegalStateException
- {
- if (name == null)
- {
- throw new NullPointerException();
- }
- if (!expanded)
- {
- throw new IllegalStateException("No children relationship");
- }
-
- //
- for (NodeContext<N> node = getFirst();node != null;node = node.getNext())
- {
- if (node.getName().equals(name))
- {
- return node;
- }
- }
-
- //
- return null;
- }
-
/**
- * Returns the total number of nodes.
+ * Applies a filter recursively, the filter will update the hiddent status of the
+ * fragment.
*
- * @return the total number of nodes
+ * @param filter the filter to apply
*/
- public int getNodeSize()
+ public void filter(NodeFilter filter)
{
+ doFilter(0, filter);
+ }
+
+ private void doFilter(int depth, NodeFilter filter)
+ {
+ boolean accept = filter.accept(depth, getId(), name, getState());
+ setHidden(!accept);
if (expanded)
{
- return getSize();
+ for (NodeContext<N> node = getFirst();node != null;node = node.getNext())
+ {
+ node.doFilter(depth + 1, filter);
+ }
}
- else
- {
- return data.children.length;
- }
}
/**
- * Returns the node count defined by:
- * <ul>
- * <li>when the node has a children relationship, the number of non hidden nodes</li>
- * <li>when the node has not a children relationship, the total number of nodes</li>
- * </ul>
+ * Returns the relative depth of this node with respect to the ancestor argument.
*
- * @return the node count
+ * @param ancestor the ancestor
+ * @return the depth
+ * @throws IllegalArgumentException if the ancestor argument is not an ancestor
+ * @throws NullPointerException if the ancestor argument is null
*/
- public int getNodeCount()
+ public int getDepth(NodeContext<N> ancestor) throws IllegalArgumentException, NullPointerException
{
- if (expanded)
+ if (ancestor == null)
{
- return getSize() - hiddenCount;
+ throw new NullPointerException();
}
- else
+ int depth = 0;
+ for (NodeContext<N> current = this;current != null;current = current.getParent())
{
- return data.children.length;
+ if (current == ancestor)
+ {
+ return depth;
+ }
+ else
+ {
+ depth++;
+ }
}
+ throw new IllegalArgumentException("Context " + ancestor + " is not an ancestor of " + this);
}
- public NodeState getState()
+ public NodeContext<N> getDescendant(String handle) throws NullPointerException
{
- if (state != null)
+ if (handle == null)
{
- return state;
+ throw new NullPointerException();
}
- else
- {
- return data.getState();
- }
- }
- /**
- * Update the context state
- *
- * @param state the new state
- * @throws NullPointerException if the state is null
- */
- public void setState(NodeState state) throws NullPointerException
- {
- if (state == null)
- {
- throw new NullPointerException("No null state accepted");
- }
-
//
- tree.addChange(new NodeChange.Updated<NodeContext<N>>(this, state));
- }
-
- public N getParentNode()
- {
- NodeContext<N> parent = getParent();
- return parent != null ? parent.node : null;
- }
-
- public N getNode(String name) throws NullPointerException
- {
- NodeContext<N> child = get(name);
- return child != null && !child.hidden ? child.node: null;
- }
-
- public N getNode(int index)
- {
- if (index < 0)
+ NodeContext<N> found = null;
+ if (this.handle.equals(handle))
{
- throw new IndexOutOfBoundsException("Index " + index + " cannot be negative");
+ found = this;
}
- if (!expanded)
- {
- throw new IllegalStateException("No children relationship");
- }
- NodeContext<N> context = getFirst();
- while (context != null && (context.hidden || index-- > 0))
- {
- context = context.getNext();
- }
- if (context == null)
- {
- throw new IndexOutOfBoundsException("Index " + index + " is out of bounds");
- }
else
{
- return context.node;
- }
- }
-
- public final Iterator<N> iterator()
- {
- return new Iterator<N>()
- {
- NodeContext<N> next = getFirst();
+ if (expanded)
{
- while (next != null && next.isHidden())
+ for (NodeContext<N> current = getFirst();current != null;current = current.getNext())
{
- next = next.getNext();
- }
- }
- public boolean hasNext()
- {
- return next != null;
- }
- public N next()
- {
- if (next != null)
- {
- NodeContext<N> tmp = next;
- do
+ found = current.getDescendant(handle);
+ if (found != null)
{
- next = next.getNext();
+ break;
}
- while (next != null && next.isHidden());
- return tmp.getNode();
}
- else
- {
- throw new NoSuchElementException();
- }
}
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
+ }
+ return found;
}
- /** . */
- private Collection<N> nodes;
-
- public Collection<N> getNodes()
+ public NodeContext<N> get(String name) throws NullPointerException, IllegalStateException
{
- if (expanded)
+ if (name == null)
{
- if (nodes == null)
- {
- nodes = new AbstractCollection<N>()
- {
- public Iterator<N> iterator()
- {
- return NodeContext.this.iterator();
- }
- public int size()
- {
- return getNodeCount();
- }
- };
- }
- return nodes;
+ throw new NullPointerException();
}
- else
+ if (!expanded)
{
- return null;
+ throw new IllegalStateException("No children relationship");
}
+
+ //
+ for (NodeContext<N> node = getFirst();node != null;node = node.getNext())
+ {
+ if (node.getName().equals(name))
+ {
+ return node;
+ }
+ }
+
+ //
+ return null;
}
/**
@@ -670,65 +544,144 @@
}
}
+ // Node related methods
+
/**
- * Remove a specified context.
+ * Returns the total number of nodes.
*
- * @param name the name of the context to remove
- * @return true if the context was removed
- * @throws NullPointerException if the name argument is null
- * @throws IllegalArgumentException if the named context does not exist
- * @throws IllegalStateException if the children relationship does not exist
+ * @return the total number of nodes
*/
- public boolean removeNode(String name) throws NullPointerException, IllegalArgumentException, IllegalStateException
+ public int getNodeSize()
{
- NodeContext<N> node = get(name);
- if (node == null)
+ if (expanded)
{
- throw new IllegalArgumentException("Cannot remove non existent " + name + " child");
+ return getSize();
}
+ else
+ {
+ return data.children.length;
+ }
+ }
- //
- if (node.hidden)
+ /**
+ * Returns the node count defined by:
+ * <ul>
+ * <li>when the node has a children relationship, the number of non hidden nodes</li>
+ * <li>when the node has not a children relationship, the total number of nodes</li>
+ * </ul>
+ *
+ * @return the node count
+ */
+ public int getNodeCount()
+ {
+ if (expanded)
{
- return false;
+ return getSize() - hiddenCount;
}
else
{
- tree.addChange(new NodeChange.Destroyed<NodeContext<N>>(this, node));
-
- //
- return true;
+ return data.children.length;
}
}
- public boolean isExpanded()
+ public N getParentNode()
{
- return expanded;
+ NodeContext<N> parent = getParent();
+ return parent != null ? parent.node : null;
}
- void expand()
+ public N getNode(String name) throws NullPointerException
{
+ NodeContext<N> child = get(name);
+ return child != null && !child.hidden ? child.node: null;
+ }
+
+ public N getNode(int index)
+ {
+ if (index < 0)
+ {
+ throw new IndexOutOfBoundsException("Index " + index + " cannot be negative");
+ }
if (!expanded)
{
- this.expanded = true;
+ throw new IllegalStateException("No children relationship");
}
+ NodeContext<N> context = getFirst();
+ while (context != null && (context.hidden || index-- > 0))
+ {
+ context = context.getNext();
+ }
+ if (context == null)
+ {
+ throw new IndexOutOfBoundsException("Index " + index + " is out of bounds");
+ }
else
{
- throw new IllegalStateException("Context is already expanded");
+ return context.node;
}
}
- Iterable<NodeContext<N>> getContexts()
+ public final Iterator<N> iterator()
{
- if (expanded)
+ return new Iterator<N>()
{
- return new Iterable<NodeContext<N>>()
+ NodeContext<N> next = getFirst();
{
- public Iterator<NodeContext<N>> iterator()
+ while (next != null && next.isHidden())
{
- return listIterator();
+ next = next.getNext();
}
- };
+ }
+ public boolean hasNext()
+ {
+ return next != null;
+ }
+ public N next()
+ {
+ if (next != null)
+ {
+ NodeContext<N> tmp = next;
+ do
+ {
+ next = next.getNext();
+ }
+ while (next != null && next.isHidden());
+ return tmp.getNode();
+ }
+ else
+ {
+ throw new NoSuchElementException();
+ }
+ }
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ /** . */
+ private Collection<N> nodes;
+
+ public Collection<N> getNodes()
+ {
+ if (expanded)
+ {
+ if (nodes == null)
+ {
+ nodes = new AbstractCollection<N>()
+ {
+ public Iterator<N> iterator()
+ {
+ return NodeContext.this.iterator();
+ }
+ public int size()
+ {
+ return getNodeCount();
+ }
+ };
+ }
+ return nodes;
}
else
{
@@ -736,6 +689,50 @@
}
}
+ /**
+ * Remove a specified context when it is not hidden.
+ *
+ * @param name the name of the context to remove
+ * @return true if the context was removed
+ * @throws NullPointerException if the name argument is null
+ * @throws IllegalArgumentException if the named context does not exist
+ * @throws IllegalStateException if the children relationship does not exist
+ */
+ public boolean removeNode(String name) throws NullPointerException, IllegalArgumentException, IllegalStateException
+ {
+ NodeContext<N> node = get(name);
+ if (node == null)
+ {
+ throw new IllegalArgumentException("Cannot remove non existent " + name + " child");
+ }
+
+ //
+ return node.removeNode();
+ }
+
+ /**
+ * Removes this current context when it is not hidden.
+ *
+ * @return if the context was removed
+ * @throws IllegalStateException if the children relationship does not exist
+ */
+ public boolean removeNode() throws IllegalStateException
+ {
+ if (hidden)
+ {
+ return false;
+ }
+ else
+ {
+ tree.addChange(new NodeChange.Destroyed<NodeContext<N>>(getParent(), this));
+
+ //
+ return true;
+ }
+ }
+
+ // Callbacks
+
protected void beforeRemove(NodeContext<N> context)
{
if (!expanded)
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/Scope.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/Scope.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/Scope.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -36,22 +36,22 @@
/**
* The node without its children.
*/
- Scope SINGLE = new GenericScope(0);
+ Scope SINGLE = GenericScope.treeShape(0);
/**
* A node and its chidren.
*/
- Scope CHILDREN = new GenericScope(1);
+ Scope CHILDREN = GenericScope.treeShape(1);
/**
* A node, its chidren and grandchildren.
*/
- Scope GRANDCHILDREN = new GenericScope(2);
+ Scope GRANDCHILDREN = GenericScope.treeShape(2);
/**
* The entire hierarchy, to use with care.
*/
- Scope ALL = new GenericScope(-1);
+ Scope ALL = GenericScope.treeShape(-1);
Visitor get();
@@ -61,7 +61,7 @@
public interface Visitor
{
/**
- * Returns the visit mode for the specified node.
+ * Signals a node is ented and returns the visit mode for that node.
*
* @param depth the relative depth to the root of the loading
* @param id the node persistent id
@@ -71,6 +71,14 @@
*/
VisitMode enter(int depth, String id, String name, NodeState state);
+ /**
+ * Signals a node is left.
+ *
+ * @param depth the relative depth to the root of the loading
+ * @param id the node persistent id
+ * @param name the node name
+ * @param state the node state
+ */
void leave(int depth, String id, String name, NodeState state);
}
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/TreeUpdate.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/TreeUpdate.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/TreeUpdate.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -113,15 +113,19 @@
private void perform(NodeContext<N1> parent)
{
// Compute visit
- VisitMode visit = null;
- N2 d = it.getDestination();
- NodeData data = updateAdapter.getData(d);
+ final N2 d = it.getDestination();
+ final NodeData data = updateAdapter.getData(d);
//
+ final VisitMode visit;
if (data != null)
{
visit = visitor.enter(depth, data.id, data.name, data.state);
}
+ else
+ {
+ visit = null;
+ }
// Cut the recursion if necessary
if (visit != VisitMode.ALL_CHILDREN)
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNode.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNode.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNode.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -48,13 +48,13 @@
final NodeContext<UserNode> context;
/** . */
- private String resolvedLabel;
+ String resolvedLabel;
/** . */
- private String encodedResolvedLabel;
+ String encodedResolvedLabel;
/** . */
- private String uri;
+ String uri;
UserNode(UserNodeContext owner, NodeContext<UserNode> context)
{
@@ -89,6 +89,11 @@
public void setName(String name)
{
context.setName(name);
+
+ //
+ this.uri = null;
+ this.resolvedLabel = null;
+ this.encodedResolvedLabel = null;
}
public String getURI()
@@ -125,11 +130,11 @@
public void setLabel(String label)
{
+ context.setState(new NodeState.Builder(context.getState()).label(label).build());
+
+ //
this.resolvedLabel = null;
this.encodedResolvedLabel = null;
-
- //
- context.setState(new NodeState.Builder(context.getState()).label(label).build());
}
public String getIcon()
@@ -306,11 +311,13 @@
public void addChild(UserNode child)
{
context.add(null, child.context);
+ child.uri = null;
}
public void addChild(int index, UserNode child)
{
context.add(index, child.context);
+ child.uri = null;
}
public UserNode addChild(String childName)
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNodeListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNodeListener.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNodeListener.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2011 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.mop.user;
+
+import org.exoplatform.portal.mop.navigation.NodeChangeListener;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeState;
+
+/**
+ * This listener takes care of invalidating the cached state of the UserNode listener when it is updated against the
+ * navigation service.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+class UserNodeListener implements NodeChangeListener<NodeContext<UserNode>>
+{
+
+ /** . */
+ private NodeChangeListener<UserNode> next;
+
+ UserNodeListener(NodeChangeListener<UserNode> next)
+ {
+ if (next != null)
+ {
+ this.next = next;
+ }
+ }
+
+ public void onAdd(NodeContext<UserNode> target, NodeContext<UserNode> parent, NodeContext<UserNode> previous)
+ {
+ if (next != null)
+ {
+ next.onAdd(unwrap(target), unwrap(parent), unwrap(previous));
+ }
+ }
+
+ public void onCreate(NodeContext<UserNode> target, NodeContext<UserNode> parent, NodeContext<UserNode> previous, String name)
+ {
+ if (next != null)
+ {
+ next.onCreate(unwrap(target), unwrap(parent), unwrap(previous), name);
+ }
+ }
+
+ public void onRemove(NodeContext<UserNode> target, NodeContext<UserNode> parent)
+ {
+ if (next != null)
+ {
+ next.onRemove(unwrap(target), unwrap(parent));
+ }
+ }
+
+ public void onDestroy(NodeContext<UserNode> target, NodeContext<UserNode> parent)
+ {
+ if (next != null)
+ {
+ next.onDestroy(unwrap(target), unwrap(parent));
+ }
+ }
+
+ public void onRename(NodeContext<UserNode> target, NodeContext<UserNode> parent, String name)
+ {
+ UserNode unwrappedTarget = unwrap(target);
+ unwrappedTarget.resolvedLabel = null;
+ unwrappedTarget.encodedResolvedLabel = null;
+ unwrappedTarget.uri = null;
+ if (next != null)
+ {
+ next.onRename(unwrappedTarget, unwrap(parent), name);
+ }
+ }
+
+ public void onUpdate(NodeContext<UserNode> target, NodeState state)
+ {
+ UserNode unwrappedTarget = unwrap(target);
+ unwrappedTarget.resolvedLabel = null;
+ unwrappedTarget.encodedResolvedLabel = null;
+ if (next != null)
+ {
+ next.onUpdate(unwrappedTarget, state);
+ }
+ }
+
+ public void onMove(NodeContext<UserNode> target, NodeContext<UserNode> from, NodeContext<UserNode> to, NodeContext<UserNode> previous)
+ {
+ UserNode unwrappedTarget = unwrap(target);
+ unwrappedTarget.uri = null;
+ if (next != null)
+ {
+ next.onMove(unwrappedTarget, unwrap(from), unwrap(to), unwrap(previous));
+ }
+ }
+
+ private UserNode unwrap(NodeContext<UserNode> context)
+ {
+ return context != null ? context.getNode() : null;
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -30,11 +30,11 @@
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.SiteType;
+import org.exoplatform.portal.mop.navigation.GenericScope;
import org.exoplatform.portal.mop.navigation.NavigationContext;
import org.exoplatform.portal.mop.navigation.NavigationServiceException;
import org.exoplatform.portal.mop.navigation.NodeChangeListener;
import org.exoplatform.portal.mop.navigation.NodeContext;
-import org.exoplatform.portal.mop.navigation.NodeContextChangeAdapter;
import org.exoplatform.portal.mop.navigation.NodeState;
import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.mop.navigation.VisitMode;
@@ -201,7 +201,7 @@
NodeChangeListener<UserNode> listener) throws NullPointerException, UserPortalException, NavigationServiceException
{
UserNodeContext context = new UserNodeContext(userNavigation, filterConfig);
- NodeContext<UserNode> nodeContext = service.getNavigationService().loadNode(context, userNavigation.navigation, scope, NodeContextChangeAdapter.safeWrap(listener));
+ NodeContext<UserNode> nodeContext = service.getNavigationService().loadNode(context, userNavigation.navigation, scope, new UserNodeListener(listener));
if (nodeContext != null)
{
return nodeContext.getNode().filter();
@@ -219,7 +219,7 @@
{
throw new NullPointerException("No null node accepted");
}
- service.getNavigationService().updateNode(node.context, scope, NodeContextChangeAdapter.safeWrap(listener));
+ service.getNavigationService().updateNode(node.context, scope, new UserNodeListener(listener));
node.filter();
}
@@ -230,7 +230,7 @@
{
throw new NullPointerException("No null node accepted");
}
- service.getNavigationService().rebaseNode(node.context, scope, NodeContextChangeAdapter.safeWrap(listener));
+ service.getNavigationService().rebaseNode(node.context, scope, new UserNodeListener(listener));
node.filter();
}
@@ -240,11 +240,14 @@
{
throw new NullPointerException("No null node accepted");
}
- service.getNavigationService().saveNode(node.context, NodeContextChangeAdapter.safeWrap(listener));
+ service.getNavigationService().saveNode(node.context, new UserNodeListener(listener));
node.filter();
}
- private class MatchingScope implements Scope
+ /**
+ * Note : the scope implementation is not stateless but we don't care in this case.
+ */
+ private class MatchingScope extends GenericScope.Branch.Visitor implements Scope
{
final UserNavigation userNavigation;
final UserNodeFilterConfig filterConfig;
@@ -260,6 +263,29 @@
this.match = match;
}
+ public Visitor get()
+ {
+ return this;
+ }
+
+ @Override
+ protected int getSize()
+ {
+ return match.length;
+ }
+
+ @Override
+ protected String getName(int index)
+ {
+ return match[index];
+ }
+
+ @Override
+ protected Visitor getFederated()
+ {
+ return Scope.CHILDREN.get();
+ }
+
void resolve() throws NavigationServiceException
{
UserNodeContext context = new UserNodeContext(userNavigation, filterConfig);
@@ -273,34 +299,23 @@
}
}
- public Visitor get()
+ public VisitMode enter(int depth, String id, String name, NodeState state)
{
- return new Visitor()
+ VisitMode vm = super.enter(depth, id, name, state);
+ if (depth == 0)
{
- public VisitMode enter(int depth, String id, String name, NodeState state)
+ score = 0;
+ MatchingScope.this.id = null;
+ }
+ else
+ {
+ if (vm == VisitMode.ALL_CHILDREN)
{
- if (depth == 0 && "default".equals(name))
- {
- score = 0;
- MatchingScope.this.id = null;
- return VisitMode.ALL_CHILDREN;
- }
- else if (depth <= match.length && name.equals(match[depth - 1]))
- {
- score++;
- MatchingScope.this.id = id;
- return VisitMode.ALL_CHILDREN;
- }
- else
- {
- return VisitMode.NO_CHILDREN;
- }
+ MatchingScope.this.id = id;
+ score++;
}
-
- public void leave(int depth, String id, String name, NodeState state)
- {
- }
- };
+ }
+ return vm;
}
}
@@ -342,7 +357,7 @@
// Find the first navigation available or return null
if (segments == null)
{
- return getDefaultPath(null);
+ return getDefaultPath(filterConfig);
}
// Get navigations
Modified: portal/trunk/component/portal/src/main/resources/binding.xml
===================================================================
--- portal/trunk/component/portal/src/main/resources/binding.xml 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/main/resources/binding.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -29,7 +29,7 @@
marshaller="org.exoplatform.portal.config.serialize.JibxPropertiesMapper"
unmarshaller="org.exoplatform.portal.config.serialize.JibxPropertiesMapper"/>
- <mapping class="org.exoplatform.portal.config.model.LocalizedValue"
+ <mapping class="org.exoplatform.portal.config.model.LocalizedString"
name="label"
unmarshaller="org.exoplatform.portal.config.serialize.LocalizedValueMapper"
marshaller="org.exoplatform.portal.config.serialize.LocalizedValueMapper">
@@ -105,10 +105,10 @@
</mapping>
<mapping name="node" label="node" class="org.exoplatform.portal.config.model.PageNode">
- <value name="uri" field="uri" usage="optional"/>
+ <value name="uri" get-method="getUri" set-method="setUri" usage="optional"/>
<value name="name" field="name"/>
- <collection field="labels" ordered="false">
- <structure map-as="org.exoplatform.portal.config.model.LocalizedValue" usage="optional"/>
+ <collection field="labels" ordered="false" factory="org.exoplatform.portal.config.model.I18NString.create">
+ <structure map-as="org.exoplatform.portal.config.model.LocalizedString" usage="optional"/>
</collection>
<value name="icon" field="icon" usage="optional"/>
<value name="start-publication-date" field="startPublicationDate" usage="optional"/>
@@ -116,7 +116,7 @@
<value name="visibility" field="visibility" usage="optional" default="DISPLAYED"/>
<value name="page-reference" field="pageReference" usage="optional"
deserializer="org.exoplatform.portal.config.serialize.JibxStringSerialize.deserializeString"/>
- <collection field="children" usage="optional" item-type="org.exoplatform.portal.config.model.PageNode"/>
+ <collection get-method="getNodes" set-method="setNodes" usage="optional" item-type="org.exoplatform.portal.config.model.PageNode"/>
</mapping>
<mapping name="portal-config" class="org.exoplatform.portal.config.model.PortalConfig" ordered="false">
@@ -139,11 +139,18 @@
<value name="owner-type" field="ownerType" usage="optional"/>
<value name="owner-id" field="ownerId" usage="optional"/>
<value name="priority" field="priority" usage="optional"/>
- <collection name="page-nodes" field="pageNodes" usage="optional"
- item-type="org.exoplatform.portal.config.model.PageNode"/>
+ <collection field="fragments" ordered="false">
+ <structure map-as="org.exoplatform.portal.config.model.NavigationFragment" usage="optional"/>
+ </collection>
</mapping>
-
-
+
+ <mapping name="page-nodes" class="org.exoplatform.portal.config.model.NavigationFragment">
+ <value name="parent-uri" field="parentURI" usage="optional"/>
+ <collection get-method="getNodes" set-method="setNodes" ordered="false">
+ <structure map-as="org.exoplatform.portal.config.model.PageNode" usage="optional"/>
+ </collection>
+ </mapping>
+
<mapping name="portlet-preferences-set"
class="org.exoplatform.portal.application.PortletPreferences$PortletPreferencesSet">
<collection field="portlets"
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/AbstractPortalTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/AbstractPortalTest.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/AbstractPortalTest.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,77 @@
+/*
+ * 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;
+
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.component.test.*;
+import org.exoplatform.container.PortalContainer;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class AbstractPortalTest extends AbstractKernelTest
+{
+
+ public AbstractPortalTest()
+ {
+ }
+
+ public AbstractPortalTest(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ protected void end()
+ {
+ end(false);
+ }
+
+ protected void end(boolean save)
+ {
+ PortalContainer container = getContainer();
+ ChromatticManager manager = (ChromatticManager)container.getComponentInstanceOfType(ChromatticManager.class);
+ manager.getSynchronization().setSaveOnClose(save);
+ super.end();
+ }
+
+ protected final void sync()
+ {
+ end();
+ begin();
+ }
+
+ protected final void sync(boolean save)
+ {
+ end(save);
+ begin();
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ //
+ }
+}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -60,6 +60,6 @@
{
assertHash("d0591b0a022a0c2929e1aed8979857cd", "gatein_objects_1_0.xsd");
assertHash("99ae24c9bbfe1b59e066756a29ab6c79", "gatein_objects_1_1.xsd");
- assertHash("e30953182120381d5ffe65056071a270", "gatein_objects_1_2.xsd");
+ assertHash("852e20df61c51199e3425f0882f2581d", "gatein_objects_1_2.xsd");
}
}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractConfigTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractConfigTest.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractConfigTest.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.portal.AbstractPortalTest;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/portal/config/conf/configuration.xml")
+})
+public abstract class AbstractConfigTest extends AbstractPortalTest
+{
+
+ protected AbstractConfigTest()
+ {
+ }
+
+ protected AbstractConfigTest(String name)
+ {
+ super(name);
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportFragmentTest.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public abstract class AbstractImportFragmentTest extends AbstractImportTest
+{
+
+ @Override
+ protected final String getConfig1()
+ {
+ return "fragment1";
+ }
+
+ @Override
+ protected final String getConfig2()
+ {
+ return "fragment2";
+ }
+
+ protected abstract void assertState(NodeContext<?> root);
+
+ @Override
+ protected final void afterTwoPhasesBoot(NodeContext<?> root)
+ {
+ assertEquals(1, root.getNodeSize());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon", foo.getState().getIcon());
+ assertEquals(0, foo.getNodeSize());
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReboot(NodeContext<?> root)
+ {
+ assertEquals(1, root.getNodeSize());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon", foo.getState().getIcon());
+ assertEquals(0, foo.getNodeSize());
+ }
+
+ @Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportNavigationTest.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public abstract class AbstractImportNavigationTest extends AbstractImportTest
+{
+
+ @Override
+ protected final String getConfig1()
+ {
+ return "navigation1";
+ }
+
+ @Override
+ protected final String getConfig2()
+ {
+ return "navigation2";
+ }
+
+ protected abstract void assertState(NodeContext<?> root);
+
+ @Override
+ protected final void afterTwoPhasesBoot(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ assertNotNull(root.get("foo"));
+ assertNotNull(root.get("daa"));
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReboot(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ assertNotNull(root.get("foo"));
+ assertNotNull(root.get("daa"));
+ }
+
+ @Override
+ protected final void afterOnePhaseBoot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseOverrideReboot(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+
+ @Override
+ protected final void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root)
+ {
+ assertState(root);
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractImportTest.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.component.test.AbstractGateInTest;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.KernelBootstrap;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.Node;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeModel;
+import org.exoplatform.portal.mop.navigation.Scope;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.gatein.mop.api.workspace.Workspace;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public abstract class AbstractImportTest extends AbstractGateInTest
+{
+
+ protected abstract ImportMode getMode();
+
+ protected abstract String getConfig2();
+
+ protected abstract String getConfig1();
+
+ protected abstract void afterOnePhaseBoot(NodeContext<?> root);
+
+ protected abstract void afterTwoPhasesBoot(NodeContext<?> root);
+
+ protected abstract void afterTwoPhaseOverrideReboot(NodeContext<?> root);
+
+ protected abstract void afterTwoPhaseNoOverrideReboot(NodeContext<?> root);
+
+ protected abstract void afterTwoPhaseNoOverrideReconfigure(NodeContext<?> root);
+
+ public void testOnePhase() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport2-configuration.xml");
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "conserve");
+ System.setProperty("import.portal.1", getConfig1());
+ System.setProperty("override_2", "false");
+ System.setProperty("import.mode_2", getMode().toString());
+ System.setProperty("import.portal_2", getConfig2());
+
+ //
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ NavigationService service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ RequestLifeCycle.begin(container);
+ NavigationContext nav = service.loadNavigation(SiteKey.portal("classic"));
+ NodeContext<?> root = service.loadNode(Node.MODEL, nav, Scope.ALL, null);
+ afterOnePhaseBoot(root);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
+
+ public void testTwoPhasesOverride() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ System.setProperty("override.1", "true");
+ System.setProperty("import.mode.1", getMode().toString());
+
+ //
+ System.setProperty("import.portal.1", getConfig1());
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ NavigationService service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ RequestLifeCycle.begin(container);
+ NavigationContext nav = service.loadNavigation(SiteKey.portal("classic"));
+ NodeContext<?> root = service.loadNode(Node.MODEL, nav, Scope.ALL, null);
+ afterTwoPhasesBoot(root);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+
+ //
+ System.setProperty("import.portal.1", getConfig2());
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ RequestLifeCycle.begin(container);
+ nav = service.loadNavigation(SiteKey.portal("classic"));
+ root = service.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ afterTwoPhaseOverrideReboot(root);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
+
+ public void testTwoPhasesNoOverride() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", getMode().toString());
+
+ //
+ System.setProperty("import.portal.1", getConfig1());
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ NavigationService service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ RequestLifeCycle.begin(container);
+ NavigationContext nav = service.loadNavigation(SiteKey.portal("classic"));
+ NodeContext<?> root = service.loadNode(Node.MODEL, nav, Scope.ALL, null);
+ afterTwoPhasesBoot(root);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+
+ //
+ System.setProperty("import.portal.1", getConfig2());
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ RequestLifeCycle.begin(container);
+ nav = service.loadNavigation(SiteKey.portal("classic"));
+ root = service.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ afterTwoPhaseNoOverrideReboot(root);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ workspace.removeAdapter(Imported.class);
+ assertFalse(workspace.isAdapted(Imported.class));
+ mgr.getSession().save();
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+
+ //
+ bootstrap.boot();
+ container = bootstrap.getContainer();
+ service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ RequestLifeCycle.begin(container);
+ nav = service.loadNavigation(SiteKey.portal("classic"));
+ root = service.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ afterTwoPhaseNoOverrideReconfigure(root);
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
+}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,83 +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;
-
-import org.exoplatform.commons.chromattic.ChromatticManager;
-import org.exoplatform.component.test.*;
-import org.exoplatform.container.PortalContainer;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@ConfiguredBy({
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.organization-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration1.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration2.xml")
-})
-public abstract class AbstractPortalTest extends AbstractKernelTest
-{
-
- public AbstractPortalTest()
- {
- }
-
- public AbstractPortalTest(String name)
- {
- super(name);
- }
-
- @Override
- protected void end()
- {
- end(false);
- }
-
- protected void end(boolean save)
- {
- PortalContainer container = getContainer();
- ChromatticManager manager = (ChromatticManager)container.getComponentInstanceOfType(ChromatticManager.class);
- manager.getSynchronization().setSaveOnClose(save);
- super.end();
- }
-
- protected final void sync()
- {
- end();
- begin();
- }
-
- protected final void sync(boolean save)
- {
- end(save);
- begin();
- }
-
- @Override
- protected void setUp() throws Exception
- {
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- //
- }
-}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestCache extends AbstractPortalTest
+public class TestCache extends AbstractConfigTest
{
/** . */
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestConcurrencyDataStorage.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -30,7 +30,7 @@
* Nov 10, 2010
*/
-public class TestConcurrencyDataStorage extends AbstractPortalTest
+public class TestConcurrencyDataStorage extends AbstractConfigTest
{
private DataStorage storage_;
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -26,7 +26,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestContentRegistry extends AbstractPortalTest
+public class TestContentRegistry extends AbstractConfigTest
{
/** . */
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 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -32,6 +32,7 @@
import org.exoplatform.portal.config.model.Dashboard;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
+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.mop.EventType;
@@ -47,9 +48,15 @@
import org.exoplatform.portal.pom.spi.gadget.Gadget;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
import org.exoplatform.services.listener.ListenerService;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupHandler;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserHandler;
import java.util.ArrayList;
import java.util.Arrays;
@@ -64,7 +71,7 @@
* Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
* 13, 2007
*/
-public class TestDataStorage extends AbstractPortalTest
+public class TestDataStorage extends AbstractConfigTest
{
/** . */
@@ -82,10 +89,15 @@
/** . */
private POMSessionManager mgr;
+ /** . */
private LinkedList<Event> events;
+ /** . */
private ListenerService listenerService;
+ /** . */
+ private OrganizationService org;
+
public TestDataStorage(String name)
{
super(name);
@@ -110,6 +122,7 @@
navService = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
events = new LinkedList<Event>();
listenerService = (ListenerService)container.getComponentInstanceOfType(ListenerService.class);
+ org = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
//
listenerService.addListener(DataStorage.PAGE_CREATED, listener);
@@ -132,6 +145,19 @@
super.tearDown();
}
+ private void assertPageFound(Query<Page> q, String expectedPage) throws Exception
+ {
+ List<Page> res = storage_.find(q).getAll();
+ assertEquals(1, res.size());
+ assertEquals(expectedPage, res.get(0).getPageId());
+ }
+
+ private void assertPageNotFound(Query<Page> q) throws Exception
+ {
+ List<Page> res = storage_.find(q).getAll();
+ assertEquals(0, res.size());
+ }
+
public void testCreatePortal() throws Exception
{
String label = "portal_foo";
@@ -886,4 +912,263 @@
portletApp.setState(state);
return portletApp;
}
+
+ public void testSearchPage() throws Exception
+ {
+ Page page = new Page();
+ page.setPageId("portal::test::searchedpage");
+ page.setTitle("Juuu Ziii");
+ storage_.create(page);
+
+ //
+ assertPageFound(new Query<Page>(null, null, null, "Juuu Ziii", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "Juuu", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "Ziii", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "juuu ziii", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "juuu", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "ziii", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "juu", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "zii", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "ju", Page.class), "portal::test::searchedpage");
+ assertPageFound(new Query<Page>(null, null, null, "zi", Page.class), "portal::test::searchedpage");
+
+ assertPageNotFound(new Query<Page>(null, null, null, "foo", Page.class));
+ assertPageNotFound(new Query<Page>(null, null, null, "foo bar", Page.class));
+ assertPageNotFound(new Query<Page>("test", null, null, null, Page.class));
+ }
+
+ public void testGadget() throws Exception
+ {
+ Gadget gadget = new Gadget();
+ gadget.setUserPref("user_pref");
+ TransientApplicationState<Gadget> state = new TransientApplicationState<Gadget>("bar", gadget);
+ Application<Gadget> gadgetApplication = Application.createGadgetApplication();
+ gadgetApplication.setState(state);
+
+ Page container = new Page();
+ container.setPageId("portal::test::gadget_page");
+ container.getChildren().add(gadgetApplication);
+
+ storage_.create(container);
+
+ container = storage_.getPage("portal::test::gadget_page");
+ gadgetApplication = (Application<Gadget>)container.getChildren().get(0);
+
+ gadget = storage_.load(gadgetApplication.getState(), ApplicationType.GADGET);
+ assertNotNull(gadget);
+ assertEquals("user_pref", gadget.getUserPref());
+ }
+
+ public void testSiteScopedPreferences() throws Exception
+ {
+ Page page = storage_.getPage("portal::test::test4");
+ Application<Portlet> app = (Application<Portlet>)page.getChildren().get(0);
+ PersistentApplicationState<Portlet> state = (PersistentApplicationState)app.getState();
+
+ //
+ Portlet prefs = storage_.load(state, ApplicationType.PORTLET);
+ assertEquals(new PortletBuilder().add("template", "par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl")
+ .build(), prefs);
+
+ //
+ prefs.setValue("template", "someanothervalue");
+ storage_.save(state, prefs);
+
+ //
+ prefs = storage_.load(state, ApplicationType.PORTLET);
+ assertNotNull(prefs);
+ assertEquals(new PortletBuilder().add("template", "someanothervalue").build(), prefs);
+ }
+
+ public void testNullPreferenceValue() throws Exception
+ {
+ Page page = storage_.getPage("portal::test::test4");
+ Application<Portlet> app = (Application<Portlet>)page.getChildren().get(0);
+ PersistentApplicationState<Portlet> state = (PersistentApplicationState)app.getState();
+
+ //
+ Portlet prefs = storage_.load(state, ApplicationType.PORTLET);
+
+ //
+ prefs.setValue("template", null);
+ storage_.save(state, prefs);
+
+ //
+ prefs = storage_.load(state, ApplicationType.PORTLET);
+ assertNotNull(prefs);
+ assertEquals(new PortletBuilder().add("template", "").build(), prefs);
+ }
+
+ public void testAccessMixin() throws Exception
+ {
+ Page page = new Page();
+ page.setTitle("MyTitle");
+ page.setOwnerType(PortalConfig.PORTAL_TYPE);
+ page.setOwnerId("test");
+ page.setName("foo");
+ storage_.save(page);
+
+ //
+ page = storage_.getPage("portal::test::foo");
+ assertNotNull(page);
+ assertEquals("MyTitle", page.getTitle());
+ assertEquals("test", page.getOwnerId());
+ assertEquals("foo", page.getName());
+
+ //
+ SampleMixin sampleMixin = storage_.adapt(page, SampleMixin.class);
+ //Check the default value of sampleProperty property
+ assertEquals("SampleProperty", sampleMixin.getSampleProperty());
+ }
+
+ public void testModifyMixin() throws Exception
+ {
+ Page page = new Page();
+ page.setTitle("MyTitle");
+ page.setOwnerType(PortalConfig.PORTAL_TYPE);
+ page.setOwnerId("test");
+ page.setName("foo");
+ storage_.save(page);
+
+ //
+ page = storage_.getPage("portal::test::foo");
+ assertNotNull(page);
+ assertEquals("MyTitle", page.getTitle());
+ assertEquals("test", page.getOwnerId());
+ assertEquals("foo", page.getName());
+
+ //
+ SampleMixin sampleMixin = storage_.adapt(page, SampleMixin.class);
+ sampleMixin.setSampleProperty("FYM!");
+
+ //
+ page = storage_.getPage("portal::test::foo");
+ assertNotNull(page);
+ SampleMixin sampleMixin2 = storage_.adapt(page, SampleMixin.class);
+ assertEquals("FYM!", sampleMixin2.getSampleProperty());
+ }
+
+ public void testSiteLayout() throws Exception
+ {
+ PortalConfig pConfig = storage_.getPortalConfig(PortalConfig.PORTAL_TYPE, "classic");
+ assertNotNull(pConfig);
+ assertNotNull("The Group layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
+
+ pConfig = storage_.getPortalConfig(PortalConfig.GROUP_TYPE, "/platform/administrators");
+ assertNotNull(pConfig);
+ assertNotNull("The Group layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
+ assertTrue(pConfig.getPortalLayout().getChildren() != null && pConfig.getPortalLayout().getChildren().size() > 1);
+ pConfig.getPortalLayout().getChildren().clear();
+ storage_.save(pConfig);
+
+ pConfig = storage_.getPortalConfig(PortalConfig.GROUP_TYPE, "/platform/administrators");
+ assertNotNull(pConfig);
+ assertNotNull("The Group layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
+ assertTrue(pConfig.getPortalLayout().getChildren() != null && pConfig.getPortalLayout().getChildren().size() == 0);
+
+ pConfig = storage_.getPortalConfig(PortalConfig.USER_TYPE, "root");
+ assertNotNull(pConfig);
+ assertNotNull("The User layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
+
+ pConfig = storage_.getPortalConfig(PortalConfig.USER_TYPE, "mary");
+ assertNotNull(pConfig);
+ assertNotNull("The User layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
+ }
+
+ public void testGroupLayout() throws Exception
+ {
+ GroupHandler groupHandler = org.getGroupHandler();
+ Group group = groupHandler.findGroupById("groupTest");
+ assertNull(group);
+
+ group = groupHandler.createGroupInstance();
+ group.setGroupName("groupTest");
+ group.setLabel("group label");
+
+ groupHandler.addChild(null, group, true);
+
+ group = groupHandler.findGroupById("/groupTest");
+ assertNotNull(group);
+
+ PortalConfig pConfig = storage_.getPortalConfig(PortalConfig.GROUP_TYPE, "/groupTest");
+ assertNotNull("the Group's PortalConfig is not null", pConfig);
+ assertTrue(pConfig.getPortalLayout().getChildren() == null || pConfig.getPortalLayout().getChildren().size() == 4);
+
+ /**
+ * We need to remove the /groupTest from the groupHandler as the
+ * handler is shared between the tests and can cause other tests
+ * to fail.
+ * TODO: make the tests fully independent
+ */
+ groupHandler.removeGroup(group, false);
+ group = groupHandler.findGroupById("/groupTest");
+ assertNull(group);
+ }
+
+
+
+ public void testGroupNavigation() throws Exception
+ {
+ GroupHandler groupHandler = org.getGroupHandler();
+ Group group = groupHandler.createGroupInstance();
+ group.setGroupName("testGroupNavigation");
+ group.setLabel("testGroupNavigation");
+
+ groupHandler.addChild(null, group, true);
+
+ SiteKey key = SiteKey.group(group.getId());
+ navService.saveNavigation(new NavigationContext(key, new NavigationState(0)));
+ assertNotNull(navService.loadNavigation(key));
+
+ // Remove group
+ groupHandler.removeGroup(group, true);
+
+ // Group navigations is removed after remove group
+ assertNull(navService.loadNavigation(key));
+ }
+
+ public void testUserLayout() throws Exception
+ {
+ UserHandler userHandler = org.getUserHandler();
+ User user = userHandler.findUserByName("testing");
+ assertNull(user);
+
+ user = userHandler.createUserInstance("testing");
+ user.setEmail("testing(a)gmaild.com");
+ user.setFirstName("test firstname");
+ user.setLastName("test lastname");
+ user.setPassword("123456");
+
+ userHandler.createUser(user, true);
+
+ user = userHandler.findUserByName("testing");
+ assertNotNull(user);
+
+ PortalConfig pConfig = storage_.getPortalConfig(PortalConfig.USER_TYPE, "testing");
+ assertNotNull("the User's PortalConfig is not null", pConfig);
+ }
+
+ public void testWSRP() throws Exception
+ {
+ WSRP wsrp = new WSRP();
+ String id = "portlet id";
+ wsrp.setPortletId(id);
+ TransientApplicationState<WSRP> state = new TransientApplicationState<WSRP>("test", wsrp);
+ Application<WSRP> wsrpApplication = Application.createWSRPApplication();
+ wsrpApplication.setState(state);
+
+ Page container = new Page();
+ String pageId = "portal::test::wsrp_page";
+ container.setPageId(pageId);
+ container.getChildren().add(wsrpApplication);
+
+ storage_.create(container);
+
+ container = storage_.getPage(pageId);
+ wsrpApplication = (Application<WSRP>)container.getChildren().get(0);
+
+ wsrp = storage_.load(wsrpApplication.getState(), ApplicationType.WSRP_PORTLET);
+ assertNotNull(wsrp);
+ assertEquals(id, wsrp.getPortletId());
+ }
}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,85 +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;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestGadget extends AbstractPortalTest
-{
-
- /** . */
- private DataStorage storage_;
-
- /** . */
- private POMSessionManager mgr;
-
- /** . */
- private POMSession session;
-
- public void setUp() throws Exception
- {
- super.setUp();
- begin();
- PortalContainer container = getContainer();
- storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- session = mgr.openSession();
- }
-
- protected void tearDown() throws Exception
- {
- session.close();
- end();
- super.tearDown();
- }
-
- public void testBilto() throws Exception
- {
- Gadget gadget = new Gadget();
- gadget.setUserPref("user_pref");
- TransientApplicationState<Gadget> state = new TransientApplicationState<Gadget>("bar", gadget);
- Application<Gadget> gadgetApplication = Application.createGadgetApplication();
- gadgetApplication.setState(state);
-
- Page container = new Page();
- container.setPageId("portal::test::gadget_page");
- container.getChildren().add(gadgetApplication);
-
- storage_.create(container);
-
- container = storage_.getPage("portal::test::gadget_page");
- gadgetApplication = (Application<Gadget>)container.getChildren().get(0);
-
- gadget = storage_.load(gadgetApplication.getState(), ApplicationType.GADGET);
- assertNotNull(gadget);
- assertEquals("user_pref", gadget.getUserPref());
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestHandleMixin.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestHandleMixin.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestHandleMixin.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -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.config;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-
-/**
- * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
- * Aug 25, 2010
- */
-
-public class TestHandleMixin extends AbstractPortalTest
-{
-
- private DataStorage dataStorage;
-
- private POMSessionManager pomMgr;
-
- private POMSession session;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- begin();
-
- PortalContainer container = PortalContainer.getInstance();
- dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- POMSessionManager pomMgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- session = pomMgr.getSession();
- }
-
- private void createPage() throws Exception
- {
-
- Page page = new Page();
- page.setTitle("MyTitle");
- page.setOwnerType(PortalConfig.PORTAL_TYPE);
- page.setOwnerId("test");
- page.setName("foo");
-
- dataStorage.create(page);
- }
-
- public void testAccessMixin() throws Exception
- {
- createPage();
- Page page = dataStorage.getPage("portal::test::foo");
-
- assertNotNull(page);
- assertEquals("MyTitle", page.getTitle());
- assertEquals("test", page.getOwnerId());
- assertEquals("foo", page.getName());
-
- SampleMixin sampleMixin = dataStorage.adapt(page, SampleMixin.class);
- //Check the default value of sampleProperty property
- assertEquals("SampleProperty", sampleMixin.getSampleProperty());
- }
-
- public void testModifyMixin() throws Exception
- {
- createPage();
- Page page = dataStorage.getPage("portal::test::foo");
-
- assertNotNull(page);
- assertEquals("MyTitle", page.getTitle());
- assertEquals("test", page.getOwnerId());
- assertEquals("foo", page.getName());
-
- SampleMixin sampleMixin = dataStorage.adapt(page, SampleMixin.class);
- sampleMixin.setSampleProperty("FYM!");
-
- Page page2 = dataStorage.getPage("portal::test::foo");
- assertNotNull(page2);
- SampleMixin sampleMixin2 = dataStorage.adapt(page2, SampleMixin.class);
- assertEquals("FYM!", sampleMixin2.getSampleProperty());
-
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- session.close();
- end();
- super.tearDown();
- }
-}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.component.test.AbstractGateInTest;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.KernelBootstrap;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.gatein.mop.api.workspace.Workspace;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImport extends AbstractGateInTest
+{
+
+ public void testMixin() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+
+ //
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "conserve");
+ System.setProperty("import.portal.1", "navigation1");
+
+ //
+ bootstrap.boot();
+ PortalContainer container = bootstrap.getContainer();
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+
+ //
+ RequestLifeCycle.begin(container);
+ Workspace workspace = mgr.getSession().getWorkspace();
+ assertTrue(workspace.isAdapted(Imported.class));
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentConserve.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportFragmentConserve extends AbstractImportFragmentTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.CONSERVE;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(1, root.getNodeSize());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon", foo.getState().getIcon());
+ assertEquals(0, foo.getNodeSize());
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentInsert.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportFragmentInsert extends AbstractImportFragmentTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.INSERT;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(1, root.getNodeSize());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeSize());
+ NodeContext<?> bar = foo.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeSize());
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportFragmentOverwrite.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportFragmentOverwrite extends AbstractImportFragmentTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.OVERWRITE;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(1, root.getNodeSize());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeSize());
+ NodeContext<?> bar = foo.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeSize());
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationConserve.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportNavigationConserve extends AbstractImportNavigationTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.CONSERVE;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_1", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeCount());
+ NodeContext<?> juu = foo.get("juu");
+ assertNotNull(juu);
+ assertEquals("juu_icon", juu.getState().getIcon());
+ assertEquals(0, juu.getNodeCount());
+ NodeContext<?> daa = root.get("daa");
+ assertNotNull(daa);
+ assertEquals("daa_icon", daa.getState().getIcon());
+ assertEquals(0, daa.getNodeCount());
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationInsert.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportNavigationInsert extends AbstractImportNavigationTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.INSERT;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(3, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_1", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeCount());
+ NodeContext<?> juu = foo.get("juu");
+ assertNotNull(juu);
+ assertEquals("juu_icon", juu.getState().getIcon());
+ assertEquals(0, juu.getNodeCount());
+ NodeContext<?> bar = root.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeCount());
+ NodeContext<?> daa = root.get("daa");
+ assertNotNull(daa);
+ assertEquals("daa_icon", daa.getState().getIcon());
+ assertEquals(0, daa.getNodeCount());
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationMerge.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportNavigationMerge extends AbstractImportNavigationTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.MERGE;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(3, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_2", foo.getState().getIcon());
+ assertEquals(1, foo.getNodeCount());
+ NodeContext<?> juu = foo.get("juu");
+ assertNotNull(juu);
+ assertEquals("juu_icon", juu.getState().getIcon());
+ assertEquals(0, juu.getNodeCount());
+ NodeContext<?> bar = root.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeCount());
+ NodeContext<?> daa = root.get("daa");
+ assertNotNull(daa);
+ assertEquals("daa_icon", daa.getState().getIcon());
+ assertEquals(0, daa.getNodeCount());
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImportNavigationOverwrite.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.portal.mop.importer.ImportMode;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestImportNavigationOverwrite extends AbstractImportNavigationTest
+{
+
+ @Override
+ protected ImportMode getMode()
+ {
+ return ImportMode.OVERWRITE;
+ }
+
+ @Override
+ protected void assertState(NodeContext<?> root)
+ {
+ assertEquals(2, root.getNodeCount());
+ NodeContext<?> foo = root.get("foo");
+ assertNotNull(foo);
+ assertEquals("foo_icon_2", foo.getState().getIcon());
+ assertEquals(0, foo.getNodeCount());
+ NodeContext<?> bar = root.get("bar");
+ assertNotNull(bar);
+ assertEquals("bar_icon", bar.getState().getIcon());
+ assertEquals(0, bar.getNodeCount());
+ }
+}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -22,8 +22,9 @@
import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.config.model.LocalizedValue;
+import org.exoplatform.portal.config.model.LocalizedString;
import org.exoplatform.portal.config.model.ModelUnmarshaller;
+import org.exoplatform.portal.config.model.NavigationFragment;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.Page.PageSet;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -70,7 +71,7 @@
IBindingFactory bfact = BindingDirectory.getFactory(PageSet.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Object obj =
- uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/pages.xml"), null);
+ uctx.unmarshalDocument(new FileInputStream("src/test/resources/org/exoplatform/portal/config/conf/portal/classic/pages.xml"), null);
assertEquals(Page.PageSet.class, obj.getClass());
}
@@ -79,7 +80,7 @@
IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Object obj =
- uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/portal.xml"), null);
+ uctx.unmarshalDocument(new FileInputStream("src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portal.xml"), null);
assertEquals(PortalConfig.class, obj.getClass());
}
@@ -88,13 +89,11 @@
IBindingFactory bfact = BindingDirectory.getFactory(PageNavigation.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Object obj =
- uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/navigation.xml"), null);
+ uctx.unmarshalDocument(new FileInputStream("src/test/resources/org/exoplatform/portal/config/conf/portal/classic/navigation.xml"), null);
assertEquals(PageNavigation.class, obj.getClass());
PageNavigation pageNavigation = (PageNavigation)obj;
- assertEquals("portal::classic::homepage", pageNavigation.getNode("home").getPageReference());
- assertEquals("portal", pageNavigation.getOwnerType());
- assertEquals("classic", pageNavigation.getOwnerId());
+ assertEquals("portal::classic::homepage", pageNavigation.getFragment().getNode("home").getPageReference());
/*
IMarshallingContext mctx = bfact.createMarshallingContext();
@@ -112,7 +111,7 @@
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Object obj =
uctx.unmarshalDocument(
- new FileInputStream("src/test/resources/portal/portal/classic/portlet-preferences.xml"), null);
+ new FileInputStream("src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portlet-preferences.xml"), null);
assertEquals(PortletPreferencesSet.class, obj.getClass());
IMarshallingContext mctx = bfact.createMarshallingContext();
@@ -142,14 +141,14 @@
assertEquals(Version.V_1_1, obj.getVersion());
//
- PageNode bar = nav.getNode("bar");
+ PageNode bar = nav.getFragment().getNode("bar");
assertEquals("bar_label", bar.getLabel());
- ArrayList<LocalizedValue> barLabels = bar.getLabels();
+ ArrayList<LocalizedString> barLabels = bar.getLabels();
assertNotNull(barLabels);
assertEquals(1, barLabels.size());
assertEquals("bar_label", barLabels.get(0).getValue());
assertEquals(null, barLabels.get(0).getLang());
- assertEquals(null, bar.getLocalizedLabel(Locale.ENGLISH));
+ assertEquals(null, bar.getLabels().getExtended(Locale.ENGLISH));
}
public void testExtendedNavigationMapping() throws Exception
@@ -159,9 +158,9 @@
assertEquals(Version.V_1_2, obj.getVersion());
//
- PageNode foo = nav.getNode("foo");
+ PageNode foo = nav.getFragment().getNode("foo");
assertEquals("foo_label", foo.getLabel());
- ArrayList<LocalizedValue> fooLabels = foo.getLabels();
+ ArrayList<LocalizedString> fooLabels = foo.getLabels();
assertNotNull(fooLabels);
assertEquals(3, fooLabels.size());
assertEquals("foo_label_en", fooLabels.get(0).getValue());
@@ -170,23 +169,23 @@
assertEquals(null, fooLabels.get(1).getLang());
assertEquals("foo_label_fr", fooLabels.get(2).getValue());
assertEquals(Locale.FRENCH, fooLabels.get(2).getLang());
- assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH), foo.getLocalizedLabel(Locale.ENGLISH).keySet());
- assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN), foo.getLocalizedLabel(Locale.GERMAN).keySet());
+ assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH), foo.getLabels().getExtended(Locale.ENGLISH).keySet());
+ assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN), foo.getLabels().getExtended(Locale.GERMAN).keySet());
//
- PageNode bar = nav.getNode("bar");
+ PageNode bar = nav.getFragment().getNode("bar");
assertEquals("bar_label", bar.getLabel());
- ArrayList<LocalizedValue> barLabels = bar.getLabels();
+ ArrayList<LocalizedString> barLabels = bar.getLabels();
assertNotNull(barLabels);
assertEquals(1, barLabels.size());
assertEquals("bar_label", barLabels.get(0).getValue());
assertEquals(null, barLabels.get(0).getLang());
- assertEquals(null, bar.getLocalizedLabel(Locale.ENGLISH));
+ assertEquals(null, bar.getLabels().getExtended(Locale.ENGLISH));
//
- PageNode juu = nav.getNode("juu");
+ PageNode juu = nav.getFragment().getNode("juu");
assertEquals(null, juu.getLabel());
- ArrayList<LocalizedValue> juuLabels = juu.getLabels();
+ ArrayList<LocalizedString> juuLabels = juu.getLabels();
assertNotNull(juuLabels);
assertEquals(3, juuLabels.size());
assertEquals("juu_label_en", juuLabels.get(0).getValue());
@@ -196,4 +195,21 @@
assertEquals("juu_label_fr_FR", juuLabels.get(2).getValue());
assertEquals(Locale.FRANCE, juuLabels.get(2).getLang());
}
+
+ public void testNavigationFragment() throws Exception
+ {
+ UnmarshalledObject<PageNavigation> obj = ModelUnmarshaller.unmarshall(PageNavigation.class, new FileInputStream("src/test/resources/jibx/fragment-navigation.xml"));;
+ PageNavigation nav = obj.getObject();
+ assertEquals(Version.V_1_2, obj.getVersion());
+
+ //
+ ArrayList<NavigationFragment> fragments = nav.getFragments();
+ assertNotNull(fragments);
+ assertEquals(1, fragments.size());
+ NavigationFragment fragment = fragments.get(0);
+ assertEquals("foo", fragment.getParentURI());
+ assertEquals(1, fragment.getNodes().size());
+ PageNode bar = fragment.getNode("bar");
+ assertNotNull(bar);
+ }
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -49,7 +49,7 @@
* Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
* 13, 2007
*/
-public class TestLoadedPOM extends AbstractPortalTest
+public class TestLoadedPOM extends AbstractConfigTest
{
/** . */
@@ -93,45 +93,45 @@
public void testLegacyGroupWithNormalizedName() throws Exception
{
- SiteKey key = SiteKey.group("/platform/test/legacy");
+ SiteKey key = SiteKey.group("/test/legacy");
NavigationContext nav = navService.loadNavigation(key);
assertNotNull(nav);
NodeContext<?> root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
NodeContext<?> node = root.get(0);
- assertEquals("group::/platform/test/legacy::register", node.getState().getPageRef());
+ assertEquals("group::/test/legacy::register", node.getState().getPageRef());
- Page page = storage.getPage("group::/platform/test/legacy::register");
+ Page page = storage.getPage("group::/test/legacy::register");
assertNotNull(page);
- assertEquals("group::/platform/test/legacy::register", page.getPageId());
- assertEquals("/platform/test/legacy", page.getOwnerId());
+ assertEquals("group::/test/legacy::register", page.getPageId());
+ assertEquals("/test/legacy", page.getOwnerId());
Application app = (Application)page.getChildren().get(0);
- // assertEquals("group#/platform/test/legacy:/web/IFramePortlet/blog", app.getInstanceState().getWeakReference());
+ // assertEquals("group#/test/legacy:/web/IFramePortlet/blog", app.getInstanceState().getWeakReference());
- PortletPreferences prefs = storage.getPortletPreferences("group#/platform/test/legacy:/web/IFramePortlet/blog");
+ PortletPreferences prefs = storage.getPortletPreferences("group#/test/legacy:/web/IFramePortlet/blog");
assertNotNull(prefs);
- assertEquals("group#/platform/test/legacy:/web/IFramePortlet/blog", prefs.getWindowId());
+ assertEquals("group#/test/legacy:/web/IFramePortlet/blog", prefs.getWindowId());
}
public void testGroupWithNormalizedName() throws Exception
{
- SiteKey key = SiteKey.group("/platform/test/normalized");
+ SiteKey key = SiteKey.group("/test/normalized");
NavigationContext nav = navService.loadNavigation(key);
assertNotNull(nav);
NodeContext<?> root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
NodeContext<?> node = root.get(0);
- assertEquals("group::/platform/test/normalized::register", node.getState().getPageRef());
+ assertEquals("group::/test/normalized::register", node.getState().getPageRef());
- Page page = storage.getPage("group::/platform/test/normalized::register");
+ Page page = storage.getPage("group::/test/normalized::register");
assertNotNull(page);
- assertEquals("group::/platform/test/normalized::register", page.getPageId());
- assertEquals("/platform/test/normalized", page.getOwnerId());
+ assertEquals("group::/test/normalized::register", page.getPageId());
+ assertEquals("/test/normalized", page.getOwnerId());
Application app = (Application)page.getChildren().get(0);
- // assertEquals("group#/platform/test/normalized:/exoadmin/AccountPortlet/Account", app.getInstanceState().getWeakReference());
+ // assertEquals("group#/test/normalized:/exoadmin/AccountPortlet/Account", app.getInstanceState().getWeakReference());
PortletPreferences prefs =
- storage.getPortletPreferences("group#/platform/test/normalized:/exoadmin/AccountPortlet/Account");
+ storage.getPortletPreferences("group#/test/normalized:/exoadmin/AccountPortlet/Account");
assertNotNull(prefs);
- assertEquals("group#/platform/test/normalized:/exoadmin/AccountPortlet/Account", prefs.getWindowId());
+ assertEquals("group#/test/normalized:/exoadmin/AccountPortlet/Account", prefs.getWindowId());
}
public void testNavigation() throws Exception
@@ -237,8 +237,8 @@
assertEquals("Expected two result instead of " + list, 2, list.size());
Set<String> ids = new HashSet<String>(Arrays.asList(list.get(0).getPageId(), list.get(1).getPageId()));
HashSet<String> expectedIds =
- new HashSet<String>(Arrays.asList("group::/platform/test/legacy::register",
- "group::/platform/test/normalized::register"));
+ new HashSet<String>(Arrays.asList("group::/test/legacy::register",
+ "group::/test/normalized::register"));
assertEquals(expectedIds, ids);
}
*/
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestMOP.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestMOP.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestMOP.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,541 @@
+/*
+ * Copyright (C) 2011 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;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.Described;
+import org.exoplatform.portal.mop.ProtectedResource;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.Visibility;
+import org.exoplatform.portal.mop.Visible;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeModel;
+import org.exoplatform.portal.mop.navigation.Scope;
+import org.exoplatform.portal.pom.config.POMSession;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.gatein.mop.api.Attributes;
+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.link.Link;
+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.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TimeZone;
+
+/**
+ * Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
+ * 13, 2007
+ */
+public class TestMOP extends AbstractConfigTest
+{
+
+ /** . */
+ private UserPortalConfigService portalConfigService;
+
+ /** . */
+ private DataStorage storage;
+
+ /** . */
+ private POMSessionManager mgr;
+
+ /** . */
+ private POMSession session;
+
+ /** . */
+ private NavigationService navService;
+
+ public TestMOP(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ begin();
+ PortalContainer container = getContainer();
+ portalConfigService = (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ navService = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ session = mgr.openSession();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ session.close();
+ end();
+ super.tearDown();
+ }
+
+ public void testLoadLegacyGroupWithNormalizedName() throws Exception
+ {
+ SiteKey key = SiteKey.group("/test/legacy");
+ NavigationContext nav = navService.loadNavigation(key);
+ assertNotNull(nav);
+ NodeContext<?> root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ NodeContext<?> node = root.get(0);
+ assertEquals("group::/test/legacy::register", node.getState().getPageRef());
+
+ Page page = storage.getPage("group::/test/legacy::register");
+ assertNotNull(page);
+ assertEquals("group::/test/legacy::register", page.getPageId());
+ assertEquals("/test/legacy", page.getOwnerId());
+ Application app = (Application)page.getChildren().get(0);
+ // assertEquals("group#/test/legacy:/web/IFramePortlet/blog", app.getInstanceState().getWeakReference());
+
+ PortletPreferences prefs = storage.getPortletPreferences("group#/test/legacy:/web/IFramePortlet/blog");
+ assertNotNull(prefs);
+ assertEquals("group#/test/legacy:/web/IFramePortlet/blog", prefs.getWindowId());
+ }
+
+ public void testLoadGroupWithNormalizedName() throws Exception
+ {
+ SiteKey key = SiteKey.group("/test/normalized");
+ NavigationContext nav = navService.loadNavigation(key);
+ assertNotNull(nav);
+ NodeContext<?> root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ NodeContext<?> node = root.get(0);
+ assertEquals("group::/test/normalized::register", node.getState().getPageRef());
+
+ Page page = storage.getPage("group::/test/normalized::register");
+ assertNotNull(page);
+ assertEquals("group::/test/normalized::register", page.getPageId());
+ assertEquals("/test/normalized", page.getOwnerId());
+ Application app = (Application)page.getChildren().get(0);
+ // assertEquals("group#/test/normalized:/exoadmin/AccountPortlet/Account", app.getInstanceState().getWeakReference());
+
+ PortletPreferences prefs =
+ storage.getPortletPreferences("group#/test/normalized:/exoadmin/AccountPortlet/Account");
+ assertNotNull(prefs);
+ assertEquals("group#/test/normalized:/exoadmin/AccountPortlet/Account", prefs.getWindowId());
+ }
+
+ public void testLoadNavigation() throws Exception
+ {
+ SiteKey key = SiteKey.portal("test");
+ NavigationContext nav = navService.loadNavigation(key);
+ assertNotNull(nav);
+
+ //
+ assertEquals(1, (int) nav.getState().getPriority());
+
+ //
+ NodeContext<?> root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ assertEquals(5, root.getNodeCount());
+
+ //
+ NodeContext<?> nodeNavigation = root.get(0);
+ assertEquals(0, nodeNavigation.getNodeCount());
+ assertEquals("node_name", nodeNavigation.getName());
+ assertEquals("node_label", nodeNavigation.getState().getLabel());
+ assertEquals("node_icon", nodeNavigation.getState().getIcon());
+ GregorianCalendar start = new GregorianCalendar(2000, 2, 21, 1, 33, 0);
+ start.setTimeZone(TimeZone.getTimeZone("UTC"));
+ assertEquals(start.getTime().getTime(), nodeNavigation.getState().getStartPublicationTime());
+ GregorianCalendar end = new GregorianCalendar(2009, 2, 21, 1, 33, 0);
+ end.setTimeZone(TimeZone.getTimeZone("UTC"));
+ assertEquals(end.getTime().getTime(), nodeNavigation.getState().getEndPublicationTime());
+ assertEquals(Visibility.TEMPORAL, nodeNavigation.getState().getVisibility());
+ }
+
+ public void testLoadPortal() throws Exception
+ {
+ PortalConfig portal = storage.getPortalConfig("test");
+ assertNotNull(portal);
+
+ assertEquals("test", portal.getName());
+ assertEquals("en", portal.getLocale());
+ assertTrue(Arrays.equals(new String[]{"test_access_permissions"}, portal.getAccessPermissions()));
+ assertEquals("test_edit_permission", portal.getEditPermission());
+ assertEquals("test_skin", portal.getSkin());
+ assertEquals("test_prop_value", portal.getProperty("prop_key"));
+ assertNull(portal.getLabel());
+ assertNull(portal.getDescription());
+ }
+
+ public void testLoadPageWithoutPageId() throws Exception
+ {
+ Page page = storage.getPage("portal::test::test2");
+ assertNotNull(page);
+ assertEquals("portal::test::test2", page.getPageId());
+ assertEquals("test", page.getOwnerId());
+ assertEquals("portal", page.getOwnerType());
+ assertEquals("test2", page.getName());
+ }
+
+ public void testLoadPage() throws Exception
+ {
+ Page page = storage.getPage("portal::test::test1");
+ assertNotNull(page);
+
+ //
+ assertEquals("test_title", page.getTitle());
+ assertEquals("test_factory_id", page.getFactoryId());
+ assertTrue(Arrays.equals(new String[]{"test_access_permissions"}, page.getAccessPermissions()));
+ assertEquals("test_edit_permission", page.getEditPermission());
+ assertEquals(true, page.isShowMaxWindow());
+
+ //
+ List<ModelObject> children = page.getChildren();
+ assertEquals(2, children.size());
+
+ //
+ Container container1 = (Container)children.get(0);
+ assertEquals("container_1", container1.getName());
+ assertEquals("container_1_title", container1.getTitle());
+ assertEquals("container_1_icon", container1.getIcon());
+ assertEquals("container_1_template", container1.getTemplate());
+ assertTrue(Arrays.equals(new String[]{"container_1_access_permissions"}, container1.getAccessPermissions()));
+ assertEquals("container_1_factory_id", container1.getFactoryId());
+ assertEquals("container_1_description", container1.getDescription());
+ assertEquals("container_1_width", container1.getWidth());
+ assertEquals("container_1_height", container1.getHeight());
+
+ //
+ Application application1 = (Application)children.get(1);
+ assertEquals("application_1_theme", application1.getTheme());
+ assertEquals("application_1_title", application1.getTitle());
+ assertTrue(Arrays.equals(new String[]{"application_1_access_permissions"}, application1.getAccessPermissions()));
+ assertEquals(true, application1.getShowInfoBar());
+ assertEquals(true, application1.getShowApplicationState());
+ assertEquals(true, application1.getShowApplicationMode());
+ assertEquals("application_1_description", application1.getDescription());
+ assertEquals("application_1_icon", application1.getIcon());
+ assertEquals("application_1_width", application1.getWidth());
+ assertEquals("application_1_height", application1.getHeight());
+ assertEquals("application_1_prop_value", application1.getProperties().get("prop_key"));
+ // assertEquals("portal#test:/web/BannerPortlet/banner", application1.getInstanceState().getWeakReference());
+ }
+
+/*
+ public void testFindPageByTitle() throws Exception
+ {
+ Query<Page> query = new Query<Page>(null, null, null, "TestTitle", Page.class);
+ List<Page> list = storage.find(query).getAll();
+ assertEquals("Expected two result instead of " + list, 2, list.size());
+ Set<String> ids = new HashSet<String>(Arrays.asList(list.get(0).getPageId(), list.get(1).getPageId()));
+ HashSet<String> expectedIds =
+ new HashSet<String>(Arrays.asList("group::/test/legacy::register",
+ "group::/test/normalized::register"));
+ assertEquals(expectedIds, ids);
+ }
+*/
+
+/*
+ public void testFindPageByName() throws Exception
+ {
+ Query<Page> query = new Query<Page>("portal", "test", null, null, Page.class);
+ List<Page> list = storage.find(query).getAll();
+ assertEquals("Expected 4 results instead of " + list, 4, list.size());
+ Set<String> names = new HashSet<String>();
+ for (Page page : list)
+ {
+ assertEquals("portal", page.getOwnerType());
+ assertEquals("test", page.getOwnerId());
+ names.add(page.getName());
+ }
+ HashSet<String> expectedNames = new HashSet<String>(Arrays.asList("test1", "test2", "test3", "test4"));
+ assertEquals(expectedNames, names);
+ }
+*/
+
+ public void testLoadAnonymousPreferencesSavePage() throws Exception
+ {
+ Page page = storage.getPage("portal::test::test3");
+
+ // Save it again
+ storage.save(page);
+
+ //
+ page = storage.getPage("portal::test::test3");
+
+ //
+ Application app = (Application)page.getChildren().get(0);
+ // String instanceId = app.getInstanceState().getWeakReference();
+
+ // Check instance id
+ // String[] chunks = Mapper.parseWindowId(instanceId);
+ // assertEquals("portal", chunks[0]);
+ // assertEquals("test", chunks[1]);
+ // assertEquals("web", chunks[2]);
+ // assertEquals("BannerPortlet", chunks[3]);
+ // assertEquals("banner2", chunks[4]);
+
+ // Check state
+ // assertNull(storage.getPortletPreferences(instanceId));
+ }
+
+ public void testLoadAnonymousPreference() throws Exception
+ {
+ Page page = storage.getPage("portal::test::test3");
+ Application app = (Application)page.getChildren().get(0);
+ // String instanceId = app.getInstanceState().getWeakReference();
+
+ // Check instance id
+ // String[] chunks = Mapper.parseWindowId(instanceId);
+ // assertEquals("portal", chunks[0]);
+ // assertEquals("test", chunks[1]);
+ // assertEquals("web", chunks[2]);
+ // assertEquals("BannerPortlet", chunks[3]);
+ // assertEquals("banner2", chunks[4]);
+
+ // Check initial state
+ // assertNull(storage.getPortletPreferences(instanceId));
+
+ // Save state
+ // PortletPreferences prefs = new PortletPreferences();
+ // prefs.setWindowId(instanceId);
+ // prefs.setPreferences(new ArrayList<Preference>());
+ // Preference pref = new Preference();
+ // pref.setName("foo");
+ // pref.setValues(new ArrayList<String>(Arrays.asList("foo1")));
+ // pref.setReadOnly(false);
+ // prefs.getPreferences().add(pref);
+ // storage.save(prefs);
+
+ // Now save the page
+ // storage.save(page);
+
+ // Check we have the same instance id
+ // page = storage.getPage(page.getPageId());
+ // app = (Application)page.getChildren().get(0);
+ // assertEquals(instanceId, app.getInstanceState().getWeakReference());
+
+ // Now check state
+ // prefs = storage.getPortletPreferences(app.getInstanceState().getWeakReference());
+ // assertEquals(1, prefs.getPreferences().size());
+ // assertEquals("foo", prefs.getPreferences().get(0).getName());
+ // assertEquals(1, prefs.getPreferences().get(0).getValues().size());
+ // assertEquals("foo1", prefs.getPreferences().get(0).getValues().get(0));
+ }
+
+ public void testLoadSitePreferences() throws Exception
+ {
+ // Page page = storage.getPage("portal::test::test4");
+ // Application app = (Application)page.getChildren().get(0);
+ // String instanceId = app.getInstanceState().getWeakReference();
+
+ // Check instance id
+ // String[] chunks = Mapper.parseWindowId(instanceId);
+ // assertEquals("portal", chunks[0]);
+ // assertEquals("test", chunks[1]);
+ // assertEquals("web", chunks[2]);
+ // assertEquals("BannerPortlet", chunks[3]);
+ // assertEquals("banner", chunks[4]);
+
+ // Check initial state
+ // PortletPreferences prefs = storage.getPortletPreferences(instanceId);
+ // assertEquals(1, prefs.getPreferences().size());
+ // assertEquals("template", prefs.getPreferences().get(0).getName());
+ // assertEquals(1, prefs.getPreferences().get(0).getValues().size());
+ // assertEquals("par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl", prefs.getPreferences().get(0).getValues().get(0));
+ //
+ // Save state
+ // prefs.getPreferences().get(0).setValues(new ArrayList<String>(Arrays.asList("foo")));
+ // storage.save(prefs);
+
+ // Now save the page
+ // storage.save(page);
+
+ // Check we have the same instance id
+ // page = storage.getPage(page.getPageId());
+ // app = (Application)page.getChildren().get(0);
+ // assertEquals(instanceId, app.getInstanceState().getWeakReference());
+
+ // Now check state
+ // prefs = storage.getPortletPreferences(instanceId);
+ // assertEquals(1, prefs.getPreferences().size());
+ // assertEquals("template", prefs.getPreferences().get(0).getName());
+ // assertEquals(1, prefs.getPreferences().get(0).getValues().size());
+ // assertEquals("foo", prefs.getPreferences().get(0).getValues().get(0));
+ }
+
+ public void testSaveNavigation() throws Exception
+ {
+ Site portal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
+ assertNotNull(portal);
+
+ //
+ Navigation rootNavigation = portal.getRootNavigation();
+ assertNotNull(rootNavigation);
+
+ //
+ Navigation defaultNav = rootNavigation.getChild("default");
+
+ //
+ Attributes defaultAttrs = defaultNav.getAttributes();
+ assertEquals(1, (int)defaultAttrs.getInteger("priority"));
+
+ //
+ Collection<? extends Navigation> childrenNavigations = defaultNav.getChildren();
+ assertNotNull(childrenNavigations);
+ assertEquals(5, childrenNavigations.size());
+ Iterator<? extends Navigation> i = childrenNavigations.iterator();
+
+ //
+ assertTrue(i.hasNext());
+ Navigation nodeNavigation = i.next();
+ assertNotNull(nodeNavigation);
+ assertEquals(0, nodeNavigation.getChildren().size());
+ assertEquals("node_name", nodeNavigation.getName());
+ Described nodeDescribed = nodeNavigation.adapt(Described.class);
+ assertEquals("node_label", nodeDescribed.getName());
+ Attributes nodeAttrs = nodeNavigation.getAttributes();
+ assertEquals("node_icon", nodeAttrs.getString("icon"));
+
+ //
+ assertTrue(nodeNavigation.isAdapted(Visible.class));
+ Visible visible = nodeNavigation.adapt(Visible.class);
+ GregorianCalendar start = new GregorianCalendar(2000, 2, 21, 1, 33, 0);
+ start.setTimeZone(TimeZone.getTimeZone("UTC"));
+ assertEquals(start.getTime(), visible.getStartPublicationDate());
+ GregorianCalendar end = new GregorianCalendar(2009, 2, 21, 1, 33, 0);
+ end.setTimeZone(TimeZone.getTimeZone("UTC"));
+ assertEquals(end.getTime(), visible.getEndPublicationDate());
+ assertEquals(Visibility.TEMPORAL, visible.getVisibility());
+
+ //
+ Link link = nodeNavigation.getLink();
+ assertNotNull(link);
+ }
+
+ public void testSavePortal() throws Exception
+ {
+ Site portal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
+ assertNotNull(portal);
+
+ //
+ assertTrue(portal.isAdapted(ProtectedResource.class));
+ ProtectedResource pr = portal.adapt(ProtectedResource.class);
+ assertEquals(Arrays.asList("test_access_permissions"), pr.getAccessPermissions());
+ assertEquals("test_edit_permission", pr.getEditPermission());
+
+ //
+ assertEquals("test", portal.getName());
+ Attributes attrs = portal.getAttributes();
+ assertEquals("en", attrs.getString("locale"));
+ assertEquals("test_skin", attrs.getString("skin"));
+ assertEquals("test_prop_value", attrs.getString("prop_key"));
+
+ //
+ org.gatein.mop.api.workspace.Page layout = portal.getRootNavigation().getTemplatized().getTemplate();
+ assertNotNull(layout);
+ assertSame(portal.getRootPage().getChild("templates").getChild("default"), layout);
+ }
+
+ public void testSavePageWithoutPageId() throws Exception
+ {
+ Site testPortal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
+ org.gatein.mop.api.workspace.Page testRootPage = testPortal.getRootPage();
+ org.gatein.mop.api.workspace.Page pages = testRootPage.getChild("pages");
+ org.gatein.mop.api.workspace.Page testPage = pages.getChild("test2");
+ assertNotNull(testPage);
+ }
+
+ public void testSavePage() throws Exception
+ {
+ Site testPortal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
+ org.gatein.mop.api.workspace.Page testRootPage = testPortal.getRootPage();
+ org.gatein.mop.api.workspace.Page pages = testRootPage.getChild("pages");
+ org.gatein.mop.api.workspace.Page testPage = pages.getChild("test1");
+ assertNotNull(testPage);
+
+ //
+ assertTrue(testPage.isAdapted(ProtectedResource.class));
+ ProtectedResource pr = testPage.adapt(ProtectedResource.class);
+ assertEquals(Arrays.asList("test_access_permissions"), pr.getAccessPermissions());
+ assertEquals("test_edit_permission", pr.getEditPermission());
+
+ //
+ Described testPageDescribed = testPage.adapt(Described.class);
+ assertEquals("test_title", testPageDescribed.getName());
+ assertEquals(null, testPageDescribed.getDescription());
+
+ //
+ Attributes testPageAttrs = testPage.getAttributes();
+ assertEquals("test_factory_id", testPageAttrs.getString("factory-id"));
+ assertEquals(true, (boolean)testPageAttrs.getBoolean("show-max-window"));
+
+ //
+ UIContainer c = testPage.getRootComponent();
+ assertNotNull(c);
+ assertEquals(2, c.getComponents().size());
+ Iterator<? extends UIComponent> it = c.getComponents().iterator();
+
+ //
+ UIContainer container1 = (UIContainer)it.next();
+ assertTrue(container1.isAdapted(ProtectedResource.class));
+ ProtectedResource container1PR = container1.adapt(ProtectedResource.class);
+ assertEquals(Collections.singletonList("container_1_access_permissions"), container1PR.getAccessPermissions());
+ Described container1Described = container1.adapt(Described.class);
+ assertEquals("container_1_title", container1Described.getName());
+ assertEquals("container_1_description", container1Described.getDescription());
+ Attributes container1Attrs = container1.getAttributes();
+ assertEquals("container_1", container1Attrs.getString("name"));
+ assertEquals("container_1_icon", container1Attrs.getString("icon"));
+ assertEquals("container_1_template", container1Attrs.getString("template"));
+ assertEquals("container_1_factory_id", container1Attrs.getString("factory-id"));
+ assertEquals("container_1_width", container1Attrs.getString("width"));
+ assertEquals("container_1_height", container1Attrs.getString("height"));
+
+ //
+ UIWindow application1 = (UIWindow)it.next();
+ assertTrue(application1.isAdapted(ProtectedResource.class));
+ ProtectedResource application1PR = application1.adapt(ProtectedResource.class);
+ assertEquals(Collections.singletonList("application_1_access_permissions"), application1PR.getAccessPermissions());
+ Described application1Described = application1.adapt(Described.class);
+ assertEquals("application_1_title", application1Described.getName());
+ assertEquals("application_1_description", application1Described.getDescription());
+ Attributes application1Attrs = application1.getAttributes();
+ assertEquals("application_1_theme", application1Attrs.getString("theme"));
+ assertEquals(true, (boolean)application1Attrs.getBoolean("showinfobar"));
+ assertEquals(true, (boolean)application1Attrs.getBoolean("showmode"));
+ assertEquals(true, (boolean)application1Attrs.getBoolean("showwindowstate"));
+ assertEquals("application_1_icon", application1Attrs.getString("icon"));
+ assertEquals("application_1_width", application1Attrs.getString("width"));
+ assertEquals("application_1_height", application1Attrs.getString("height"));
+ assertEquals("application_1_prop_value", application1Attrs.getString("prop_key"));
+
+ //
+ Customization<?> customization = application1.getCustomization();
+ assertNotNull(customization);
+ assertEquals("application/portlet", customization.getType().getMimeType());
+ assertEquals("web/BannerPortlet", customization.getContentId());
+ // assertEquals("banner", customization.getName());
+ }
+}
\ No newline at end of file
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,201 +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;
-
-import java.util.Collection;
-import org.exoplatform.commons.utils.PageList;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.GroupHandler;
-import org.exoplatform.services.organization.OrganizationService;
-import org.exoplatform.services.organization.User;
-import org.exoplatform.services.organization.UserHandler;
-
-/**
- * Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
- * 13, 2007
- */
-public class TestOrganization extends AbstractPortalTest
-{
-
- private static final String GROUP_1 = "testOrganization_group1";
- private static final String GROUP_2 = "testOrganization_group2";
- private static final String GROUP_3 = "testOrganization_group3";
-
- private static final String USER_1 = "testOrganization_user1";
- private static final String USER_2 = "testOrganization_user2";
- private static final String USER_3 = "testOrganization_user3";
- private static final String DEFAULT_PASSWORD = "defaultpassword";
- private static final String DESCRIPTION = " Description";
-
- private OrganizationService organizationService;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- begin();
- PortalContainer container = getContainer();
- organizationService = (OrganizationService)container.getComponentInstance(OrganizationService.class);
-
- createGroup(null, GROUP_1);
- createGroup(GROUP_1, GROUP_2);
- createGroup(GROUP_1, GROUP_3);
-
- createUser(USER_1, GROUP_1);
- createUser(USER_2, GROUP_2);
- createUser(USER_3, GROUP_1);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- deleteGroup(GROUP_1);
- deleteGroup(GROUP_2);
- deleteGroup(GROUP_3);
-
- deleteUser(USER_1);
- deleteUser(USER_2);
- deleteUser(USER_3);
-
- end(false);
- super.tearDown();
- }
-
- public void testFindGroupNotFound() throws Exception {
- GroupHandler groupHander = organizationService.getGroupHandler();
- Group group = groupHander.findGroupById(GROUP_1 + "NOTFOUND");
- assertNull(group);
- }
-
- public void testFindGroupFromRoot() throws Exception
- {
- GroupHandler handler = organizationService.getGroupHandler();
- Collection<Group> allGroups = handler.findGroups(null);
- assertNotNull(allGroups);
- assertTrue(allGroups.size() > 0);
- }
-
- public void testFindGroupById() throws Exception
- {
- GroupHandler groupHandler = organizationService.getGroupHandler();
- Group group = groupHandler.findGroupById(GROUP_1);
- assertNotNull(group);
- assertEquals(GROUP_1, group.getGroupName());
- assertEquals(GROUP_1 + DESCRIPTION, group.getDescription());
-
- group = groupHandler.findGroupById(GROUP_3);
- assertNotNull(group);
- assertEquals(GROUP_3, group.getGroupName());
- }
-
- public void testFindGroupOfUser() {
- GroupHandler groupHandler = organizationService.getGroupHandler();
- try {
- Collection<Group> groups = groupHandler.findGroupsOfUser(USER_1);
- assertNotNull(groups);
- assertTrue(groups.size() >= 1);
- } catch (Exception e) {
- fail();
- }
- }
-
- public void testFindUserByGroup() throws Exception
- {
- GroupHandler groupHandler = organizationService.getGroupHandler();
- Group group = groupHandler.findGroupById(GROUP_1);
- UserHandler uHandler = organizationService.getUserHandler();
- PageList<User> users = uHandler.findUsersByGroup(group.getId());
- assertNotNull(users);
- assertTrue(users.getPageSize() > 0);
- }
-
- public void testChangePassword() throws Exception
- {
- UserHandler uHandler = organizationService.getUserHandler();
- User user = uHandler.findUserByName(USER_1);
- assertNotNull(user);
- assertTrue(uHandler.authenticate(USER_1, DEFAULT_PASSWORD));
-
- // Test changing password
- user.setPassword("newPassword");
- uHandler.saveUser(user, false);
- user = uHandler.findUserByName(USER_1);
- assertNotNull(user);
- assertTrue(uHandler.authenticate(USER_1, "newPassword"));
- }
-
-
- private void createGroup(String parent, String name) {
- GroupHandler groupHandler = organizationService.getGroupHandler();
- try {
- Group parentGroup = null;
- if(parent != null) {
- parentGroup = groupHandler.findGroupById(parent);
- }
- Group newGroup = groupHandler.createGroupInstance();
- newGroup.setGroupName(name);
- newGroup.setDescription(name + DESCRIPTION);
- newGroup.setLabel(name);
- if(parentGroup != null) {
- groupHandler.addChild(parentGroup, newGroup, true);
- }
- groupHandler.saveGroup(newGroup, true);
-
- } catch (Exception e) {
- e.printStackTrace();
- fail("Error on create group [" + name + "] " + e.getMessage());
- }
-
- }
-
- private void deleteGroup(String name) {
- GroupHandler groupHandler = organizationService.getGroupHandler();
- try {
- Group group = groupHandler.findGroupById(name);
- groupHandler.removeGroup(group, true);
- } catch (Exception e) {
-
- }
- }
-
- private void createUser(String username, String... groups) {
- UserHandler userHandler = organizationService.getUserHandler();
- User user = userHandler.createUserInstance(username);
- user.setPassword(DEFAULT_PASSWORD);
- user.setFirstName("default");
- user.setLastName("default");
- user.setEmail("exo(a)exoportal.org");
- user.setOrganizationId(groups[0]);
- try {
- userHandler.createUser(user, true);
- } catch (Exception e) {
- e.printStackTrace();
- fail("Error on create user: " + e.getMessage());
- }
- }
- private void deleteUser(String username) {
- UserHandler userHandler = organizationService.getUserHandler();
- try {
- userHandler.removeUser(username, true);
- } catch (Exception e) {
- }
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,183 +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;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.model.PageNavigation;
-import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.mop.navigation.NavigationContext;
-import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.mop.navigation.NavigationState;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.GroupHandler;
-import org.exoplatform.services.organization.OrganizationService;
-import org.exoplatform.services.organization.User;
-import org.exoplatform.services.organization.UserHandler;
-
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * Author : TrongTT
- */
-public class TestPortalConfig extends AbstractPortalTest
-{
-
- private DataStorage storage;
-
- private POMSessionManager mgr;
-
- private OrganizationService org;
-
- /** . */
- private POMSession session;
-
- /** . */
- private NavigationService navService;
-
- public TestPortalConfig(String name)
- {
- super(name);
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- begin();
- PortalContainer container = PortalContainer.getInstance();
- org = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
- storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- navService = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
- session = mgr.openSession();
- }
-
- protected void tearDown() throws Exception
- {
- session.close();
- end();
- super.tearDown();
- }
-
- public void testSiteLayout() throws Exception
- {
- PortalConfig pConfig = storage.getPortalConfig(PortalConfig.PORTAL_TYPE, "classic");
- assertNotNull(pConfig);
- assertNotNull("The Group layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
-
- pConfig = storage.getPortalConfig(PortalConfig.GROUP_TYPE, "/platform/administrators");
- assertNotNull(pConfig);
- assertNotNull("The Group layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
- assertTrue(pConfig.getPortalLayout().getChildren() != null && pConfig.getPortalLayout().getChildren().size() > 1);
- pConfig.getPortalLayout().getChildren().clear();
- storage.save(pConfig);
-
- pConfig = storage.getPortalConfig(PortalConfig.GROUP_TYPE, "/platform/administrators");
- assertNotNull(pConfig);
- assertNotNull("The Group layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
- assertTrue(pConfig.getPortalLayout().getChildren() != null && pConfig.getPortalLayout().getChildren().size() == 0);
-
- pConfig = storage.getPortalConfig(PortalConfig.USER_TYPE, "root");
- assertNotNull(pConfig);
- assertNotNull("The User layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
-
- pConfig = storage.getPortalConfig(PortalConfig.USER_TYPE, "mary");
- assertNotNull(pConfig);
- assertNotNull("The User layout of " + pConfig.getName() + " is null", pConfig.getPortalLayout());
- }
-
- public void testGroupLayout() throws Exception
- {
- GroupHandler groupHandler = org.getGroupHandler();
- Group group = groupHandler.findGroupById("groupTest");
- assertNull(group);
-
- group = groupHandler.createGroupInstance();
- group.setGroupName("groupTest");
- group.setLabel("group label");
-
- groupHandler.addChild(null, group, true);
-
- group = groupHandler.findGroupById("/groupTest");
- assertNotNull(group);
-
- PortalConfig pConfig = storage.getPortalConfig(PortalConfig.GROUP_TYPE, "/groupTest");
- assertNotNull("the Group's PortalConfig is not null", pConfig);
- assertTrue(pConfig.getPortalLayout().getChildren() == null || pConfig.getPortalLayout().getChildren().size() == 4);
-
- /**
- * We need to remove the /groupTest from the groupHandler as the
- * handler is shared between the tests and can cause other tests
- * to fail.
- * TODO: make the tests fully independent
- */
- groupHandler.removeGroup(group, false);
- group = groupHandler.findGroupById("/groupTest");
- assertNull(group);
- }
-
-
-
- public void testGroupNavigation() throws Exception
- {
-
-
- GroupHandler groupHandler = org.getGroupHandler();
- Group group = groupHandler.createGroupInstance();
- group.setGroupName("testGroupNavigation");
- group.setLabel("testGroupNavigation");
-
- groupHandler.addChild(null, group, true);
-
- SiteKey key = SiteKey.group(group.getId());
- navService.saveNavigation(new NavigationContext(key, new NavigationState(0)));
- assertNotNull(navService.loadNavigation(key));
-
- // Remove group
- groupHandler.removeGroup(group, true);
-
- // Group navigations is removed after remove group
- assertNull(navService.loadNavigation(key));
- }
-
- public void testUserLayout() throws Exception
- {
- UserHandler userHandler = org.getUserHandler();
- User user = userHandler.findUserByName("testing");
- assertNull(user);
-
- user = userHandler.createUserInstance("testing");
- user.setEmail("testing(a)gmaild.com");
- user.setFirstName("test firstname");
- user.setLastName("test lastname");
- user.setPassword("123456");
-
- userHandler.createUser(user, true);
-
- user = userHandler.findUserByName("testing");
- assertNotNull(user);
-
- PortalConfig pConfig = storage.getPortalConfig(PortalConfig.USER_TYPE, "testing");
- assertNotNull("the User's PortalConfig is not null", pConfig);
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,109 +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;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PersistentApplicationState;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.spi.portlet.Portlet;
-import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestPortletPreferences extends AbstractPortalTest
-{
-
- public TestPortletPreferences(String name)
- {
- super(name);
- }
-
- /** . */
- private DataStorage storage_;
-
- /** . */
- private POMSessionManager mgr;
-
- /** . */
- private POMSession session;
-
- public void setUp() throws Exception
- {
- super.setUp();
- begin();
- PortalContainer container = getContainer();
- storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- session = mgr.openSession();
- }
-
- protected void tearDown() throws Exception
- {
- session.close();
- end();
- super.tearDown();
- }
-
- public void testSiteScopedPreferences() throws Exception
- {
- Page page = storage_.getPage("portal::test::test4");
- Application<Portlet> app = (Application<Portlet>)page.getChildren().get(0);
- PersistentApplicationState<Portlet> state = (PersistentApplicationState)app.getState();
-
- //
- Portlet prefs = storage_.load(state, ApplicationType.PORTLET);
- assertEquals(new PortletBuilder().add("template", "par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl")
- .build(), prefs);
-
- //
- prefs.setValue("template", "someanothervalue");
- storage_.save(state, prefs);
-
- //
- prefs = storage_.load(state, ApplicationType.PORTLET);
- assertNotNull(prefs);
- assertEquals(new PortletBuilder().add("template", "someanothervalue").build(), prefs);
- }
-
- public void testNullPreferenceValue() throws Exception
- {
- Page page = storage_.getPage("portal::test::test4");
- Application<Portlet> app = (Application<Portlet>)page.getChildren().get(0);
- PersistentApplicationState<Portlet> state = (PersistentApplicationState)app.getState();
-
- //
- Portlet prefs = storage_.load(state, ApplicationType.PORTLET);
-
- //
- prefs.setValue("template", null);
- storage_.save(state, prefs);
-
- //
- prefs = storage_.load(state, ApplicationType.PORTLET);
- assertNotNull(prefs);
- assertEquals(new PortletBuilder().add("template", "").build(), prefs);
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,234 +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;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.mop.*;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.gatein.mop.api.Attributes;
-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.Page;
-import org.gatein.mop.api.workspace.Site;
-import org.gatein.mop.api.workspace.link.Link;
-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.*;
-
-/**
- * Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
- * 13, 2007
- */
-public class TestSavedPOM extends AbstractPortalTest
-{
-
- /** . */
- private UserPortalConfigService portalConfigService;
-
- /** . */
- private DataStorage storage;
-
- /** . */
- private POMSessionManager mgr;
-
- /** . */
- private POMSession session;
-
- public TestSavedPOM(String name)
- {
- super(name);
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- begin();
- PortalContainer container = getContainer();
- portalConfigService = (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
- storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- session = mgr.openSession();
- }
-
- protected void tearDown() throws Exception
- {
- session.close();
- end();
- super.tearDown();
- }
-
- public void testNavigation() throws Exception
- {
- Site portal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
- assertNotNull(portal);
-
- //
- Navigation rootNavigation = portal.getRootNavigation();
- assertNotNull(rootNavigation);
-
- //
- Navigation defaultNav = rootNavigation.getChild("default");
-
- //
- Attributes defaultAttrs = defaultNav.getAttributes();
- assertEquals(1, (int)defaultAttrs.getInteger("priority"));
-
- //
- Collection<? extends Navigation> childrenNavigations = defaultNav.getChildren();
- assertNotNull(childrenNavigations);
- assertEquals(5, childrenNavigations.size());
- Iterator<? extends Navigation> i = childrenNavigations.iterator();
-
- //
- assertTrue(i.hasNext());
- Navigation nodeNavigation = i.next();
- assertNotNull(nodeNavigation);
- assertEquals(0, nodeNavigation.getChildren().size());
- assertEquals("node_name", nodeNavigation.getName());
- Described nodeDescribed = nodeNavigation.adapt(Described.class);
- assertEquals("node_label", nodeDescribed.getName());
- Attributes nodeAttrs = nodeNavigation.getAttributes();
- assertEquals("node_icon", nodeAttrs.getString("icon"));
-
- //
- assertTrue(nodeNavigation.isAdapted(Visible.class));
- Visible visible = nodeNavigation.adapt(Visible.class);
- GregorianCalendar start = new GregorianCalendar(2000, 2, 21, 1, 33, 0);
- start.setTimeZone(TimeZone.getTimeZone("UTC"));
- assertEquals(start.getTime(), visible.getStartPublicationDate());
- GregorianCalendar end = new GregorianCalendar(2009, 2, 21, 1, 33, 0);
- end.setTimeZone(TimeZone.getTimeZone("UTC"));
- assertEquals(end.getTime(), visible.getEndPublicationDate());
- assertEquals(Visibility.TEMPORAL, visible.getVisibility());
-
- //
- Link link = nodeNavigation.getLink();
- assertNotNull(link);
- }
-
- public void testPortal() throws Exception
- {
- Site portal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
- assertNotNull(portal);
-
- //
- assertTrue(portal.isAdapted(ProtectedResource.class));
- ProtectedResource pr = portal.adapt(ProtectedResource.class);
- assertEquals(Arrays.asList("test_access_permissions"), pr.getAccessPermissions());
- assertEquals("test_edit_permission", pr.getEditPermission());
-
- //
- assertEquals("test", portal.getName());
- Attributes attrs = portal.getAttributes();
- assertEquals("en", attrs.getString("locale"));
- assertEquals("test_skin", attrs.getString("skin"));
- assertEquals("test_prop_value", attrs.getString("prop_key"));
-
- //
- Page layout = portal.getRootNavigation().getTemplatized().getTemplate();
- assertNotNull(layout);
- assertSame(portal.getRootPage().getChild("templates").getChild("default"), layout);
- }
-
- public void testPageWithoutPageId() throws Exception
- {
- Site testPortal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
- Page testRootPage = testPortal.getRootPage();
- Page pages = testRootPage.getChild("pages");
- Page testPage = pages.getChild("test2");
- assertNotNull(testPage);
- }
-
- public void testPage() throws Exception
- {
- Site testPortal = session.getWorkspace().getSite(ObjectType.PORTAL_SITE, "test");
- Page testRootPage = testPortal.getRootPage();
- Page pages = testRootPage.getChild("pages");
- Page testPage = pages.getChild("test1");
- assertNotNull(testPage);
-
- //
- assertTrue(testPage.isAdapted(ProtectedResource.class));
- ProtectedResource pr = testPage.adapt(ProtectedResource.class);
- assertEquals(Arrays.asList("test_access_permissions"), pr.getAccessPermissions());
- assertEquals("test_edit_permission", pr.getEditPermission());
-
- //
- Described testPageDescribed = testPage.adapt(Described.class);
- assertEquals("test_title", testPageDescribed.getName());
- assertEquals(null, testPageDescribed.getDescription());
-
- //
- Attributes testPageAttrs = testPage.getAttributes();
- assertEquals("test_factory_id", testPageAttrs.getString("factory-id"));
- assertEquals(true, (boolean)testPageAttrs.getBoolean("show-max-window"));
-
- //
- UIContainer c = testPage.getRootComponent();
- assertNotNull(c);
- assertEquals(2, c.getComponents().size());
- Iterator<? extends UIComponent> it = c.getComponents().iterator();
-
- //
- UIContainer container1 = (UIContainer)it.next();
- assertTrue(container1.isAdapted(ProtectedResource.class));
- ProtectedResource container1PR = container1.adapt(ProtectedResource.class);
- assertEquals(Collections.singletonList("container_1_access_permissions"), container1PR.getAccessPermissions());
- Described container1Described = container1.adapt(Described.class);
- assertEquals("container_1_title", container1Described.getName());
- assertEquals("container_1_description", container1Described.getDescription());
- Attributes container1Attrs = container1.getAttributes();
- assertEquals("container_1", container1Attrs.getString("name"));
- assertEquals("container_1_icon", container1Attrs.getString("icon"));
- assertEquals("container_1_template", container1Attrs.getString("template"));
- assertEquals("container_1_factory_id", container1Attrs.getString("factory-id"));
- assertEquals("container_1_width", container1Attrs.getString("width"));
- assertEquals("container_1_height", container1Attrs.getString("height"));
-
- //
- UIWindow application1 = (UIWindow)it.next();
- assertTrue(application1.isAdapted(ProtectedResource.class));
- ProtectedResource application1PR = application1.adapt(ProtectedResource.class);
- assertEquals(Collections.singletonList("application_1_access_permissions"), application1PR.getAccessPermissions());
- Described application1Described = application1.adapt(Described.class);
- assertEquals("application_1_title", application1Described.getName());
- assertEquals("application_1_description", application1Described.getDescription());
- Attributes application1Attrs = application1.getAttributes();
- assertEquals("application_1_theme", application1Attrs.getString("theme"));
- assertEquals(true, (boolean)application1Attrs.getBoolean("showinfobar"));
- assertEquals(true, (boolean)application1Attrs.getBoolean("showmode"));
- assertEquals(true, (boolean)application1Attrs.getBoolean("showwindowstate"));
- assertEquals("application_1_icon", application1Attrs.getString("icon"));
- assertEquals("application_1_width", application1Attrs.getString("width"));
- assertEquals("application_1_height", application1Attrs.getString("height"));
- assertEquals("application_1_prop_value", application1Attrs.getString("prop_key"));
-
- //
- Customization<?> customization = application1.getCustomization();
- assertNotNull(customization);
- assertEquals("application/portlet", customization.getType().getMimeType());
- assertEquals("web/BannerPortlet", customization.getContentId());
- // assertEquals("banner", customization.getName());
- }
-}
\ No newline at end of file
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSearch.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSearch.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSearch.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -30,7 +30,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestSearch extends AbstractPortalTest
+public class TestSearch extends AbstractConfigTest
{
/** . */
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -52,6 +52,7 @@
import org.exoplatform.services.organization.UserHandler;
import org.exoplatform.services.security.Authenticator;
import org.exoplatform.services.security.ConversationState;
+import org.gatein.common.util.Tools;
import java.util.Arrays;
import java.util.Collections;
@@ -66,7 +67,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestUserPortalConfigService extends AbstractPortalTest
+public class TestUserPortalConfigService extends AbstractConfigTest
{
/** . */
@@ -198,8 +199,8 @@
assertEquals("expected to have 5 navigations instead of " + navigations, 5, navigations.size());
assertTrue(navigations.containsKey("portal::classic"));
assertTrue(navigations.containsKey("group::/platform/administrators"));
+ assertTrue(navigations.containsKey("group::/platform/users"));
assertTrue(navigations.containsKey("group::/organization/management/executive-board"));
- assertTrue(navigations.containsKey("group::/platform/users"));
assertTrue(navigations.containsKey("user::root"));
}
}.execute("root");
@@ -223,7 +224,6 @@
assertEquals("expected to have 5 navigations instead of " + navigations, 5, navigations.size());
assertTrue(navigations.containsKey("portal::classic"));
assertTrue(navigations.containsKey("group::/platform/administrators"));
- assertTrue(navigations.containsKey("group::/organization/management/executive-board"));
assertTrue(navigations.containsKey("group::/platform/users"));
assertTrue(navigations.containsKey("user::john"));
}
@@ -359,13 +359,14 @@
public void execute() throws Exception
{
Set<String> navigations = new HashSet<String>(userPortalConfigSer_.getMakableNavigations("root", false));
- Set<String> expectedNavigations =
- new HashSet<String>(Arrays.asList("/platform/users", "/organization/management/human-resources",
- "/partners", "/customers", "/organization/communication", "/organization/management/executive-board",
- "/organization/management", "/organization/operations", "/organization", "/platform",
- "/organization/communication/marketing", "/platform/guests",
- "/organization/communication/press-and-media", "/platform/administrators",
- "/organization/operations/sales", "/organization/operations/finances"));
+ Set<String> expectedNavigations = Tools.toSet(
+ "/platform/users",
+ "/platform",
+ "/platform/guests",
+ "/platform/administrators",
+ "/organization",
+ "/organization/management",
+ "/organization/management/executive-board");
assertEquals(expectedNavigations, navigations);
}
}.execute(null);
@@ -378,7 +379,7 @@
public void execute() throws Exception
{
Set<String> navigations = new HashSet<String>(userPortalConfigSer_.getMakableNavigations("john", false));
- Set<String> expectedNavigations = Collections.singleton("/organization/management/executive-board");
+ Set<String> expectedNavigations = Tools.toSet("/organization/management/executive-board");
assertEquals(expectedNavigations, navigations);
}
}.execute(null);
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,87 +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;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.model.Application;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.spi.wsrp.WSRP;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestWSRP extends AbstractPortalTest
-{
-
- /** . */
- private DataStorage storage_;
-
- /** . */
- private POMSessionManager mgr;
-
- /** . */
- private POMSession session;
-
- public void setUp() throws Exception
- {
- super.setUp();
- begin();
- PortalContainer container = getContainer();
- storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- session = mgr.openSession();
- }
-
- protected void tearDown() throws Exception
- {
- session.close();
- end();
- super.tearDown();
- }
-
- public void testBilto() throws Exception
- {
- WSRP wsrp = new WSRP();
- String id = "portlet id";
- wsrp.setPortletId(id);
- TransientApplicationState<WSRP> state = new TransientApplicationState<WSRP>("test", wsrp);
- Application<WSRP> wsrpApplication = Application.createWSRPApplication();
- wsrpApplication.setState(state);
-
- Page container = new Page();
- String pageId = "portal::test::wsrp_page";
- container.setPageId(pageId);
- container.getChildren().add(wsrpApplication);
-
- storage_.create(container);
-
- container = storage_.getPage(pageId);
- wsrpApplication = (Application<WSRP>)container.getChildren().get(0);
-
- wsrp = storage_.load(wsrpApplication.getState(), ApplicationType.WSRP_PORTLET);
- assertNotNull(wsrp);
- assertEquals(id, wsrp.getPortletId());
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/Builder.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/Builder.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/Builder.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2011 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.importer;
-
-import org.exoplatform.portal.config.model.PageNavigation;
-import org.exoplatform.portal.config.model.PageNode;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-public class Builder
-{
-
- /** . */
- private String value;
-
- /** . */
- private List<Builder> nodes;
-
- private Builder(String value)
- {
- this.value = value;
- this.nodes = new ArrayList<Builder>();
- }
-
- public static Builder navigation(String ownerId)
- {
- return new Builder(ownerId);
- }
-
- public static Builder node(String name)
- {
- return new Builder(name);
- }
-
- public Builder add(Builder... nodes)
- {
- for (Builder node : nodes)
- {
- this.nodes.add(node);
- }
- return this;
- }
-
- public Builder get(String value)
- {
- for (Builder node : nodes)
- {
- if (node.value.equals(value))
- {
- return node;
- }
- }
- return null;
- }
-
- private ArrayList<PageNode> buildNodes()
- {
- ArrayList<PageNode> nodes = new ArrayList<PageNode>();
- for (Builder node : this.nodes)
- {
- nodes.add(node.buildNode());
- }
- return nodes;
- }
-
- public PageNavigation build()
- {
- PageNavigation navigation = new PageNavigation();
- navigation.setOwnerType("portal");
- navigation.setOwnerId(value);
- navigation.setNodes(buildNodes());
- return navigation;
- }
-
- private PageNode buildNode()
- {
- PageNode node = new PageNode();
- node.setName(value);
- node.setLabel(value);
- node.setChildren(buildNodes());
- return node;
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/TestNavigationImporter.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/TestNavigationImporter.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/importer/TestNavigationImporter.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,362 +0,0 @@
-/*
- * Copyright (C) 2011 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.importer;
-
-import org.exoplatform.portal.config.model.LocalizedValue;
-import org.exoplatform.portal.config.model.PageNavigation;
-import org.exoplatform.portal.mop.Described;
-import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.mop.navigation.*;
-import org.gatein.common.util.Tools;
-import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.core.api.MOPService;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Locale;
-import java.util.Map;
-
-import static org.exoplatform.portal.config.importer.Builder.*;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-public class TestNavigationImporter extends AbstractTestNavigationService
-{
-
- public void testMergeCreateNavigation()
- {
- testCreate(ImportMode.MERGE);
- }
-
- public void testConserveCreateNavigation()
- {
- testCreate(ImportMode.CONSERVE);
- }
-
- public void testReimportCreateNavigation()
- {
- testCreate(ImportMode.REIMPORT);
- }
-
- private void testCreate(ImportMode mode)
- {
- String name = mode.name() + "_create_navigation";
-
- //
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, name);
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal(name)));
- PageNavigation src = navigation(name).build();
- src.setPriority(2);
- src.setOwnerId(name);
- NavigationImporter merge = new NavigationImporter(Locale.ENGLISH, mode, false, src, service, descriptionService);
- merge.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal(name));
- assertEquals(2, (int)ctx.getState().getPriority());
- }
-
- public void testMergeCreate()
- {
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "merge_create");
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal("merge_create")));
-
- //
- Builder builder = navigation("merge_create").add(node("a"));
-
- //
- PageNavigation src = builder.build();
- src.setOwnerId("merge_create");
- NavigationImporter merge = new NavigationImporter(Locale.ENGLISH, ImportMode.MERGE, false, src, service, descriptionService);
- merge.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal("merge_create"));
- NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
- NodeContext<?> a = node.get("a");
- assertNotNull(a);
- assertEquals("a", a.getName());
- assertEquals("a", a.getState().getLabel());
- assertEquals(0, a.getNodeCount());
- }
-
- public void testMergeNested()
- {
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "merge_nested");
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal("merge_nested")));
-
- //
- Builder builder = navigation("merge_nested").add(node("a").add(node("b")));
-
- //
- PageNavigation src = builder.build();
- src.setOwnerId("merge_nested");
- NavigationImporter merge = new NavigationImporter(Locale.ENGLISH, ImportMode.MERGE, false, src, service, descriptionService);
- merge.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal("merge_nested"));
- NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
- NodeContext<?> a = node.get("a");
- assertNotNull(a);
- assertEquals("a", a.getName());
- assertEquals("a", a.getState().getLabel());
- assertEquals(1, a.getNodeCount());
- }
-
- public void testCreateMerge()
- {
- testMerge(ImportMode.CONSERVE);
- }
-
- public void testMergeMerge()
- {
- testMerge(ImportMode.MERGE);
- }
-
- public void testReimportMerge()
- {
- testMerge(ImportMode.REIMPORT);
- }
-
- private void testMerge(ImportMode importMode)
- {
- String name = importMode.name() + "_merge_merge";
-
- //
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, name);
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal(name)));
-
- //
- Builder builder = navigation(name).add(node("a").add(node("b")));
-
- //
- PageNavigation src = builder.build();
- src.setOwnerId(name);
- NavigationImporter merge = new NavigationImporter(Locale.ENGLISH, ImportMode.CONSERVE, false, src, service, descriptionService);
- merge.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal(name));
- Node node = service.loadNode(Node.MODEL, ctx, Scope.ALL, null).getNode();
- Node a = node.getChild("a");
- assertNotNull(a);
- assertEquals("a", a.getName());
- assertEquals(1, a.getNodeCount());
- Node b = a.getChild("b");
- assertNotNull(b);
- assertEquals("b", b.getName());
- assertEquals(0, b.getNodeCount());
-
- //
- builder = navigation(name).add(node("a").add(node("d"))).add(node("c"));
- src = builder.build();
- src.setOwnerId(name);
- merge = new NavigationImporter(Locale.ENGLISH, importMode, false, src, service, descriptionService);
- merge.perform();
-
- //
- ctx = service.loadNavigation(SiteKey.portal(name));
- node = service.loadNode(Node.MODEL, ctx, Scope.ALL, null).getNode();
- switch (importMode)
- {
- case MERGE:
- {
- assertEquals(2, node.getNodeCount());
- a = node.getChild("a");
- assertNotNull(a);
- assertEquals("a", a.getState().getLabel());
- assertEquals(2, a.getNodeCount());
- b = a.getChild("b");
- assertNotNull(b);
- assertEquals("b", b.getState().getLabel());
- assertEquals(0, b.getNodeCount());
- Node c = node.getChild("c");
- assertNotNull(c);
- assertEquals("c", c.getState().getLabel());
- assertEquals(0, c.getNodeCount());
- Node d = a.getChild("d");
- assertNotNull(d);
- assertEquals("d", d.getName());
- assertEquals(0, d.getNodeCount());
- break;
- }
- case CONSERVE:
- {
- assertEquals(1, node.getNodeCount());
- a = node.getChild("a");
- assertNotNull(a);
- assertEquals(1, a.getNodeCount());
- assertNotNull(b);
- assertEquals("b", b.getState().getLabel());
- assertEquals(0, b.getNodeCount());
- break;
- }
- case REIMPORT:
- {
- assertEquals(2, node.getNodeCount());
- a = node.getChild("a");
- assertNotNull(a);
- assertEquals("a", a.getState().getLabel());
- assertEquals(1, a.getNodeCount());
- Node c = node.getChild("c");
- assertNotNull(c);
- assertEquals("c", c.getState().getLabel());
- assertEquals(0, c.getNodeCount());
- Node d = a.getChild("d");
- assertNotNull(d);
- assertEquals("d", d.getName());
- assertEquals(0, d.getNodeCount());
- break;
- }
- }
- }
-
- public void testMergeOrder()
- {
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "merge_order");
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal("merge_order")));
-
- //
- PageNavigation src = navigation("merge_order").add(node("a"), node("b"), node("c")).build();
- src.setOwnerId("merge_order");
- NavigationImporter merge = new NavigationImporter(Locale.ENGLISH, ImportMode.MERGE, false, src, service, descriptionService);
- merge.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal("merge_order"));
- NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
- assertEquals(3, node.getNodeCount());
- assertEquals("a", node.get(0).getName());
- assertEquals("b", node.get(1).getName());
- assertEquals("c", node.get(2).getName());
- }
-
- public void testExtendedLabel()
- {
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "importer_extended_label");
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal("importer_extended_label")));
-
- //
- PageNavigation src = navigation("importer_extended_label").add(node("a"), node("b"), node("c")).build();
- src.getNode("a").setLabels(new ArrayList<LocalizedValue>(Arrays.asList(new LocalizedValue("a_en", Locale.ENGLISH), new LocalizedValue("a_fr", Locale.FRENCH))));
- src.getNode("b").setLabels(new ArrayList<LocalizedValue>(Arrays.asList(new LocalizedValue("b_en"), new LocalizedValue("b_fr", Locale.FRENCH))));
- src.getNode("c").setLabels(new ArrayList<LocalizedValue>(Arrays.asList(new LocalizedValue("c_en"))));
- src.setOwnerId("importer_extended_label");
- NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.REIMPORT, true, src, service, descriptionService);
- importer.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal("importer_extended_label"));
- NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
-
- // The fully explicit case
- NodeContext<?> a = (NodeContext<?>)node.getNode("a");
- Map<Locale, Described.State> aDesc = descriptionService.getDescriptions(a.getId());
- assertNotNull(aDesc);
- assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH), aDesc.keySet());
- assertEquals(new Described.State("a_en", null), aDesc.get(Locale.ENGLISH));
- assertEquals(new Described.State("a_fr", null), aDesc.get(Locale.FRENCH));
- assertNull(a.getState().getLabel());
-
- // No explicit language means to use the portal locale
- NodeContext<?> b = (NodeContext<?>)node.getNode("b");
- Map<Locale, Described.State> bDesc = descriptionService.getDescriptions(b.getId());
- assertNotNull(bDesc);
- assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH), bDesc.keySet());
- assertEquals(new Described.State("b_en", null), bDesc.get(Locale.ENGLISH));
- assertEquals(new Described.State("b_fr", null), bDesc.get(Locale.FRENCH));
- assertNull(b.getState().getLabel());
-
- // The simple use case : one single label without the xml:lang attribute
- NodeContext<?> c = (NodeContext<?>)node.getNode("c");
- Map<Locale, Described.State> cDesc = descriptionService.getDescriptions(c.getId());
- assertNotNull(cDesc);
- assertEquals(Tools.toSet(Locale.ENGLISH), cDesc.keySet());
- assertEquals(new Described.State("c_en", null), cDesc.get(Locale.ENGLISH));
- assertEquals(null, c.getState().getLabel());
- }
-
- public void testSimpleLabel()
- {
- MOPService mop = mgr.getPOMService();
- mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "importer_simple_label");
- sync(true);
-
- //
- assertNull(service.loadNavigation(SiteKey.portal("importer_simple_label")));
-
- //
- PageNavigation src = navigation("importer_simple_label").add(node("a"), node("b"), node("c")).build();
- src.getNode("a").setLabels(new ArrayList<LocalizedValue>(Arrays.asList(new LocalizedValue("a_en", Locale.ENGLISH), new LocalizedValue("a_fr", Locale.FRENCH))));
- src.getNode("b").setLabels(new ArrayList<LocalizedValue>(Arrays.asList(new LocalizedValue("b_en"), new LocalizedValue("b_fr", Locale.FRENCH))));
- src.getNode("c").setLabels(new ArrayList<LocalizedValue>(Arrays.asList(new LocalizedValue("c_en"))));
- src.setOwnerId("importer_simple_label");
- NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.REIMPORT, false, src, service, descriptionService);
- importer.perform();
-
- //
- NavigationContext ctx = service.loadNavigation(SiteKey.portal("importer_simple_label"));
- NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
-
- // The fully explicit case
- NodeContext<?> a = (NodeContext<?>)node.getNode("a");
- Map<Locale, Described.State> aDesc = descriptionService.getDescriptions(a.getId());
- assertNull(aDesc);
- assertEquals("a_en", a.getState().getLabel());
-
- // No explicit language means to use the portal locale
- NodeContext<?> b = (NodeContext<?>)node.getNode("b");
- Map<Locale, Described.State> bDesc = descriptionService.getDescriptions(b.getId());
- assertNull(bDesc);
- assertEquals("b_en", b.getState().getLabel());
-
- // The simple use case : one single label without the xml:lang attribute
- NodeContext<?> c = (NodeContext<?>)node.getNode("c");
- Map<Locale, Described.State> cDesc = descriptionService.getDescriptions(c.getId());
- assertNull(cDesc);
- assertEquals("c_en", c.getState().getLabel());
- }
-}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/description/TestDescriptionService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/description/TestDescriptionService.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/description/TestDescriptionService.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -19,8 +19,11 @@
package org.exoplatform.portal.mop.description;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.AbstractPortalTest;
+import org.exoplatform.portal.AbstractPortalTest;
import org.exoplatform.portal.mop.Described;
import org.exoplatform.portal.mop.i18n.I18Nized;
import org.exoplatform.portal.mop.navigation.NavigationServiceImpl;
@@ -38,6 +41,11 @@
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
*/
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml")
+})
public class TestDescriptionService extends AbstractPortalTest
{
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/Builder.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/Builder.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/Builder.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PageNodeContainer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public abstract class Builder<B extends Builder<B>>
+{
+
+ /** . */
+ protected final String value;
+
+ /** . */
+ protected final List<NodeBuilder> nodes;
+
+ protected Builder(String value)
+ {
+ this.value = value;
+ this.nodes = new ArrayList<NodeBuilder>();
+ }
+
+ public static NodeBuilder node(String name)
+ {
+ return new NodeBuilder(name);
+ }
+
+ public static FragmentBuilder fragment(String... path)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (String name : path)
+ {
+ if (sb.length() > 0)
+ {
+ sb.append('/');
+ }
+ sb.append(name);
+ }
+ return new FragmentBuilder(sb.toString());
+ }
+
+ public B add(NodeBuilder... nodes)
+ {
+ for (NodeBuilder node : nodes)
+ {
+ this.nodes.add(node);
+ }
+ return (B)this;
+ }
+
+ public Builder get(String value)
+ {
+ for (Builder node : nodes)
+ {
+ if (node.value.equals(value))
+ {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ protected final ArrayList<PageNode> buildNodes()
+ {
+ ArrayList<PageNode> nodes = new ArrayList<PageNode>();
+ for (NodeBuilder node : this.nodes)
+ {
+ nodes.add(node.build());
+ }
+ return nodes;
+ }
+
+ public abstract PageNodeContainer build();
+
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/FragmentBuilder.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/FragmentBuilder.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/FragmentBuilder.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.NavigationFragment;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class FragmentBuilder extends Builder<FragmentBuilder>
+{
+ public FragmentBuilder(String parentURI)
+ {
+ super(parentURI);
+ }
+
+ @Override
+ public NavigationFragment build()
+ {
+ NavigationFragment fragment = new NavigationFragment();
+ fragment.setParentURI(value);
+ fragment.setNodes(buildNodes());
+ return fragment;
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/NodeBuilder.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/NodeBuilder.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/NodeBuilder.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class NodeBuilder extends Builder<NodeBuilder>
+{
+ public NodeBuilder(String ownerId)
+ {
+ super(ownerId);
+ }
+
+ @Override
+ public PageNode build()
+ {
+ PageNode node = new PageNode();
+ node.setName(value);
+ node.setLabel(value);
+ node.setChildren(buildNodes());
+ return node;
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationFragmentImporter.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationFragmentImporter.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationFragmentImporter.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.NavigationFragment;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.navigation.AbstractTestNavigationService;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationState;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeModel;
+import org.exoplatform.portal.mop.navigation.Scope;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.core.api.MOPService;
+
+import java.util.Locale;
+
+import static org.exoplatform.portal.mop.importer.Builder.fragment;
+import static org.exoplatform.portal.mop.importer.Builder.node;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestNavigationFragmentImporter extends AbstractTestNavigationService
+{
+
+ public void testRemoveOrphan()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "remove_orphan");
+ sync(true);
+
+ //
+ NavigationContext ctx = new NavigationContext(SiteKey.portal("remove_orphan"), new NavigationState(1));
+ service.saveNavigation(ctx);
+ NodeContext root = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null);
+ root.add(0, "foo").add(0, "bar");
+ service.saveNode(root, null);
+
+ //
+ NavigationFragment imported = fragment("foo").build();
+
+ //
+ NavigationFragmentImporter importer = new NavigationFragmentImporter(
+ new String[0],
+ service,
+ SiteKey.portal("remove_orphan"),
+ Locale.ENGLISH,
+ descriptionService,
+ imported,
+ new ImportConfig(true, false, false));
+ NodeContext node = importer.perform();
+ assertEquals(0, node.getNodeSize());
+ }
+
+ public void testCreateMissingPath()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "create_missing_path");
+ sync(true);
+
+ //
+ NavigationContext ctx = new NavigationContext(SiteKey.portal("create_missing_path"), new NavigationState(1));
+ service.saveNavigation(ctx);
+ NodeContext root = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null);
+ root.add(0, "foo").add(0, "bar");
+ service.saveNode(root, null);
+
+ //
+ NavigationFragment imported = fragment("foo").add(node("juu")).build();
+
+ //
+ NavigationFragmentImporter importer = new NavigationFragmentImporter(
+ new String[]{"foo","bar"},
+ service,
+ SiteKey.portal("create_missing_path"),
+ Locale.ENGLISH,
+ descriptionService,
+ imported,
+ ImportMode.INSERT.config);
+ NodeContext node = importer.perform();
+ assertNotNull(node);
+ assertEquals("bar", node.getName());
+ assertNotNull(node.get("juu"));
+
+ //
+ importer = new NavigationFragmentImporter(
+ new String[]{"foo","bar","daa"},
+ service,
+ SiteKey.portal("create_missing_path"),
+ Locale.ENGLISH,
+ descriptionService,
+ imported,
+ ImportMode.INSERT.config);
+ node = importer.perform();
+ assertNotNull(node);
+ assertEquals("daa", node.getName());
+ assertNotNull(node.get("juu"));
+
+ //
+ importer = new NavigationFragmentImporter(
+ new String[]{"foo"},
+ service,
+ SiteKey.portal("create_missing_path"),
+ Locale.ENGLISH,
+ descriptionService,
+ imported,
+ ImportMode.INSERT.config);
+ node = importer.perform();
+ assertEquals("foo", node.getName());
+ assertNotNull(node.get("juu"));
+ }
+}
Added: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationImporter.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationImporter.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/importer/TestNavigationImporter.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,380 @@
+/*
+ * Copyright (C) 2011 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.mop.importer;
+
+import org.exoplatform.portal.config.model.I18NString;
+import org.exoplatform.portal.config.model.LocalizedString;
+import org.exoplatform.portal.config.model.NavigationFragment;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.mop.Described;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.navigation.*;
+import org.gatein.common.util.Tools;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.core.api.MOPService;
+
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.exoplatform.portal.mop.importer.Builder.*;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class TestNavigationImporter extends AbstractTestNavigationService
+{
+
+ public void testInsertCreateNavigation()
+ {
+ testCreate(ImportMode.INSERT);
+ }
+
+ public void testConserveCreateNavigation()
+ {
+ testCreate(ImportMode.CONSERVE);
+ }
+
+ public void testOverwriteCreateNavigation()
+ {
+ testCreate(ImportMode.OVERWRITE);
+ }
+
+ private void testCreate(ImportMode mode)
+ {
+ String name = mode.name() + "_create";
+
+ //
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, name);
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal(name)));
+ PageNavigation src = new PageNavigation("portal", name);
+ src.setPriority(2);
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, mode, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal(name));
+ assertEquals(2, (int)ctx.getState().getPriority());
+ }
+
+ public void testInsertNavigation()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "insert_navigation");
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal("insert_navigation")));
+
+ //
+ FragmentBuilder builder = fragment().add(node("a"));
+
+ //
+ PageNavigation src = new PageNavigation("portal", "insert_navigation").addFragment(builder.build());
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.INSERT, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal("insert_navigation"));
+ NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
+ NodeContext<?> a = node.get("a");
+ assertNotNull(a);
+ assertEquals("a", a.getName());
+ assertEquals("a", a.getState().getLabel());
+ assertEquals(0, a.getNodeCount());
+ }
+
+ public void testInsertFragment()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "insert_fragment");
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal("insert_fragment")));
+
+ //
+ FragmentBuilder builder = fragment().add(node("a").add(node("b")));
+
+ //
+ PageNavigation src = new PageNavigation("portal", "insert_fragment").addFragment(builder.build());
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.INSERT, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal("insert_fragment"));
+ NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
+ NodeContext<?> a = node.get("a");
+ assertNotNull(a);
+ assertEquals("a", a.getName());
+ assertEquals("a", a.getState().getLabel());
+ assertEquals(1, a.getNodeCount());
+ }
+
+ public void testCreateMerge()
+ {
+ testMerge(ImportMode.CONSERVE);
+ }
+
+ public void testInsertMerge()
+ {
+ testMerge(ImportMode.INSERT);
+ }
+
+ public void testOverwriteMerge()
+ {
+ testMerge(ImportMode.OVERWRITE);
+ }
+
+ private void testMerge(ImportMode importMode)
+ {
+ String name = importMode.name() + "_merge";
+
+ //
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, name);
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal(name)));
+
+ //
+ FragmentBuilder builder = fragment().add(node("a").add(node("b")));
+
+ //
+ PageNavigation src = new PageNavigation("portal", name).addFragment(builder.build());
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.CONSERVE, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal(name));
+ Node node = service.loadNode(Node.MODEL, ctx, Scope.ALL, null).getNode();
+ Node a = node.getChild("a");
+ assertNotNull(a);
+ assertEquals("a", a.getName());
+ assertEquals(1, a.getNodeCount());
+ Node b = a.getChild("b");
+ assertNotNull(b);
+ assertEquals("b", b.getName());
+ assertEquals(0, b.getNodeCount());
+
+ //
+ builder = fragment().add(node("a").add(node("d"))).add(node("c"));
+ src = new PageNavigation("portal", name).addFragment(builder.build());
+ importer = new NavigationImporter(Locale.ENGLISH, importMode, src, service, descriptionService);
+ importer.perform();
+
+ //
+ ctx = service.loadNavigation(SiteKey.portal(name));
+ node = service.loadNode(Node.MODEL, ctx, Scope.ALL, null).getNode();
+ switch (importMode)
+ {
+ case INSERT:
+ {
+ assertEquals(2, node.getNodeCount());
+ a = node.getChild("a");
+ assertNotNull(a);
+ assertEquals("a", a.getState().getLabel());
+ assertEquals(2, a.getNodeCount());
+ b = a.getChild("b");
+ assertNotNull(b);
+ assertEquals("b", b.getState().getLabel());
+ assertEquals(0, b.getNodeCount());
+ Node c = node.getChild("c");
+ assertNotNull(c);
+ assertEquals("c", c.getState().getLabel());
+ assertEquals(0, c.getNodeCount());
+ Node d = a.getChild("d");
+ assertNotNull(d);
+ assertEquals("d", d.getName());
+ assertEquals(0, d.getNodeCount());
+ break;
+ }
+ case CONSERVE:
+ {
+ assertEquals(1, node.getNodeCount());
+ a = node.getChild("a");
+ assertNotNull(a);
+ assertEquals(1, a.getNodeCount());
+ assertNotNull(b);
+ assertEquals("b", b.getState().getLabel());
+ assertEquals(0, b.getNodeCount());
+ break;
+ }
+ case OVERWRITE:
+ {
+ assertEquals(2, node.getNodeCount());
+ a = node.getChild("a");
+ assertNotNull(a);
+ assertEquals("a", a.getState().getLabel());
+ assertEquals(1, a.getNodeCount());
+ Node c = node.getChild("c");
+ assertNotNull(c);
+ assertEquals("c", c.getState().getLabel());
+ assertEquals(0, c.getNodeCount());
+ Node d = a.getChild("d");
+ assertNotNull(d);
+ assertEquals("d", d.getName());
+ assertEquals(0, d.getNodeCount());
+ break;
+ }
+ }
+ }
+
+ public void testOrder()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "order");
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal("order")));
+
+ //
+ PageNavigation src = new PageNavigation("portal", "order").addFragment(fragment().add(node("a"), node("b"), node("c")).build());
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.INSERT, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal("order"));
+ NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
+ assertEquals(3, node.getNodeCount());
+ assertEquals("a", node.get(0).getName());
+ assertEquals("b", node.get(1).getName());
+ assertEquals("c", node.get(2).getName());
+
+ //
+ src.getFragment().getNodes().add(0, node("d").build());
+ importer = new NavigationImporter(Locale.ENGLISH, ImportMode.INSERT, src, service, descriptionService);
+ importer.perform();
+
+ //
+ node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
+ assertEquals(4, node.getNodeCount());
+ assertEquals("d", node.get(0).getName());
+ assertEquals("a", node.get(1).getName());
+ assertEquals("b", node.get(2).getName());
+ assertEquals("c", node.get(3).getName());
+
+ //
+ src.getFragment().getNodes().add(node("e").build());
+ importer = new NavigationImporter(Locale.ENGLISH, ImportMode.INSERT, src, service, descriptionService);
+ importer.perform();
+
+ //
+ node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
+ assertEquals(5, node.getNodeCount());
+ assertEquals("d", node.get(0).getName());
+ assertEquals("a", node.get(1).getName());
+ assertEquals("b", node.get(2).getName());
+ assertEquals("c", node.get(3).getName());
+ assertEquals("e", node.get(4).getName());
+ }
+
+ public void testExtendedLabel()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "extended_label");
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal("extended_label")));
+
+ //
+ PageNavigation src = new PageNavigation("portal", "extended_label").addFragment(fragment().add(node("a"), node("b"), node("c")).build());
+ NavigationFragment fragment = src.getFragment();
+ fragment.getNode("a").setLabels(new I18NString(new LocalizedString("a_en", Locale.ENGLISH), new LocalizedString("a_fr", Locale.FRENCH)));
+ fragment.getNode("b").setLabels(new I18NString(new LocalizedString("b_en"), new LocalizedString("b_fr", Locale.FRENCH)));
+ fragment.getNode("c").setLabels(new I18NString(new LocalizedString("c_en")));
+ src.setOwnerId("extended_label");
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.OVERWRITE, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal("extended_label"));
+ NodeContext<?> node = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null).getNode();
+
+ // The fully explicit case
+ NodeContext<?> a = (NodeContext<?>)node.getNode("a");
+ Map<Locale, Described.State> aDesc = descriptionService.getDescriptions(a.getId());
+ assertNotNull(aDesc);
+ assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH), aDesc.keySet());
+ assertEquals(new Described.State("a_en", null), aDesc.get(Locale.ENGLISH));
+ assertEquals(new Described.State("a_fr", null), aDesc.get(Locale.FRENCH));
+ assertNull(a.getState().getLabel());
+
+ // No explicit language means to use the portal locale
+ NodeContext<?> b = (NodeContext<?>)node.getNode("b");
+ Map<Locale, Described.State> bDesc = descriptionService.getDescriptions(b.getId());
+ assertNotNull(bDesc);
+ assertEquals(Tools.toSet(Locale.ENGLISH, Locale.FRENCH), bDesc.keySet());
+ assertEquals(new Described.State("b_en", null), bDesc.get(Locale.ENGLISH));
+ assertEquals(new Described.State("b_fr", null), bDesc.get(Locale.FRENCH));
+ assertNull(b.getState().getLabel());
+
+ // The simple use case : one single label without the xml:lang attribute
+ NodeContext<?> c = (NodeContext<?>)node.getNode("c");
+ Map<Locale, Described.State> cDesc = descriptionService.getDescriptions(c.getId());
+ assertNull(cDesc);
+ assertEquals("c_en", c.getState().getLabel());
+ }
+
+ public void testFullNavigation()
+ {
+ MOPService mop = mgr.getPOMService();
+ mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "full_navigation");
+ sync(true);
+
+ //
+ assertNull(service.loadNavigation(SiteKey.portal("full_navigation")));
+
+ //
+ PageNavigation src = new PageNavigation("portal", "full_navigation").addFragment(fragment().add(node("a")).build());
+ src.addFragment(fragment().add(node("b"), node("c")).build());
+ src.addFragment(fragment("a").add(node("d")).build());
+
+ //
+ NavigationImporter importer = new NavigationImporter(Locale.ENGLISH, ImportMode.INSERT, src, service, descriptionService);
+ importer.perform();
+
+ //
+ NavigationContext ctx = service.loadNavigation(SiteKey.portal("full_navigation"));
+ NodeContext<NodeContext<?>> root = service.loadNode(NodeModel.SELF_MODEL, ctx, Scope.ALL, null);
+ assertEquals(3, root.getNodeSize());
+ Iterator<NodeContext<?>> i = root.iterator();
+ NodeContext<?> a = i.next();
+ assertEquals("a", a.getName());
+ assertEquals(1, a.getNodeSize());
+ NodeContext<?> d = a.get("d");
+ assertNotNull(d);
+ assertEquals(0, d.getNodeSize());
+ NodeContext<?> b = i.next();
+ assertEquals("b", b.getName());
+ assertEquals(0, b.getNodeSize());
+ NodeContext<?> c = i.next();
+ assertEquals("c", c.getName());
+ assertEquals(0, c.getNodeSize());
+ assertFalse(i.hasNext());
+ }
+}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/AbstractTestNavigationService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/AbstractTestNavigationService.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/AbstractTestNavigationService.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -20,8 +20,11 @@
package org.exoplatform.portal.mop.navigation;
import junit.framework.AssertionFailedError;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.AbstractPortalTest;
+import org.exoplatform.portal.AbstractPortalTest;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.mop.description.DescriptionService;
import org.exoplatform.portal.mop.description.DescriptionServiceImpl;
@@ -30,6 +33,12 @@
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
*/
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/portal/mop/navigation/configuration.xml")
+})
public abstract class AbstractTestNavigationService extends AbstractPortalTest
{
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestNavigationServiceWrapper.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestNavigationServiceWrapper.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestNavigationServiceWrapper.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -20,7 +20,6 @@
package org.exoplatform.portal.mop.navigation;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.AbstractPortalTest;
import org.exoplatform.portal.mop.EventType;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.pom.config.POMSessionManager;
@@ -35,7 +34,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestNavigationServiceWrapper extends AbstractPortalTest
+public class TestNavigationServiceWrapper extends AbstractTestNavigationService
{
/** . */
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestScope.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestScope.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/navigation/TestScope.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -19,14 +19,14 @@
package org.exoplatform.portal.mop.navigation;
-import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.portal.mop.Visibility;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestScope extends AbstractKernelTest
+public class TestScope extends AbstractGateInTest
{
public void testBranchShape()
@@ -34,6 +34,17 @@
NodeState nodeState = new NodeState("", null, -1, -1, Visibility.DISPLAYED, "portal::classic::home");
//
+ Scope scope0 = GenericScope.branchShape(new String[0], Scope.CHILDREN);
+ Scope.Visitor visitor0 = scope0.get();
+ assertEquals(VisitMode.ALL_CHILDREN, visitor0.enter(0, "0", "", nodeState));
+ assertEquals(VisitMode.NO_CHILDREN, visitor0.enter(1, "1", "a", nodeState));
+
+ //
+ scope0 = GenericScope.branchShape(new String[0], Scope.SINGLE);
+ visitor0 = scope0.get();
+ assertEquals(VisitMode.NO_CHILDREN, visitor0.enter(0, "0", "", nodeState));
+
+ //
Scope scope1 = GenericScope.branchShape(new String[]{"a"}, Scope.CHILDREN);
Scope.Visitor visitor1 = scope1.get();
assertEquals(VisitMode.ALL_CHILDREN, visitor1.enter(0, "0", "", nodeState));
@@ -41,27 +52,27 @@
assertEquals(VisitMode.NO_CHILDREN, visitor1.enter(1, "2", "b", nodeState));
//
- Scope scope2 = GenericScope.branchShape(new String[]{"a"}, Scope.SINGLE);
+ scope1 = GenericScope.branchShape(new String[]{"a"}, Scope.SINGLE);
+ visitor1 = scope1.get();
+ assertEquals(VisitMode.ALL_CHILDREN, visitor1.enter(0, "0", "", nodeState));
+ assertEquals(VisitMode.NO_CHILDREN, visitor1.enter(1, "1", "a", nodeState));
+ assertEquals(VisitMode.NO_CHILDREN, visitor1.enter(1, "2", "b", nodeState));
+
+ //
+ Scope scope2 = GenericScope.branchShape(new String[]{"a","c"}, Scope.SINGLE);
Scope.Visitor visitor2 = scope2.get();
assertEquals(VisitMode.ALL_CHILDREN, visitor2.enter(0, "0", "", nodeState));
- assertEquals(VisitMode.NO_CHILDREN, visitor2.enter(1, "1", "a", nodeState));
+ assertEquals(VisitMode.ALL_CHILDREN, visitor2.enter(1, "1", "a", nodeState));
assertEquals(VisitMode.NO_CHILDREN, visitor2.enter(1, "2", "b", nodeState));
+ assertEquals(VisitMode.NO_CHILDREN, visitor2.enter(2, "3", "c", nodeState));
+ assertEquals(VisitMode.NO_CHILDREN, visitor2.enter(2, "4", "d", nodeState));
//
- Scope scope3 = GenericScope.branchShape(new String[]{"a","c"}, Scope.SINGLE);
- Scope.Visitor visitor3 = scope3.get();
- assertEquals(VisitMode.ALL_CHILDREN, visitor3.enter(0, "0", "", nodeState));
- assertEquals(VisitMode.ALL_CHILDREN, visitor3.enter(1, "1", "a", nodeState));
- assertEquals(VisitMode.NO_CHILDREN, visitor3.enter(1, "2", "b", nodeState));
- assertEquals(VisitMode.NO_CHILDREN, visitor3.enter(2, "3", "c", nodeState));
- assertEquals(VisitMode.NO_CHILDREN, visitor3.enter(2, "4", "d", nodeState));
-
- //
- Scope scope4 = GenericScope.branchShape(new String[]{"a"}, GenericScope.branchShape(new String[]{"b"}, Scope.CHILDREN));
- Scope.Visitor visitor4 = scope4.get();
- assertEquals(VisitMode.ALL_CHILDREN, visitor4.enter(0, "0", "", nodeState));
- assertEquals(VisitMode.ALL_CHILDREN, visitor4.enter(1, "1", "a", nodeState));
- assertEquals(VisitMode.ALL_CHILDREN, visitor4.enter(2, "2", "b", nodeState));
- assertEquals(VisitMode.NO_CHILDREN, visitor4.enter(2, "3", "c", nodeState));
+ scope2 = GenericScope.branchShape(new String[]{"a"}, GenericScope.branchShape(new String[]{"b"}, Scope.CHILDREN));
+ visitor2 = scope2.get();
+ assertEquals(VisitMode.ALL_CHILDREN, visitor2.enter(0, "0", "", nodeState));
+ assertEquals(VisitMode.ALL_CHILDREN, visitor2.enter(1, "1", "a", nodeState));
+ assertEquals(VisitMode.ALL_CHILDREN, visitor2.enter(2, "2", "b", nodeState));
+ assertEquals(VisitMode.NO_CHILDREN, visitor2.enter(2, "3", "c", nodeState));
}
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java 2011-07-22 03:13:14 UTC (rev 6912)
@@ -21,8 +21,11 @@
import junit.framework.AssertionFailedError;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.config.AbstractPortalTest;
+import org.exoplatform.portal.AbstractPortalTest;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
@@ -30,6 +33,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.Visibility;
import org.exoplatform.portal.mop.navigation.Scope;
+import org.exoplatform.portal.mop.user.UserNodeFilterConfig.Builder;
import org.exoplatform.portal.pom.config.POMDataStorage;
import org.exoplatform.portal.pom.config.POMSessionManager;
import org.exoplatform.services.listener.Event;
@@ -50,13 +54,18 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.TimeZone;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/portal/mop/user/configuration.xml")
+})
public class TestUserPortal extends AbstractPortalTest
{
@@ -433,6 +442,44 @@
}.execute("root");
}
+ public void testFindBestAvailablePath()
+ {
+ new UnitTest()
+ {
+ public void execute() throws Exception
+ {
+ UserPortalConfig userPortalCfg = userPortalConfigSer_.getUserPortalConfig("limited", getUserId());
+ UserPortal userPortal = userPortalCfg.getUserPortal();
+
+ // Without authentication
+ UserNode nav = userPortal.resolvePath(null, "/");
+ assertEquals(SiteKey.portal("limited"), nav.getNavigation().getKey());
+ assertEquals("foo", nav.getName());
+
+ nav = userPortal.resolvePath(null, "/foo");
+ assertEquals(SiteKey.portal("limited"), nav.getNavigation().getKey());
+ assertEquals("foo", nav.getName());
+
+ // With authentication
+ UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder();
+ builder.withAuthorizationCheck();
+ UserNodeFilterConfig filterConfig = builder.build();
+
+ nav = userPortal.resolvePath(filterConfig, "/");
+ assertEquals(SiteKey.portal("limited"), nav.getNavigation().getKey());
+ assertEquals("bar", nav.getName());
+
+ nav = userPortal.resolvePath(filterConfig, "/foo");
+ assertEquals(SiteKey.portal("limited"), nav.getNavigation().getKey());
+ assertEquals("foo", nav.getName());
+
+ nav = userPortal.resolvePath(filterConfig, "/bit");
+ assertEquals(SiteKey.portal("limited"), nav.getNavigation().getKey());
+ assertEquals("bit", nav.getName());
+ }
+ }.execute("demo");
+ }
+
public void testPathResolutionPerNavigation()
{
new UnitTest()
@@ -659,6 +706,67 @@
}.execute("root");
}
+ public void testInvalidateState()
+ {
+ new UnitTest()
+ {
+ public void execute() throws Exception
+ {
+ storage_.create(new PortalConfig("portal", "usernode_invalidate_uri"));
+ end(true);
+
+ //
+ begin();
+ Site site = mgr.getPOMService().getModel().getWorkspace().getSite(ObjectType.PORTAL_SITE, "usernode_invalidate_uri");
+ site.getRootNavigation().addChild("default");
+ end(true);
+
+ //
+ begin();
+ UserPortalConfig userPortalCfg = userPortalConfigSer_.getUserPortalConfig("usernode_invalidate_uri", getUserId());
+ UserPortal userPortal = userPortalCfg.getUserPortal();
+ UserNavigation navigation = userPortal.getNavigation(SiteKey.portal("usernode_invalidate_uri"));
+ UserNode root = userPortal.getNode(navigation, Scope.ALL, null, null);
+ UserNode foo = root.addChild("foo");
+ UserNode bar = root.addChild("bar");
+ assertEquals("foo", foo.getURI());
+ assertEquals("bar", bar.getURI());
+ userPortal.saveNode(root, null);
+ end(true);
+
+ begin();
+ //Move node --> change URI
+ foo.addChild(bar);
+ assertEquals("foo/bar", bar.getURI());
+
+ //Rename node --> URI should be changed too
+ bar.setName("bar2");
+ assertEquals("foo/bar2", bar.getURI());
+
+ userPortal.saveNode(bar, null);
+ end(true);
+
+ begin();
+ UserNode root2 = userPortal.getNode(navigation, Scope.ALL, null, null);
+ UserNode foo2 = root2.getChild("foo");
+ foo2.setName("foo2");
+
+ UserNode bar2 = foo2.getChild("bar2");
+ root2.addChild(bar2);
+
+ userPortal.saveNode(bar2, null);
+ end(true);
+
+ begin();
+
+ //Changes from other session : foo has been renamed, and bar has been moved
+ userPortal.updateNode(root, Scope.ALL, null);
+ assertEquals("foo2", foo.getURI());
+ assertEquals("bar2", bar.getURI());
+ }
+ }.execute("root");
+ }
+
public void testNodeExtension()
{
new UnitTest()
Added: portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>30000</int></field>
+ <field name="liveTime"><long>60000</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.listener.ListenerService</key>
+ <type>org.exoplatform.services.listener.ListenerService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.commons.chromattic.ChromatticManager</key>
+ <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.pom.config.POMSessionManager</key>
+ <type>org.exoplatform.portal.pom.config.POMSessionManager</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.pom.data.ModelDataStorage</key>
+ <type>org.exoplatform.portal.pom.config.POMDataStorage</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.DataStorage</key>
+ <type>org.exoplatform.portal.config.DataStorageImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
+ <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+ <value-param>
+ <name>super.user</name>
+ <value>root</value>
+ </value-param>
+ <value-param>
+ <name>guests.group</name>
+ <value>/platform/guests</value>
+ </value-param>
+ <value-param>
+ <name>navigation.creator.membership.type</name>
+ <value>manager</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.mop.navigation.NavigationService</key>
+ <type>org.exoplatform.portal.mop.navigation.NavigationServiceWrapper</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.mop.description.DescriptionService</key>
+ <type>org.exoplatform.portal.mop.description.DescriptionServiceImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.UserPortalConfigService</key>
+ <type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="gtn" value="http://www.gatein.org/jcr/gatein/1.0/"/>
+ <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <value>jar:/conf/gatein-nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/test-mop-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.portal.pom.config.MOPChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>mop</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-test</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+
+ <!-- The MOP node types -->
+ <value>org.gatein.mop.core.api.workspace.WorkspaceImpl</value>
+ <value>org.gatein.mop.core.api.workspace.UIContainerImpl</value>
+ <value>org.gatein.mop.core.api.workspace.UIWindowImpl</value>
+ <value>org.gatein.mop.core.api.workspace.UIBodyImpl</value>
+ <value>org.gatein.mop.core.api.workspace.PageImpl</value>
+ <value>org.gatein.mop.core.api.workspace.PageContainer</value>
+ <value>org.gatein.mop.core.api.workspace.NavigationImpl</value>
+ <value>org.gatein.mop.core.api.workspace.NavigationContainer</value>
+ <value>org.gatein.mop.core.api.workspace.PageLinkImpl</value>
+ <value>org.gatein.mop.core.api.workspace.URLLinkImpl</value>
+ <value>org.gatein.mop.core.api.workspace.PortalSiteContainer</value>
+ <value>org.gatein.mop.core.api.workspace.PortalSite</value>
+ <value>org.gatein.mop.core.api.workspace.GroupSiteContainer</value>
+ <value>org.gatein.mop.core.api.workspace.GroupSite</value>
+ <value>org.gatein.mop.core.api.workspace.UserSiteContainer</value>
+ <value>org.gatein.mop.core.api.workspace.UserSite</value>
+ <value>org.gatein.mop.core.api.workspace.TemplatizedImpl</value>
+ <value>org.gatein.mop.core.api.AttributesImpl</value>
+ <value>org.gatein.mop.core.api.Attribute</value>
+ <value>org.gatein.mop.core.api.PathAttribute</value>
+ <value>org.gatein.mop.core.api.StringAttribute</value>
+ <value>org.gatein.mop.core.api.BooleanAttribute</value>
+ <value>org.gatein.mop.core.api.IntegerAttribute</value>
+ <value>org.gatein.mop.core.api.DateAttribute</value>
+ <value>org.gatein.mop.core.api.workspace.content.CustomizationContainer</value>
+ <value>org.gatein.mop.core.api.workspace.content.ContextTypeContainer</value>
+ <value>org.gatein.mop.core.api.workspace.content.ContextType</value>
+ <value>org.gatein.mop.core.api.workspace.content.ContextSpecialization</value>
+ <value>org.gatein.mop.core.api.workspace.content.WorkspaceClone</value>
+ <value>org.gatein.mop.core.api.workspace.content.WorkspaceSpecialization</value>
+
+ <!-- GateIn node types -->
+ <value>org.exoplatform.portal.pom.spi.portlet.PortletState</value>
+ <value>org.exoplatform.portal.pom.spi.portlet.PreferenceState</value>
+ <value>org.exoplatform.portal.pom.spi.gadget.GadgetState</value>
+ <value>org.exoplatform.portal.pom.spi.wsrp.WSRPState</value>
+ <value>org.exoplatform.portal.mop.ProtectedResource</value>
+ <value>org.exoplatform.portal.mop.Described</value>
+ <value>org.exoplatform.portal.mop.Visible</value>
+ <value>org.exoplatform.portal.mop.i18n.I18Nized</value>
+ <value>org.exoplatform.portal.mop.i18n.LanguageSpace</value>
+ <value>org.exoplatform.portal.mop.i18n.Language</value>
+ <value>org.exoplatform.portal.mop.importer.Imported</value>
+
+ <!-- For the unit test purpose -->
+ <value>org.exoplatform.portal.config.SampleMixin</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig">
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
+ <field name="groupId"><string>/platform/users</string></field>
+ <field name="membership"><string>member</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="ignoredUser">
+ <collection type="java.util.HashSet">
+ <value><string>root</string></value>
+ <value><string>john</string></value>
+ <value><string>mary</string></value>
+ <value><string>demo</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>user.portal.config.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.portal.config.UserPortalConfigListener</type>
+ </component-plugin>
+ <component-plugin>
+ <name>group.portal.config.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.portal.config.GroupPortalConfigListener</type>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Deleted: portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration1.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration1.xml 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration1.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,263 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <key>org.exoplatform.services.cache.CacheService</key>
- <jmx-name>cache:type=CacheService</jmx-name>
- <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
- <init-params>
- <object-param>
- <name>cache.config.default</name>
- <description>The default cache configuration</description>
- <object type="org.exoplatform.services.cache.ExoCacheConfig">
- <field name="name"><string>default</string></field>
- <field name="maxSize"><int>30000</int></field>
- <field name="liveTime"><long>60000</long></field>
- <field name="distributed"><boolean>false</boolean></field>
- <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
- </object>
- </object-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.security.Authenticator</key>
- <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.listener.ListenerService</key>
- <type>org.exoplatform.services.listener.ListenerService</type>
- </component>
-
- <component>
- <key>org.exoplatform.commons.chromattic.ChromatticManager</key>
- <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
- </component>
-
- <component>
- <key>org.exoplatform.portal.pom.config.POMSessionManager</key>
- <type>org.exoplatform.portal.pom.config.POMSessionManager</type>
- </component>
-
- <component>
- <key>org.exoplatform.portal.pom.data.ModelDataStorage</key>
- <type>org.exoplatform.portal.pom.config.POMDataStorage</type>
- </component>
-
- <component>
- <key>org.exoplatform.portal.config.DataStorage</key>
- <type>org.exoplatform.portal.config.DataStorageImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.ext.distribution.DataDistributionManager</key>
- <type>org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionManagerImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
- <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.portal.config.UserACL</key>
- <type>org.exoplatform.portal.config.UserACL</type>
- <init-params>
- <value-param>
- <name>super.user</name>
- <description>administrator</description>
- <value>root</value>
- </value-param>
- <value-param>
- <name>guests.group</name>
- <description>guests group</description>
- <value>/platform/guests</value>
- </value-param>
- <value-param>
- <name>navigation.creator.membership.type</name>
- <description>specific membership type have full permission with group navigation</description>
- <value>manager</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.portal.mop.navigation.NavigationService</key>
- <type>org.exoplatform.portal.mop.navigation.NavigationServiceWrapper</type>
- </component>
-
- <component>
- <key>org.exoplatform.portal.mop.description.DescriptionService</key>
- <type>org.exoplatform.portal.mop.description.DescriptionServiceImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.portal.config.UserPortalConfigService</key>
- <type>org.exoplatform.portal.config.UserPortalConfigService</type>
- </component>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="gtn" value="http://www.gatein.org/jcr/gatein/1.0/"/>
- <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/gatein-nodetypes.xml</value>
- <value>jar:/conf/mop-nodetypes.xml</value>
- <value>jar:/conf/content-nodetypes.xml</value>
- <value>jar:/conf/test-mop-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <external-component-plugins>
- <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
- <component-plugin>
- <name>chromattic</name>
- <set-method>addLifeCycle</set-method>
- <type>org.exoplatform.portal.pom.config.MOPChromatticLifeCycle</type>
- <init-params>
- <value-param>
- <name>domain-name</name>
- <value>mop</value>
- </value-param>
- <value-param>
- <name>workspace-name</name>
- <value>portal-test</value>
- </value-param>
- <values-param>
- <name>entities</name>
- <value>org.gatein.mop.core.api.workspace.WorkspaceImpl</value>
- <value>org.gatein.mop.core.api.workspace.UIContainerImpl</value>
- <value>org.gatein.mop.core.api.workspace.UIWindowImpl</value>
- <value>org.gatein.mop.core.api.workspace.UIBodyImpl</value>
- <value>org.gatein.mop.core.api.workspace.PageImpl</value>
- <value>org.gatein.mop.core.api.workspace.PageContainer</value>
- <value>org.gatein.mop.core.api.workspace.NavigationImpl</value>
- <value>org.gatein.mop.core.api.workspace.NavigationContainer</value>
- <value>org.gatein.mop.core.api.workspace.PageLinkImpl</value>
- <value>org.gatein.mop.core.api.workspace.URLLinkImpl</value>
- <value>org.gatein.mop.core.api.workspace.PortalSiteContainer</value>
- <value>org.gatein.mop.core.api.workspace.PortalSite</value>
- <value>org.gatein.mop.core.api.workspace.GroupSiteContainer</value>
- <value>org.gatein.mop.core.api.workspace.GroupSite</value>
- <value>org.gatein.mop.core.api.workspace.UserSiteContainer</value>
- <value>org.gatein.mop.core.api.workspace.UserSite</value>
- <value>org.gatein.mop.core.api.workspace.TemplatizedImpl</value>
- <value>org.gatein.mop.core.api.AttributesImpl</value>
- <value>org.gatein.mop.core.api.Attribute</value>
- <value>org.gatein.mop.core.api.PathAttribute</value>
- <value>org.gatein.mop.core.api.StringAttribute</value>
- <value>org.gatein.mop.core.api.BooleanAttribute</value>
- <value>org.gatein.mop.core.api.IntegerAttribute</value>
- <value>org.gatein.mop.core.api.DateAttribute</value>
- <value>org.gatein.mop.core.api.workspace.content.CustomizationContainer</value>
- <value>org.gatein.mop.core.api.workspace.content.ContextTypeContainer</value>
- <value>org.gatein.mop.core.api.workspace.content.ContextType</value>
- <value>org.gatein.mop.core.api.workspace.content.ContextSpecialization</value>
- <value>org.gatein.mop.core.api.workspace.content.WorkspaceClone</value>
- <value>org.gatein.mop.core.api.workspace.content.WorkspaceSpecialization</value>
- <value>org.exoplatform.portal.pom.spi.portlet.PortletState</value>
- <value>org.exoplatform.portal.pom.spi.portlet.PreferenceState</value>
- <value>org.exoplatform.portal.pom.spi.gadget.GadgetState</value>
- <value>org.exoplatform.portal.pom.spi.wsrp.WSRPState</value>
- <value>org.exoplatform.portal.mop.ProtectedResource</value>
- <value>org.exoplatform.portal.mop.Described</value>
- <value>org.exoplatform.portal.mop.Visible</value>
- <value>org.exoplatform.portal.config.SampleMixin</value>
- <value>org.exoplatform.portal.mop.i18n.I18Nized</value>
- <value>org.exoplatform.portal.mop.i18n.LanguageSpace</value>
- <value>org.exoplatform.portal.mop.i18n.Language</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
- <component-plugin>
- <name>new.user.event.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
- <description>this listener assign group and membership to a new created user</description>
- <init-params>
- <object-param>
- <name>configuration</name>
- <description>description</description>
- <object type="org.exoplatform.services.organization.impl.NewUserConfig">
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
- <field name="groupId"><string>/platform/users</string></field>
- <field name="membership"><string>member</string></field>
- </object>
- </value>
- </collection>
- </field>
- <field name="ignoredUser">
- <collection type="java.util.HashSet">
- <value><string>root</string></value>
- <value><string>john</string></value>
- <value><string>mary</string></value>
- <value><string>demo</string></value>
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>user.portal.config.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.portal.config.UserPortalConfigListener</type>
- </component-plugin>
- <component-plugin>
- <name>group.portal.config.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.portal.config.GroupPortalConfigListener</type>
- </component-plugin>
- </external-component-plugins>
-
-</configuration>
Deleted: portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration2.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration2.xml 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration2.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,441 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
- <component-plugin>
- <name>new.portal.config.user.listener</name>
- <set-method>initListener</set-method>
- <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <description>this listener init the portal configuration</description>
- <init-params>
- <value-param>
- <name>default.portal</name>
- <description>The default portal for checking db is empty or not</description>
- <value>classic</value>
- </value-param>
- <value-param>
- <name>initializing.failure.ignore</name>
- <description>In the run method, use try catch or not (value is true/false)</description>
- <value>true</value>
- </value-param>
- <value-param>
- <name>page.templates.location</name>
- <description>the path to the location that contains Page templates</description>
- <value>classpath:/portal/template/pages</value>
- </value-param>
- <object-param>
- <name>site.templates.location</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.SiteConfigTemplates">
- <field name="location">
- <string>classpath:/portal</string>
- </field>
- <field name="portalTemplates">
- <collection type="java.util.HashSet">
- <value>
- <string>classic</string>
- </value>
- <value>
- <string>test</string>
- </value>
- </collection>
- </field>
- <field name="groupTemplates">
- <collection type="java.util.HashSet">
- <value>
- <string>group</string>
- </value>
- </collection>
- </field>
- <field name="userTemplates">
- <collection type="java.util.HashSet">
- <value>
- <string>user</string>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
- <object-param>
- <name>portal.configuration</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>classic</string>
- </value>
- <value>
- <string>test</string>
- </value>
- <value>
- <string>system</string>
- </value>
- <value>
- <string>large</string>
- </value>
- <value>
- <string>extended</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>portal</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/portal</string>
- </field>
- </object>
- </object-param>
- <object-param>
- <name>group.configuration</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>platform/administrators</string>
- </value>
- <value>
- <string>platform/users</string>
- </value>
- <value>
- <string>platform/guests</string>
- </value>
- <value>
- <string>platform/test/legacy</string>
- </value>
- <value>
- <string>platform/test/normalized</string>
- </value>
- <value>
- <string>organization/management/executive-board</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>group</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/portal</string>
- </field>
- </object>
- </object-param>
- <object-param>
- <name>user.configuration</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>root</string>
- </value>
- <value>
- <string>john</string>
- </value>
- <value>
- <string>mary</string>
- </value>
- <value>
- <string>demo</string>
- </value>
- <value>
- <string>overwritelayout</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>user</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/portal</string>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
- <component-plugin>
- <name>init.service.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
- <description>this listener populate organization data for the first launch</description>
- <init-params>
- <value-param>
- <name>checkDatabaseAlgorithm</name>
- <description>check database</description>
- <value>entry</value>
- </value-param>
- <value-param>
- <name>printInformation</name>
- <description>Print information init database</description>
- <value>true</value>
- </value-param>
- <object-param>
- <name>configuration</name>
- <description>description</description>
- <object type="org.exoplatform.services.organization.OrganizationConfig">
- <field name="membershipType">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
- <field name="type"><string>manager</string></field>
- <field name="description"><string>manager membership type</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
- <field name="type"><string>member</string></field>
- <field name="description"><string>member membership type</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
- <field name="type"><string>validator</string></field>
- <field name="description"><string>validator membership type</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>platform</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /platform group</string></field>
- <field name="label"><string>Platform</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>administrators</string></field>
- <field name="parentId"><string>/platform</string></field>
- <field name="description"><string>the /platform/administrators group</string></field>
- <field name="label"><string>Administrators</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>users</string></field>
- <field name="parentId"><string>/platform</string></field>
- <field name="description"><string>the /platform/users group</string></field>
- <field name="label"><string>Users</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>guests</string></field>
- <field name="parentId"><string>/platform</string></field>
- <field name="description"><string>the /platform/guests group</string></field>
- <field name="label"><string>Guests</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>organization</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the organization group</string></field>
- <field name="label"><string>Organization</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>management</string></field>
- <field name="parentId"><string>/organization</string></field>
- <field name="description"><string>the /organization/management group</string></field>
- <field name="label"><string>Management</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>executive-board</string></field>
- <field name="parentId"><string>/organization/management</string></field>
- <field name="description"><string>the /organization/management/executive-board group</string></field>
- <field name="label"><string>Executive Board</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>human-resources</string></field>
- <field name="parentId"><string>/organization/management</string></field>
- <field name="description"><string>the /organization/management/human-resource group</string></field>
- <field name="label"><string>Human Resources</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>communication</string></field>
- <field name="parentId"><string>/organization</string></field>
- <field name="description"><string>the /organization/communication group</string></field>
- <field name="label"><string>Communication</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>marketing</string></field>
- <field name="parentId"><string>/organization/communication</string></field>
- <field name="description"><string>the /organization/communication/marketing group</string></field>
- <field name="label"><string>Marketing</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>press-and-media</string></field>
- <field name="parentId"><string>/organization/communication</string></field>
- <field name="description"><string>the /organization/communication/press-and-media group</string></field>
- <field name="label"><string>Press and Media</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>operations</string></field>
- <field name="parentId"><string>/organization</string></field>
- <field name="description"><string>the /organization/operations and media group</string></field>
- <field name="label"><string>Operations</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>sales</string></field>
- <field name="parentId"><string>/organization/operations</string></field>
- <field name="description"><string>the /organization/operations/sales group</string></field>
- <field name="label"><string>Sales</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>finances</string></field>
- <field name="parentId"><string>/organization/operations</string></field>
- <field name="description"><string>the /organization/operations/finances group</string></field>
- <field name="label"><string>Finances</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>customers</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /customers group</string></field>
- <field name="label"><string>Customers</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>partners</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /partners group</string></field>
- <field name="label"><string>Partners</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="user">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>root</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>Root</string></field>
- <field name="lastName"><string>Root</string></field>
- <field name="email"><string>root@localhost</string></field>
- <field name="groups">
- <string>
- manager:/platform/administrators,member:/platform/users,
- member:/organization/management/executive-board
- </string>
- </field>
- </object>
- </value>
-
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>john</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>John</string></field>
- <field name="lastName"><string>Anthony</string></field>
- <field name="email"><string>john@localhost</string></field>
- <field name="groups">
- <string>
- member:/platform/administrators,member:/platform/users,
- manager:/organization/management/executive-board
- </string>
- </field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>mary</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>Mary</string></field>
- <field name="lastName"><string>Kelly</string></field>
- <field name="email"><string>mary@localhost</string></field>
- <field name="groups">
- <string>member:/platform/users</string>
- </field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>demo</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>Demo</string></field>
- <field name="lastName"><string>gtn</string></field>
- <field name="email"><string>demo@localhost</string></field>
- <field name="groups">
- <string>member:/platform/guests,member:/platform/users</string>
- </field>
- </object>
- </value>
-
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>overwritelayout</string></field>
- <field name="password"><string>whatever</string></field>
- <field name="firstName"><string>whatever</string></field>
- <field name="lastName"><string>whatever</string></field>
- <field name="email"><string>whatever@localhost</string></field>
- <field name="groups">
- <string>member:/platform/guests</string>
- </field>
- </object>
- </value>
-
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
-
- </external-component-plugins>
-
-</configuration>
Modified: portal/trunk/component/portal/src/test/resources/conf/test-mop-nodetypes.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/conf/test-mop-nodetypes.xml 2011-07-22 02:50:13 UTC (rev 6911)
+++ portal/trunk/component/portal/src/test/resources/conf/test-mop-nodetypes.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -1,5 +1,5 @@
<!--
- ~ Copyright (C) 2009 eXo Platform SAS.
+ ~ Copyright (C) 2011 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
Added: portal/trunk/component/portal/src/test/resources/jibx/fragment-navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/jibx/fragment-navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/jibx/fragment-navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+ <parent-uri>foo</parent-uri>
+ <node>
+ <name>bar</name>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport1-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>override</name>
+ <value>${override.1}</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal.1}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode.1}</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport2-configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <priority>1</priority>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>override</name>
+ <value>${override_2}</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal_2}-conf</string>
+ </field>
+ <field name="importMode">
+ <string>${import.mode_2}</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>initializing.failure.ignore</name>
+ <value>true</value>
+ </value-param>
+ <value-param>
+ <name>page.templates.location</name>
+ <value>classpath:/org/exoplatform/portal/config/conf/template/pages</value>
+ </value-param>
+ <object-param>
+ <name>site.templates.location</name>
+ <object type="org.exoplatform.portal.config.SiteConfigTemplates">
+ <field name="location">
+ <string>classpath:/org/exoplatform/portal/config/conf</string>
+ </field>
+ <field name="portalTemplates">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ <value>
+ <string>test</string>
+ </value>
+ </collection>
+ </field>
+ <field name="groupTemplates">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>group</string>
+ </value>
+ </collection>
+ </field>
+ <field name="userTemplates">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>user</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ <value>
+ <string>test</string>
+ </value>
+ <value>
+ <string>system</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/conf</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>platform/administrators</string>
+ </value>
+ <value>
+ <string>platform/users</string>
+ </value>
+ <value>
+ <string>platform/guests</string>
+ </value>
+ <value>
+ <string>test/legacy</string>
+ </value>
+ <value>
+ <string>test/normalized</string>
+ </value>
+ <value>
+ <string>organization/management/executive-board</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/conf</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>overwritelayout</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>user</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/conf</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <value>entry</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>manager</string></field>
+ <field name="description"><string>manager membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>member</string></field>
+ <field name="description"><string>member membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>validator</string></field>
+ <field name="description"><string>validator membership type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>platform</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /platform group</string></field>
+ <field name="label"><string>Platform</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>administrators</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/administrators group</string></field>
+ <field name="label"><string>Administrators</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>users</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/users group</string></field>
+ <field name="label"><string>Users</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>guests</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/guests group</string></field>
+ <field name="label"><string>Guests</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>organization</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the organization group</string></field>
+ <field name="label"><string>Organization</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>management</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/management group</string></field>
+ <field name="label"><string>Management</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>executive-board</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/executive-board group</string></field>
+ <field name="label"><string>Executive Board</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>root</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Root</string></field>
+ <field name="lastName"><string>Root</string></field>
+ <field name="email"><string>root@localhost</string></field>
+ <field name="groups">
+ <string>
+ manager:/platform/administrators,member:/platform/users,
+ member:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>john</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>John</string></field>
+ <field name="lastName"><string>Anthony</string></field>
+ <field name="email"><string>john@localhost</string></field>
+ <field name="groups">
+ <string>
+ member:/platform/administrators,member:/platform/users,
+ manager:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>mary</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Mary</string></field>
+ <field name="lastName"><string>Kelly</string></field>
+ <field name="email"><string>mary@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ </external-component-plugins>
+
+</configuration>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>organization/management/executive-board</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <priority>5</priority>
+
+ <page-nodes>
+ <node>
+ <uri>organization</uri>
+ <name>organization</name>
+ <label>#{organization.title}</label>
+
+ <node>
+ <uri>organization/newStaff</uri>
+ <name>newStaff</name>
+ <label>#{organization.newstaff}</label>
+ <page-reference>group::organization/management/executive-board::newStaff</page-reference>
+ </node>
+
+ <node>
+ <uri>organization/management</uri>
+ <name>management</name>
+ <label>#{organization.management}</label>
+ <page-reference>group::organization/management/executive-board::management</page-reference>
+ </node>
+ </node>
+
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::organization/management/executive-board::newStaff</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <name>newStaff</name>
+ <title>New Staff</title>
+ <access-permissions>*:/organization/management/executive-board</access-permissions>
+ <edit-permission>manager:/organization/management/executive-board</edit-permission>
+
+ <application>
+ <instance-id>group#organization/management/executive-board:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Staff</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::organization/management/executive-board::management</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <name>management</name>
+ <title>Organization Management</title>
+ <access-permissions>*:/organization/management/executive-board</access-permissions>
+ <edit-permission>manager:/organization/management/executive-board</edit-permission>
+
+ <application>
+ <instance-id>group#organization/management/executive-board:/exoadmin/OrganizationPortlet/Organization</instance-id>
+ <title>Organization Management</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/organization/management/executive-board/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set />
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
+ <portal-name>platform/administrators</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <priority>2</priority>
+
+ <page-nodes>
+ <node>
+ <uri>administration</uri>
+ <name>administration</name>
+ <label>#{administration.title}</label>
+
+ <node>
+ <uri>administration/registry</uri>
+ <name>registry</name>
+ <label>#{administration.application-registry}</label>
+ <page-reference>group::platform/administrators::registry</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/newAccount</uri>
+ <name>newAccount</name>
+ <label>#{administration.newAccount}</label>
+ <page-reference>group::platform/administrators::newAccount</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/communityManagement</uri>
+ <name>communityManagement</name>
+ <label>#{administration.community-management}</label>
+ <page-reference>group::platform/administrators::communityManagement</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/pageManagement</uri>
+ <name>i18n</name>
+ <label>#{administration.pageManagement}</label>
+ <page-reference>group::platform/administrators::pageManagement</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/console</uri>
+ <name>console</name>
+ <label>#{administration.console}</label>
+ <page-reference>group::platform/administrators::console</page-reference>
+ </node>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::platform/administrators::newAccount</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>newAccount</name>
+ <title>New Account</title>
+ <access-permissions>MembershipType_1:/Group1</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::communityManagement</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>communityManagement</name>
+ <title>Community Management</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/OrganizationPortlet/Organization</instance-id>
+ <title>Community Management</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::registry</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>registry</name>
+ <title>Registry</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/ApplicationRegistryPortlet/ApplicationRegistry</instance-id>
+ <title>Application Registry</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::pageManagement</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>pageManagement</name>
+ <title>Page Management</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/PageManagementPortlet/PageManagement</instance-id>
+ <title>Page Management</title>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/administrators/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set />
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>platform/guests</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <priority>9</priority>
+
+ <page-nodes>
+ <node>
+ <uri>register</uri>
+ <name>register</name>
+ <label>#{platform.guests.register}</label>
+ <page-reference>group::platform/guests::register</page-reference>
+ </node>
+
+ <node>
+ <uri>link</uri>
+ <name>link</name>
+ <label>#{platform.guests.link}</label>
+ <page-reference>group::platform/guests::link</page-reference>
+ </node>
+
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{platform.guests.sitemap}</label>
+ <page-reference>group::platform/guests::sitemap</page-reference>
+ </node>
+
+ </page-nodes>
+
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::platform/guests::register</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>register</name>
+ <title>Register</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/guests::sitemap</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>SiteMap</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/guests::link</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>link</name>
+ <title>Link</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/web/IFramePortlet/blog</instance-id>
+ <title>Blog</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+</page-set>
+
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/guests/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <window-id>group#platform/guests:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>/platform/users</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <priority>8</priority>
+
+ <page-nodes>
+ <node>
+ <uri>dashboard</uri>
+ <name>dashboard</name>
+ <label>#{platform.users.dashboard}</label>
+ <page-reference>group::/platform/users::dashboard</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink</uri>
+ <name>mylink</name>
+ <label>#{platform.users.mylink}</label>
+
+ <node>
+ <uri>mylink/blog</uri>
+ <name>blog</name>
+ <label>#{platform.users.mylink-blog}</label>
+ <page-reference>group::/platform/users::mylink-blog</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink/google</uri>
+ <name>google</name>
+ <label>#{platform.users.mylink-google}</label>
+ <page-reference>group::/platform/users::mylink-google</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink/facebooks</uri>
+ <name>facebooks</name>
+ <label>#{platform.users.mylink-facebook}</label>
+ <page-reference>group::/platform/users::mylink-facebook</page-reference>
+ </node>
+ </node>
+
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{platform.users.sitemap}</label>
+ <page-reference>group::/platform/users::sitemap</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::/platform/users::dashboard</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>dashboard</name>
+ <title>Dashboard</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/dashboard/DashboardPortlet/Dashboard</instance-id>
+ <title>Dashboard</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::webexplorer</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::mylink-blog</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>mylink-blog</name>
+ <title>Blog</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/IFramePortlet/blog</instance-id>
+ <title>Blog</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::mylink-google</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>mylink-google</name>
+ <title>Google</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/IFramePortlet/google</instance-id>
+ <title>Google</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::mylink-facebook</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>mylink-facebook</name>
+ <title>FaceBook</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/IFramePortlet/facebook</instance-id>
+ <title>FaceBook</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::sitemap</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>SiteMap</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
+
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/platform/users/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <window-id>group#/platform/users:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <window-id>group#/platform/users:/web/IFramePortlet/google</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://www.google.com</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <window-id>group#/platform/users:/web/IFramePortlet/facebook</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://www.facebook.com</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/template/group/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/template/group/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/template/group/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_1 http://www.gatein.org/xml/ns/gatein_objects_1_1"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_1">
+ <portal-name>@owner@</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <properties>
+ <entry key="sessionAlive">onDemand</entry>
+ </properties>
+
+ <portal-layout>
+
+ <portlet-application>
+ <portlet>
+ <application-ref>web</application-ref>
+ <portlet-ref>LogoPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>url</name>
+ <value>/eXoResources/skin/sharedImages/GroupIcon.png</value>
+ <read-only>false</read-only>
+ </preference>
+ </preferences>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>false</show-info-bar>
+ </portlet-application>
+
+ <portlet-application>
+ <portlet>
+ <application-ref>web</application-ref>
+ <portlet-ref>NavigationPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>CSSClassName</name>
+ <value>GroupNavigation</value>
+ <read-only>true</read-only>
+ </preference>
+ </preferences>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>false</show-info-bar>
+ </portlet-application>
+
+ <page-body>
+ </page-body>
+
+ <portlet-application>
+ <portlet>
+ <application-ref>web</application-ref>
+ <portlet-ref>FooterPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </preferences>
+ </portlet>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>false</show-info-bar>
+ </portlet-application>
+
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>test/legacy</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <page-body> </page-body>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>test/legacy</owner-id>
+ <priority>9</priority>
+
+ <page-nodes>
+ <node>
+ <uri>register</uri>
+ <name>register</name>
+ <label>#{platform.guests.register}</label>
+ <page-reference>group::test/legacy::register</page-reference>
+ </node>
+
+ </page-nodes>
+
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<page-set>
+
+ <page>
+ <page-id>group::test/legacy::bilto</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>test/legacy</owner-id>
+ <name>register</name>
+ <title>TestTitle</title>
+ <access-permissions>*:/test/legacy</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#test/legacy:/web/IFramePortlet/blog</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
+
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/legacy/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>test/legacy</owner-id>
+ <window-id>group#test/legacy:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>/test/normalized</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <page-body> </page-body>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>/test/normalized</owner-id>
+ <priority>9</priority>
+
+ <page-nodes>
+ <node>
+ <uri>register</uri>
+ <name>register</name>
+ <label>#{platform.guests.register}</label>
+ <page-reference>group::/test/normalized::register</page-reference>
+ </node>
+
+ </page-nodes>
+
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<page-set>
+
+ <page>
+ <page-id>group::/test/normalized::register</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/test/normalized</owner-id>
+ <name>register</name>
+ <title>TestTitle</title>
+ <access-permissions>*:/platform/normalized/legacy</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/test/normalized:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
+
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/group/test/normalized/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/test/normalized</owner-id>
+ <window-id>group#/test/normalized:/exoadmin/AccountPortlet/Account</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>
+ portal::classic::homepage
+ </page-reference>
+ </node>
+ <node>
+ <uri>webexplorer</uri>
+ <name>webexplorer</name>
+ <label>#{portal.classic.webexplorer}</label>
+ <page-reference>portal::classic::webexplorer</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>portal::classic::homepage</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>homepage</name>
+ <title>Home Page</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
+ <title>Home Page portlet</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>false</show-application-state>
+ <show-application-mode>false</show-application-mode>
+ <properties>
+ <entry key="locationX">23432</entry>
+ <entry key="locationY">343534</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <page-id>portal::classic::webexplorer</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <label>Classic</label>
+ <description>This is classic portal for testing</description>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/classic/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/HomePagePortlet/homepageportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>system</owner-id>
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>portal::classic::homepage</page-reference>
+ </node>
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{portal.classic.sitemap}</label>
+ <visibility>DISPLAYED</visibility>
+ <page-reference>portal::classic::sitemap</page-reference>
+ </node>
+ <node>
+ <uri>groupnavigation</uri>
+ <name>groupnavigation</name>
+ <label>#{portal.classic.groupnavigation}</label>
+ <visibility>SYSTEM</visibility>
+ <page-reference>portal::classic::groupnavigation</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<page-set>
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/system/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<portal-config>
+ <portal-name>system</portal-name>
+ <locale>en</locale>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <skin>test_skin</skin>
+
+ <portal-layout>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>Home</label>
+ <page-reference>portal::@owner@::sitemap</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>portal::@owner@::sitemap</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#@owner@:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>Site Map portlet</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portal-config>
+ <portal-name>@owner@</portal-name>
+ <locale>en</locale>
+ <!--<factory-id>office</factory-id>-->
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#@owner@:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#@owner@:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#@owner@:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#@owner@:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/classic/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#portalclassic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#portalclassic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#portalclassic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>uri</uri>
+ <name>name</name>
+ <label>label</label>
+ <page-reference>portal::@owner@::index</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <name>index</name>
+ <application>
+ <instance-id>portal#@owner@:/web/BannerPortlet/banner</instance-id>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portal-config>
+ <portal-name>@owner@</portal-name>
+ <locale>en</locale>
+ <access-permissions>access_permission</access-permissions>
+ <edit-permission>edit_permission</edit-permission>
+ <skin>skin</skin>
+
+ <properties>
+ <entry key="prop_key">test_prop_value</entry>
+ </properties>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#@owner@:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <page-body> </page-body>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/template/test/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#@owner@:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2000-03-21T01:33:00</start-publication-date>
+ <end-publication-date>2009-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name1</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2000-03-21T01:33:00</start-publication-date>
+ <end-publication-date>2050-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name2</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2050-03-21T01:33:00</start-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name3</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <end-publication-date>2050-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name4</name>
+ <label>node_label4</label>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>portal::test::test1</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test1</name>
+ <title>test_title</title>
+ <factory-id>test_factory_id</factory-id>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <show-max-window>true</show-max-window>
+ <container
+ template="container_1_template"
+ decorator="container_1_decorator"
+ width="container_1_width"
+ height="container_1_height">
+ <name>container_1</name>
+ <title>container_1_title</title>
+ <icon>container_1_icon</icon>
+ <access-permissions>container_1_access_permissions</access-permissions>
+ <factory-id>container_1_factory_id</factory-id>
+ <description>container_1_description</description>
+ </container>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ <application-type>application_1_type</application-type>
+ <theme>application_1_theme</theme>
+ <title>application_1_title</title>
+ <access-permissions>application_1_access_permissions</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ <description>application_1_description</description>
+ <icon>application_1_icon</icon>
+ <width>application_1_width</width>
+ <height>application_1_height</height>
+ <properties>
+ <entry key="prop_key">application_1_prop_value</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test2</name>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test3</name>
+ <application>
+ <instance-id>portal#notexisting:/web/BannerPortlet/banner2</instance-id>
+ </application>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test4</name>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <container>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <application>
+ <instance-id>portal#test:/web/FooterPortlet/footer</instance-id>
+ </application>
+ </container>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portal-config>
+ <portal-name>test</portal-name>
+ <locale>en</locale>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <skin>test_skin</skin>
+
+ <properties>
+ <entry key="prop_key">test_prop_value</entry>
+ </properties>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#test:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#test:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#test:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/portal/test/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/HomePagePortlet/homepageportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/container.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/container.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/container.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<container>
+ <name>rootName</name>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+</container>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/four-columns/container.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/four-columns/container.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/four-columns/container.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Todo</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/rssAggregator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/one-column/container.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/one-column/container.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/one-column/container.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/three-columns/container.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/three-columns/container.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/three-columns/container.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/rssAggregator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/two-columns/container.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/two-columns/container.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/containers/two-columns/container.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <portlet-application>
+ <portlet>
+ <application-ref>dashboard</application-ref>
+ <portlet-ref>DashboardPortlet</portlet-ref>
+ </portlet>
+ <title>Dashboard</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </portlet-application>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/dashboard/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/empty/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/one-row-two-columns/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-columns/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-rows-two-columns/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <title></title>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UITabContainer.gtmpl">
+ <factory-id>TabContainer</factory-id>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+ </container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/three-tabs/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-columns-one-row/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-rows/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set/>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/page.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/page.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/page.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <title></title>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UITabContainer.gtmpl">
+ <factory-id>TabContainer</factory-id>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <portlet-application>
+ <portlet>
+ <application-ref>exoadmin</application-ref>
+ <portlet-ref>AccountPortlet</portlet-ref>
+ </portlet>
+ <title>New Account</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </portlet-application>
+ </container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <portlet-application>
+ <portlet>
+ <application-ref>web</application-ref>
+ <portlet-ref>SiteMapPortlet</portlet-ref>
+ </portlet>
+ <title>Sitemap Portlet</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </portlet-application>
+ </container>
+ </container>
+ </container>
+</page>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/template/pages/two-tabs/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <window-id>/exoadmin/AccountPortlet</window-id>
+ <preference>
+ <name>NewAccountPreference</name>
+ <value>Preference value for Account portlet</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <window-id>/web/SiteMapPortlet</window-id>
+ <preference>
+ <name>SitemapPreference</name>
+ <value>Preference value for Sitemap portlet</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
\ No newline at end of file
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/overwritelayout/user.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/overwritelayout/user.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/overwritelayout/user.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>root</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <page-body> </page-body>
+
+ <portlet-application>
+ <portlet>
+ <application-ref>overwrite_application_ref</application-ref>
+ <portlet-ref>overwrite_portlet_ref</portlet-ref>
+ </portlet>
+ </portlet-application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>user</owner-type>
+ <owner-id>@owner@</owner-id>
+ <priority>3</priority>
+
+ <page-nodes />
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set />
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/user.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/user.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/conf/user/template/user/user.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>@owner@</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+
+ <page-body/>
+ <portlet-application>
+ <portlet>
+ <application-ref>foo</application-ref>
+ <portlet-ref>bar</portlet-ref>
+ <preferences>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </preferences>
+ </portlet>
+ <show-info-bar>false</show-info-bar>
+ </portlet-application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment1-conf/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <name>foo</name>
+ <icon>foo_icon</icon>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/fragment2-conf/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+ <parent-uri>foo</parent-uri>
+ <node>
+ <name>bar</name>
+ <icon>bar_icon</icon>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation1-conf/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <name>foo</name>
+ <icon>foo_icon_1</icon>
+ <node>
+ <name>juu</name>
+ <icon>juu_icon</icon>
+ </node>
+ </node>
+ <node>
+ <name>daa</name>
+ <icon>daa_icon</icon>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/navigation2-conf/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <name>foo</name>
+ <icon>foo_icon_2</icon>
+ </node>
+ <node>
+ <name>bar</name>
+ <icon>bar_icon</icon>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>initializing.failure.ignore</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ <value>
+ <string>large</string>
+ </value>
+ <value>
+ <string>test</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/mop/navigation</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>
+ portal::classic::homepage
+ </page-reference>
+ </node>
+ <node>
+ <uri>webexplorer</uri>
+ <name>webexplorer</name>
+ <label>#{portal.classic.webexplorer}</label>
+ <page-reference>portal::classic::webexplorer</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/classic/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<page-set>
+
+ <page>
+ <page-id>portal::classic::homepage</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>homepage</name>
+ <title>Home Page</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
+ <title>Home Page portlet</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>false</show-application-state>
+ <show-application-mode>false</show-application-mode>
+ <properties>
+ <entry key="locationX">23432</entry>
+ <entry key="locationY">343534</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <page-id>portal::classic::webexplorer</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/large/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/large/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/large/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>large</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>a</uri>
+ <name>a</name>
+ <label>A</label>
+ <node>
+ <uri>c</uri>
+ <name>c</name>
+ <label>C</label>
+ </node>
+ </node>
+ <node>
+ <uri>b</uri>
+ <name>b</name>
+ <label>B</label>
+ <node>
+ <uri>d</uri>
+ <name>d</name>
+ <label>D</label>
+ <node>
+ <uri>e</uri>
+ <name>e</name>
+ <label>E</label>
+ </node>
+ </node>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2000-03-21T01:33:00</start-publication-date>
+ <end-publication-date>2009-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name1</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2000-03-21T01:33:00</start-publication-date>
+ <end-publication-date>2050-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name2</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2050-03-21T01:33:00</start-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name3</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <end-publication-date>2050-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name4</name>
+ <label>node_label4</label>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/navigation/portal/test/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<page-set>
+
+ <page>
+ <page-id>portal::test::test1</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test1</name>
+ <title>test_title</title>
+ <factory-id>test_factory_id</factory-id>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <show-max-window>true</show-max-window>
+ <container
+ template="container_1_template"
+ decorator="container_1_decorator"
+ width="container_1_width"
+ height="container_1_height">
+ <name>container_1</name>
+ <title>container_1_title</title>
+ <icon>container_1_icon</icon>
+ <access-permissions>container_1_access_permissions</access-permissions>
+ <factory-id>container_1_factory_id</factory-id>
+ <description>container_1_description</description>
+ </container>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ <application-type>application_1_type</application-type>
+ <theme>application_1_theme</theme>
+ <title>application_1_title</title>
+ <access-permissions>application_1_access_permissions</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ <description>application_1_description</description>
+ <icon>application_1_icon</icon>
+ <width>application_1_width</width>
+ <height>application_1_height</height>
+ <properties>
+ <entry key="prop_key">application_1_prop_value</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test2</name>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test3</name>
+ <application>
+ <instance-id>portal#notexisting:/web/BannerPortlet/banner2</instance-id>
+ </application>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test4</name>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <container>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <application>
+ <instance-id>portal#test:/web/FooterPortlet/footer</instance-id>
+ </application>
+ </container>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/configuration.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>initializing.failure.ignore</name>
+ <value>true</value>
+ </value-param>
+ <value-param>
+ <name>page.templates.location</name>
+ <value>classpath:/portal/template/pages</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ <value>
+ <string>test</string>
+ </value>
+ <value>
+ <string>system</string>
+ </value>
+ <value>
+ <string>extended</string>
+ </value>
+ <value>
+ <string>limited</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/mop/user</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>platform/administrators</string>
+ </value>
+ <value>
+ <string>platform/users</string>
+ </value>
+ <value>
+ <string>platform/guests</string>
+ </value>
+ <value>
+ <string>organization/management/executive-board</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/mop/user</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <value>entry</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>manager</string></field>
+ <field name="description"><string>manager membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>member</string></field>
+ <field name="description"><string>member membership type</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>validator</string></field>
+ <field name="description"><string>validator membership type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>platform</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /platform group</string></field>
+ <field name="label"><string>Platform</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>administrators</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/administrators group</string></field>
+ <field name="label"><string>Administrators</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>users</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/users group</string></field>
+ <field name="label"><string>Users</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>guests</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/guests group</string></field>
+ <field name="label"><string>Guests</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>organization</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the organization group</string></field>
+ <field name="label"><string>Organization</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>management</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/management group</string></field>
+ <field name="label"><string>Management</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>executive-board</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/executive-board group</string></field>
+ <field name="label"><string>Executive Board</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>root</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Root</string></field>
+ <field name="lastName"><string>Root</string></field>
+ <field name="email"><string>root@localhost</string></field>
+ <field name="groups">
+ <string>
+ manager:/platform/administrators,member:/platform/users,
+ member:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>john</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>John</string></field>
+ <field name="lastName"><string>Anthony</string></field>
+ <field name="email"><string>john@localhost</string></field>
+ <field name="groups">
+ <string>
+ member:/platform/administrators,member:/platform/users,
+ manager:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>demo</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Demo</string></field>
+ <field name="lastName"><string>gtn</string></field>
+ <field name="email"><string>demo@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/guests,member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ </external-component-plugins>
+
+</configuration>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>organization/management/executive-board</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <priority>5</priority>
+
+ <page-nodes>
+ <node>
+ <uri>organization</uri>
+ <name>organization</name>
+ <label>#{organization.title}</label>
+
+ <node>
+ <uri>organization/newStaff</uri>
+ <name>newStaff</name>
+ <label>#{organization.newstaff}</label>
+ <page-reference>group::organization/management/executive-board::newStaff</page-reference>
+ </node>
+
+ <node>
+ <uri>organization/management</uri>
+ <name>management</name>
+ <label>#{organization.management}</label>
+ <page-reference>group::organization/management/executive-board::management</page-reference>
+ </node>
+ </node>
+
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::organization/management/executive-board::newStaff</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <name>newStaff</name>
+ <title>New Staff</title>
+ <access-permissions>*:/organization/management/executive-board</access-permissions>
+ <edit-permission>manager:/organization/management/executive-board</edit-permission>
+
+ <application>
+ <instance-id>group#organization/management/executive-board:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Staff</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::organization/management/executive-board::management</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <name>management</name>
+ <title>Organization Management</title>
+ <access-permissions>*:/organization/management/executive-board</access-permissions>
+ <edit-permission>manager:/organization/management/executive-board</edit-permission>
+
+ <application>
+ <instance-id>group#organization/management/executive-board:/exoadmin/OrganizationPortlet/Organization</instance-id>
+ <title>Organization Management</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/organization/management/executive-board/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set />
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_1 http://www.gatein.org/xml/ns/gatein_objects_1_1"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_1">
+ <portal-name>platform/administrators</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <priority>2</priority>
+
+ <page-nodes>
+ <node>
+ <uri>administration</uri>
+ <name>administration</name>
+ <label>#{administration.title}</label>
+
+ <node>
+ <uri>administration/registry</uri>
+ <name>registry</name>
+ <label>#{administration.application-registry}</label>
+ <page-reference>group::platform/administrators::registry</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/newAccount</uri>
+ <name>newAccount</name>
+ <label>#{administration.newAccount}</label>
+ <page-reference>group::platform/administrators::newAccount</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/communityManagement</uri>
+ <name>communityManagement</name>
+ <label>#{administration.community-management}</label>
+ <page-reference>group::platform/administrators::communityManagement</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/pageManagement</uri>
+ <name>i18n</name>
+ <label>#{administration.pageManagement}</label>
+ <page-reference>group::platform/administrators::pageManagement</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/console</uri>
+ <name>console</name>
+ <label>#{administration.console}</label>
+ <page-reference>group::platform/administrators::console</page-reference>
+ </node>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::platform/administrators::newAccount</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>newAccount</name>
+ <title>New Account</title>
+ <access-permissions>MembershipType_1:/Group1</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::communityManagement</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>communityManagement</name>
+ <title>Community Management</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/OrganizationPortlet/Organization</instance-id>
+ <title>Community Management</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::registry</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>registry</name>
+ <title>Registry</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/ApplicationRegistryPortlet/ApplicationRegistry</instance-id>
+ <title>Application Registry</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::pageManagement</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>pageManagement</name>
+ <title>Page Management</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/PageManagementPortlet/PageManagement</instance-id>
+ <title>Page Management</title>
+ <access-permissions>Everyone</access-permissions>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/administrators/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set />
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>platform/guests</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <priority>9</priority>
+
+ <page-nodes>
+ <node>
+ <uri>register</uri>
+ <name>register</name>
+ <label>#{platform.guests.register}</label>
+ <page-reference>group::platform/guests::register</page-reference>
+ </node>
+
+ <node>
+ <uri>link</uri>
+ <name>link</name>
+ <label>#{platform.guests.link}</label>
+ <page-reference>group::platform/guests::link</page-reference>
+ </node>
+
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{platform.guests.sitemap}</label>
+ <page-reference>group::platform/guests::sitemap</page-reference>
+ </node>
+
+ </page-nodes>
+
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::platform/guests::register</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>register</name>
+ <title>Register</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/guests::sitemap</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>SiteMap</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/guests::link</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>link</name>
+ <title>Link</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/web/IFramePortlet/blog</instance-id>
+ <title>Blog</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+</page-set>
+
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/guests/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <window-id>group#platform/guests:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/group.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/group.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/group.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>/platform/users</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <priority>8</priority>
+
+ <page-nodes>
+ <node>
+ <uri>dashboard</uri>
+ <name>dashboard</name>
+ <label>#{platform.users.dashboard}</label>
+ <page-reference>group::/platform/users::dashboard</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink</uri>
+ <name>mylink</name>
+ <label>#{platform.users.mylink}</label>
+
+ <node>
+ <uri>mylink/blog</uri>
+ <name>blog</name>
+ <label>#{platform.users.mylink-blog}</label>
+ <page-reference>group::/platform/users::mylink-blog</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink/google</uri>
+ <name>google</name>
+ <label>#{platform.users.mylink-google}</label>
+ <page-reference>group::/platform/users::mylink-google</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink/facebooks</uri>
+ <name>facebooks</name>
+ <label>#{platform.users.mylink-facebook}</label>
+ <page-reference>group::/platform/users::mylink-facebook</page-reference>
+ </node>
+ </node>
+
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{platform.users.sitemap}</label>
+ <page-reference>group::/platform/users::sitemap</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>group::/platform/users::dashboard</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>dashboard</name>
+ <title>Dashboard</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/dashboard/DashboardPortlet/Dashboard</instance-id>
+ <title>Dashboard</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::webexplorer</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::mylink-blog</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>mylink-blog</name>
+ <title>Blog</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/IFramePortlet/blog</instance-id>
+ <title>Blog</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::mylink-google</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>mylink-google</name>
+ <title>Google</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/IFramePortlet/google</instance-id>
+ <title>Google</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::mylink-facebook</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>mylink-facebook</name>
+ <title>FaceBook</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/IFramePortlet/facebook</instance-id>
+ <title>FaceBook</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::/platform/users::sitemap</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#/platform/users:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>SiteMap</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
+
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/group/platform/users/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <window-id>group#/platform/users:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <window-id>group#/platform/users:/web/IFramePortlet/google</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://www.google.com</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>/platform/users</owner-id>
+ <window-id>group#/platform/users:/web/IFramePortlet/facebook</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://www.facebook.com</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>
+ portal::classic::homepage
+ </page-reference>
+ </node>
+ <node>
+ <uri>webexplorer</uri>
+ <name>webexplorer</name>
+ <label>#{portal.classic.webexplorer}</label>
+ <page-reference>portal::classic::webexplorer</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>portal::classic::homepage</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>homepage</name>
+ <title>Home Page</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
+ <title>Home Page portlet</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>false</show-application-state>
+ <show-application-mode>false</show-application-mode>
+ <properties>
+ <entry key="locationX">23432</entry>
+ <entry key="locationY">343534</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <page-id>portal::classic::webexplorer</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <label>Classic</label>
+ <description>This is classic portal for testing</description>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/classic/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/HomePagePortlet/homepageportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <uri>foo</uri>
+ <name>foo</name>
+ <label>foo_label</label>
+ </node>
+ <node>
+ <uri>bar</uri>
+ <name>bar</name>
+ <label xml:lang="en">bar_label_en</label>
+ <label xml:lang="fr">bar_label_fr</label>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/extended/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<portal-config>
+ <portal-name>extended</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <portal-layout>
+ </portal-layout>
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
+ <priority>1</priority>
+ <page-nodes>
+
+ <!-- Node with /platform/administrator permission -->
+ <node>
+ <uri>foo</uri>
+ <name>foo</name>
+ <page-reference>portal::limited::foo</page-reference>
+ </node>
+
+ <!-- Node with /platform/user permission -->
+ <node>
+ <uri>bar</uri>
+ <name>bar</name>
+ <page-reference>portal::limited::bar</page-reference>
+ </node>
+
+ <!-- Node with everyone permission -->
+ <node>
+ <uri>bit</uri>
+ <name>bit</name>
+ <page-reference>portal::limited::bit</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>limited</owner-id>
+ <name>foo</name>
+ <access-permissions>*:/platform/administrators</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>limited</owner-id>
+ <name>bar</name>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>limited</owner-id>
+ <name>bit</name>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ </page>
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/limited/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2011 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.
+
+-->
+
+<portal-config>
+ <portal-name>limited</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <portal-layout>
+ </portal-layout>
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>system</owner-id>
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>portal::classic::homepage</page-reference>
+ </node>
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{portal.classic.sitemap}</label>
+ <visibility>DISPLAYED</visibility>
+ <page-reference>portal::classic::sitemap</page-reference>
+ </node>
+ <node>
+ <uri>groupnavigation</uri>
+ <name>groupnavigation</name>
+ <label>#{portal.classic.groupnavigation}</label>
+ <visibility>SYSTEM</visibility>
+ <page-reference>portal::classic::groupnavigation</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<page-set>
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/system/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<portal-config>
+ <portal-name>system</portal-name>
+ <locale>en</locale>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <skin>test_skin</skin>
+
+ <portal-layout>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/navigation.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/navigation.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/navigation.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 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.
+ -->
+
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2000-03-21T01:33:00</start-publication-date>
+ <end-publication-date>2009-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name1</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2000-03-21T01:33:00</start-publication-date>
+ <end-publication-date>2050-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name2</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <start-publication-date>2050-03-21T01:33:00</start-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name3</name>
+ <label>node_label</label>
+ <icon>node_icon</icon>
+ <end-publication-date>2050-03-21T01:33:00</end-publication-date>
+ <visibility>TEMPORAL</visibility>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ <node>
+ <uri>node_uri</uri>
+ <name>node_name4</name>
+ <label>node_label4</label>
+ <page-reference>portal::test::test1</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/pages.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/pages.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/pages.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<page-set>
+
+ <page>
+ <page-id>portal::test::test1</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test1</name>
+ <title>test_title</title>
+ <factory-id>test_factory_id</factory-id>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <show-max-window>true</show-max-window>
+ <container
+ template="container_1_template"
+ decorator="container_1_decorator"
+ width="container_1_width"
+ height="container_1_height">
+ <name>container_1</name>
+ <title>container_1_title</title>
+ <icon>container_1_icon</icon>
+ <access-permissions>container_1_access_permissions</access-permissions>
+ <factory-id>container_1_factory_id</factory-id>
+ <description>container_1_description</description>
+ </container>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ <application-type>application_1_type</application-type>
+ <theme>application_1_theme</theme>
+ <title>application_1_title</title>
+ <access-permissions>application_1_access_permissions</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ <description>application_1_description</description>
+ <icon>application_1_icon</icon>
+ <width>application_1_width</width>
+ <height>application_1_height</height>
+ <properties>
+ <entry key="prop_key">application_1_prop_value</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test2</name>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test3</name>
+ <application>
+ <instance-id>portal#notexisting:/web/BannerPortlet/banner2</instance-id>
+ </application>
+ </page>
+
+ <page>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <name>test4</name>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <container>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ </application>
+ <application>
+ <instance-id>portal#test:/web/FooterPortlet/footer</instance-id>
+ </application>
+ </container>
+ </page>
+
+</page-set>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portal.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portal.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portal.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portal-config>
+ <portal-name>test</portal-name>
+ <locale>en</locale>
+ <access-permissions>test_access_permissions</access-permissions>
+ <edit-permission>test_edit_permission</edit-permission>
+ <skin>test_skin</skin>
+
+ <properties>
+ <entry key="prop_key">test_prop_value</entry>
+ </properties>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#test:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#test:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#test:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#test:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portlet-preferences.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portlet-preferences.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/mop/user/portal/test/portlet-preferences.xml 2011-07-22 03:13:14 UTC (rev 6912)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>test</owner-id>
+ <window-id>portal#test:/web/HomePagePortlet/homepageportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
13 years, 5 months