You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by vk...@apache.org on 2008/09/10 12:13:09 UTC

svn commit: r693768 - /portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserBrowserPortlet.java

Author: vkumar
Date: Wed Sep 10 03:13:08 2008
New Revision: 693768

URL: http://svn.apache.org/viewvc?rev=693768&view=rev
Log:
Optimizing portlet functionality with  new security API's

Modified:
    portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserBrowserPortlet.java

Modified: portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserBrowserPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserBrowserPortlet.java?rev=693768&r1=693767&r2=693768&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserBrowserPortlet.java (original)
+++ portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserBrowserPortlet.java Wed Sep 10 03:13:08 2008
@@ -133,8 +133,8 @@
         {
             if (control == null)
             {
-                Iterator users = userManager.getUsers(USER_FILTER).iterator();
-                control = buildTree(users, request.getLocale());
+                List<String> users = userManager.getUserNames(USER_FILTER);
+                control = buildTree(users.iterator(), request.getLocale());
                 request.getPortletSession().setAttribute(TREE_CONTROL, control);
             }
         }
@@ -157,14 +157,7 @@
         {
             if (roles == null)
             {
-                roles = new LinkedList();
-                Iterator fullRoles = roleManager.getRoles("").iterator();
-                while (fullRoles.hasNext())
-                {
-                    Role role = (Role)fullRoles.next();
-                    //roles.add(role.getPrincipal().getName());
-                    roles.add(role.getName());
-                }
+                roles = roleManager.getRoleNames("");
                 request.getPortletSession().setAttribute(ROLES_CONTROL, roles);
             }
         }
@@ -221,8 +214,8 @@
                 	credential.setPassword(null,password);
                 	userManager.storePasswordCredential(credential);
                     TreeControl control = (TreeControl) actionRequest.getPortletSession().getAttribute(TREE_CONTROL);
-                    Iterator users = userManager.getUsers(USER_FILTER).iterator();
-                    control = buildTree(users, actionRequest.getLocale());
+                    List<String> users = userManager.getUserNames(USER_FILTER);
+                    control = buildTree(users.iterator(), actionRequest.getLocale());
                     actionRequest.getPortletSession().setAttribute(TREE_CONTROL, control);
                     selectNode(actionRequest, control, userName);
                     
@@ -317,10 +310,10 @@
 
         while (users.hasNext())
         {
-            User user = (User) users.next();
+            String userName = (String) users.next();
             //Principal principal = getPrincipal(user.getSubject(), UserPrincipal.class);
 
-            TreeControlNode userNode = new TreeControlNode(user.getName(), null, user.getName(),
+            TreeControlNode userNode = new TreeControlNode(userName, null, userName,
                     SecurityResources.PORTLET_URL, null, false, USER_DETAIL_DOMAIN);
             userTree.addChild(userNode);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org