KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > accounts > CmsShowUserGroupsList


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/accounts/CmsShowUserGroupsList.java,v $
3  * Date : $Date: 2006/03/27 14:52:49 $
4  * Version: $Revision: 1.12 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.tools.accounts;
33
34 import org.opencms.jsp.CmsJspActionElement;
35 import org.opencms.main.CmsException;
36 import org.opencms.main.CmsRuntimeException;
37 import org.opencms.workplace.list.CmsListColumnDefinition;
38 import org.opencms.workplace.list.CmsListDirectAction;
39 import org.opencms.workplace.list.CmsListItemActionIconComparator;
40 import org.opencms.workplace.list.CmsListMetadata;
41
42 import java.util.List JavaDoc;
43
44 import javax.servlet.http.HttpServletRequest JavaDoc;
45 import javax.servlet.http.HttpServletResponse JavaDoc;
46 import javax.servlet.jsp.PageContext JavaDoc;
47
48 /**
49  * User groups overview view.<p>
50  *
51  * @author Michael Moossen
52  *
53  * @version $Revision: 1.12 $
54  *
55  * @since 6.0.0
56  */

57 public class CmsShowUserGroupsList extends A_CmsUserGroupsList {
58
59     /** list id constant. */
60     public static final String JavaDoc LIST_ID = "lsug";
61
62     /**
63      * Public constructor.<p>
64      *
65      * @param jsp an initialized JSP action element
66      */

67     public CmsShowUserGroupsList(CmsJspActionElement jsp) {
68
69         this(jsp, LIST_ID);
70     }
71
72     /**
73      * Public constructor.<p>
74      *
75      * @param jsp an initialized JSP action element
76      * @param listId the id of the list
77      */

78     public CmsShowUserGroupsList(CmsJspActionElement jsp, String JavaDoc listId) {
79
80         super(jsp, listId, Messages.get().container(Messages.GUI_USERGROUPS_LIST_NAME_0), false);
81     }
82
83     /**
84      * Public constructor with JSP variables.<p>
85      *
86      * @param context the JSP page context
87      * @param req the JSP request
88      * @param res the JSP response
89      */

90     public CmsShowUserGroupsList(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
91
92         this(new CmsJspActionElement(context, req, res));
93     }
94
95     /**
96      * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions()
97      */

98     public void executeListMultiActions() throws CmsRuntimeException {
99
100         throwListUnsupportedActionException();
101     }
102
103     /**
104      * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
105      */

106     public void executeListSingleActions() throws CmsRuntimeException {
107
108         throwListUnsupportedActionException();
109     }
110
111     /**
112      * @see org.opencms.workplace.list.A_CmsListDialog#defaultActionHtmlStart()
113      */

114     protected String JavaDoc defaultActionHtmlStart() {
115
116         return getList().listJs(getLocale()) + dialogContentStart(getParamTitle());
117     }
118
119     /**
120      * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#getGroups()
121      */

122     protected List JavaDoc getGroups() throws CmsException {
123
124         return getCms().getGroupsOfUser(getParamUsername());
125     }
126
127     /**
128      * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#setDefaultAction(org.opencms.workplace.list.CmsListColumnDefinition)
129      */

130     protected void setDefaultAction(CmsListColumnDefinition nameCol) {
131
132         // no-op
133
}
134
135     /**
136      * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#setIconAction(org.opencms.workplace.list.CmsListColumnDefinition)
137      */

138     protected void setIconAction(CmsListColumnDefinition iconCol) {
139
140         // adds a direct group icon
141
CmsListDirectAction dirAction = new CmsGroupStateAction(LIST_ACTION_ICON_DIRECT, getCms(), true);
142         dirAction.setName(Messages.get().container(Messages.GUI_GROUPS_LIST_DIRECT_NAME_0));
143         dirAction.setHelpText(Messages.get().container(Messages.GUI_GROUPS_LIST_DIRECT_HELP_0));
144         dirAction.setIconPath(A_CmsUsersList.PATH_BUTTONS + "group.png");
145         dirAction.setEnabled(false);
146         iconCol.addDirectAction(dirAction);
147
148         // adds an indirect group icon
149
CmsListDirectAction indirAction = new CmsGroupStateAction(LIST_ACTION_ICON_INDIRECT, getCms(), false);
150         indirAction.setName(Messages.get().container(Messages.GUI_GROUPS_LIST_INDIRECT_NAME_0));
151         indirAction.setHelpText(Messages.get().container(Messages.GUI_GROUPS_LIST_INDIRECT_HELP_0));
152         indirAction.setIconPath(A_CmsUsersList.PATH_BUTTONS + "group_indirect.png");
153         indirAction.setEnabled(false);
154         iconCol.addDirectAction(indirAction);
155
156         iconCol.setListItemComparator(new CmsListItemActionIconComparator());
157     }
158
159     /**
160      * @see org.opencms.workplace.list.A_CmsListDialog#setMultiActions(org.opencms.workplace.list.CmsListMetadata)
161      */

162     protected void setMultiActions(CmsListMetadata metadata) {
163
164         // noop
165
}
166
167     /**
168      * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#setStateActionCol(org.opencms.workplace.list.CmsListMetadata)
169      */

170     protected void setStateActionCol(CmsListMetadata metadata) {
171
172         // no-op
173
}
174 }
175
Popular Tags