1 31 32 package org.opencms.workplace.tools.accounts; 33 34 import org.opencms.file.CmsUser; 35 import org.opencms.jsp.CmsJspActionElement; 36 import org.opencms.main.CmsException; 37 import org.opencms.security.CmsPrincipal; 38 import org.opencms.workplace.list.CmsListColumnDefinition; 39 import org.opencms.workplace.list.CmsListDirectAction; 40 41 import java.util.List ; 42 43 import javax.servlet.http.HttpServletRequest ; 44 import javax.servlet.http.HttpServletResponse ; 45 import javax.servlet.jsp.PageContext ; 46 47 56 public class CmsUsersList extends A_CmsUsersList { 57 58 59 public static final String LIST_ID = "lsu"; 60 61 66 public CmsUsersList(CmsJspActionElement jsp) { 67 68 super(jsp, LIST_ID, Messages.get().container(Messages.GUI_USERS_LIST_NAME_0)); 69 } 70 71 78 public CmsUsersList(PageContext context, HttpServletRequest req, HttpServletResponse res) { 79 80 this(new CmsJspActionElement(context, req, res)); 81 } 82 83 86 protected String getGroupIcon() { 87 88 return PATH_BUTTONS + "group.png"; 89 } 90 91 94 protected List getUsers() throws CmsException { 95 96 return CmsPrincipal.filterCore(getCms().getUsers(CmsUser.USER_TYPE_SYSTEMUSER)); 97 } 98 99 102 protected CmsUser readUser(String name) throws CmsException { 103 104 return getCms().readUser(name, CmsUser.USER_TYPE_SYSTEMUSER); 105 } 106 107 110 protected void setDeleteAction(CmsListColumnDefinition deleteCol) { 111 112 CmsListDirectAction deleteAction = new CmsListDirectAction(LIST_ACTION_DELETE); 113 deleteAction.setName(Messages.get().container(Messages.GUI_USERS_LIST_ACTION_DELETE_NAME_0)); 114 deleteAction.setHelpText(Messages.get().container(Messages.GUI_USERS_LIST_ACTION_DELETE_HELP_0)); 115 deleteAction.setIconPath(ICON_DELETE); 116 deleteCol.addDirectAction(deleteAction); 117 } 118 119 122 protected void setEditAction(CmsListColumnDefinition editCol) { 123 124 CmsListDirectAction editAction = new CmsListDirectAction(LIST_ACTION_EDIT); 125 editAction.setName(Messages.get().container(Messages.GUI_USERS_LIST_ACTION_EDIT_NAME_0)); 126 editAction.setHelpText(Messages.get().container(Messages.GUI_USERS_LIST_ACTION_EDIT_HELP_0)); 127 editAction.setIconPath(PATH_BUTTONS + "user.png"); 128 editCol.addDirectAction(editAction); 129 } 130 } | Popular Tags |