Author: chris.laprun(a)jboss.com
Date: 2011-07-28 11:27:35 -0400 (Thu, 28 Jul 2011)
New Revision: 6941
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/portal/NavigationImpl.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java
portal/branches/api/pom.xml
Log:
- Adapted for changes in Id design.
Modified: portal/branches/api/component/api-impl/pom.xml
===================================================================
--- portal/branches/api/component/api-impl/pom.xml 2011-07-28 12:18:49 UTC (rev 6940)
+++ portal/branches/api/component/api-impl/pom.xml 2011-07-28 15:27:35 UTC (rev 6941)
@@ -18,6 +18,10 @@
<artifactId>gatein-java-api</artifactId>
</dependency>
<dependency>
+ <groupId>org.gatein.api</groupId>
+ <artifactId>generic-id-impl</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.container</artifactId>
</dependency>
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-28
12:18:49 UTC (rev 6940)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-28
15:27:35 UTC (rev 6941)
@@ -52,6 +52,7 @@
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.Page;
@@ -83,21 +84,21 @@
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()
+ public static final Context CONTEXT = GenericContext.builder()
.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();
- public static final Context GROUP_CONTEXT =
Context.builder().requiredUnboundedHierarchicalComponent("group",
Identifiable.class, Pattern.compile("(" + GROUP_CHARS + ")+"))
+ public static final Context GROUP_CONTEXT =
GenericContext.builder().requiredUnboundedHierarchicalComponent("group",
Identifiable.class, Pattern.compile("(" + GROUP_CHARS + ")+"))
.withDefaultSeparator("/").requireSeparatorInFirstPosition().build();
- public static final Context APPLICATION_CONTEXT =
Context.builder().requiredComponent("application", Identifiable.class,
Pattern.compile("\\w+"))
+ public static final Context APPLICATION_CONTEXT =
GenericContext.builder().requiredComponent("application", Identifiable.class,
Pattern.compile("\\w+"))
.requiredComponent("portlet", Portlet.class,
Pattern.compile("\\w+")).withDefaultSeparator("/").build();
- private static final Context GADGET_CONTEXT =
Context.builder().requiredComponent("name", Gadget.class,
Pattern.compile("\\w+")).build();
- private static final Context CATEGORY_CONTEXT =
Context.builder().requiredComponent("name", Category.class,
Pattern.compile("\\w+")).build();
- private static final Context WSRP_CONTEXT =
Context.builder().requiredComponent("invoker", Identifiable.class,
Pattern.compile("\\w+"))
+ private static final Context GADGET_CONTEXT =
GenericContext.builder().requiredComponent("name", Gadget.class,
Pattern.compile("\\w+")).build();
+ private static final Context CATEGORY_CONTEXT =
GenericContext.builder().requiredComponent("name", Category.class,
Pattern.compile("\\w+")).build();
+ private static final Context WSRP_CONTEXT =
GenericContext.builder().requiredComponent("invoker", Identifiable.class,
Pattern.compile("\\w+"))
.requiredComponent("portletcontext", WSRP.class,
Pattern.compile(GROUP_CHARS + "+")).build();
private static final String MANAGED = "managed";
- private static final Context MANAGED_CONTENT_CONTEXT = Context.builder()
+ private static final Context MANAGED_CONTENT_CONTEXT = GenericContext.builder()
.requiredComponent(MANAGED, ManagedContent.class, Pattern.compile(MANAGED))
.requiredComponent("content", Content.class,
Pattern.compile(".+"))
.build();
@@ -239,7 +240,7 @@
public Site adapt(Object old)
{
Group group = (Group)old;
- return getGroupSite(Id.parse(GROUP_CONTEXT, group.getId()));
+ return getGroupSite(GROUP_CONTEXT.parse(group.getId()));
}
};
}
@@ -324,32 +325,32 @@
public Id groupId(String root, String... children)
{
- return Id.create(GROUP_CONTEXT, root, children);
+ return GROUP_CONTEXT.create(root, children);
}
public Id<Portlet> portletId(String application, String portlet)
{
- return Id.create(APPLICATION_CONTEXT, Portlet.class, application, portlet);
+ return APPLICATION_CONTEXT.create(Portlet.class, application, portlet);
}
public Id<Portlet> parsePortletId(String contentId)
{
- return Id.parse(GateInImpl.APPLICATION_CONTEXT, contentId, Portlet.class);
+ return APPLICATION_CONTEXT.parse(contentId, Portlet.class);
}
public Id<WSRP> wsrpPortletId(String invoker, String portlet)
{
- return Id.create(WSRP_CONTEXT, WSRP.class, invoker, portlet);
+ return WSRP_CONTEXT.create(WSRP.class, invoker, portlet);
}
public Id<WSRP> parseWSRPPortletId(String compositeId)
{
- return Id.parse(WSRP_CONTEXT, compositeId, WSRP.class);
+ return WSRP_CONTEXT.parse(compositeId, WSRP.class);
}
public Id<Gadget> gadgetId(String gadgetName)
{
- return Id.create(GADGET_CONTEXT, Gadget.class, gadgetName);
+ return GADGET_CONTEXT.create(Gadget.class, gadgetName);
}
public Id<Gadget> gadgetId(URI uri)
@@ -359,17 +360,17 @@
public <T extends Content> Id<ManagedContent> managedContentId(Id<T>
contentId)
{
- return Id.create(MANAGED_CONTENT_CONTEXT, ManagedContent.class, MANAGED,
contentId.toString());
+ return MANAGED_CONTENT_CONTEXT.create(ManagedContent.class, MANAGED,
contentId.toString());
}
public Id<Category> categoryId(String name)
{
- return Id.create(CATEGORY_CONTEXT, Category.class, name);
+ return CATEGORY_CONTEXT.create(Category.class, name);
}
public <T extends Site> Id<T> siteId(Type<T, Site> siteType, String
siteName)
{
- return Id.create(CONTEXT, siteType.getValueType(), siteType.getName(), siteName);
+ return CONTEXT.create(siteType.getValueType(), siteType.getName(), siteName);
}
public <T extends Site> Id<Page> pageId(Id<T> ownerSite, String
pageName)
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-28
12:18:49 UTC (rev 6940)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-28
15:27:35 UTC (rev 6941)
@@ -29,6 +29,7 @@
import org.exoplatform.portal.mop.navigation.Scope;
import org.gatein.api.GateIn;
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;
@@ -51,7 +52,7 @@
private Id<Navigation> id;
private final GateInImpl gateIn;
- private final static Context CONTEXT =
Context.builder().requiredComponent("navigation", Navigation.class,
Pattern.compile("[a-z0-9]+")).build();
+ private final static Context CONTEXT =
GenericContext.builder().requiredComponent("navigation", Navigation.class,
Pattern.compile("[a-z0-9]+")).build();
public NavigationImpl(Id<Site> siteId, NodeContext<NavigationImpl>
context, GateInImpl gateIn)
{
@@ -210,7 +211,7 @@
{
if (id == null)
{
- id = Id.create(CONTEXT, Navigation.class, context.getId());
+ id = CONTEXT.create(Navigation.class, context.getId());
}
return id;
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-07-28
12:18:49 UTC (rev 6940)
+++
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java 2011-07-28
15:27:35 UTC (rev 6941)
@@ -132,7 +132,7 @@
private static IdentifiableImpl createIdentifiable(String name)
{
- return new IdentifiableImpl(Id.create(GateInImpl.GROUP_CONTEXT, name), name,
null);
+ return new IdentifiableImpl(GateInImpl.GROUP_CONTEXT.create(name), name, null);
}
private static class TestCollection implements
IterableIdentifiableCollection<Identifiable>
Modified: portal/branches/api/pom.xml
===================================================================
--- portal/branches/api/pom.xml 2011-07-28 12:18:49 UTC (rev 6940)
+++ portal/branches/api/pom.xml 2011-07-28 15:27:35 UTC (rev 6941)
@@ -387,6 +387,11 @@
</dependency>
<dependency>
<groupId>org.gatein.api</groupId>
+ <artifactId>generic-id-impl</artifactId>
+ <version>${org.gatein.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.api</groupId>
<artifactId>java-api-impl</artifactId>
<version>${project.version}</version>
</dependency>