Author: chris.laprun(a)jboss.com
Date: 2011-07-23 09:50:44 -0400 (Sat, 23 Jul 2011)
New Revision: 6921
Added:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java
Log:
- Adapted for API changes.
- Finished implementation of Category.
- Added ManagedContent implementation.
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -23,6 +23,7 @@
package org.gatein.portal.api.impl;
import org.exoplatform.application.gadget.GadgetRegistryService;
+import org.exoplatform.application.gadget.SourceStorage;
import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
@@ -53,7 +54,8 @@
import org.gatein.api.portal.Portal;
import org.gatein.api.portal.Site;
import org.gatein.api.util.IterableResult;
-import org.gatein.api.util.ParameterValidation;
+import org.gatein.api.util.Type;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.portal.api.impl.portal.GroupSiteImpl;
import org.gatein.portal.api.impl.portal.PageImpl;
import org.gatein.portal.api.impl.portal.PortalImpl;
@@ -76,7 +78,7 @@
private static final Query<PageData> GROUPS = new
Query<PageData>(SiteType.GROUP.getName(), null, PageData.class);
private static final String GROUP_CHARS = "\\w|-|_";
public static final Context CONTEXT = Context.builder()
- .requiredComponent("owner", Site.class,
Pattern.compile(Site.Type.PORTAL_NAME + "|" + Site.Type.GROUP_NAME +
"|" + Site.Type.DASHBOARD_NAME))
+ .requiredComponent("owner", Site.class, Pattern.compile(Site.PORTAL_NAME
+ "|" + Site.GROUP_NAME + "|" + Site.DASHBOARD_NAME))
.requiredComponent("portal", Portal.class, Pattern.compile("("
+ GROUP_CHARS + "|\\/)+"))
.optionalComponent("page", Page.class,
Pattern.compile("\\w+"))
.withDefaultSeparator("::").build();
@@ -90,6 +92,7 @@
private OrganizationService organizationService;
private ApplicationRegistryService registryService;
private GadgetRegistryService gadgetService;
+ private SourceStorage sourceStorage;
public GateInImpl(ExoContainerContext context, InitParams params, ConfigurationManager
configurationManager)
{
@@ -139,7 +142,7 @@
public Portal getDefaultPortal()
{
- return getPortal(siteId(Site.Type.PORTAL, "classic")); // todo: check
+ return getPortal(siteId(Site.PORTAL, "classic")); // todo: check
}
public IterableResult<Site> getSites()
@@ -187,7 +190,7 @@
public Site getGroupSite(Id groupId)
{
String groupName = groupId.toString();
- Id<Site> siteId = siteId(Site.Type.GROUP, groupName);
+ Id<Site> siteId = siteId(Site.GROUP, groupName);
return new GroupSiteImpl(siteId, groupName, this);
}
@@ -244,7 +247,7 @@
return type.cast(result);
}
- public <T extends Site> T getSite(Id<T> siteId, Site.Type<T> type)
+ public <T extends Site> T getSite(Id<T> siteId, Type<T, Site> type)
{
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
@@ -289,7 +292,7 @@
return null;
}
- public <T extends Site> Id<T> siteId(Site.Type<T> siteType, String
siteName)
+ public <T extends Site> Id<T> siteId(Type<T, Site> siteType, String
siteName)
{
return Id.create(CONTEXT, siteType.getValueType(), siteType.getName(), siteName);
}
@@ -307,6 +310,7 @@
organizationService =
(OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
registryService =
(ApplicationRegistryService)container.getComponentInstanceOfType(ApplicationRegistryService.class);
gadgetService =
(GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ sourceStorage =
(SourceStorage)container.getComponentInstanceOfType(SourceStorage.class);
}
public void stop()
@@ -329,6 +333,11 @@
return registryService;
}
+ public SourceStorage getSourceStorage()
+ {
+ return sourceStorage;
+ }
+
private PortalData getPortalDataFor(Id<Portal> portalId)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portalId, "Portal
Id");
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ApplicationImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -23,7 +23,9 @@
package org.gatein.portal.api.impl.content;
import org.exoplatform.application.registry.Application;
+import org.gatein.api.content.Content;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
@@ -37,4 +39,9 @@
super(Id.parse(GateInImpl.APPLICATION_CONTEXT, application.getId()),
application.getApplicationName(), gateIn);
this.application = application;
}
+
+ public Type<org.gatein.api.content.Application, Content> getType()
+ {
+ return Content.PORTLET;
+ }
}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/CategoryImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -22,21 +22,31 @@
package org.gatein.portal.api.impl.content;
+import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.gatein.api.GateIn;
import org.gatein.api.content.Category;
import org.gatein.api.content.Content;
import org.gatein.api.content.ManagedContent;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Type;
+import org.gatein.mop.api.content.ContentType;
import org.gatein.portal.api.impl.GateInImpl;
-import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
public class CategoryImpl implements Category
{
private final ApplicationCategory category;
private final GateInImpl gateIn;
+ private Map<String, ManagedContent> managed = new HashMap<String,
ManagedContent>(7);
public CategoryImpl(ApplicationCategory category, GateInImpl gateIn)
{
@@ -44,26 +54,79 @@
this.gateIn = gateIn;
}
- public <T extends Content<T>> ManagedContent<T>
getContent(Id<ManagedContent<T>> contentId)
+ public boolean contains(String managedContentName)
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ return getApplication(managedContentName) != null;
}
- public boolean contains(Id<? extends ManagedContent> contentId)
+ private Application getApplication(String managedContentName)
{
- return false; //To change body of implemented methods use File | Settings | File
Templates.
+ try
+ {
+ return gateIn.getRegistryService().getApplication(category.getName(),
managedContentName);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
}
- public <T extends Content<T>> ManagedContent<T>
addContent(Id<T> contentId)
+ public <T extends Content> ManagedContent<T> addContent(Id<T>
contentId)
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ T t = gateIn.get(contentId);
+ Type type = t.getType();
+ ContentType<?> contentType = getContentTypeFor(type);
+ ArrayList<String> permissions = new ArrayList<String>();
+ permissions.add(UserACL.EVERYONE);
+ gateIn.getRegistryService().createOrReplaceContentIn(category.getName(),
t.getName(), contentType, t.getId().toString(), t.getDisplayName(), null, permissions);
+
+ ManagedContent<T> managedContent = new ManagedContentImpl<T>(t, this);
+ managed.put(managedContent.getName(), managedContent);
+
+ return managedContent;
}
- public List<Id<? extends ManagedContent>> getKnownManagedContentIds()
+ private ContentType<?> getContentTypeFor(Type type)
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ if (Content.GADGET.equals(type))
+ {
+ return org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE;
+ }
+ else if (Content.PORTLET.equals(type))
+ {
+ return Portlet.CONTENT_TYPE;
+ }
+ else if (Content.WSRP.equals(type))
+ {
+ return WSRP.CONTENT_TYPE;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown Content type: " + type);
+ }
}
+ private <T extends Content> String getContentIdFor(T content)
+ {
+ Type type = content.getType();
+ if (Content.GADGET.equals(type))
+ {
+ return content.getName();
+ }
+ else if (Content.PORTLET.equals(type))
+ {
+ return content.getId().toString();
+ }
+ else if (Content.WSRP.equals(type))
+ {
+ return content.getId().toString();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown Content type: " + type);
+ }
+ }
+
public String getDescription()
{
return category.getDescription();
@@ -74,11 +137,21 @@
category.setDescription(description);
}
- public <T extends Content<T>> void
removeContent(Id<ManagedContent<T>> id)
+ public void removeContent(String managedContentName)
{
- //To change body of implemented methods use File | Settings | File Templates.
+ managed.remove(managedContentName);
}
+ public <T extends Content> ManagedContent<T> getManagedContent(String
name)
+ {
+ return managed.get(name);
+ }
+
+ public Collection<String> getKnownManagedContentNames()
+ {
+ return managed.keySet();
+ }
+
public Id<Category> getId()
{
return gateIn.categoryId(getName());
@@ -98,4 +171,13 @@
{
return gateIn;
}
+
+ void renameManagedContent(String oldName, String newName)
+ {
+ ManagedContent removed = managed.remove(oldName);
+ if (removed != null)
+ {
+ managed.put(newName, removed);
+ }
+ }
}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -31,6 +31,7 @@
import org.gatein.api.content.Gadget;
import org.gatein.api.content.ManagedContent;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Filter;
import org.gatein.api.util.IterableResult;
import org.gatein.api.util.Query;
import org.gatein.portal.api.impl.GateInImpl;
@@ -83,7 +84,7 @@
}
}
- public <T extends Content<T>> T getContent(Id<T> id)
+ public <T extends Content> T get(Id<T> id)
{
Class<T> type = id.getIdentifiableType();
Object result;
@@ -125,4 +126,29 @@
{
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
+
+ public IterableResult<Content> getAll()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public int size()
+ {
+ return 0; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public <U extends Content> boolean contains(Id<U> id)
+ {
+ return false; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public <U extends Content> IterableResult<U> getAllWhere(Filter<U>
filter)
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public <U extends Content> IterableResult<U>
getAllSatisfying(Query<U> query)
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/GadgetImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -23,13 +23,14 @@
package org.gatein.portal.api.impl.content;
import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.Source;
+import org.gatein.api.content.Content;
import org.gatein.api.id.Id;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
-import java.net.MalformedURLException;
import java.net.URI;
-import java.net.URL;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
public class GadgetImpl extends IdentifiableImpl<org.gatein.api.content.Gadget>
implements org.gatein.api.content.Gadget
@@ -42,34 +43,86 @@
this.gadget = gadget;
}
- public URL getViewURL()
+ public URI getReferenceURI()
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ return URI.create(gadget.getReferenceUrl());
}
- public URL getEditURL()
+ public URI getURI()
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ return URI.create(gadget.getUrl());
}
- public URL getReferenceURL()
+ public Data getData()
{
+ if (isLocal())
+ {
+ return new LocalData()
+ {
+
+ public String getSource()
+ {
+ try
+ {
+ return GadgetImpl.this.getSource().getTextContent();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void setSource(String source)
+ {
+ Source initial = GadgetImpl.this.getSource();
+ try
+ {
+ initial.setTextContent(source);
+ getGateInImpl().getSourceStorage().saveSource(gadget, initial);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+ else
+ {
+ return new RemoteData()
+ {
+ public URI getURI()
+ {
+ return GadgetImpl.this.getURI();
+ }
+
+ public void setURI(URI uri)
+ {
+ gadget.setUrl(uri.toString());
+ }
+ };
+ }
+ }
+
+ private Source getSource()
+ {
try
{
- return URI.create(gadget.getReferenceUrl()).toURL();
+ return getGateInImpl().getSourceStorage().getSource(gadget);
}
- catch (MalformedURLException e)
+ catch (Exception e)
{
throw new RuntimeException(e);
}
}
- public String getSource()
+ public boolean isLocal()
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ return gadget.isLocal();
}
- public void setSource(String source)
+ public Type<org.gatein.api.content.Gadget, Content> getType()
{
+ return Content.GADGET;
}
}
Added:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java
(rev 0)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ManagedContentImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.api.impl.content;
+
+import org.gatein.api.GateIn;
+import org.gatein.api.content.Content;
+import org.gatein.api.content.ManagedContent;
+import org.gatein.api.id.Context;
+import org.gatein.api.id.Id;
+import org.gatein.common.util.ParameterValidation;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class ManagedContentImpl<T extends Content> implements
ManagedContent<T>
+{
+ private final T content;
+ private final Id<ManagedContent<T>> id;
+ private final CategoryImpl category;
+ private String name;
+ private String displayName;
+ private String description;
+ private static final String MANAGED = "managed";
+ private static final Context CONTEXT = Context.builder()
+ .requiredComponent(MANAGED, ManagedContentImpl.class, Pattern.compile(MANAGED))
+ .requiredComponent("content", Content.class,
Pattern.compile(".+"))
+ .build();
+
+ public ManagedContentImpl(T content, CategoryImpl category)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(content, "Content");
+ this.content = content;
+ this.id = Id.create(CONTEXT, MANAGED, content.getId().toString());
+ this.category = category;
+ }
+
+ public Id<ManagedContent<T>> getId()
+ {
+ return id;
+ }
+
+ public String getName()
+ {
+ if (name != null)
+ {
+ return name;
+ }
+ return content.getName();
+ }
+
+ public void setName(String name)
+ {
+ category.renameManagedContent(this.name, name);
+ this.name = name;
+ }
+
+ public String getDisplayName()
+ {
+ if (displayName != null)
+ {
+ return displayName;
+ }
+ return content.getDisplayName();
+ }
+
+ public GateIn getGateIn()
+ {
+ return content.getGateIn();
+ }
+
+ public void setDisplayName(String displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ public T getContent()
+ {
+ return content;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/DashboardSiteImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -25,6 +25,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.gatein.api.id.Id;
import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
@@ -43,6 +44,6 @@
public Type getType()
{
- return Type.DASHBOARD;
+ return Site.DASHBOARD;
}
}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/GroupSiteImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -25,6 +25,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.gatein.api.id.Id;
import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
@@ -43,6 +44,6 @@
public Type getType()
{
- return Type.GROUP;
+ return Site.GROUP;
}
}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/NavigationImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -164,7 +164,7 @@
return contains(getIdForChild(key));
}
- public boolean contains(Id<Navigation> navigationId)
+ public <U extends Navigation> boolean contains(Id<U> navigationId)
{
loadChildrenIfNeeded();
@@ -176,7 +176,7 @@
return createAndAdd(getIdForChild(key));
}
- public Navigation createAndAdd(Id<Navigation> navigationId)
+ public <U extends Navigation> U createAndAdd(Id<U> navigationId)
{
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
@@ -186,7 +186,7 @@
return get(getIdForChild(key));
}
- public Navigation get(Id<Navigation> navigationId)
+ public <U extends Navigation> U get(Id<U> navigationId)
{
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/PortalImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -27,6 +27,7 @@
import org.gatein.api.content.ContentRegistry;
import org.gatein.api.portal.Portal;
import org.gatein.api.portal.Site;
+import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.content.ContentRegistryImpl;
@@ -36,7 +37,7 @@
public PortalImpl(PortalData portal, GateInImpl gateIn)
{
- super(gateIn.siteId(Site.Type.forName(portal.getKey().getType()),
portal.getKey().getId()), portal.getName(), gateIn);
+ super(gateIn.siteId(Type.forName(portal.getKey().getType(), Site.class),
portal.getKey().getId()), portal.getName(), gateIn);
}
public ContentRegistry getContentRegistry()
@@ -46,7 +47,7 @@
public Type getType()
{
- return Type.PORTAL;
+ return Site.PORTAL;
}
protected SiteKey getSiteKey()
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java 2011-07-23
13:48:27 UTC (rev 6920)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/portal/SiteImpl.java 2011-07-23
13:50:44 UTC (rev 6921)
@@ -32,7 +32,7 @@
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
-import org.gatein.api.util.Container;
+import org.gatein.api.util.HierarchicalContainer;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.IdentifiableImpl;
@@ -44,7 +44,7 @@
super(siteId, name, gateIn);
}
- public Container<String, Page> getPageRegistry()
+ public HierarchicalContainer<String, Page> getPageRegistry()
{
return null; //To change body of implemented methods use File | Settings | File
Templates.
}