gatein SVN: r7138 - in portal/branches/api: component/api-impl and 9 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-15 16:55:43 -0400 (Mon, 15 Aug 2011)
New Revision: 7138
Added:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/GateInTypesResolver.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
Modified:
portal/branches/api/component/api-impl/pom.xml
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/IdentifiableImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/AbstractPortlet.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/content/ManagedContentImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/PortletImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/WSRPImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationContext.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationId.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/PageImpl.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
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableIdentifiableCollection.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java
portal/branches/api/examples/portlets/api/src/main/java/org/gatein/portal/samples/api/NavigationPortlet.java
portal/branches/api/pom.xml
Log:
some work on api impl
Modified: portal/branches/api/component/api-impl/pom.xml
===================================================================
--- portal/branches/api/component/api-impl/pom.xml 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/pom.xml 2011-08-15 20:55:43 UTC (rev 7138)
@@ -34,17 +34,44 @@
<artifactId>exo.portal.component.application-registry</artifactId>
</dependency>
<dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.web.controller</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.jcr</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.portal</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.identity</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.14.10</version>
<scope>test</scope>
</dependency>
-
- <!-- To be able to access Util to generate Navigation URI -->
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.webui.portal</artifactId>
- </dependency>
</dependencies>
<build>
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -59,8 +59,6 @@
import org.gatein.api.content.ManagedContent;
import org.gatein.api.content.Portlet;
import org.gatein.api.content.WSRP;
-import org.gatein.api.id.Context;
-import org.gatein.api.id.GenericContext;
import org.gatein.api.id.Id;
import org.gatein.api.id.Identifiable;
import org.gatein.api.portal.Navigation;
@@ -72,8 +70,6 @@
import org.gatein.api.util.Type;
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.federation.FederatingPortletInvoker;
-import org.gatein.portal.api.impl.id.ComplexApplicationContext;
-import org.gatein.portal.api.impl.id.ComplexApplicationId;
import org.gatein.portal.api.impl.portal.DashboardSiteImpl;
import org.gatein.portal.api.impl.portal.GroupSiteImpl;
import org.gatein.portal.api.impl.portal.PageImpl;
@@ -82,6 +78,7 @@
import org.gatein.portal.api.impl.util.AggregatedIterableIdentifiableCollection;
import org.picocontainer.Startable;
+import java.lang.reflect.UndeclaredThrowableException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
@@ -106,6 +103,7 @@
public static final Pattern INVOKER_COMPONENT_PATTERN = Pattern.compile("\\w+");
+/*
public static final Context LOCAL_PORTLET_CONTEXT = GenericContext.builder().named("Local Portlet")
.requiredComponent(APPLICATION_COMPONENT, Identifiable.class, Pattern.compile("(" + GROUP_CHARS + "|\\.)+"))
.requiredComponent(PORTLET_COMPONENT, Portlet.class, Pattern.compile("\\w+"))
@@ -142,6 +140,7 @@
.requiredComponent(NAVIGATION_COMPONENT, Navigation.class, Pattern.compile("[a-z0-9]+"))
.withDefaultSeparator("@")
.build();
+*/
private ExoContainer container;
private ModelDataStorage dataStorage;
@@ -158,8 +157,9 @@
container = context.getContainer();
}
- public static Id<? extends Content> getContentIdFrom(Application application)
+ public static Content.Id getContentIdFrom(Application application)
{
+/*
ApplicationType type = application.getType();
Class<Content> contentClass = getContentClassFor(type);
if (Gadget.class.isAssignableFrom(contentClass))
@@ -178,6 +178,8 @@
{
throw new IllegalArgumentException("Unknown application type: " + type);
}
+*/
+ throw new UnsupportedOperationException();
}
public static <T extends Content> Class<T> getContentClassFor(ApplicationType type)
@@ -224,23 +226,23 @@
}
}
- public IterableIdentifiableCollection<Portal> getPortals()
+ public IterableIdentifiableCollection<Site> getPortals()
{
try
{
begin();
final List<PortalData> portals = dataStorage.find(PORTALS).getAll();
- return new AdaptedIterableIdentifiableCollection<PortalData, Portal>(portals.size(), portals.iterator())
+ return new AdaptedIterableIdentifiableCollection<PortalData, Site>(portals.size(), portals.iterator())
{
public Portal adapt(PortalData old)
{
return new PortalImpl(old, GateInImpl.this);
}
- public boolean contains(Id<Portal> id)
+ public boolean contains(Id<Site> id)
{
- return getPortalDataFor(id) != null;
+ return getPortalDataFor((Site.Id)id) != null;
}
};
}
@@ -254,7 +256,7 @@
}
}
- public Portal getPortal(Id<Portal> portalId)
+ public Portal getPortal(Site.Id portalId)
{
PortalData portalData = getPortalDataFor(portalId);
return new PortalImpl(portalData, this);
@@ -265,13 +267,13 @@
return getPortal(siteId(Site.PORTAL, "classic")); // todo: check
}
- public IterableIdentifiableCollection<? extends Site> getSites()
+ public IterableIdentifiableCollection<Site> getSites()
{
IterableIdentifiableCollection<Site> groupSites = getGroupSites();
- IterableIdentifiableCollection<Portal> portals = getPortals();
+ IterableIdentifiableCollection<Site> portals = getPortals();
IterableIdentifiableCollection<Site> dashboards = getDashboards();
- AggregatedIterableIdentifiableCollection collection = new AggregatedIterableIdentifiableCollection();
+ AggregatedIterableIdentifiableCollection<Site> collection = new AggregatedIterableIdentifiableCollection<Site>();
collection.addCollection(groupSites);
collection.addCollection(portals);
collection.addCollection(dashboards);
@@ -295,7 +297,7 @@
public Site adapt(User old)
{
- return getDashboard(userId(old.getUserName()));
+ return getDashboard(old.getUserName());
}
public boolean contains(Id<Site> t)
@@ -347,7 +349,8 @@
public Site adapt(Object old)
{
Group group = (Group)old;
- return getGroupSite(GROUP_CONTEXT.parse(group.getId()));
+ // Should parse group id
+ return getGroupSite(group.getId());
}
};
}
@@ -361,15 +364,20 @@
}
}
- public Site getGroupSite(Id groupId)
+ public Site getGroupSite(String... names)
{
- String groupName = groupId.toString();
- Id<Site> siteId = siteId(Site.GROUP, groupName);
+ StringBuilder sb = new StringBuilder();
+ for (String name : names)
+ {
+ sb.append("/").append(name);
+ }
+ String groupId = sb.toString();
+ Site.Id siteId = siteId(Site.GROUP, groupId);
- return new GroupSiteImpl(siteId, groupName, this);
+ return new GroupSiteImpl(siteId, groupId, this);
}
- public IterableIdentifiableCollection<Site> getGroupSites(Id userId)
+ public IterableIdentifiableCollection<Site> getGroupSites(String userId)
{
final GroupHandler groupHandler = getOrganizationService().getGroupHandler();
try
@@ -396,7 +404,7 @@
public Site adapt(Object old)
{
Group group = (Group)old;
- return getGroupSite(GROUP_CONTEXT.parse(group.getId()));
+ return getGroupSite(group.getId());
}
};
}
@@ -410,7 +418,7 @@
}
}
- public IterableIdentifiableCollection<Portal> getPortalSites(Id userId)
+ public IterableIdentifiableCollection<Site> getPortalSites(String userId)
{
try
{
@@ -418,17 +426,16 @@
final List<PortalData> portalDatas = dataStorage.find(PORTALS).getAll();
// first build Identity based on user id so that we can check its permissions using UserACL... ugh! :(
- final String user = userId.toString();
- final Collection membershipsByUser = getOrganizationService().getMembershipHandler().findMembershipsByUser(user);
+ final Collection membershipsByUser = getOrganizationService().getMembershipHandler().findMembershipsByUser(userId);
Collection<MembershipEntry> membershipEntries = new ArrayList<MembershipEntry>(membershipsByUser.size());
for (Object o : membershipsByUser)
{
Membership membership = (Membership)o;
membershipEntries.add(new MembershipEntry(membership.getGroupId(), membership.getMembershipType()));
}
- final Identity identity = new Identity(user, membershipEntries);
+ final Identity identity = new Identity(userId, membershipEntries);
- final List<Portal> portals = new ArrayList<Portal>(portalDatas.size());
+ final List<Site> portals = new ArrayList<Site>(portalDatas.size());
final Filter<PortalData> filter = new Filter<PortalData>()
{
@Override
@@ -446,16 +453,16 @@
}
}
- return new AdaptedIterableIdentifiableCollection<Portal, Portal>(portals.size(), portals.iterator())
+ return new AdaptedIterableIdentifiableCollection<Site, Site>(portals.size(), portals.iterator())
{
- public Portal adapt(Portal old)
+ public Site adapt(Site old)
{
return old;
}
- public boolean contains(Id<Portal> id)
+ public boolean contains(Id<Site> id)
{
- final PortalData portalData = getPortalDataFor(id);
+ final PortalData portalData = getPortalDataFor((Site.Id)id);
return portalData != null && filter.accept(portalData);
}
};
@@ -470,15 +477,14 @@
}
}
- public Site getDashboard(Id userId)
+ public Site getDashboard(String userId)
{
- String user = userId.toString();
- Id<Site> siteId = siteId(Site.DASHBOARD, user);
+ Site.Id siteId = siteId(Site.DASHBOARD, userId);
- return new DashboardSiteImpl(siteId, user, this);
+ return new DashboardSiteImpl(siteId, userId, this);
}
- public <T extends Identifiable> T get(Id<T> id)
+ public <T extends Identifiable<T>> T get(Id<T> id)
{
Class<T> type = id.getIdentifiableType();
@@ -486,7 +492,7 @@
if (Portal.class.equals(type))
{
- result = getPortal((Id<Portal>)id);
+ result = getPortal((Site.Id)(Id)id);
}
else if (Page.class.equals(type))
{
@@ -494,7 +500,8 @@
{
begin();
PageData pageData = dataStorage.getPage(PageKey.create(id.toString()));
- result = new PageImpl(pageData, id.getParent(), this);
+ Page.Id pageId = (Page.Id)(Id)id;
+ result = new PageImpl(pageData, pageId.getSite(), this);
}
catch (Exception e)
{
@@ -507,16 +514,15 @@
}
else if (Site.class.equals(type))
{
- Id<Site> siteId = (Id<Site>)id;
- result = getSite(siteId, null);
+ result = getSite((Site.Id)(Id)id);
}
else if (Content.class.isAssignableFrom(type))
{
// todo: split by types and optimize by calling portlet invoker or gadget registry directly
- final IterableIdentifiableCollection<Portal> portals = getPortals();
- for (Portal portal : portals)
+ final IterableIdentifiableCollection<Site> portals = getPortals();
+ for (Site portal : portals)
{
- result = portal.getContentRegistry().get((Id<? extends Content>)id);
+ result = ((Portal)portal).getContentRegistry().get((Content.Id)(Id)id);
if (result != null)
{
break;
@@ -526,10 +532,10 @@
else if (Category.class.equals(type))
{
// todo: optimize by adding portal id to category id (so that appropriate content registry can be retrieved) and calling application registry directly
- final IterableIdentifiableCollection<Portal> portals = getPortals();
- for (Portal portal : portals)
+ final IterableIdentifiableCollection<Site> portals = getPortals();
+ for (Site portal : portals)
{
- result = portal.getContentRegistry().getCategory(id.toString());
+ result = ((Portal)portal).getContentRegistry().getCategory(id.toString());
if (result != null)
{
break;
@@ -544,12 +550,6 @@
}
else if (Navigation.class.equals(type))
{
- final String siteStringId = id.getComponent(NAVIGATION_SITE_COMPONENT);
- final Id<Site> siteId = SITE_CONTEXT.parse(siteStringId, Site.class);
- final Site site = getSite(siteId, null);
- //todo: need to get all the parents of a Navigation to be able to load it so we would need to add the complete path to the Id to be able to resolve Navigations properly
- result = site.getNavigation().get(id.getComponent(NAVIGATION_COMPONENT));
-
throw new UnsupportedOperationException("Id<" + type.getSimpleName() + "> not yet supported");
}
else
@@ -560,22 +560,22 @@
return type.cast(result);
}
- public <T extends Site> T getSite(Id<T> siteId, Type<T> type)
+ public Site getSite(Site.Id siteId)
{
final String siteType = siteId.getComponent(SITE_TYPE_COMPONENT);
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(siteType, "Site type", "A valid Site Id");
- if (Site.PORTAL.equals(siteType))
+ if (Site.PORTAL_TYPE_NAME.equals(siteType))
{
- return (T)getPortal((Id<Portal>)siteId);
+ return getPortal(siteId);
}
else if (Site.GROUP_TYPE_NAME.equals(siteType))
{
- return (T)getGroupSite(groupId(siteId.getComponent(SITE_NAME_COMPONENT)));
+ return getGroupSite(siteId.getComponent(SITE_NAME_COMPONENT));
}
else if (Site.DASHBOARD_TYPE_NAME.equals(siteType))
{
- return (T)getDashboard(userId(siteId.getComponent(SITE_NAME_COMPONENT)));
+ return getDashboard(siteId.getComponent(SITE_NAME_COMPONENT));
}
else
{
@@ -583,21 +583,12 @@
}
}
- public Id userId(String user)
+ public Portlet.Id portletId(String application, String portlet)
{
- return USER_CONTEXT.create(user);
+ throw new UnsupportedOperationException();
}
- public Id groupId(String root, String... children)
- {
- return GROUP_CONTEXT.create(root, children);
- }
-
- public Id<Portlet> portletId(String application, String portlet)
- {
- return LOCAL_PORTLET_CONTEXT.create(Portlet.class, application, portlet);
- }
-
+/*
public static Id<Portlet> parsePortletId(String contentId)
{
if (contentId.contains(ComplexApplicationId.START))
@@ -609,12 +600,14 @@
return LOCAL_PORTLET_CONTEXT.parse(contentId, Portlet.class);
}
}
+*/
- public Id<WSRP> wsrpPortletId(String invoker, String portlet)
+ public WSRP.Id wsrpPortletId(String invoker, String portlet)
{
- return staticWSRPPortletId(invoker, portlet);
+ throw new UnsupportedOperationException();
}
+/*
private static Id<WSRP> staticWSRPPortletId(String invoker, String portlet)
{
return WSRP_PORTLET_CONTEXT.create(WSRP.class, invoker, portlet);
@@ -624,41 +617,51 @@
{
return WSRP_PORTLET_CONTEXT.parse(compositeId, WSRP.class);
}
+*/
- public Id<Gadget> gadgetId(String gadgetName)
+ public Gadget.Id gadgetId(String gadgetName)
{
- return staticGadgetId(gadgetName);
+ throw new UnsupportedOperationException();
}
- private static Id<Gadget> staticGadgetId(String gadgetName)
+/*
+ private static Gadget.Id staticGadgetId(String gadgetName)
{
- return GADGET_CONTEXT.create(Gadget.class, gadgetName);
+ throw new UnsupportedOperationException();
}
+*/
- public Id<Gadget> gadgetId(URI uri)
+ public Gadget.Id gadgetId(URI uri)
{
- return GADGET_CONTEXT.create(Gadget.class, uri.toString());
+ throw new UnsupportedOperationException();
}
- public <T extends Content> Id<ManagedContent> managedContentId(Id<Category> categoryId, String name, Id<T> contentId)
+ public ManagedContent.Id managedContentId(Category.Id categoryId, String name, Content.Id contentId)
{
- return MANAGED_CONTENT_CONTEXT.create(ManagedContent.class, categoryId.toString(), name, contentId.toString());
+ throw new UnsupportedOperationException();
}
- public Id<Category> categoryId(String name)
+ public Category.Id categoryId(String name)
{
- return CATEGORY_CONTEXT.create(Category.class, name);
+ return new Category.Id(name);
}
+/*
public <T extends Site> Id<T> siteId(Type<T> siteType, String siteName)
{
return SITE_CONTEXT.create(siteType.getValueType(), siteType.getName(), siteName);
}
+*/
- public <T extends Site> Id<Page> pageId(Id<T> ownerSite, String pageName)
+ public Site.Id siteId(Type<Site> siteType, String portalName)
{
+ return new Site.Id(siteType, portalName);
+ }
+
+ public Page.Id pageId(Site.Id ownerSite, String pageName)
+ {
ParameterValidation.throwIllegalArgExceptionIfNull(ownerSite, "Owner Site Id");
- return ownerSite.getIdForChild(pageName);
+ return new Page.Id(ownerSite, pageName);
}
public void start()
@@ -701,18 +704,32 @@
return portletInvoker;
}
- private PortalData getPortalDataFor(Id<Portal> portalId)
+ private PortalData getPortalDataFor(Site.Id portalId)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portalId, "Portal Id");
try
{
begin();
- return dataStorage.getPortalConfig(PortalKey.create(portalId.toString()));
+ String type;
+ if (portalId.getType() == Site.PORTAL)
+ {
+ type = "portal";
+ }
+ else if (portalId.getType() == Site.GROUP)
+ {
+ type = "group";
+ }
+ else
+ {
+ type = "user";
+ }
+
+ return dataStorage.getPortalConfig(new PortalKey(type, portalId.getName()));
}
catch (Exception e)
{
- throw new RuntimeException(e);
+ throw new UndeclaredThrowableException(e);
}
finally
{
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/IdentifiableImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/IdentifiableImpl.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/IdentifiableImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -27,14 +27,14 @@
import org.gatein.api.id.Identifiable;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public class IdentifiableImpl<T extends Identifiable<T>> implements Identifiable<T>
+public class IdentifiableImpl<T extends Identifiable<T>, I extends Id<T>> implements Identifiable<T>
{
- private final Id<T> id;
+ private final I id;
private final String name;
private final String displayName;
private final GateInImpl gateIn;
- public IdentifiableImpl(Id<T> id, String name, GateInImpl gateIn)
+ public IdentifiableImpl(I id, String name, GateInImpl gateIn)
{
this.id = id;
this.name = name;
@@ -42,7 +42,7 @@
this.displayName = name; // todo: fix-me
}
- public Id<T> getId()
+ public I getId()
{
return id;
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/AbstractPortlet.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/AbstractPortlet.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/AbstractPortlet.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -28,11 +28,11 @@
import org.gatein.portal.api.impl.IdentifiableImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public abstract class AbstractPortlet<T extends Content<T>> extends IdentifiableImpl<T> implements Content<T>
+public abstract class AbstractPortlet extends IdentifiableImpl<Content, Content.Id> implements Content
{
private final org.gatein.pc.api.Portlet portlet;
- public AbstractPortlet(Id<T> id, org.gatein.pc.api.Portlet application, GateInImpl gateIn)
+ public AbstractPortlet(Content.Id id, org.gatein.pc.api.Portlet application, GateInImpl gateIn)
{
super(id, application.getInfo().getName(), gateIn);
this.portlet = application;
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -115,10 +115,10 @@
}
}
- public <T extends Content> ManagedContent<T> addContent(Id<T> contentId, String name)
+ public ManagedContent addContent(Content.Id contentId, String name)
{
ParameterValidation.throwIllegalArgExceptionIfNull(contentId, "Content Id");
- GateInImpl.MANAGED_CONTENT_CONTEXT.validateValueFor("name", name);
+// GateInImpl.MANAGED_CONTENT_CONTEXT.validateValueFor("name", name);
final ContentType<?> contentType = getContentTypeFor(contentId);
@@ -132,7 +132,7 @@
final ApplicationRegistryService registryService = gateIn.getRegistryService();
final Application application = registryService.createOrUpdateApplication(category.getName(), name, contentType, contentId.toString(), name, null, permissions);
- return new ManagedContentImpl<T>(name, contentId, application, this);
+ return new ManagedContentImpl(name, contentId, application, this);
}
catch (Exception e)
{
@@ -164,7 +164,7 @@
}
}
- private ContentType<?> getContentTypeFor(Id id)
+ private ContentType<?> getContentTypeFor(Content.Id id)
{
final Class type = id.getIdentifiableType();
if (Gadget.class.equals(type))
@@ -247,7 +247,7 @@
return null;
}
- final Id<? extends Content> contentId = GateInImpl.getContentIdFrom(application);
+ Content.Id contentId = GateInImpl.getContentIdFrom(application);
return new ManagedContentImpl(name, contentId, application, this);
}
@@ -268,7 +268,7 @@
};
}
- public Id<Category> getId()
+ public Category.Id getId()
{
return gateIn.categoryId(getName());
}
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -199,9 +199,9 @@
}
}
- public <T extends Content> T get(Id<T> id)
+ public Content get(Id<Content> id)
{
- Class<T> type = id.getIdentifiableType();
+ Class<Content> type = id.getIdentifiableType();
Object result;
Object regitryItem;
try
@@ -233,7 +233,7 @@
}
}
- private <T extends Content> Object getPortletFrom(Id<T> id) throws PortletInvokerException
+ private Object getPortletFrom(Id<Content> id) throws PortletInvokerException
{
PortletContext portletContext;
Object regitryItem;
@@ -255,15 +255,15 @@
Object result;
if (Portlet.class.equals(wanted))
{
- result = new PortletImpl((Id<Portlet>)id, (org.gatein.pc.api.Portlet)registryItem, gateIn);
+ result = new PortletImpl((Portlet.Id)id, (org.gatein.pc.api.Portlet)registryItem, gateIn);
}
else if (Gadget.class.equals(wanted))
{
- result = new GadgetImpl((Id<Gadget>)id, (org.exoplatform.application.gadget.Gadget)registryItem, gateIn);
+ result = new GadgetImpl((Gadget.Id)id, (org.exoplatform.application.gadget.Gadget)registryItem, gateIn);
}
else if (WSRP.class.equals(wanted))
{
- result = new WSRPImpl((Id<WSRP>)id, (org.gatein.pc.api.Portlet)registryItem, gateIn);
+ result = new WSRPImpl((WSRP.Id)id, (org.gatein.pc.api.Portlet)registryItem, gateIn);
}
else
{
@@ -330,21 +330,22 @@
}
}
- public IterableIdentifiableCollection<Portlet> getLocalPortlets()
+ public IterableIdentifiableCollection<Content> getLocalPortlets()
{
try
{
gateIn.begin();
final FederatingPortletInvoker portletInvoker = gateIn.getPortletInvoker();
final Set<org.gatein.pc.api.Portlet> initialLocalPortlets = portletInvoker.getLocalPortlets();
- return new AdaptedIterableIdentifiableCollection<org.gatein.pc.api.Portlet, Portlet>(initialLocalPortlets.size(), initialLocalPortlets.iterator())
+ return new AdaptedIterableIdentifiableCollection<org.gatein.pc.api.Portlet, Content>(initialLocalPortlets.size(), initialLocalPortlets.iterator())
{
public Portlet adapt(org.gatein.pc.api.Portlet old)
{
- return (Portlet)newContentFrom(GateInImpl.parsePortletId(old.getContext().getId()), old, Portlet.class);
+// return (Portlet)newContentFrom(GateInImpl.parsePortletId(old.getContext().getId()), old, Portlet.class);
+ throw new UnsupportedOperationException();
}
- public boolean contains(Id<Portlet> t)
+ public boolean contains(Id<Content> t)
{
try
{
@@ -367,21 +368,22 @@
}
}
- public IterableIdentifiableCollection<WSRP> getRemotePortlets()
+ public IterableIdentifiableCollection<Content> getRemotePortlets()
{
try
{
gateIn.begin();
final FederatingPortletInvoker portletInvoker = gateIn.getPortletInvoker();
final Set<org.gatein.pc.api.Portlet> initialRemotePortlets = portletInvoker.getRemotePortlets();
- return new AdaptedIterableIdentifiableCollection<org.gatein.pc.api.Portlet, WSRP>(initialRemotePortlets.size(), initialRemotePortlets.iterator())
+ return new AdaptedIterableIdentifiableCollection<org.gatein.pc.api.Portlet, Content>(initialRemotePortlets.size(), initialRemotePortlets.iterator())
{
public WSRP adapt(org.gatein.pc.api.Portlet old)
{
- return (WSRP)newContentFrom(GateInImpl.parseWSRPPortletId(old.getContext().getId()), old, WSRP.class);
+// return (WSRP)newContentFrom(GateInImpl.parseWSRPPortletId(old.getContext().getId()), old, WSRP.class);
+ throw new UnsupportedOperationException();
}
- public boolean contains(Id<WSRP> id)
+ public boolean contains(Id<Content> id)
{
try
{
@@ -404,20 +406,20 @@
}
}
- public IterableIdentifiableCollection<Gadget> getGadgets()
+ public IterableIdentifiableCollection<Content> getGadgets()
{
try
{
gateIn.begin();
final List<org.exoplatform.application.gadget.Gadget> initialGadgets = gateIn.getGadgetService().getAllGadgets();
- return new AdaptedIterableIdentifiableCollection<org.exoplatform.application.gadget.Gadget, Gadget>(initialGadgets.size(), initialGadgets.iterator())
+ return new AdaptedIterableIdentifiableCollection<org.exoplatform.application.gadget.Gadget, Content>(initialGadgets.size(), initialGadgets.iterator())
{
public Gadget adapt(org.exoplatform.application.gadget.Gadget old)
{
return (Gadget)newContentFrom(gateIn.gadgetId(old.getName()), old, Gadget.class);
}
- public boolean contains(Id<Gadget> id)
+ public boolean contains(Id<Content> id)
{
try
{
@@ -446,7 +448,7 @@
return getAll().size();
}
- public <U extends Content> boolean contains(Id<U> id)
+ public boolean contains(Id<Content> id)
{
// todo: optimize
return get(id) != null;
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -25,7 +25,6 @@
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;
@@ -33,11 +32,11 @@
import java.net.URI;
/** @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
+public class GadgetImpl extends IdentifiableImpl<org.gatein.api.content.Content, org.gatein.api.content.Content.Id> implements org.gatein.api.content.Gadget
{
private final Gadget gadget;
- public GadgetImpl(Id<org.gatein.api.content.Gadget> id, Gadget gadget, GateInImpl gateIn)
+ public GadgetImpl(org.gatein.api.content.Gadget.Id id, Gadget gadget, GateInImpl gateIn)
{
super(id, gadget.getName(), gateIn);
this.gadget = gadget;
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -33,15 +33,15 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class ManagedContentImpl<T extends Content> implements ManagedContent<T>
+public class ManagedContentImpl implements ManagedContent
{
- private T content;
- private final Id<T> contentId;
- private final Id<ManagedContent<T>> id;
+ private Content content;
+ private final Content.Id contentId;
+ private final ManagedContent.Id id;
private final CategoryImpl category;
private final Application application;
- ManagedContentImpl(String name, Id contentId, Application application, CategoryImpl category)
+ ManagedContentImpl(String name, Content.Id contentId, Application application, CategoryImpl category)
{
this.contentId = contentId;
this.id = category.getGateIn().managedContentId(category.getId(), name, contentId);
@@ -55,7 +55,7 @@
return "ManagedContent '" + getName() + "' =>" + getContent();
}
- public Id<ManagedContent<T>> getId()
+ public ManagedContent.Id getId()
{
return id;
}
@@ -92,7 +92,7 @@
return category.getGateIn();
}
- public T getContent()
+ public Content getContent()
{
if (content == null)
{
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/PortletImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/PortletImpl.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/PortletImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -29,9 +29,9 @@
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public class PortletImpl extends AbstractPortlet<Portlet> implements Portlet
+public class PortletImpl extends AbstractPortlet implements Portlet
{
- public PortletImpl(Id<Portlet> id, org.gatein.pc.api.Portlet application, GateInImpl gateIn)
+ public PortletImpl(Portlet.Id id, org.gatein.pc.api.Portlet application, GateInImpl gateIn)
{
super(id, application, gateIn);
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/WSRPImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/WSRPImpl.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/WSRPImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -29,9 +29,9 @@
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public class WSRPImpl extends AbstractPortlet<WSRP> implements WSRP
+public class WSRPImpl extends AbstractPortlet implements WSRP
{
- public WSRPImpl(Id<WSRP> id, org.gatein.pc.api.Portlet application, GateInImpl gateIn)
+ public WSRPImpl(WSRP.Id id, org.gatein.pc.api.Portlet application, GateInImpl gateIn)
{
super(id, application, gateIn);
}
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationContext.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationContext.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationContext.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -43,7 +43,7 @@
return create(Identifiable.class, rootComponent, additionalComponent);
}
- public <T extends Identifiable> Id<T> create(Class<T> type, String rootComponent, String... additionalComponents)
+ public <T extends Identifiable<T>> Id<T> create(Class<T> type, String rootComponent, String... additionalComponents)
{
if (!type.isAssignableFrom(Portlet.class))
{
Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationId.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationId.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/id/ComplexApplicationId.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -29,7 +29,7 @@
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public class ComplexApplicationId implements Id<Portlet>
+public class ComplexApplicationId // implements Id<Portlet>
{
public static final String LOCAL = "local";
public static final String START = LOCAL + ".";
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -23,7 +23,6 @@
package org.gatein.portal.api.impl.portal;
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;
@@ -31,7 +30,7 @@
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class DashboardSiteImpl extends SiteImpl
{
- public DashboardSiteImpl(Id<? extends Site> siteId, String name, GateInImpl gateIn)
+ public DashboardSiteImpl(Site.Id siteId, String name, GateInImpl gateIn)
{
super(siteId, name, gateIn);
}
@@ -42,7 +41,7 @@
return SiteKey.user(getName());
}
- public Type getType()
+ public Type<Site> getType()
{
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -31,7 +31,7 @@
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class GroupSiteImpl extends SiteImpl
{
- public GroupSiteImpl(Id<? extends Site> siteId, String name, GateInImpl gateIn)
+ public GroupSiteImpl(Site.Id siteId, String name, GateInImpl gateIn)
{
super(siteId, name, gateIn);
}
@@ -42,7 +42,7 @@
return SiteKey.group(getName());
}
- public Type getType()
+ public Type<Site> getType()
{
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -25,7 +25,6 @@
import org.exoplatform.commons.utils.ExpressionUtil;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.mop.Described;
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.description.DescriptionService;
@@ -34,12 +33,11 @@
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.webui.util.Util;
import org.exoplatform.services.resources.ResourceBundleManager;
+import org.exoplatform.web.application.RequestContext;
import org.exoplatform.web.url.navigation.NavigationResource;
import org.exoplatform.web.url.navigation.NodeURL;
import org.gatein.api.GateIn;
-import org.gatein.api.id.Id;
import org.gatein.api.id.Identifiable;
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
@@ -61,14 +59,14 @@
public class NavigationImpl implements Navigation, Identifiable<Navigation>
{
private final NodeContext<NavigationImpl> context;
- private Id<? extends Site> site;
- private Id<Navigation> id;
+ private Site.Id site;
+ private Navigation.Id id;
private final GateInImpl gateIn;
private URI uri;
private String displayName;
private ResourceBundle bundle;
- public NavigationImpl(Id<Site> siteId, NodeContext<NavigationImpl> context, GateInImpl gateIn)
+ public NavigationImpl(Site.Id siteId, NodeContext<NavigationImpl> context, GateInImpl gateIn)
{
this.context = context;
this.site = siteId;
@@ -116,7 +114,7 @@
{
try
{
- PortalRequestContext requestContext = Util.getPortalRequestContext();
+ RequestContext requestContext = RequestContext.getCurrentInstance();
SiteType siteType = SiteType.valueOf(site.getComponents()[0].toUpperCase());
String siteName = site.getComponents()[1];
@@ -172,7 +170,7 @@
setTargetPage(target.getId());
}
- public void setTargetPage(Id<Page> targetId)
+ public void setTargetPage(Page.Id targetId)
{
context.setState(new NodeState.Builder(context.getState()).pageRef(targetId.toString()).build());
}
@@ -193,7 +191,7 @@
return old;
}
- public boolean contains(Id<Navigation> id)
+ public boolean contains(org.gatein.api.id.Id<Navigation> id)
{
return NavigationImpl.this.contains(id);
}
@@ -227,16 +225,17 @@
return contains(getIdForChild(key));
}
- public <U extends Navigation> boolean contains(Id<U> navigationId)
+ public boolean contains(org.gatein.api.id.Id<Navigation> navigationId)
{
loadChildrenIfNeeded();
return getChild(navigationId) != null;
}
- private <U extends Navigation> NodeContext<NavigationImpl> getChild(Id<U> navigationId)
+ private NodeContext<NavigationImpl> getChild(org.gatein.api.id.Id<Navigation> navigationId)
{
- return context.get(navigationId.getComponent(GateInImpl.NAVIGATION_COMPONENT));
+// return context.get(navigationId.getComponent(GateInImpl.NAVIGATION_COMPONENT));
+ throw new UnsupportedOperationException();
}
public Navigation createAndAdd(String key)
@@ -244,7 +243,7 @@
return createAndAdd(getIdForChild(key));
}
- public <U extends Navigation> U createAndAdd(Id<U> navigationId)
+ public Navigation createAndAdd(org.gatein.api.id.Id<Navigation> navigationId)
{
throw new NotYetImplemented(); // TODO
}
@@ -254,7 +253,7 @@
return get(getIdForChild(key));
}
- public <U extends Navigation> U get(Id<U> navigationId)
+ public Navigation get(org.gatein.api.id.Id<Navigation> navigationId)
{
if (navigationId == null)
{
@@ -263,22 +262,22 @@
else
{
loadChildrenIfNeeded();
- final Class<U> type = navigationId.getIdentifiableType();
final NodeContext<NavigationImpl> child = getChild(navigationId);
- return child != null ? type.cast(child.getNode()) : null;
+ return child != null ? child.getNode() : null;
}
}
- public Id<Navigation> getIdForChild(String key)
+ public Navigation.Id getIdForChild(String key)
{
- return site.getIdForChild(key);
+// return site.getIdForChild(key);
+ throw new UnsupportedOperationException();
}
- public Id<Navigation> getId()
+ public Navigation.Id getId()
{
if (id == null)
{
- id = GateInImpl.NAVIGATION_CONTEXT.create(Navigation.class, site.toString(), context.getId());
+ id = new Navigation.Id(context.getId());
}
return id;
@@ -327,7 +326,7 @@
public Locale getUserLocale()
{
- return Util.getPortalRequestContext().getLocale();
+ return RequestContext.getCurrentInstance().getLocale();
}
@@ -337,7 +336,7 @@
{
ExoContainer container = ExoContainerContext.getCurrentContainer();
ResourceBundleManager rbMgr = (ResourceBundleManager)container.getComponentInstanceOfType(ResourceBundleManager.class);
- Locale locale = Util.getPortalRequestContext().getLocale();
+ Locale locale = getUserLocale();
bundle = rbMgr.getNavigationResourceBundle(
locale.getLanguage(),
site.getComponent(GateInImpl.SITE_TYPE_COMPONENT),
@@ -359,10 +358,10 @@
static class NavigationNodeModel implements NodeModel<NavigationImpl>
{
- private final Id<Site> siteId;
+ private final Site.Id siteId;
private final GateInImpl gateIn;
- NavigationNodeModel(Id<Site> siteId, GateInImpl gateIn)
+ NavigationNodeModel(Site.Id siteId, GateInImpl gateIn)
{
this.siteId = siteId;
this.gateIn = gateIn;
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PageImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -34,12 +34,12 @@
import org.gatein.portal.api.impl.IdentifiableImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public class PageImpl extends IdentifiableImpl<Page> implements Page
+public class PageImpl extends IdentifiableImpl<Page, Page.Id> implements Page
{
- private final Id<? extends Site> site;
+ private final Site.Id site;
private PageData pageData;
- public PageImpl(PageData pageData, Id<? extends Site> parent, GateInImpl gateIn)
+ public PageImpl(PageData pageData, Site.Id parent, GateInImpl gateIn)
{
super(gateIn.pageId(parent, pageData.getName()), pageData.getName(), gateIn);
this.site = parent;
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -45,7 +45,7 @@
return new ContentRegistryImpl(getGateInImpl(), this);
}
- public Type getType()
+ public Type<Site> getType()
{
return Site.PORTAL;
}
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-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -32,11 +32,9 @@
import org.exoplatform.portal.pom.data.OwnerKey;
import org.exoplatform.portal.pom.data.PageData;
import org.exoplatform.portal.pom.data.PageKey;
-import org.gatein.api.id.Id;
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
-import org.gatein.api.util.GateInTypesResolver;
import org.gatein.api.util.HierarchicalContainer;
import org.gatein.api.util.IterableIdentifiableCollection;
import org.gatein.api.util.Type;
@@ -44,15 +42,16 @@
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
import org.gatein.portal.api.impl.util.AdaptedIterableIdentifiableCollection;
+import org.gatein.portal.api.impl.util.GateInTypesResolver;
import java.util.List;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public abstract class SiteImpl extends IdentifiableImpl implements Site
+public abstract class SiteImpl extends IdentifiableImpl<Site, Site.Id> implements Site
{
private PageContainer pageRegistry;
- public SiteImpl(Id<? extends Site> siteId, String name, GateInImpl gateIn)
+ public SiteImpl(Site.Id siteId, String name, GateInImpl gateIn)
{
super(siteId, name, gateIn);
pageRegistry = new PageContainer(gateIn, this);
@@ -173,14 +172,14 @@
return pageData != null ? new PageImpl(pageData, site.getId(), gateIn) : null;
}
- public Id<Page> getIdForChild(String key)
+ public org.gatein.api.id.Id<Page> getIdForChild(String key)
{
return site.getId().getIdForChild(key);
}
- public <U extends Page> U createAndAdd(Id<U> id)
+ public Page createAndAdd(org.gatein.api.id.Id<Page> id)
{
- return (U)createAndAdd(id.toString());
+ return createAndAdd(id.toString());
}
public IterableIdentifiableCollection<Page> getAll()
@@ -193,7 +192,7 @@
return new PageImpl(old, site.getId(), gateIn);
}
- public boolean contains(Id<Page> t)
+ public boolean contains(org.gatein.api.id.Id<Page> t)
{
return getPageData(t.toString()) != null;
}
@@ -224,12 +223,12 @@
return getAllPageData().size();
}
- public <U extends Page> U get(Id<U> id)
+ public Page get(org.gatein.api.id.Id<Page> id)
{
- return (U)get(id.toString());
+ return get(id.toString());
}
- public <U extends Page> boolean contains(Id<U> id)
+ public boolean contains(org.gatein.api.id.Id<Page> id)
{
return contains(id.toString());
}
Modified: 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 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AdaptedIterableIdentifiableCollection.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -29,7 +29,7 @@
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 abstract class AdaptedIterableIdentifiableCollection<O, N extends Identifiable<N>> extends AdaptedIterableCollection<O, N> implements IterableIdentifiableCollection<N>
{
public AdaptedIterableIdentifiableCollection(int size, Iterator<O> adaptee)
{
Added: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/GateInTypesResolver.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/GateInTypesResolver.java (rev 0)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/GateInTypesResolver.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -0,0 +1,63 @@
+package org.gatein.portal.api.impl.util;
+
+import org.gatein.api.GateIn;
+import org.gatein.api.content.Content;
+import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
+
+/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
+public class GateInTypesResolver
+{
+ public static Type forName(String name, Class originatingClass)
+ {
+ if (originatingClass == null)
+ {
+ throw new IllegalArgumentException("Must pass a valid class for which a Type needs to be resolved");
+ }
+
+ if (name == null || name.isEmpty())
+ {
+ throw new IllegalArgumentException("Must pass a valid name for the Type to be resolved");
+ }
+
+ if (Site.class.equals(originatingClass))
+ {
+ if (Site.PORTAL_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return Site.PORTAL;
+ }
+ else if (Site.GROUP_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return Site.GROUP;
+ }
+ else if (Site.DASHBOARD_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return Site.DASHBOARD;
+ }
+ }
+ else if (Content.class.equals(originatingClass))
+ {
+ if (Content.PORTLET_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return Content.PORTLET;
+ }
+ else if (Content.GADGET_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return Content.GADGET;
+ }
+ else if (Content.WSRP_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return Content.WSRP;
+ }
+ }
+ else if (GateIn.class.equals(originatingClass))
+ {
+ if (GateIn.LIFECYCLEMANAGER_TYPE_NAME.equalsIgnoreCase(name))
+ {
+ return GateIn.LIFECYCLE_MANAGER;
+ }
+ }
+
+ throw new IllegalArgumentException("Unknown Type '" + name + "' for class " + originatingClass.getName());
+ }
+}
\ No newline at end of file
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -33,6 +33,7 @@
@Test
public void checkParsing()
{
+/*
Id<Portlet> id = ComplexApplicationContext.INSTANCE.parse("category/local._webapp.portlet", Portlet.class);
assert "category".equals(id.getComponent(GateInImpl.CATEGORY_COMPONENT));
assert "webapp".equals(id.getComponent(GateInImpl.APPLICATION_COMPONENT));
@@ -47,5 +48,6 @@
assert "portlet".equals(id.getComponent(GateInImpl.PORTLET_COMPONENT));
assert id.equals(ComplexApplicationContext.INSTANCE.parse(id.toString()));
+*/
}
}
Added: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java (rev 0)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -0,0 +1,121 @@
+package org.gatein.portal.api.impl.portal;
+
+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.AbstractPortalTest;
+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.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.exoplatform.portal.pom.data.ModelDataStorage;
+import org.gatein.api.GateIn;
+import org.gatein.api.portal.Navigation;
+import org.gatein.api.portal.Site;
+import org.gatein.portal.api.impl.GateInImpl;
+
+import java.util.Iterator;
+
+/** @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 NavigationTestCase extends AbstractPortalTest
+{
+
+ /** . */
+ protected POMSessionManager mgr;
+
+ /** . */
+ protected NavigationService navService;
+
+ /** . */
+ protected GateIn gatein;
+
+ /** . */
+ protected NodeContext root;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ //
+ PortalContainer container = getContainer();
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ NavigationService navService = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ GateInImpl gatein = new GateInImpl(container.getContext(), null, null, null);
+
+ //
+ gatein.start();
+
+ // Clear the cache for each test
+ // navService.clearCache();
+
+ //
+ this.gatein = gatein;
+ this.mgr = mgr;
+ this.navService = navService;
+
+ //
+ begin();
+
+ //
+ ModelDataStorage storage = (ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
+ storage.create(new PortalConfig("portal", "classic").build());
+ NavigationContext nav = new NavigationContext(SiteKey.portal("classic"), new NavigationState(0));
+ navService.saveNavigation(nav);
+ root = navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ end(false);
+ }
+
+ public void testEmptyNavigation()
+ {
+ Site site = gatein.getPortal(new Site.Id(Site.PORTAL, "classic"));
+ assertNotNull(site);
+ Site.Id id = site.getId();
+ assertEquals(Site.PORTAL, id.getType());
+ assertEquals("classic", id.getName());
+
+ //
+ Navigation navigation = site.getNavigation();
+ assertNotNull(navigation);
+ Iterator<Navigation> i = navigation.getAll().iterator();
+ assertFalse(i.hasNext());
+ }
+
+ public void testSingleNavigation()
+ {
+ root.add(null, "home");
+ navService.saveNode(root, null);
+
+ //
+ Site site = gatein.getPortal(new Site.Id(Site.PORTAL, "classic"));
+ assertNotNull(site);
+ Site.Id id = site.getId();
+ assertEquals(Site.PORTAL, id.getType());
+ assertEquals("classic", id.getName());
+
+ //
+ Navigation navigation = site.getNavigation();
+ assertNotNull(navigation);
+ Iterator<Navigation> i = navigation.getAll().iterator();
+ assertTrue(i.hasNext());
+ Navigation home = i.next();
+ assertEquals("home", home.getName());
+ assertFalse(i.hasNext());
+ }
+}
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -26,8 +26,8 @@
import org.exoplatform.portal.pom.data.PageKey;
import org.exoplatform.portal.pom.data.PortalKey;
import org.gatein.api.portal.Site;
-import org.gatein.api.util.GateInTypesResolver;
import org.gatein.api.util.Type;
+import org.gatein.portal.api.impl.util.GateInTypesResolver;
import org.testng.annotations.Test;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
@@ -48,4 +48,6 @@
assert Site.PORTAL.equals(SiteImpl.getAPITypeFrom(new PortalKey(SiteType.PORTAL.getName(), "foo")));
assert Site.PORTAL.equals(SiteImpl.getAPITypeFrom(new PortalKey("portal", "foo")));
}
+
+
}
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -37,6 +37,7 @@
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class AggregatedIterableIdentifiableCollectionTestCase
{
+/*
private AggregatedIterableIdentifiableCollection collection;
private static final IterableIdentifiableCollection fixture3 = new TestCollection("1", "2", "3");
private static final IterableIdentifiableCollection fixture4 = new TestCollection("a", "b", "c", "d");
@@ -169,4 +170,5 @@
return elements.values().iterator();
}
}
+*/
}
Modified: portal/branches/api/examples/portlets/api/src/main/java/org/gatein/portal/samples/api/NavigationPortlet.java
===================================================================
--- portal/branches/api/examples/portlets/api/src/main/java/org/gatein/portal/samples/api/NavigationPortlet.java 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/examples/portlets/api/src/main/java/org/gatein/portal/samples/api/NavigationPortlet.java 2011-08-15 20:55:43 UTC (rev 7138)
@@ -51,26 +51,24 @@
@Override
protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
{
- Id userId = gateIn.userId("root");
-
PrintWriter writer = response.getWriter();
writer.println("<h1>Portal Sites</h1>");
- IterableIdentifiableCollection<? extends Site> sites = gateIn.getPortalSites(userId);
+ IterableIdentifiableCollection<? extends Site> sites = gateIn.getPortalSites("root");
for (Site site : sites)
{
outputSite(site, writer);
}
writer.println("<h1>Group Sites</h1>");
- sites = gateIn.getGroupSites(userId);
+ sites = gateIn.getGroupSites("root");
for (Site site : sites)
{
outputSite(site, writer);
}
writer.println("<h1>Dashboard</h1>");
- outputSite(gateIn.getDashboard(userId), writer);
+ outputSite(gateIn.getDashboard("root"), writer);
}
private void outputSite(Site site, PrintWriter writer) throws IOException
Modified: portal/branches/api/pom.xml
===================================================================
--- portal/branches/api/pom.xml 2011-08-15 20:52:16 UTC (rev 7137)
+++ portal/branches/api/pom.xml 2011-08-15 20:55:43 UTC (rev 7138)
@@ -50,7 +50,7 @@
<org.gatein.wsrp.version>2.1.0-Beta04</org.gatein.wsrp.version>
<org.gatein.mop.version>1.1.0-Beta05</org.gatein.mop.version>
<org.gatein.mgmt.version>1.0.0-Beta01</org.gatein.mgmt.version>
- <org.gatein.api.version>1.0.0-Beta01</org.gatein.api.version>
+ <org.gatein.api.version>1.0.0-Beta02-SNAPSHOT</org.gatein.api.version>
<org.slf4j.version>1.5.8</org.slf4j.version>
<commons-pool.version>1.5.5</commons-pool.version>
<rhino.version>1.6R5</rhino.version>
14 years, 8 months
gatein SVN: r7137 - portal/branches.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-08-15 16:52:16 -0400 (Mon, 15 Aug 2011)
New Revision: 7137
Removed:
portal/branches/gatein-management/
Log:
Deleting branch since it's been merged
14 years, 8 months
gatein SVN: r7136 - portal/branches.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-15 16:43:45 -0400 (Mon, 15 Aug 2011)
New Revision: 7136
Added:
portal/branches/api/
Log:
some work on API snapshoted at rev 7135
14 years, 8 months
gatein SVN: r7135 - epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: ghjboss
Date: 2011-08-15 15:47:38 -0400 (Mon, 15 Aug 2011)
New Revision: 7135
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
Log:
fix for JBEPP-1071
Modified: epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
===================================================================
--- epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-15 19:35:05 UTC (rev 7134)
+++ epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-15 19:47:38 UTC (rev 7135)
@@ -146,15 +146,15 @@
*/
private void addUserToPlatformUsers(String userId) throws Exception
{
+ OrganizationService orgService = null;
try
{
- OrganizationService orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
+ orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
begin(orgService);
User user = orgService.getUserHandler().findUserByName(userId);
MembershipType memberType = orgService.getMembershipTypeHandler().findMembershipType(membershipType);
Group platformUsersGroup = orgService.getGroupHandler().findGroupById(groupId);
- orgService.getMembershipHandler().linkMembership(user, platformUsersGroup, memberType, true);
- end(orgService);
+ orgService.getMembershipHandler().linkMembership(user, platformUsersGroup, memberType, true);
}
catch (Exception e)
{
@@ -162,6 +162,10 @@
// don't rethrow login exception in case of failure.
// throw e;
}
+ finally
+ {
+ end(orgService);
+ }
}
private void begin(OrganizationService orgService) throws Exception
{
14 years, 8 months
gatein SVN: r7134 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-08-15 15:35:05 -0400 (Mon, 15 Aug 2011)
New Revision: 7134
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java
Log:
GTNPORTAL-1997: Support navigation rollback during management operation import-resource.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java 2011-08-15 19:26:34 UTC (rev 7133)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java 2011-08-15 19:35:05 UTC (rev 7134)
@@ -174,7 +174,7 @@
void rollback() throws Exception;
}
- private class RollbackChangeListener implements NodeChangeListener<NodeContext<NodeContext<?>>>
+ private static class RollbackChangeListener implements NodeChangeListener<NodeContext<NodeContext<?>>>
{
private List<RollbackTask> tasks = new ArrayList<RollbackTask>();
private boolean errors;
14 years, 8 months
gatein SVN: r7133 - in portal/trunk/component/portal/src: main/java/org/exoplatform/portal/mop/management/operations/page and 1 other directories.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-08-15 15:26:34 -0400 (Mon, 15 Aug 2011)
New Revision: 7133
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/PageImportTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/SiteLayoutImportTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/page/PageUtils.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/management/exportimport/PageImportTaskTest.java
Log:
GTNPORTAL-2023: Stale storage id's result in error during rollback for pages and site layout.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/PageImportTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/PageImportTask.java 2011-08-15 19:24:14 UTC (rev 7132)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/PageImportTask.java 2011-08-15 19:26:34 UTC (rev 7133)
@@ -27,6 +27,7 @@
import org.exoplatform.portal.config.Query;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.management.operations.page.PageUtils;
import java.util.ArrayList;
import java.util.List;
@@ -109,7 +110,7 @@
}
else
{
- rollbackSaves.getPages().add(found);
+ rollbackSaves.getPages().add(PageUtils.copy(found));
}
}
}
@@ -129,9 +130,10 @@
rollbackDeletes.setPages(new ArrayList<Page>());
for (Page page : existingPages)
{
+ Page copy = PageUtils.copy(page);
dataStorage.remove(page);
dataStorage.save();
- rollbackSaves.getPages().add(page);
+ rollbackSaves.getPages().add(copy);
}
for (Page src : data.getPages())
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/SiteLayoutImportTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/SiteLayoutImportTask.java 2011-08-15 19:24:14 UTC (rev 7132)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/SiteLayoutImportTask.java 2011-08-15 19:26:34 UTC (rev 7133)
@@ -25,9 +25,7 @@
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.pom.data.ModelDataStorage;
-import org.exoplatform.portal.pom.data.PortalData;
-import org.exoplatform.portal.pom.data.PortalKey;
+import org.exoplatform.portal.mop.management.operations.page.PageUtils;
/**
* @author <a href="mailto:nscavell@redhat.com">Nick Scavelli</a>
@@ -72,7 +70,7 @@
}
else
{
- rollbackSave = dst;
+ rollbackSave = PageUtils.copy(dst);
}
dst = data;
break;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/page/PageUtils.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/page/PageUtils.java 2011-08-15 19:24:14 UTC (rev 7132)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/page/PageUtils.java 2011-08-15 19:26:34 UTC (rev 7133)
@@ -1,8 +1,21 @@
package org.exoplatform.portal.mop.management.operations.page;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.Query;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.ApplicationType;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Dashboard;
+import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageBody;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.config.model.Properties;
+import org.exoplatform.portal.config.model.TransientApplicationState;
import org.exoplatform.portal.mop.SiteKey;
import org.gatein.management.api.exceptions.OperationException;
@@ -29,7 +42,7 @@
}
}
- public static Page.PageSet getAllPages(DataStorage dataStorage, SiteKey siteKey, String operationName)
+ public static Page.PageSet getAllPages(DataStorage dataStorage, SiteKey siteKey, String operationName)
{
Query<Page> query = new Query<Page>(siteKey.getTypeName(), siteKey.getName(), Page.class);
try
@@ -45,4 +58,180 @@
throw new OperationException(operationName, "Could not retrieve pages for site " + siteKey);
}
}
+
+ public static <S> Application<S> copy(Application<S> existing)
+ {
+ Application<S> application = new Application<S>(existing.getType());
+ application.setAccessPermissions(copy(existing.getAccessPermissions()));
+ application.setDescription(existing.getDescription());
+ application.setHeight(existing.getHeight());
+ application.setIcon(existing.getIcon());
+ application.setId(existing.getId());
+ application.setModifiable(existing.isModifiable());
+ application.setProperties(new Properties(existing.getProperties()));
+ application.setShowApplicationMode(existing.getShowApplicationMode());
+ application.setShowApplicationState(existing.getShowApplicationState());
+ application.setShowInfoBar(existing.getShowInfoBar());
+ application.setState(copy(existing.getType(), existing.getState()));
+ application.setTheme(existing.getTheme());
+ application.setTitle(existing.getTitle());
+ application.setWidth(existing.getWidth());
+
+ return application;
+ }
+
+ public static <S> ApplicationState<S> copy(ApplicationType<S> type, ApplicationState<S> existing)
+ {
+ if (existing instanceof TransientApplicationState)
+ {
+ TransientApplicationState<S> state = (TransientApplicationState<S>) existing;
+ return new TransientApplicationState<S>(state.getContentId(), state.getContentState(), state.getOwnerType(), state.getOwnerId(), state.getUniqueId());
+ }
+ else
+ {
+ // Hate doing this, but it's the only way to deal with persistent application state...
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ if (container instanceof PortalContainer)
+ {
+ DataStorage ds = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
+ try
+ {
+ S s = ds.load(existing, type);
+ String contentId = ds.getId(existing);
+
+ return new TransientApplicationState<S>(contentId, s);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Exception copying persistent application state.", e);
+ }
+ }
+ else
+ {
+ throw new RuntimeException("Unable to copy persistent application state with kernel container " + container);
+ }
+ }
+ }
+
+ public static Container copy(Container existing)
+ {
+ Container container = new Container();
+ copyFields(existing, container);
+
+ return container;
+ }
+
+ public static Dashboard copy(Dashboard existing)
+ {
+ Dashboard dashboard = new Dashboard();
+ copyFields(existing, dashboard);
+
+ return dashboard;
+ }
+
+ public static Page copy(Page existing)
+ {
+ Page page = new Page();
+
+ // Copy page specific data
+ page.setEditPermission(existing.getEditPermission());
+ page.setModifiable(existing.isModifiable());
+ page.setOwnerId(existing.getOwnerId());
+ page.setOwnerType(existing.getOwnerType());
+ page.setPageId(existing.getPageId());
+ page.setShowMaxWindow(existing.isShowMaxWindow());
+
+ // Copy container specific data.
+ copyFields(existing, page);
+
+ return page;
+ }
+
+ public static Page.PageSet copy(Page.PageSet existingPageSet)
+ {
+ Page.PageSet pageSet = new Page.PageSet();
+ ArrayList<Page> pages = new ArrayList<Page>(existingPageSet.getPages().size());
+ pageSet.setPages(pages);
+
+ for (Page existingPage : existingPageSet.getPages())
+ {
+ pages.add(copy(existingPage));
+ }
+
+ return pageSet;
+ }
+
+ @SuppressWarnings("unused")
+ public static PageBody copy(PageBody existing)
+ {
+ return new PageBody();
+ }
+
+ public static PortalConfig copy(PortalConfig existing)
+ {
+ PortalConfig portalConfig = new PortalConfig(existing.getType(), existing.getName());
+ portalConfig.setAccessPermissions(copy(existing.getAccessPermissions()));
+ portalConfig.setDescription(existing.getDescription());
+ portalConfig.setEditPermission(existing.getEditPermission());
+ portalConfig.setLabel(existing.getLabel());
+ portalConfig.setLocale(existing.getLocale());
+ portalConfig.setModifiable(existing.isModifiable());
+ portalConfig.setPortalLayout(copy(existing.getPortalLayout()));
+ portalConfig.setProperties(new Properties(existing.getProperties()));
+
+ return portalConfig;
+ }
+
+ private static void copyFields(Container existing, Container container)
+ {
+ container.setAccessPermissions(copy(existing.getAccessPermissions()));
+ container.setChildren(copyChildren(existing.getChildren()));
+ container.setDecorator(existing.getDecorator());
+ container.setDescription(existing.getDescription());
+ container.setFactoryId(existing.getFactoryId());
+ container.setHeight(existing.getHeight());
+ container.setIcon(existing.getIcon());
+ container.setId(existing.getId());
+ container.setName(existing.getName());
+ container.setTemplate(existing.getTemplate());
+ container.setTitle(existing.getTitle());
+ container.setWidth(existing.getWidth());
+ }
+
+ private static ArrayList<ModelObject> copyChildren(ArrayList<ModelObject> existing)
+ {
+ if (existing == null) return null;
+ ArrayList<ModelObject> children = new ArrayList<ModelObject>(existing.size());
+
+ for (ModelObject object : existing)
+ {
+ if (object instanceof Application)
+ {
+ @SuppressWarnings("unchecked")
+ Application app = copy((Application) object);
+
+ children.add(app);
+ }
+ if (object instanceof Dashboard)
+ {
+ children.add(copy((Dashboard) object));
+ }
+ if (object instanceof Container)
+ {
+ children.add(copy((Container) object));
+ }
+ }
+
+ return children;
+ }
+
+ private static String[] copy(String[] existing)
+ {
+ if (existing == null) return null;
+
+ String[] array = new String[existing.length];
+ System.arraycopy(existing, 0, array, 0, existing.length);
+
+ return array;
+ }
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/management/exportimport/PageImportTaskTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/management/exportimport/PageImportTaskTest.java 2011-08-15 19:24:14 UTC (rev 7132)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/mop/management/exportimport/PageImportTaskTest.java 2011-08-15 19:26:34 UTC (rev 7133)
@@ -220,7 +220,7 @@
assertNullOrEmpty(task.getRollbackDeletes());
Assert.assertNotNull(task.getRollbackSaves());
Assert.assertEquals(3, task.getRollbackSaves().getPages().size());
- Assert.assertEquals(existing.getPages(), task.getRollbackSaves().getPages());
+ comparePages(existing.getPages(), task.getRollbackSaves().getPages());
}
public void testMerge_NewPages() throws Exception
@@ -283,8 +283,8 @@
Assert.assertNotNull(task.getRollbackSaves());
Assert.assertEquals(2, task.getRollbackSaves().getPages().size());
- Assert.assertEquals(existing.getPages().get(0), task.getRollbackSaves().getPages().get(0));
- Assert.assertEquals(existing.getPages().get(2), task.getRollbackSaves().getPages().get(1));
+ comparePage(existing.getPages().get(0), task.getRollbackSaves().getPages().get(0));
+ comparePage(existing.getPages().get(2), task.getRollbackSaves().getPages().get(1));
}
public void testOverwrite_NoPages() throws Exception
@@ -347,7 +347,7 @@
assertNullOrEmpty(task.getRollbackDeletes());
Assert.assertNotNull(task.getRollbackSaves());
Assert.assertEquals(3, task.getRollbackSaves().getPages().size());
- Assert.assertEquals(existing.getPages(), task.getRollbackSaves().getPages());
+ comparePages(existing.getPages(), task.getRollbackSaves().getPages());
}
public void testOverwrite_NewPages() throws Exception
@@ -384,7 +384,7 @@
Assert.assertEquals(importing.getPages(), task.getRollbackDeletes().getPages());
Assert.assertNotNull(task.getRollbackSaves());
- Assert.assertEquals(existing.getPages(), task.getRollbackSaves().getPages());
+ comparePages(existing.getPages(), task.getRollbackSaves().getPages());
}
public void testOverwrite_NewAndSamePages() throws Exception
@@ -423,7 +423,7 @@
Assert.assertEquals(importing.getPages().get(3), task.getRollbackDeletes().getPages().get(1));
Assert.assertNotNull(task.getRollbackSaves());
- Assert.assertEquals(existing.getPages(), task.getRollbackSaves().getPages());
+ comparePages(existing.getPages(), task.getRollbackSaves().getPages());
}
private void assertNullOrEmpty(Page.PageSet pages)
@@ -434,6 +434,27 @@
}
}
+ private void comparePages(ArrayList<Page> expected, ArrayList<Page> actual)
+ {
+ if (expected == null)
+ {
+ assertNull(actual);
+ return;
+ }
+
+ assertEquals(expected.size(), actual.size());
+
+ for (int i=0; i<expected.size(); i++)
+ {
+ comparePage(expected.get(i), actual.get(i));
+ }
+ }
+
+ private void comparePage(Page expected, Page actual)
+ {
+ assertEquals(expected.getName(), actual.getName());
+ }
+
private Query<Page> query(String ownerType, String ownerId)
{
return argThat(new QueryMatcher(new Query<Page>(ownerType, ownerId, Page.class)));
14 years, 8 months
gatein SVN: r7132 - in portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management: operations and 1 other directory.
by do-not-reply@jboss.org
Author: nscavell
Date: 2011-08-15 15:24:14 -0400 (Mon, 15 Aug 2011)
New Revision: 7132
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java
Log:
GTNPORTAL-1997: Support navigation rollback during management operation import-resource.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java 2011-08-15 18:42:13 UTC (rev 7131)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/exportimport/NavigationImportTask.java 2011-08-15 19:24:14 UTC (rev 7132)
@@ -23,20 +23,25 @@
package org.exoplatform.portal.mop.management.exportimport;
import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.model.NavigationFragment;
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.description.DescriptionService;
import org.exoplatform.portal.mop.importer.ImportMode;
import org.exoplatform.portal.mop.importer.NavigationImporter;
+import org.exoplatform.portal.mop.management.operations.navigation.NavigationUtils;
import org.exoplatform.portal.mop.navigation.NavigationContext;
import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.pom.data.ModelDataStorage;
-import org.exoplatform.portal.pom.data.PortalData;
-import org.exoplatform.portal.pom.data.PortalKey;
+import org.exoplatform.portal.mop.navigation.NodeChangeListener;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeState;
+import org.exoplatform.portal.mop.navigation.Scope;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Locale;
/**
@@ -91,25 +96,64 @@
rollbackTask = new RollbackTask()
{
@Override
+ public String getDescription()
+ {
+ return "Deleting navigation for site " + siteKey;
+ }
+
+ @Override
public void rollback() throws Exception
{
+ log.debug("Rollback: " + getDescription());
navigationService.destroyNavigation(navContext);
}
};
}
else
{
- //TODO: Rollback updates.
+
+ final List<NodeContext<NodeContext<?>>> snapshots = new ArrayList<NodeContext<NodeContext<?>>>(data.getFragments().size());
+ for (NavigationFragment fragment : data.getFragments())
+ {
+ snapshots.add(NavigationUtils.loadNode(navigationService, navContext, fragment.getParentURI()));
+ }
+
rollbackTask = new RollbackTask()
{
@Override
+ public String getDescription()
+ {
+ return "Rolling back navigation changes...";
+ }
+
+ @Override
public void rollback() throws Exception
{
- log.warn("Rollback for existing navigation not supported at the moment.");
+ log.debug(getDescription());
+
+ for (NodeContext<NodeContext<?>> snapshot : snapshots)
+ {
+ RollbackChangeListener listener = new RollbackChangeListener();
+ navigationService.updateNode(snapshot, Scope.ALL, listener);
+
+ // Rollback...
+ listener.rollback();
+
+ // If any errors, throw exception
+ if (listener.errors)
+ {
+ throw new Exception("Error rolling back navigation snapshot '" + snapshot.getName() + "'");
+ }
+
+ navigationService.saveNode(snapshot, null);
+ }
+
+ log.debug("Successfully rolled back navigation changes.");
}
};
}
+ // Import navigation using gatein navigation importer.
NavigationImporter importer = new NavigationImporter(locale, mode, data, navigationService, descriptionService);
importer.perform();
}
@@ -125,6 +169,183 @@
private static interface RollbackTask
{
+ String getDescription();
+
void rollback() throws Exception;
}
+
+ private class RollbackChangeListener implements NodeChangeListener<NodeContext<NodeContext<?>>>
+ {
+ private List<RollbackTask> tasks = new ArrayList<RollbackTask>();
+ private boolean errors;
+
+ @Override
+ public void onAdd(final NodeContext<NodeContext<?>> target, final NodeContext<NodeContext<?>> parent, NodeContext<NodeContext<?>> previous)
+ {
+ tasks.add(new RollbackTask()
+ {
+ @Override
+ public String getDescription()
+ {
+ return "Removing node " + target.getName() + " from parent " + parent.getName();
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ parent.removeNode(target.getName());
+ }
+ });
+ }
+
+ @Override
+ public void onCreate(final NodeContext<NodeContext<?>> target, final NodeContext<NodeContext<?>> parent, final NodeContext<NodeContext<?>> previous, final String name)
+ {
+ tasks.add(new RollbackTask()
+ {
+ @Override
+ public String getDescription()
+ {
+ return "Removing node " + name + " from parent " + parent.getName();
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ parent.removeNode(name);
+ }
+ });
+ }
+
+ @Override
+ public void onRemove(final NodeContext<NodeContext<?>> target, final NodeContext<NodeContext<?>> parent)
+ {
+ tasks.add(new RollbackTask()
+ {
+ // Copy all state for rollback
+ private String name = target.getName();
+ private Integer index = target.getIndex();
+ boolean hidden = target.isHidden();
+ private NodeState state = target.getState();
+
+ @Override
+ public String getDescription()
+ {
+ return "Adding node " + target.getName() + " to parent " + parent.getName();
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ NodeContext node = parent.add(index, name);
+ node.setState(state);
+ node.setHidden(hidden);
+ }
+ });
+ }
+
+ @Override
+ public void onDestroy(final NodeContext<NodeContext<?>> target, final NodeContext<NodeContext<?>> parent)
+ {
+ tasks.add(new RollbackTask()
+ {
+ @Override
+ public String getDescription()
+ {
+ return "Adding node " + target.getName() + " from parent " + parent.getName();
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ parent.add(null, target);
+ }
+ });
+ }
+
+ @Override
+ public void onRename(final NodeContext<NodeContext<?>> target, final NodeContext<NodeContext<?>> parent, final String name)
+ {
+ tasks.add(new RollbackTask()
+ {
+ // Copy previous name for rollback
+ private String targetName = target.getName();
+
+ @Override
+ public String getDescription()
+ {
+ return "Renaming node " + name + " to " + targetName + " for parent " + parent.getName();
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ target.setName(targetName);
+ }
+ });
+ }
+
+ @Override
+ public void onUpdate(final NodeContext<NodeContext<?>> target, final NodeState state)
+ {
+ tasks.add(new RollbackTask()
+ {
+ // Copy state for rollback
+ private NodeState targetState = target.getState();
+
+ @Override
+ public String getDescription()
+ {
+ return "Setting node " + target.getName() + " back to previous state " + targetState;
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ target.setState(targetState);
+ }
+ });
+ }
+
+ @Override
+ public void onMove(final NodeContext<NodeContext<?>> target, final NodeContext<NodeContext<?>> from, final NodeContext<NodeContext<?>> to, NodeContext<NodeContext<?>> previous)
+ {
+ tasks.add(new RollbackTask()
+ {
+ @Override
+ public String getDescription()
+ {
+ return "Moving node " + target.getName() + " from " + to.getName() + " to " + from.getName();
+ }
+
+ @Override
+ public void rollback() throws Exception
+ {
+ from.add(target.getIndex(), target);
+ to.removeNode(target.getName());
+ }
+ });
+ }
+
+ public void rollback()
+ {
+ boolean debug = log.isDebugEnabled();
+ for (RollbackTask task : tasks)
+ {
+ try
+ {
+ if (debug)
+ {
+ log.debug("Rollback: " + task.getDescription());
+ }
+ task.rollback();
+ }
+ catch (Exception e)
+ {
+ log.error("Exception during NodeChangeListener's rollback task: " + task.getDescription(), e);
+ errors = true;
+ }
+ }
+ }
+ }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java 2011-08-15 18:42:13 UTC (rev 7131)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/MopImportResource.java 2011-08-15 19:24:14 UTC (rev 7132)
@@ -187,7 +187,7 @@
}
// Perform import
- Map<SiteKey, MopImport> completedImportMap = new HashMap<SiteKey, MopImport>();
+ Map<SiteKey, MopImport> importsRan = new HashMap<SiteKey, MopImport>();
try
{
log.info("Performing import using strategy '" + strategy.getName() + "'");
@@ -195,13 +195,13 @@
{
SiteKey siteKey = mopImportEntry.getKey();
MopImport mopImport = mopImportEntry.getValue();
- MopImport completed = new MopImport();
+ MopImport ran = new MopImport();
- if (completedImportMap.containsKey(siteKey))
+ if (importsRan.containsKey(siteKey))
{
throw new IllegalStateException("Multiple site imports for same operation.");
}
- completedImportMap.put(siteKey, completed);
+ importsRan.put(siteKey, ran);
log.debug("Importing data for site " + siteKey);
@@ -209,24 +209,24 @@
if (mopImport.siteTask != null)
{
log.debug("Importing site layout data.");
+ ran.siteTask = mopImport.siteTask;
mopImport.siteTask.importData(strategy);
- completed.siteTask = mopImport.siteTask;
}
// Page import
if (mopImport.pageTask != null)
{
log.debug("Importing page data.");
+ ran.pageTask = mopImport.pageTask;
mopImport.pageTask.importData(strategy);
- completed.pageTask = mopImport.pageTask;
}
// Navigation import
if (mopImport.navigationTask != null)
{
log.debug("Importing navigation data.");
+ ran.navigationTask = mopImport.navigationTask;
mopImport.navigationTask.importData(strategy);
- completed.navigationTask = mopImport.navigationTask;
}
}
log.info("Import successful !");
@@ -236,7 +236,7 @@
boolean rollbackSuccess = true;
log.error("Exception importing data.", t);
log.info("Attempting to rollback data modified by import.");
- for (Map.Entry<SiteKey, MopImport> mopImportEntry : completedImportMap.entrySet())
+ for (Map.Entry<SiteKey, MopImport> mopImportEntry : importsRan.entrySet())
{
SiteKey siteKey = mopImportEntry.getKey();
MopImport mopImport = mopImportEntry.getValue();
@@ -292,7 +292,7 @@
finally
{
importMap.clear();
- completedImportMap.clear();
+ importsRan.clear();
}
}
14 years, 8 months
gatein SVN: r7130 - epp/portal/branches.
by do-not-reply@jboss.org
Author: ghjboss
Date: 2011-08-15 14:38:51 -0400 (Mon, 15 Aug 2011)
New Revision: 7130
Removed:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/
Log:
deleted the branch because this was accidentally forked from epp 5.1.1.
14 years, 8 months
gatein SVN: r7129 - epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: ghjboss
Date: 2011-08-15 12:04:25 -0400 (Mon, 15 Aug 2011)
New Revision: 7129
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
Log:
fix for JBEPP-1071
Modified: epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java
===================================================================
--- epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-15 15:48:37 UTC (rev 7128)
+++ epp/portal/branches/EPP_5_1_0_GA_JBEPP-1071/component/identity/src/main/java/org/exoplatform/services/organization/idm/CustomMembershipLoginModule.java 2011-08-15 16:04:25 UTC (rev 7129)
@@ -154,8 +154,7 @@
User user = orgService.getUserHandler().findUserByName(userId);
MembershipType memberType = orgService.getMembershipTypeHandler().findMembershipType(membershipType);
Group platformUsersGroup = orgService.getGroupHandler().findGroupById(groupId);
- orgService.getMembershipHandler().linkMembership(user, platformUsersGroup, memberType, true);
- end(orgService);
+ orgService.getMembershipHandler().linkMembership(user, platformUsersGroup, memberType, true);
}
catch (Exception e)
{
14 years, 8 months