001: /*
002: * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/accounts/CmsUsersList.java,v $
003: * Date : $Date: 2008-02-27 12:05:26 $
004: * Version: $Revision: 1.18 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software GmbH, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.workplace.tools.accounts;
033:
034: import org.opencms.file.CmsUser;
035: import org.opencms.jsp.CmsJspActionElement;
036: import org.opencms.main.CmsException;
037: import org.opencms.main.OpenCms;
038: import org.opencms.security.CmsPrincipal;
039: import org.opencms.workplace.list.CmsListColumnDefinition;
040: import org.opencms.workplace.list.CmsListDirectAction;
041:
042: import java.util.List;
043:
044: import javax.servlet.http.HttpServletRequest;
045: import javax.servlet.http.HttpServletResponse;
046: import javax.servlet.jsp.PageContext;
047:
048: /**
049: * Main system user account management view.<p>
050: *
051: * @author Michael Moossen
052: *
053: * @version $Revision: 1.18 $
054: *
055: * @since 6.0.0
056: */
057: public class CmsUsersList extends A_CmsUsersList {
058:
059: /** list id constant. */
060: public static final String LIST_ID = "lsu";
061:
062: /**
063: * Public constructor.<p>
064: *
065: * @param jsp an initialized JSP action element
066: */
067: public CmsUsersList(CmsJspActionElement jsp) {
068:
069: super (jsp, LIST_ID, Messages.get().container(
070: Messages.GUI_USERS_LIST_NAME_0));
071: }
072:
073: /**
074: * Public constructor with JSP variables.<p>
075: *
076: * @param context the JSP page context
077: * @param req the JSP request
078: * @param res the JSP response
079: */
080: public CmsUsersList(PageContext context, HttpServletRequest req,
081: HttpServletResponse res) {
082:
083: this (new CmsJspActionElement(context, req, res));
084: }
085:
086: /**
087: * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#getGroupIcon()
088: */
089: protected String getGroupIcon() {
090:
091: return PATH_BUTTONS + "group.png";
092: }
093:
094: /**
095: * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#getUsers()
096: */
097: protected List getUsers() throws CmsException {
098:
099: return CmsPrincipal.filterCore(OpenCms.getOrgUnitManager()
100: .getUsers(getCms(), getParamOufqn(), false));
101: }
102:
103: /**
104: * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#readUser(java.lang.String)
105: */
106: protected CmsUser readUser(String name) throws CmsException {
107:
108: return getCms().readUser(name);
109: }
110:
111: /**
112: * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#setDeleteAction(org.opencms.workplace.list.CmsListColumnDefinition)
113: */
114: protected void setDeleteAction(CmsListColumnDefinition deleteCol) {
115:
116: CmsListDirectAction deleteAction = new CmsListDirectAction(
117: LIST_ACTION_DELETE);
118: deleteAction.setName(Messages.get().container(
119: Messages.GUI_USERS_LIST_ACTION_DELETE_NAME_0));
120: deleteAction.setHelpText(Messages.get().container(
121: Messages.GUI_USERS_LIST_ACTION_DELETE_HELP_0));
122: deleteAction.setIconPath(ICON_DELETE);
123: deleteCol.addDirectAction(deleteAction);
124: }
125:
126: /**
127: * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#setEditAction(org.opencms.workplace.list.CmsListColumnDefinition)
128: */
129: protected void setEditAction(CmsListColumnDefinition editCol) {
130:
131: CmsListDirectAction editAction = new CmsListDirectAction(
132: LIST_ACTION_EDIT);
133: editAction.setName(Messages.get().container(
134: Messages.GUI_USERS_LIST_ACTION_EDIT_NAME_0));
135: editAction.setHelpText(Messages.get().container(
136: Messages.GUI_USERS_LIST_ACTION_EDIT_HELP_0));
137: editAction.setIconPath(PATH_BUTTONS + "user.png");
138: editCol.addDirectAction(editAction);
139: }
140: }
|