Return-Path: Delivered-To: apmail-jakarta-jetspeed-dev-archive@www.apache.org Received: (qmail 4255 invoked from network); 21 Jan 2005 22:09:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 Jan 2005 22:09:51 -0000 Received: (qmail 14505 invoked by uid 500); 21 Jan 2005 22:09:29 -0000 Delivered-To: apmail-jakarta-jetspeed-dev-archive@jakarta.apache.org Received: (qmail 14406 invoked by uid 500); 21 Jan 2005 22:09:28 -0000 Mailing-List: contact jetspeed-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jetspeed Developers List" Reply-To: "Jetspeed Developers List" Delivered-To: mailing list jetspeed-dev@jakarta.apache.org Received: (qmail 14354 invoked by uid 500); 21 Jan 2005 22:09:28 -0000 Received: (qmail 14301 invoked by uid 500); 21 Jan 2005 22:09:27 -0000 Received: (qmail 13867 invoked by uid 99); 21 Jan 2005 22:09:25 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 21 Jan 2005 14:09:23 -0800 Received: (qmail 3668 invoked by uid 1265); 21 Jan 2005 22:09:22 -0000 Date: 21 Jan 2005 22:09:22 -0000 Message-ID: <20050121220922.3667.qmail@minotaur.apache.org> From: taylor@apache.org To: jakarta-jetspeed-2-cvs@apache.org Subject: cvs commit: jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups groups-view.vm X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N taylor 2005/01/21 14:09:22 Modified: applications/security/src/java/org/apache/jetspeed/portlets/security/resources SecurityResources_en.properties SecurityResources_zh.properties SecurityResources_it.properties SecurityResources_ja.properties SecurityResources.properties applications/security/src/webapp/WEB-INF/security/sso sites-view.vm sites-details.vm applications/security/src/java/org/apache/jetspeed/portlets/security/sso SSODetails.java SSOBrowser.java applications/security/src/webapp/WEB-INF portlet.xml Added: 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/view status-include.vm applications/security/src/java/org/apache/jetspeed/portlets/security/groups GroupBrowser.java applications/security/src/webapp/WEB-INF/security/groups groups-view.vm Log: http://issues.apache.org/jira/browse/JS2-121 - role and group admin portlets implemented for FLAT view only Revision Changes Path 1.2 +7 -1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_en.properties Index: SecurityResources_en.properties =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_en.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SecurityResources_en.properties 22 Dec 2004 17:50:10 -0000 1.1 +++ SecurityResources_en.properties 21 Jan 2005 22:09:22 -0000 1.2 @@ -34,6 +34,12 @@ security.credential.last.logon=Last Logon security.credential.expires=Expires +security.refresh = Refresh +security.new = New +security.save = Save +security.delete = Delete +security.deleteQuestion = OK to delete? + ## User Information Tabs pam.details.tabs.user_attributes=Attributes pam.details.tabs.user_role=Role 1.2 +7 -1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_zh.properties Index: SecurityResources_zh.properties =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_zh.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SecurityResources_zh.properties 22 Dec 2004 17:50:10 -0000 1.1 +++ SecurityResources_zh.properties 21 Jan 2005 22:09:22 -0000 1.2 @@ -28,6 +28,12 @@ security.groupname=\u7ec4\u7fa4\u540d\u79f0 security.profile.rules=\u81ea\u5b9a\u4e49\u9009\u9879\u89c4\u5219 +security.refresh = Refresh +security.new = New +security.save = Save +security.delete = Delete +security.deleteQuestion = OK to delete? + ## User Information Tabs pam.details.tabs.user_attributes=\u5c5e\u6027 pam.details.tabs.user_role=\u89d2\u8272 1.2 +7 -1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_it.properties Index: SecurityResources_it.properties =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_it.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SecurityResources_it.properties 22 Dec 2004 17:50:10 -0000 1.1 +++ SecurityResources_it.properties 21 Jan 2005 22:09:22 -0000 1.2 @@ -27,6 +27,12 @@ security.groupname=Nome gruppo security.profile.rules=Regole profilo +security.refresh = Refresh +security.new = New +security.save = Save +security.delete = Delete +security.deleteQuestion = OK to delete? + ## User Information Tabs pam.details.tabs.user_attributes=Attributi pam.details.tabs.user_role=Ruolo 1.2 +7 -1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_ja.properties Index: SecurityResources_ja.properties =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources_ja.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SecurityResources_ja.properties 22 Dec 2004 17:50:10 -0000 1.1 +++ SecurityResources_ja.properties 21 Jan 2005 22:09:22 -0000 1.2 @@ -27,6 +27,12 @@ security.groupname=\u30b0\u30eb\u30fc\u30d7\u540d security.profile.rules=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u30fb\u30eb\u30fc\u30eb +security.refresh = Refresh +security.new = New +security.save = Save +security.delete = Delete +security.deleteQuestion = OK to delete? + ## User Information Tabs pam.details.tabs.user_attributes=\u5c5e\u6027 pam.details.tabs.user_role=\u30ed\u30fc\u30eb 1.2 +7 -1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources.properties Index: SecurityResources.properties =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/resources/SecurityResources.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SecurityResources.properties 22 Dec 2004 17:50:10 -0000 1.1 +++ SecurityResources.properties 21 Jan 2005 22:09:22 -0000 1.2 @@ -16,6 +16,12 @@ # ## general security strings +security.refresh = Refresh +security.new = New +security.save = Save +security.delete = Delete +security.deleteQuestion = OK to delete? + security.name=Name security.value=Value security.rule=Rule 1.1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/roles/RoleBrowser.java Index: RoleBrowser.java =================================================================== /* Copyright 2004 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jetspeed.portlets.security.roles; import java.io.IOException; import java.security.Principal; import java.sql.Types; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; import javax.portlet.PortletException; import javax.portlet.PortletMode; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.apache.jetspeed.portlets.security.SecurityResources; import org.apache.jetspeed.security.Role; import org.apache.jetspeed.security.RoleManager; import org.apache.jetspeed.security.SecurityException; import org.apache.portals.gems.browser.BrowserIterator; import org.apache.portals.gems.browser.DatabaseBrowserIterator; import org.apache.portals.gems.browser.BrowserPortlet; import org.apache.portals.gems.util.StatusMessage; import org.apache.portals.messaging.PortletMessaging; import org.apache.velocity.context.Context; /** * Role Browser - flat non-hierarchical view * * @author David Sean Taylor * @version $Id: RoleBrowser.java,v 1.1 2005/01/21 22:09:22 taylor Exp $ */ public class RoleBrowser extends BrowserPortlet { private RoleManager roleManager; public void init(PortletConfig config) throws PortletException { super.init(config); roleManager = (RoleManager) getPortletContext().getAttribute(SecurityResources.CPS_ROLE_MANAGER_COMPONENT); if (null == roleManager) { throw new PortletException("Failed to find the Role Manager on portlet initialization"); } } public void getRows(RenderRequest request, String sql, int windowSize) throws Exception { List resultSetTitleList = new ArrayList(); List resultSetTypeList = new ArrayList(); try { Iterator roles = roleManager.getRoles(""); resultSetTypeList.add(String.valueOf(Types.VARCHAR)); resultSetTitleList.add("Role"); List list = new ArrayList(); while (roles.hasNext()) { Role role = (Role)roles.next(); Principal principal = role.getPrincipal(); list.add(principal.getName()); } BrowserIterator iterator = new DatabaseBrowserIterator( list, resultSetTitleList, resultSetTypeList, windowSize); setBrowserIterator(request, iterator); iterator.sort("Role"); } catch (Exception e) { //log.error("Exception in CMSBrowserAction.getRows: ", e); e.printStackTrace(); throw e; } } public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { String selected = (String)PortletMessaging.receive(request, "role", "selected"); if (selected != null) { Context context = this.getContext(request); context.put("selected", selected); } StatusMessage msg = (StatusMessage)PortletMessaging.consume(request, "RoleBrowser", "status"); if (msg != null) { this.getContext(request).put("statusMsg", msg); } super.doView(request, response); } public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { if (request.getPortletMode() == PortletMode.VIEW) { String selected = request.getParameter("role"); if (selected != null) { Role role = lookupRole(selected); if (role != null) { PortletMessaging.publish(request, "role", "selected", selected); PortletMessaging.publish(request, "role", "change", selected); } } String refresh = request.getParameter("role.refresh"); String save = request.getParameter("role.save"); String neue = request.getParameter("role.new"); String delete = request.getParameter("roleDelete"); if (refresh != null) { this.clearBrowserIterator(request); } else if (neue != null) { PortletMessaging.cancel(request, "role", "selected"); } else if (delete != null && (!(isEmpty(delete)))) { try { Role role = lookupRole(delete); if (role != null) { roleManager.removeRole(delete); this.clearBrowserIterator(request); PortletMessaging.cancel(request, "role", "selected"); } } catch (Exception e) { publishStatusMessage(request, "RoleBrowser", "status", e, "Could not remove role"); } } else if (save != null) { String roleName = request.getParameter("role.name"); if (!(isEmpty(roleName))) { try { Role role = null; String old = (String)PortletMessaging.receive(request, "role", "selected"); if (old != null) { role = lookupRole(old); } else { role = lookupRole(roleName); } if (role != null) { if (old != null && !old.equals(roleName)) { roleManager.removeRole(old); roleManager.addRole(roleName); this.clearBrowserIterator(request); PortletMessaging.publish(request, "role", "selected", roleName); } } else { roleManager.addRole(roleName); this.clearBrowserIterator(request); } } catch (Exception e) { publishStatusMessage(request, "RoleBrowser", "status", e, "Could not store role"); } } } } super.processAction(request, response); } private Role lookupRole(String roleName) { try { return roleManager.getRole(roleName); } catch (SecurityException e) { return null; } } private boolean isEmpty(String s) { if (s == null) return true; if (s.trim().equals("")) return true; return false; } } 1.1 jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/roles/roles-view.vm Index: roles-view.vm =================================================================== #* Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *# #** @author David Sean Taylor @version $Id: roles-view.vm,v 1.1 2005/01/21 22:09:22 taylor Exp $ *# #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale)) #if ($statusMsg) #parse ('/WEB-INF/view/status-include.vm') #end #set ($column = $title.get(0)) #set ($columnLink = $renderResponse.createRenderURL()) $columnLink.setParameter("js_dbcolumn",$column) ## #foreach ( $role in $table ) #if ($selected == $role) #set ($rowstyle = "jetdbLight") #else #set ($rowstyle = "jetdbOdd") #end #end
  #set ($action = $renderResponse.createActionURL()) $action.setParameter('role', $role)  

Role Name: 

1.1 jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/view/status-include.vm Index: status-include.vm =================================================================== #* Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *#
$statusMsg.Text
1.5 +5 -1 jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/sso/sites-view.vm Index: sites-view.vm =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/sso/sites-view.vm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- sites-view.vm 14 Jan 2005 01:55:47 -0000 1.4 +++ sites-view.vm 21 Jan 2005 22:09:22 -0000 1.5 @@ -25,6 +25,10 @@ #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale)) +#if ($statusMsg) +#parse ('/WEB-INF/view/status-include.vm') +#end + 1.8 +5 -1 jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/sso/sites-details.vm Index: sites-details.vm =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/sso/sites-details.vm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- sites-details.vm 14 Jan 2005 05:53:32 -0000 1.7 +++ sites-details.vm 21 Jan 2005 22:09:22 -0000 1.8 @@ -35,6 +35,10 @@ #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale)) +#if ($statusMsg) +#parse ('/WEB-INF/view/status-include.vm') +#end + #if ($currentSite)
1.8 +12 -9 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java Index: SSODetails.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/sso/SSODetails.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SSODetails.java 14 Jan 2005 05:44:22 -0000 1.7 +++ SSODetails.java 21 Jan 2005 22:09:22 -0000 1.8 @@ -43,6 +43,7 @@ import org.apache.portals.gems.browser.BrowserIterator; import org.apache.portals.gems.browser.DatabaseBrowserIterator; import org.apache.portals.gems.browser.BrowserPortlet; +import org.apache.portals.gems.util.StatusMessage; import org.apache.portals.messaging.PortletMessaging; import org.apache.velocity.context.Context; @@ -140,6 +141,12 @@ context.put("userChooser", userChooser); context.put("groupChooser", groupChooser); + StatusMessage msg = (StatusMessage)PortletMessaging.consume(request, "SSODetails", "status"); + if (msg != null) + { + this.getContext(request).put("statusMsg", msg); + } + super.doView(request, response); } @@ -183,13 +190,11 @@ } catch (SecurityException e) { - // TODO: exception handling - System.err.println("Exception storing site: " + e); + publishStatusMessage(request, "SSODetails", "status", e, "Could not remove credentials"); } catch (SSOException e) { - // TODO: exception handling - System.err.println("Exception storing site: " + e); + publishStatusMessage(request, "SSODetails", "status", e, "Could not remove credentials"); } } else if (add != null) @@ -215,13 +220,11 @@ } catch (SSOException e) { - // TODO: exception handling - System.err.println("Exception storing site: " + e); + publishStatusMessage(request, "SSODetails", "status", e, "Could not add credentials"); } catch (SecurityException se) { - // TODO: exception handling - System.err.println("Exception storing site: " + se); + publishStatusMessage(request, "SSODetails", "status", se, "Could not add credentials"); } } } 1.8 +10 -6 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java Index: SSOBrowser.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/sso/SSOBrowser.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SSOBrowser.java 14 Jan 2005 18:31:53 -0000 1.7 +++ SSOBrowser.java 21 Jan 2005 22:09:22 -0000 1.8 @@ -35,6 +35,7 @@ import org.apache.portals.gems.browser.BrowserIterator; import org.apache.portals.gems.browser.DatabaseBrowserIterator; import org.apache.portals.gems.browser.BrowserPortlet; +import org.apache.portals.gems.util.StatusMessage; import org.apache.portals.messaging.PortletMessaging; import org.apache.velocity.context.Context; @@ -82,7 +83,6 @@ //subPopulate(rundata, qResult, repo, folder, null); - // TODO: need to try to normalize List/Collection/Iterators List list = new ArrayList(); while (sites.hasNext()) { @@ -117,6 +117,12 @@ String selectedName = (String)PortletMessaging.receive(request, "site", "selectedName"); context.put("currentName", selectedName); } + StatusMessage msg = (StatusMessage)PortletMessaging.consume(request, "SSOBrowser", "status"); + if (msg != null) + { + this.getContext(request).put("statusMsg", msg); + } + super.doView(request, response); } @@ -166,8 +172,7 @@ } catch (SSOException e) { - // TODO: exception handling - System.err.println("Exception storing site: " + e); + publishStatusMessage(request, "SSOBrowser", "status", e, "Could not remove site"); } } else if (save != null) @@ -205,8 +210,7 @@ } catch (SSOException e) { - // TODO: exception handling - System.err.println("Exception storing site: " + e); + publishStatusMessage(request, "SSOBrowser", "status", e, "Could not store site"); } } } 1.1 jakarta-jetspeed-2/applications/security/src/java/org/apache/jetspeed/portlets/security/groups/GroupBrowser.java Index: GroupBrowser.java =================================================================== /* Copyright 2004 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jetspeed.portlets.security.groups; import java.io.IOException; import java.security.Principal; import java.sql.Types; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; import javax.portlet.PortletException; import javax.portlet.PortletMode; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.apache.jetspeed.portlets.security.SecurityResources; import org.apache.jetspeed.security.Group; import org.apache.jetspeed.security.GroupManager; import org.apache.jetspeed.security.SecurityException; import org.apache.portals.gems.browser.BrowserIterator; import org.apache.portals.gems.browser.DatabaseBrowserIterator; import org.apache.portals.gems.browser.BrowserPortlet; import org.apache.portals.gems.util.StatusMessage; import org.apache.portals.messaging.PortletMessaging; import org.apache.velocity.context.Context; /** * Group Browser - flat non-hierarchical view * * @author David Sean Taylor * @version $Id: GroupBrowser.java,v 1.1 2005/01/21 22:09:22 taylor Exp $ */ public class GroupBrowser extends BrowserPortlet { private GroupManager groupManager; public void init(PortletConfig config) throws PortletException { super.init(config); groupManager = (GroupManager) getPortletContext().getAttribute(SecurityResources.CPS_GROUP_MANAGER_COMPONENT); if (null == groupManager) { throw new PortletException("Failed to find the Group Manager on portlet initialization"); } } public void getRows(RenderRequest request, String sql, int windowSize) throws Exception { List resultSetTitleList = new ArrayList(); List resultSetTypeList = new ArrayList(); try { Iterator groups = groupManager.getGroups(""); resultSetTypeList.add(String.valueOf(Types.VARCHAR)); resultSetTitleList.add("Group"); List list = new ArrayList(); while (groups.hasNext()) { Group group = (Group)groups.next(); Principal principal = group.getPrincipal(); list.add(principal.getName()); } BrowserIterator iterator = new DatabaseBrowserIterator( list, resultSetTitleList, resultSetTypeList, windowSize); setBrowserIterator(request, iterator); iterator.sort("Group"); } catch (Exception e) { //log.error("Exception in CMSBrowserAction.getRows: ", e); e.printStackTrace(); throw e; } } public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { String selected = (String)PortletMessaging.receive(request, "group", "selected"); if (selected != null) { Context context = this.getContext(request); context.put("selected", selected); } StatusMessage msg = (StatusMessage)PortletMessaging.consume(request, "GroupBrowser", "status"); if (msg != null) { this.getContext(request).put("statusMsg", msg); } super.doView(request, response); } public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { if (request.getPortletMode() == PortletMode.VIEW) { String selected = request.getParameter("group"); if (selected != null) { Group group = lookupGroup(selected); if (group != null) { PortletMessaging.publish(request, "group", "selected", selected); PortletMessaging.publish(request, "group", "change", selected); } } String refresh = request.getParameter("group.refresh"); String save = request.getParameter("group.save"); String neue = request.getParameter("group.new"); String delete = request.getParameter("groupDelete"); if (refresh != null) { this.clearBrowserIterator(request); } else if (neue != null) { PortletMessaging.cancel(request, "group", "selected"); } else if (delete != null && (!(isEmpty(delete)))) { try { Group group = lookupGroup(delete); if (group != null) { groupManager.removeGroup(delete); this.clearBrowserIterator(request); PortletMessaging.cancel(request, "group", "selected"); } } catch (Exception e) { publishStatusMessage(request, "GroupBrowser", "status", e, "Could not remove group"); } } else if (save != null) { String groupName = request.getParameter("group.name"); if (!(isEmpty(groupName))) { try { Group group = null; String old = (String)PortletMessaging.receive(request, "group", "selected"); if (old != null) { group = lookupGroup(old); } else { group = lookupGroup(groupName); } if (group != null) { if (old != null && !old.equals(groupName)) { groupManager.removeGroup(old); groupManager.addGroup(groupName); this.clearBrowserIterator(request); PortletMessaging.publish(request, "group", "selected", groupName); } } else { groupManager.addGroup(groupName); this.clearBrowserIterator(request); } } catch (Exception e) { publishStatusMessage(request, "GroupBrowser", "status", e, "Could not store group"); } } } } super.processAction(request, response); } private Group lookupGroup(String groupName) { try { return groupManager.getGroup(groupName); } catch (SecurityException e) { return null; } } private boolean isEmpty(String s) { if (s == null) return true; if (s.trim().equals("")) return true; return false; } } 1.14 +60 -0 jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/portlet.xml Index: portlet.xml =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/portlet.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- portlet.xml 20 Jan 2005 01:44:44 -0000 1.13 +++ portlet.xml 21 Jan 2005 22:09:22 -0000 1.14 @@ -290,5 +290,65 @@ + + + This parameter sets the template used in view mode. + ViewPage + /WEB-INF/security/groups/groups-view.vm + + GroupBrowserPortlet + Group Admin + Group Browser Portlet + org.apache.jetspeed.portlets.security.groups.GroupBrowser + -1 + + text/html + VIEW + + en + org.apache.jetspeed.portlets.security.resources.SecurityResources + + + WindowSize + 1000 + + + + Group admin + Groups + admin,security,groups + + + + + + This parameter sets the template used in view mode. + ViewPage + /WEB-INF/security/roles/roles-view.vm + + RoleBrowserPortlet + Role Admin + Role Browser Portlet + org.apache.jetspeed.portlets.security.roles.RoleBrowser + -1 + + text/html + VIEW + + en + org.apache.jetspeed.portlets.security.resources.SecurityResources + + + WindowSize + 1000 + + + + Role admin + Roles + admin,security,roles + + + 1.1 jakarta-jetspeed-2/applications/security/src/webapp/WEB-INF/security/groups/groups-view.vm Index: groups-view.vm =================================================================== #* Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *# #** @author David Sean Taylor @version $Id: groups-view.vm,v 1.1 2005/01/21 22:09:22 taylor Exp $ *# #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale)) #if ($statusMsg) #parse ('/WEB-INF/view/status-include.vm') #end
#set ($column = $title.get(0)) #set ($columnLink = $renderResponse.createRenderURL()) $columnLink.setParameter("js_dbcolumn",$column) ## #foreach ( $group in $table ) #if ($selected == $group) #set ($rowstyle = "jetdbLight") #else #set ($rowstyle = "jetdbOdd") #end #end
  #set ($action = $renderResponse.createActionURL()) $action.setParameter('group', $group)  

Group Name: 

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