KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > workplace > CmsAdminGroups


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/workplace/CmsAdminGroups.java,v $
3 * Date : $Date: 2005/06/07 16:25:40 $
4 * Version: $Revision: 1.5 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
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 OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29
30 package com.opencms.workplace;
31
32 import org.opencms.file.CmsGroup;
33 import org.opencms.file.CmsObject;
34 import org.opencms.file.CmsRequestContext;
35 import org.opencms.file.CmsUser;
36 import org.opencms.main.CmsException;
37 import org.opencms.main.CmsLog;
38 import org.opencms.main.OpenCms;
39
40 import com.opencms.core.I_CmsSession;
41 import com.opencms.legacy.CmsLegacyException;
42 import com.opencms.legacy.CmsXmlTemplateLoader;
43
44 import java.util.Hashtable JavaDoc;
45 import java.util.List JavaDoc;
46 import java.util.Vector JavaDoc;
47
48 /**
49  * Template class for displaying OpenCms workplace admin group screens.
50  * <P>
51  *
52  * @author Mario Stanke
53  * @version $Revision: 1.5 $ $Date: 2005/06/07 16:25:40 $
54  * @see com.opencms.workplace.CmsXmlWpTemplateFile
55  *
56  * @deprecated Will not be supported past the OpenCms 6 release.
57  */

58
59 public class CmsAdminGroups extends CmsWorkplaceDefault {
60
61
62     /**
63      * String constant which is submitted in the select box 'supergroup'
64      */

65
66     // Could cause a problem if a real groupname happens to be "none_selected"
67
final static String JavaDoc C_NO_SUPERGROUP_SELECTED = "none_selected";
68
69     /**
70      * Gets the content of a defined section in a given template file and its subtemplates
71      * with the given parameters.
72      *
73      * @see #getContent(CmsObject, String, String, Hashtable, String)
74      * @param cms CmsObject Object for accessing system resources.
75      * @param templateFile Filename of the template file.
76      * @param elementName Element name of this template in our parent template.
77      * @param parameters Hashtable with all template class parameters.
78      * @param templateSelector template section that should be processed.
79      */

80
81     public byte[] getContent(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName,
82             Hashtable JavaDoc parameters, String JavaDoc templateSelector) throws CmsException {
83         if(CmsLog.getLog(this).isDebugEnabled() && C_DEBUG) {
84             CmsLog.getLog(this).debug("Getting content of element " + ((elementName == null) ? "<root>" : elementName));
85             CmsLog.getLog(this).debug("Template file is: " + templateFile);
86             CmsLog.getLog(this).debug("Selected template section is: " + ((templateSelector == null) ? "<default>" : templateSelector));
87         }
88         I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
89         CmsRequestContext reqCont = cms.getRequestContext();
90         CmsXmlWpTemplateFile xmlTemplateDocument = new CmsXmlWpTemplateFile(cms, templateFile);
91         boolean groupYetChanged = true;
92         boolean groupYetEstablished = true;
93
94         // find out which template (=perspective) should be used
95
String JavaDoc perspective = (String JavaDoc)parameters.get("perspective");
96         if(perspective != null && perspective.equals("group")) {
97             session.removeValue("ERROR");
98             if(CmsXmlTemplateLoader.getRequest(reqCont).getParameter("CHANGE") != null) {
99
100                 // change data of selected user
101
perspective = "changegroup";
102                 groupYetChanged = false;
103             }
104             else {
105                 if(parameters.get("DELETE") != null) {
106
107                     // delete the selected user
108
perspective = "deletegroup";
109                 }
110                 else {
111                     if(parameters.get("NEW") != null) {
112
113                         // establish new group
114
perspective = "newgroup";
115                         groupYetEstablished = false;
116                     }
117                 }
118             }
119         }
120         if(perspective == null) {
121
122             // display the first template, which lets you chose the action
123
perspective = new String JavaDoc("group");
124         }
125         if(perspective.equals("newgroup") || perspective.equals("changegroup")) {
126
127             // first the common part of the two actions:
128
// read the parameters like group name, description, ...
129
String JavaDoc groupname, description, supergroup;
130             boolean projectManager, projectCoWorker, role;
131             if(session.getValue("ERROR") == null) {
132                 groupname = (String JavaDoc)parameters.get("GROUPNAME");
133                 description = (String JavaDoc)parameters.get("GROUPDESC");
134                 supergroup = (String JavaDoc)parameters.get("SUPERGROUP");
135                 projectManager = (parameters.get("PROJECTMANAGER") != null);
136                 projectCoWorker = (parameters.get("PROJECTCOWORKER") != null);
137                 role = (parameters.get("ROLE") != null);
138             }
139             else {
140
141                 // an error has occurred before, retrieve the form data from the session
142
groupname = (String JavaDoc)session.getValue("GROUPNAME");
143                 description = (String JavaDoc)session.getValue("GROUPDESC");
144                 supergroup = (String JavaDoc)session.getValue("SUPERGROUP");
145                 projectManager = (session.getValue("PROJECTMANAGER") != null);
146                 projectCoWorker = (session.getValue("PROJECTCOWORKER") != null);
147                 role = (session.getValue("ROLE") != null);
148
149                 // remove the data from parameters
150
parameters.remove("ADD");
151                 parameters.remove("REMOVE");
152                 parameters.remove("OK");
153                 session.removeValue("ERROR");
154             }
155             if(groupname == null) {
156                 groupname = "";
157             }
158             if(description == null) {
159                 description = "";
160             }
161             if(supergroup == null) {
162                 supergroup = "";
163             }
164             session.putValue("SUPERGROUP", supergroup);
165
166             // vectors of Strings that hold the selected and not selected Users
167
Vector JavaDoc selectedUsers = (Vector JavaDoc)session.getValue("selectedUsers");
168             Vector JavaDoc notSelectedUsers = (Vector JavaDoc)session.getValue("notSelectedUsers");
169             if(perspective.equals("newgroup")) {
170
171                 // input is the form for establishing a new group
172
templateSelector = "newgroup";
173                 if(!groupYetEstablished) {
174
175                     // first time the form is visited
176
groupname = "";
177                     selectedUsers = new Vector JavaDoc();
178                     notSelectedUsers = new Vector JavaDoc();
179                     List JavaDoc users = cms.getUsers();
180                     for(int z = 0;z < users.size();z++) {
181                         notSelectedUsers.addElement(((CmsUser)users.get(z)).getName());
182                     }
183                     session.putValue("selectedUsers", selectedUsers);
184                     session.putValue("notSelectedUsers", notSelectedUsers);
185                 }
186                 if(parameters.get("ADD") != null) {
187
188                     // add a new group to selectedGroups
189
String JavaDoc username = (String JavaDoc)parameters.get("NOTSELECTEDUSERS");
190                     if(username != null) {
191                         selectedUsers.addElement(username);
192                         notSelectedUsers.removeElement(username);
193                     }
194                     session.putValue("selectedUsers", selectedUsers);
195                     session.putValue("notSelectedUsers", notSelectedUsers);
196                 }
197                 else {
198                     if(parameters.get("REMOVE") != null) {
199
200                         // delete a new group from selectedGroups
201
// and move it to notSelectedGroups
202
String JavaDoc username = (String JavaDoc)parameters.get("SELECTEDUSERS");
203                         if(username != null) {
204                             notSelectedUsers.addElement(username);
205                             selectedUsers.removeElement(username);
206                         }
207                         session.putValue("selectedUsers", selectedUsers);
208                         session.putValue("notSelectedUsers", notSelectedUsers);
209                     }
210                     else {
211                         if(parameters.get("OK") != null) {
212
213                             // form submitted, try to establish new group
214
try {
215                                 if(groupname == null || groupname.equals("")) {
216                                     throw new CmsLegacyException("no groupname", CmsLegacyException.C_NO_GROUP);
217                                 }
218                                 if(C_NO_SUPERGROUP_SELECTED.equals(supergroup)) {
219                                     supergroup = ""; // no supergroup
220
}
221                                 CmsGroup newGroup = cms.createGroup(groupname, description, 0, supergroup);
222                                 newGroup.setProjectManager(projectManager);
223                                 newGroup.setProjectCoWorker(projectCoWorker);
224                                 newGroup.setRole(role);
225                                 cms.writeGroup(newGroup);
226                                 for(int z = 0;z < selectedUsers.size();z++) {
227                                     cms.addUserToGroup((String JavaDoc)selectedUsers.elementAt(z), groupname);
228                                 }
229                                 session.removeValue("selectedUsers");
230                                 session.removeValue("notSelectedUsers");
231                                 session.removeValue("SUPERGROUP");
232                                 session.removeValue("PROJECTMANAGER");
233                                 session.removeValue("PROJECTCOWORKER");
234                                 session.removeValue("ROLE");
235                                 session.removeValue("ERROR");
236                                 templateSelector = ""; //successful
237
}
238                             catch(CmsException e) {
239
240                                 // save the form data in the session, so it can be displayed again later
241
session.putValue("ERROR", new String JavaDoc("yes")); // remeber that an error has occurred
242
session.putValue("GROUPNAME", groupname);
243                                 session.putValue("GROUPDESC", description);
244                                 session.putValue("SUPERGROUP", supergroup);
245                                 if(projectManager) {
246                                     session.putValue("PROJECTMANAGER", "yes");
247                                 }
248                                 else {
249                                     session.removeValue("PROJECTMANAGER");
250                                 }
251                                 if(projectCoWorker) {
252                                     session.putValue("PROJECTCOWORKER", "yes");
253                                 }
254                                 else {
255                                     session.removeValue("PROJECTCOWORKER");
256                                 }
257                                 if(role) {
258                                     session.putValue("ROLE", "yes");
259                                 }
260                                 else {
261                                     session.removeValue("ROLE");
262                                 }
263                                 if ((e instanceof CmsLegacyException) && (((CmsLegacyException)e).getType() == CmsLegacyException.C_NO_GROUP) && e.getMessage().equals("no groupname")) {
264                                     templateSelector = "errordatamissing1";
265                                 }
266                                 else {
267                                     throw e; // hand the exception down
268
}
269                             }
270                         }
271                     }
272                 }
273             }
274             else {
275
276                 // input is the form for changing the group data
277
templateSelector = "changegroup";
278                 if(!groupYetChanged) {
279
280                     // form visited for the first time, not yet changed
281

282                     // read the data from the group object
283
CmsGroup theGroup = cms.readGroup(groupname);
284                     if(theGroup == null) {
285                         throw new CmsLegacyException("user does not exist");
286                     }
287                     projectManager = theGroup.getProjectManager();
288                     projectCoWorker = theGroup.getProjectCoWorker();
289                     role = theGroup.getRole();
290                     description = theGroup.getDescription();
291                     CmsGroup parent = cms.getParent(groupname);
292                     if(parent != null) {
293                         supergroup = cms.getParent(groupname).getName();
294                     }
295                     else {
296                         supergroup = "";
297                     }
298                     List JavaDoc users = cms.getUsersOfGroup(groupname);
299                     if(users != null) {
300                         selectedUsers = new Vector JavaDoc();
301                         for(int z = 0;z < users.size();z++) {
302                             selectedUsers.addElement(((CmsUser)users.get(z)).getName());
303                         }
304                     }
305                     users = cms.getUsers();
306                     if(users != null) {
307                         notSelectedUsers = new Vector JavaDoc();
308                         for(int z = 0;z < users.size();z++) {
309                             String JavaDoc name = ((CmsUser)users.get(z)).getName();
310                             if(!selectedUsers.contains(name)) {
311                                 notSelectedUsers.addElement(name);
312                             }
313                         }
314                     }
315                 }
316                 else {
317                     if(parameters.get("ADD") != null) {
318
319                         // add a new user to selectedUsers
320
String JavaDoc username = (String JavaDoc)parameters.get("NOTSELECTEDUSERS");
321                         if(username != null) {
322                             selectedUsers.addElement(username);
323                             notSelectedUsers.removeElement(username);
324                         }
325                     }
326                     else {
327                         if(parameters.get("REMOVE") != null) {
328
329                             // delete a group from selectedUsers
330
// and move it to notSelectedUsers
331
String JavaDoc username = (String JavaDoc)parameters.get("SELECTEDUSERS");
332                             if(username != null) {
333                                 notSelectedUsers.addElement(username);
334                                 selectedUsers.removeElement(username);
335                             }
336                         }
337                         else {
338                             if(parameters.get("OK") != null) {
339
340                                 // form submitted, try to change the group data
341
try {
342                                     CmsGroup theGroup = cms.readGroup(groupname);
343                                     if("".equals(supergroup) || supergroup.equals(C_NO_SUPERGROUP_SELECTED)) {
344                                         cms.setParentGroup(groupname, null);
345                                     }
346                                     else {
347                                         cms.setParentGroup(groupname, supergroup);
348                                     }
349                                     theGroup = cms.readGroup(groupname);
350                                     theGroup.setDescription(description);
351                                     theGroup.setProjectManager(projectManager);
352                                     theGroup.setProjectCoWorker(projectCoWorker);
353                                     theGroup.setRole(role);
354                                     cms.writeGroup(theGroup);
355                                     theGroup = cms.readGroup(groupname);
356
357                                     // now change the list of users of this group but take into account that
358
// the default group of a user can't be removed
359
List JavaDoc allUsers = cms.getUsersOfGroup(groupname);
360                                     boolean defaultProblem = false;
361                                     Vector JavaDoc falseUsers = new Vector JavaDoc();
362                                     for(int z = 0;z < allUsers.size();z++) {
363                                         String JavaDoc theUserName = ((CmsUser)allUsers.get(z)).getName();
364                                         if(!selectedUsers.contains(theUserName)) {
365                                             cms.removeUserFromGroup(theUserName, groupname);
366                                         }
367                                     }
368                                     for(int z = 0;z < selectedUsers.size();z++) {
369                                         cms.addUserToGroup((String JavaDoc)selectedUsers.elementAt(z), groupname);
370                                     }
371                                     cms.writeGroup(theGroup);
372                                     session.removeValue("selectedUsers");
373                                     session.removeValue("notSelectedUsers");
374                                     session.removeValue("PROJECTMANAGER");
375                                     session.removeValue("PROJECTCOWORKER");
376                                     session.removeValue("ROLE");
377                                     session.removeValue("ERROR");
378                                     if(defaultProblem) {
379                                         xmlTemplateDocument.setData("RMDEFAULTDETAIL", "The following users which were to be removed had " + groupname + " as default group: " + falseUsers);
380                                         templateSelector = "errorremovedefault";
381                                     }
382                                     else {
383                                         templateSelector = ""; //successful
384
}
385                                 }
386                                 catch(CmsException e) {
387
388                                     // remeber that an error has occurred
389
session.putValue("ERROR", new String JavaDoc("yes"));
390                                     session.putValue("GROUPDESC", description);
391                                     session.putValue("SUPERGROUP", supergroup);
392                                     if ((e instanceof CmsLegacyException) && (((CmsLegacyException)e).getType() == CmsLegacyException.C_NO_GROUP)) {
393                                         templateSelector = "errornogroup2";
394                                     }
395                                     else {
396                                         if ((e instanceof CmsLegacyException) && (((CmsLegacyException)e).getType() == CmsLegacyException.C_NO_USER && e.getMessage().equals("user data missing"))) {
397                                             templateSelector = "errordatamissing2";
398                                         }
399                                         else {
400                                             throw e; // hand the exception down
401
}
402                                     }
403                                 } // catch
404
} // else if 'OK'
405
}
406                     }
407                 } // groupYetChanged
408
session.putValue("selectedUsers", selectedUsers);
409                 session.putValue("notSelectedUsers", notSelectedUsers);
410                 session.putValue("SUPERGROUP", supergroup);
411             }
412
413             // again common part for 'newgroup' and 'changegroup':
414
// set the variables for display in the document
415
if(groupname == null) {
416                 groupname = "";
417             }
418             if(description == null) {
419                 description = "";
420             }
421             if(supergroup == null) {
422                 supergroup = "";
423             }
424             xmlTemplateDocument.setData("GROUPNAME", groupname);
425             xmlTemplateDocument.setData("GROUPDESC", description);
426             xmlTemplateDocument.setData("SUPERGROUP", supergroup);
427             xmlTemplateDocument.setData("PCWCHECKED", projectCoWorker ? "checked" : "");
428             xmlTemplateDocument.setData("PMCHECKED", projectManager ? "checked" : "");
429             xmlTemplateDocument.setData("PRCHECKED", role ? "checked" : "");
430         } // belongs to: 'if perspective is newgroup or changegroup'
431
else {
432             if(perspective.equals("deletegroup")) {
433                 String JavaDoc groupname = (String JavaDoc)parameters.get("GROUPNAME");
434                 xmlTemplateDocument.setData("GROUPNAME", groupname);
435                 templateSelector = "RUsureDelete";
436             }
437             else {
438                 if(perspective.equals("reallydeletegroup")) {
439
440                     // deleting the group
441
try {
442                         String JavaDoc groupname = (String JavaDoc)parameters.get("GROUPNAME");
443                         cms.deleteGroup(groupname);
444                         templateSelector = "";
445                     }
446                     catch(Exception JavaDoc e) {
447
448                         // groupname == null or delete failed
449
xmlTemplateDocument.setData("DELETEDETAILS", CmsException.getStackTraceAsString(e));
450                         templateSelector = "deleteerror";
451                     }
452                 }
453             }
454         }
455
456         // Now load the template file and start the processing
457
return startProcessing(cms, xmlTemplateDocument, elementName, parameters, templateSelector);
458     }
459
460     /**
461      * Gets all groups for a select box
462      * <P>
463      * The given vectors <code>names</code> and <code>values</code> will
464      * be filled with the appropriate information to be used for building
465      * a select box.
466      *
467      * @param cms CmsObject Object for accessing system resources.
468      * @param names Vector to be filled with the appropriate values in this method.
469      * @param values Vector to be filled with the appropriate values in this method.
470      * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
471      * @return Index representing the current value in the vectors.
472      * @throws CmsException
473      */

474
475     public Integer JavaDoc getGroups(CmsObject cms, CmsXmlLanguageFile lang, Vector JavaDoc names,
476             Vector JavaDoc values, Hashtable JavaDoc parameters) throws CmsException {
477
478         // get all groups
479
List JavaDoc groups = cms.getGroups();
480         int retValue = 0;
481
482         // fill the names and values
483
for(int z = 0;z < groups.size();z++) {
484             String JavaDoc name = ((CmsGroup)groups.get(z)).getName();
485             names.addElement(name);
486             values.addElement(name);
487         }
488         return new Integer JavaDoc(retValue);
489     }
490
491     /**
492      * Gets all users, that have not yet been selected for the group
493      * <P>
494      * The given vectors <code>names</code> and <code>values</code> will
495      * be filled with the appropriate information to be used for building
496      * a select box.
497      *
498      * @param cms CmsObject Object for accessing system resources.
499      * @param names Vector to be filled with the appropriate values in this method.
500      * @param values Vector to be filled with the appropriate values in this method.
501      * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
502      * @return Index representing the current value in the vectors.
503      * @throws CmsException
504      */

505
506     public Integer JavaDoc getNotSelectedUsers(CmsObject cms, CmsXmlLanguageFile lang,
507             Vector JavaDoc names, Vector JavaDoc values, Hashtable JavaDoc parameters) throws CmsException {
508         I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
509         Vector JavaDoc notSelectedUsers = (Vector JavaDoc)session.getValue("notSelectedUsers");
510         if(notSelectedUsers != null) {
511             for(int z = 0;z < notSelectedUsers.size();z++) {
512                 String JavaDoc name = (String JavaDoc)notSelectedUsers.elementAt(z);
513                 names.addElement(name);
514                 values.addElement(name);
515             }
516         }
517         return new Integer JavaDoc(-1); // nothing preselected
518
}
519
520     /**
521      * Gets all users that have been selected to be in the group
522      * <P>
523      * The given vectors <code>names</code> and <code>values</code> will
524      * be filled with the appropriate information to be used for building
525      * a select box.
526      *
527      * @param cms CmsObject Object for accessing system resources.
528      * @param names Vector to be filled with the appropriate values in this method.
529      * @param values Vector to be filled with the appropriate values in this method.
530      * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
531      * @return Index representing the default Group of the user
532      * @throws CmsException
533      */

534
535     public Integer JavaDoc getSelectedUsers(CmsObject cms, CmsXmlLanguageFile lang, Vector JavaDoc names,
536             Vector JavaDoc values, Hashtable JavaDoc parameters) throws CmsException {
537         I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
538         Vector JavaDoc selectedUsers = (Vector JavaDoc)session.getValue("selectedUsers");
539         if(selectedUsers != null) {
540             for(int z = 0;z < selectedUsers.size();z++) {
541                 String JavaDoc name = (String JavaDoc)selectedUsers.elementAt(z);
542                 names.addElement(name);
543                 values.addElement(name);
544             }
545         }
546         else {
547             selectedUsers = new Vector JavaDoc();
548         }
549         return new Integer JavaDoc(-1);
550     }
551
552     /**
553      * Gets all supergroups of the actual group (in session or in form data) for a selectbox
554      * <P>
555      * The given vectors <code>names</code> and <code>values</code> will
556      * be filled with the appropriate information to be used for building
557      * a select box.
558      *
559      * @param cms CmsObject Object for accessing system resources.
560      * @param names Vector to be filled with the appropriate values in this method.
561      * @param values Vector to be filled with the appropriate values in this method.
562      * @param parameters Hashtable containing all user parameters.
563      * @return Index representing the current value in the vectors.
564      * @throws CmsException
565      */

566
567     public Integer JavaDoc getSuperGroups(CmsObject cms, CmsXmlLanguageFile lang, Vector JavaDoc names,
568             Vector JavaDoc values, Hashtable JavaDoc parameters) throws CmsException {
569
570         int retValue = -1;
571         I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
572         String JavaDoc actualGroup = (String JavaDoc)session.getValue("GROUPNAME");
573         String JavaDoc temp = (String JavaDoc)parameters.get("GROUPNAME");
574         if(temp != null) {
575             actualGroup = temp;
576         }
577         if(parameters.get("NEW") != null) {
578             // user pressed the NEW-button so we dont need the actual Group
579
actualGroup = "";
580         }
581         String JavaDoc supergroup = (String JavaDoc)session.getValue("SUPERGROUP");
582         temp = (String JavaDoc)parameters.get("SUPERGROUP");
583         if(temp != null) {
584             supergroup = temp;
585         }
586         if(supergroup == null) {
587             supergroup = "";
588         }
589         names.addElement(lang.getLanguageValue("input.none"));
590         values.addElement(C_NO_SUPERGROUP_SELECTED);
591         List JavaDoc groups = cms.getGroups();
592         int selectedGroup = 0;
593         for(int z = 0;z < groups.size();z++) {
594             String JavaDoc name = ((CmsGroup)groups.get(z)).getName();
595             if(name.equals(supergroup)) {
596                 retValue = selectedGroup;
597             }
598             if(!name.equals(actualGroup)) {
599                 names.addElement(name);
600                 values.addElement(name);
601                 selectedGroup++;
602             }
603         }
604         return new Integer JavaDoc(retValue + 1);
605     }
606     
607     /**
608      * Determines if the group icon is shown in the administration view depending on the property value of the key "workplace.administration.showusergroupicon".<p>
609      *
610      * @param cms the CmsObject
611      * @param lang the workplace language file
612      * @param parameters the parameters
613      * @return Boolean to determine if group icon is shown in the administration view
614      */

615     public Boolean JavaDoc isVisible(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) {
616         return new Boolean JavaDoc(OpenCms.getWorkplaceManager().showUserGroupIcon());
617     }
618
619     /**
620      * Indicates if the results of this class are cacheable.
621      *
622      * @param cms CmsObject Object for accessing system resources
623      * @param templateFile Filename of the template file
624      * @param elementName Element name of this template in our parent template.
625      * @param parameters Hashtable with all template class parameters.
626      * @param templateSelector template section that should be processed.
627      * @return <EM>true</EM> if cacheable, <EM>false</EM> otherwise.
628      */

629
630     public boolean isCacheable(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName,
631             Hashtable JavaDoc parameters, String JavaDoc templateSelector) {
632         return false;
633     }
634 }
635
Popular Tags