portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups groups-view.vm
Date Sat, 23 Apr 2005 20:33:36 GMT
taylor      2005/04/23 13:33:36

  Modified:    applications/security/src/java/org/apache/jetspeed/portlets/security/groups
                        GroupBrowser.java
               applications/security/src/java/org/apache/jetspeed/portlets/security/roles
                        RoleBrowser.java
               applications/security/src/webapp/WEB-INF/security/roles
                        roles-view.vm
               applications/security/src/webapp/WEB-INF/security/groups
                        groups-view.vm
  Log:
  add filtering to group and role browsers
  
  Revision  Changes    Path
  1.5       +29 -4     jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/groups/GroupBrowser.java
  
  Index: GroupBrowser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/groups/GroupBrowser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GroupBrowser.java	23 Apr 2005 19:08:13 -0000	1.4
  +++ GroupBrowser.java	23 Apr 2005 20:33:36 -0000	1.5
  @@ -65,11 +65,17 @@
       public void getRows(RenderRequest request, String sql, int windowSize)
       throws Exception
       {
  +        getRows(request, sql, windowSize, "");
  +    }
  +    
  +    public void getRows(RenderRequest request, String sql, int windowSize, String filter)
  +    throws Exception
  +    {
           List resultSetTitleList = new ArrayList();
           List resultSetTypeList = new ArrayList();
           try
           {
  -            Iterator groups = groupManager.getGroups("");
  +            Iterator groups = groupManager.getGroups(filter);
                           
               
               resultSetTypeList.add(String.valueOf(Types.VARCHAR));
  @@ -113,6 +119,13 @@
               this.getContext(request).put("statusMsg", msg);            
           }
           
  +        String filtered = (String)PortletMessaging.receive(request, SecurityResources.TOPIC_GROUPS,
SecurityResources.MESSAGE_FILTERED);
  +        if (filtered != null)
  +        {
  +            this.getContext(request).put(FILTERED, "on");            
  +        }
  +        
  +        
           super.doView(request, response);
       }
   
  @@ -154,7 +167,7 @@
                           groupManager.removeGroup(delete);
                           this.clearBrowserIterator(request);
                           PortletMessaging.cancel(request, "group", "selected");
  -                        PortletMessaging.publish(request, SecurityResources.TOPIC_USERS,
"groups", "refresh");
  +                        PortletMessaging.publish(request, SecurityResources.TOPIC_GROUPS,
"groups", "refresh");
                       }
                   }
                   catch (Exception e)
  @@ -194,7 +207,7 @@
                               groupManager.addGroup(groupName);
                               this.clearBrowserIterator(request);
                           }
  -                        PortletMessaging.publish(request, SecurityResources.TOPIC_USERS,
"groups", "refresh");
  +                        PortletMessaging.publish(request, SecurityResources.TOPIC_GROUPS,
"groups", "refresh");
                       }
                       catch (Exception e)
                       {
  @@ -203,6 +216,18 @@
                   }
               }            
           }
  +        
  +        // TODO: if request parameters were working correctly we could replace this with
render parameters
  +        String filtered = (String)request.getParameter(FILTERED);
  +        if (filtered != null)
  +        {
  +            PortletMessaging.publish(request, SecurityResources.TOPIC_GROUPS, SecurityResources.MESSAGE_FILTERED,
"on");            
  +        }
  +        else
  +        {
  +            PortletMessaging.cancel(request, SecurityResources.TOPIC_GROUPS, SecurityResources.MESSAGE_FILTERED);
  +        }
  +        
           super.processAction(request, response);
               
       }
  
  
  
  1.4       +29 -6     jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/roles/RoleBrowser.java
  
  Index: RoleBrowser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/roles/RoleBrowser.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RoleBrowser.java	22 Apr 2005 20:42:09 -0000	1.3
  +++ RoleBrowser.java	23 Apr 2005 20:33:36 -0000	1.4
  @@ -65,11 +65,17 @@
       public void getRows(RenderRequest request, String sql, int windowSize)
       throws Exception
       {
  +        getRows(request, sql, windowSize, "");
  +    }
  +    
  +    public void getRows(RenderRequest request, String sql, int windowSize, String filter)
  +    throws Exception
  +    {
           List resultSetTitleList = new ArrayList();
           List resultSetTypeList = new ArrayList();
           try
           {
  -            Iterator roles = roleManager.getRoles("");
  +            Iterator roles = roleManager.getRoles(filter);
                           
               
               resultSetTypeList.add(String.valueOf(Types.VARCHAR));
  @@ -113,6 +119,12 @@
               this.getContext(request).put("statusMsg", msg);            
           }
           
  +        String filtered = (String)PortletMessaging.receive(request, SecurityResources.TOPIC_ROLES,
SecurityResources.MESSAGE_FILTERED);
  +        if (filtered != null)
  +        {
  +            this.getContext(request).put(FILTERED, "on");            
  +        }
  +        
           super.doView(request, response);
       }
   
  @@ -154,7 +166,7 @@
                           roleManager.removeRole(delete);
                           this.clearBrowserIterator(request);
                           PortletMessaging.cancel(request, "role", "selected");
  -                        PortletMessaging.publish(request, SecurityResources.TOPIC_USERS,
"roles", "refresh");
  +                        PortletMessaging.publish(request, SecurityResources.TOPIC_ROLES,
"roles", "refresh");
                       }
                   }
                   catch (Exception e)
  @@ -194,7 +206,7 @@
                               roleManager.addRole(roleName);
                               this.clearBrowserIterator(request);
                           }
  -                        PortletMessaging.publish(request, SecurityResources.TOPIC_USERS,
"roles", "refresh");
  +                        PortletMessaging.publish(request, SecurityResources.TOPIC_ROLES,
"roles", "refresh");
                       }
                       catch (Exception e)
                       {
  @@ -203,8 +215,19 @@
                   }
               }            
           }
  -        super.processAction(request, response);
  -            
  +
  +        // TODO: if request parameters were working correctly we could replace this with
render parameters
  +        String filtered = (String)request.getParameter(FILTERED);
  +        if (filtered != null)
  +        {
  +            PortletMessaging.publish(request, SecurityResources.TOPIC_ROLES, SecurityResources.MESSAGE_FILTERED,
"on");            
  +        }
  +        else
  +        {
  +            PortletMessaging.cancel(request, SecurityResources.TOPIC_ROLES, SecurityResources.MESSAGE_FILTERED);
  +        }
  +        
  +        super.processAction(request, response);            
       }
   
       private Role lookupRole(String roleName)
  
  
  
  1.3       +8 -0      jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/roles/roles-view.vm
  
  Index: roles-view.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/roles/roles-view.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- roles-view.vm	23 Apr 2005 19:08:13 -0000	1.2
  +++ roles-view.vm	23 Apr 2005 20:33:36 -0000	1.3
  @@ -125,4 +125,12 @@
     	<input type='hidden' name='searchColumn' value='1'/>                      	
       <input class="portlet-form-button" type="submit" value="Search">
   	<input type="text" name="searchString" size="30" value="" class="portlet-form-field-label">
   
  +	<table>
  +	<tr>
  +    <td nowrap class="portlet-section-alternate" align="right">Filter:&nbsp;&nbsp;&nbsp;</td>
  +    <td>	
  +	<input type="checkbox"  #if($filtered == "on") checked=1 #end name="filtered">
  +	</td>
  +	</tr>
  +	</table>		
   </form>
  
  
  
  1.3       +8 -0      jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups/groups-view.vm
  
  Index: groups-view.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups/groups-view.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- groups-view.vm	23 Apr 2005 19:08:13 -0000	1.2
  +++ groups-view.vm	23 Apr 2005 20:33:36 -0000	1.3
  @@ -125,4 +125,12 @@
     	<input type='hidden' name='searchColumn' value='1'/>                      	
       <input class="portlet-form-button" type="submit" value="Search">
   	<input type="text" name="searchString" size="30" value="" class="portlet-form-field-label">
   
  +	<table>
  +	<tr>
  +    <td nowrap class="portlet-section-alternate" align="right">Filter:&nbsp;&nbsp;&nbsp;</td>
  +    <td>	
  +	<input type="checkbox"  #if($filtered == "on") checked=1 #end name="filtered">
  +	</td>
  +	</tr>
  +	</table>	
   </form>
  
  
  

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


Mime
View raw message