Author: chris.laprun(a)jboss.com
Date: 2011-07-29 13:42:53 -0400 (Fri, 29 Jul 2011)
New Revision: 6953
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java
portal/branches/api/examples/portlets/api/src/main/java/org/gatein/portal/samples/api/NavigationPortlet.java
Log:
- Fixed getDashboards.
- Added userId 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-29
16:50:35 UTC (rev 6952)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/GateInImpl.java 2011-07-29
17:42:53 UTC (rev 6953)
@@ -25,7 +25,6 @@
import org.exoplatform.application.gadget.GadgetRegistryService;
import org.exoplatform.application.gadget.SourceStorage;
import org.exoplatform.application.registry.ApplicationRegistryService;
-import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
@@ -70,7 +69,6 @@
import org.picocontainer.Startable;
import java.net.URI;
-import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -95,6 +93,7 @@
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 =
GenericContext.builder().requiredComponent("name", Gadget.class,
Pattern.compile("\\w+")).build();
+ private static final Context USER_CONTEXT =
GenericContext.builder().requiredComponent("name", Identifiable.class,
Pattern.compile("[a-zA-Z0-9]+")).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();
@@ -205,10 +204,8 @@
final UserHandler userHandler = organizationService.getUserHandler();
// todo: optimize
- ListAccess<User> usersAccess = userHandler.findAllUsers();
- List<User> users = Arrays.asList(usersAccess.load(0,
usersAccess.getSize()));
+ List<User> users = userHandler.getUserPageList(1000).getAll();
-
// todo: check for correctness
return new AdaptedIterableIdentifiableCollection<User, Site>(users.size(),
users.iterator())
{
@@ -341,7 +338,7 @@
public Id userId(String user)
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ return USER_CONTEXT.create(user);
}
public Id groupId(String root, String... children)
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-07-29
16:50:35 UTC (rev 6952)
+++
portal/branches/api/examples/portlets/api/src/main/java/org/gatein/portal/samples/api/NavigationPortlet.java 2011-07-29
17:42:53 UTC (rev 6953)
@@ -23,7 +23,7 @@
package org.gatein.portal.samples.api;
import org.gatein.api.GateIn;
-import org.gatein.api.portal.Portal;
+import org.gatein.api.portal.Site;
import org.gatein.api.util.IterableIdentifiableCollection;
import javax.portlet.GenericPortlet;
@@ -49,10 +49,12 @@
protected void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
{
- IterableIdentifiableCollection<Portal> portals = gateIn.getPortals();
- for (Portal portal : portals)
+ IterableIdentifiableCollection<? extends Site> portals = gateIn.getSites();
+ for (Site portal : portals)
{
- response.getWriter().println(portal.getNavigation());
+ String s = portal.toString();
+ System.out.println(s);
+ response.getWriter().println(s);
}
}
}
Show replies by date