KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > commons > CmsPreferences


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/commons/CmsPreferences.java,v $
3  * Date : $Date: 2006/09/15 15:30:37 $
4  * Version: $Revision: 1.32 $
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.commons;
33
34 import org.opencms.db.CmsUserSettings;
35 import org.opencms.file.CmsObject;
36 import org.opencms.file.CmsProject;
37 import org.opencms.file.CmsResource;
38 import org.opencms.file.CmsUser;
39 import org.opencms.i18n.CmsEncoder;
40 import org.opencms.i18n.CmsLocaleManager;
41 import org.opencms.jsp.CmsJspActionElement;
42 import org.opencms.main.CmsException;
43 import org.opencms.main.CmsLog;
44 import org.opencms.main.OpenCms;
45 import org.opencms.report.I_CmsReport;
46 import org.opencms.security.CmsPasswordInfo;
47 import org.opencms.site.CmsSite;
48 import org.opencms.site.CmsSiteManager;
49 import org.opencms.synchronize.CmsSynchronizeSettings;
50 import org.opencms.util.CmsStringUtil;
51 import org.opencms.workflow.CmsTaskService;
52 import org.opencms.workplace.CmsTabDialog;
53 import org.opencms.workplace.CmsWorkplace;
54 import org.opencms.workplace.CmsWorkplaceManager;
55 import org.opencms.workplace.CmsWorkplaceMessages;
56 import org.opencms.workplace.CmsWorkplaceSettings;
57 import org.opencms.workplace.CmsWorkplaceView;
58 import org.opencms.workplace.editors.CmsWorkplaceEditorConfiguration;
59 import org.opencms.workplace.explorer.CmsExplorerTypeSettings;
60
61 import java.io.IOException JavaDoc;
62 import java.util.ArrayList JavaDoc;
63 import java.util.Enumeration JavaDoc;
64 import java.util.HashMap JavaDoc;
65 import java.util.Iterator JavaDoc;
66 import java.util.List JavaDoc;
67 import java.util.Locale JavaDoc;
68 import java.util.Map JavaDoc;
69 import java.util.SortedMap JavaDoc;
70 import java.util.TreeMap JavaDoc;
71
72 import javax.servlet.ServletException JavaDoc;
73 import javax.servlet.http.HttpServletRequest JavaDoc;
74 import javax.servlet.http.HttpServletResponse JavaDoc;
75 import javax.servlet.http.HttpSession JavaDoc;
76 import javax.servlet.jsp.JspException JavaDoc;
77 import javax.servlet.jsp.PageContext JavaDoc;
78
79 import org.apache.commons.logging.Log;
80
81 /**
82  * Provides methods for the user preferences dialog.<p>
83  *
84  * The following files use this class:
85  * <ul>
86  * <li>/commons/preferences.jsp
87  * </ul>
88  * <p>
89  *
90  * @author Andreas Zahner
91  *
92  * @version $Revision: 1.32 $
93  *
94  * @since 6.0.0
95  */

96 public class CmsPreferences extends CmsTabDialog {
97
98     /** Value for the action: change the password. */
99     public static final int ACTION_CHPWD = 202;
100
101     /** Value for the action: show error screen. */
102     public static final int ACTION_ERROR = 203;
103
104     /** Value for the action: reload the workplace. */
105     public static final int ACTION_RELOAD = 201;
106
107     /** Request parameter value for the action: change the password. */
108     public static final String JavaDoc DIALOG_CHPWD = "chpwd";
109
110     /** Request parameter value for the action: reload the workplace. */
111     public static final String JavaDoc DIALOG_RELOAD = "reload";
112
113     /** The dialog type. */
114     public static final String JavaDoc DIALOG_TYPE = "preferences";
115
116     /** Request parameter name prefix for the preferred editors. */
117     public static final String JavaDoc INPUT_DEFAULT = "default";
118
119     /** Request parameter name for the dialog copy file siblings default setting. */
120     public static final String JavaDoc PARAM_DIALOGS_COPYFILEMODE = "tabdicopyfilemode";
121
122     /** Request parameter name for the dialog copy folder siblings default setting. */
123     public static final String JavaDoc PARAM_DIALOGS_COPYFOLDERMODE = "tabdicopyfoldermode";
124
125     /** Request parameter name for the dialog delete file siblings default setting. */
126     public static final String JavaDoc PARAM_DIALOGS_DELETEFILEMODE = "tabdideletefilemode";
127
128     /** Request parameter name for the dialog permissions show inherited permissions. */
129     public static final String JavaDoc PARAM_DIALOGS_PERMISSIONS_EXPANDINHERITED = "tabdipermissionsexpandinherited";
130
131     /** Request parameter name for the dialog permissions show current users permissions. */
132     public static final String JavaDoc PARAM_DIALOGS_PERMISSIONS_EXPANDUSER = "tabdipermissionsexpanduser";
133
134     /** Request parameter name for the dialog permissions default inheritance behaviour on folders. */
135     public static final String JavaDoc PARAM_DIALOGS_PERMISSIONS_INHERITONFOLDER = "tabdipermissionsinheritonfolder";
136
137     /** Request parameter name for the dialog publish file siblings default setting. */
138     public static final String JavaDoc PARAM_DIALOGS_PUBLISHFILEMODE = "tabdipublishfilemode";
139
140     /** Request parameter name for the dialog show lock. */
141     public static final String JavaDoc PARAM_DIALOGS_SHOWLOCK = "tabdishowlock";
142
143     /** Request parameter name for the direct edit button style. */
144     public static final String JavaDoc PARAM_DIRECTEDIT_BUTTONSTYLE = "tabeddirecteditbuttonstyle";
145
146     /** Request parameter name for the editor button style. */
147     public static final String JavaDoc PARAM_EDITOR_BUTTONSTYLE = "tabedbuttonstyle";
148
149     /** Request parameter name for the explorer button style. */
150     public static final String JavaDoc PARAM_EXPLORER_BUTTONSTYLE = "tabexbuttonstyle";
151
152     /** Request parameter name for the explorer file date created. */
153     public static final String JavaDoc PARAM_EXPLORER_FILEDATECREATED = "tabexfiledatecreated";
154
155     /** Request parameter name for the explorer file date expired. */
156     public static final String JavaDoc PARAM_EXPLORER_FILEDATEEXPIRED = "tabexfiledateexpired";
157
158     /** Request parameter name for the explorer file date last modified. */
159     public static final String JavaDoc PARAM_EXPLORER_FILEDATELASTMODIFIED = "tabexfiledatelastmodified";
160
161     /** Request parameter name for the explorer file date released. */
162     public static final String JavaDoc PARAM_EXPLORER_FILEDATERELEASED = "tabexfiledatereleased";
163
164     /** Request parameter name for the explorer file entry number. */
165     public static final String JavaDoc PARAM_EXPLORER_FILEENTRIES = "tabexfileentries";
166
167     /** Request parameter name for the explorer file locked by. */
168     public static final String JavaDoc PARAM_EXPLORER_FILELOCKEDBY = "tabexfilelockedby";
169
170     /** Request parameter name for the explorer file permissions. */
171     public static final String JavaDoc PARAM_EXPLORER_FILEPERMISSIONS = "tabexfilepermissions";
172
173     /** Request parameter name for the explorer file size. */
174     public static final String JavaDoc PARAM_EXPLORER_FILESIZE = "tabexfilesize";
175
176     /** Request parameter name for the explorer file state. */
177     public static final String JavaDoc PARAM_EXPLORER_FILESTATE = "tabexfilestate";
178
179     /** Request parameter name for the explorer file title. */
180     public static final String JavaDoc PARAM_EXPLORER_FILETITLE = "tabexfiletitle";
181
182     /** Request parameter name for the explorer file type. */
183     public static final String JavaDoc PARAM_EXPLORER_FILETYPE = "tabexfiletype";
184
185     /** Request parameter name for the explorer file user created. */
186     public static final String JavaDoc PARAM_EXPLORER_FILEUSERCREATED = "tabexfileusercreated";
187
188     /** Request parameter name for the explorer file user last modified. */
189     public static final String JavaDoc PARAM_EXPLORER_FILEUSERLASTMODIFIED = "tabexfileuserlastmodified";
190
191     /** Request parameter name for the new password. */
192     public static final String JavaDoc PARAM_NEWPASSWORD = "newpassword";
193
194     /** Request parameter name for the old password. */
195     public static final String JavaDoc PARAM_OLDPASSWORD = "oldpassword";
196
197     /** Request parameter name prefix for the preferred editors. */
198     public static final String JavaDoc PARAM_PREFERREDEDITOR_PREFIX = "tabedprefed_";
199
200     /** Request parameter name for the workflow filter. */
201     public static final String JavaDoc PARAM_WORKFLOW_FILTER = "tabwffilter";
202
203     /** Request parameter name for the workflow message accepted. */
204     public static final String JavaDoc PARAM_WORKFLOW_MESSAGEACCEPTED = "tabwfmessageaccepted";
205
206     /** Request parameter name for the workflow message completed. */
207     public static final String JavaDoc PARAM_WORKFLOW_MESSAGECOMPLETED = "tabwfmessagecompleted";
208
209     /** Request parameter name for the workflow message forwarded. */
210     public static final String JavaDoc PARAM_WORKFLOW_MESSAGEFORWARDED = "tabwfmessageforwarded";
211
212     /** Request parameter name for the workflow message members. */
213     public static final String JavaDoc PARAM_WORKFLOW_MESSAGEMEMBERS = "tabwfmessagemembers";
214
215     /** Request parameter name for the workflow show all projects. */
216     public static final String JavaDoc PARAM_WORKFLOW_SHOWALLPROJECTS = "tabwfshowallprojects";
217
218     /** Request parameter name for the workplace button style. */
219     public static final String JavaDoc PARAM_WORKPLACE_BUTTONSTYLE = "tabwpbuttonstyle";
220
221     /** Request parameter name for the workplace start folder. */
222     public static final String JavaDoc PARAM_WORKPLACE_FOLDER = "tabwpfolder";
223
224     /** Request parameter name for the workplace language. */
225     public static final String JavaDoc PARAM_WORKPLACE_LANGUAGE = "tabwplanguage";
226
227     /** Request parameter name for the workplace project. */
228     public static final String JavaDoc PARAM_WORKPLACE_PROJECT = "tabwpproject";
229
230     /** Request parameter name for the workplace report type. */
231     public static final String JavaDoc PARAM_WORKPLACE_REPORTTYPE = "tabwpreporttype";
232
233     /** Request parameter name for the workplace explorer view restriction. */
234     public static final String JavaDoc PARAM_WORKPLACE_RESTRICTEXPLORERVIEW = "tabwprestrictexplorerview";
235
236     /** Request parameter name for the workplace start site. */
237     public static final String JavaDoc PARAM_WORKPLACE_SITE = "tabwpsite";
238
239     /** Request parameter name for the workplace use upload applet. */
240     public static final String JavaDoc PARAM_WORKPLACE_USEUPLOADAPPLET = "tabwpuseuploadapplet";
241
242     /** Request parameter name for the workplace view. */
243     public static final String JavaDoc PARAM_WORKPLACE_VIEW = "tabwpview";
244
245     /** The log object for this class. */
246     private static final Log LOG = CmsLog.getLog(CmsPreferences.class);
247
248     /** Constant for filter. */
249     private static final String JavaDoc SPACER = "------------------------------------------------";
250
251     private String JavaDoc m_paramNewPassword;
252     private String JavaDoc m_paramOldPassword;
253
254     /** User settings object used to store the dialog field values. */
255     private CmsUserSettings m_userSettings;
256
257     /**
258      * Public constructor with JSP action element.<p>
259      *
260      * @param jsp an initialized JSP action element
261      */

262     public CmsPreferences(CmsJspActionElement jsp) {
263
264         super(jsp);
265     }
266
267     /**
268      * Public constructor with JSP variables.<p>
269      *
270      * @param context the JSP page context
271      * @param req the JSP request
272      * @param res the JSP response
273      */

274     public CmsPreferences(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
275
276         this(new CmsJspActionElement(context, req, res));
277     }
278
279     /**
280      * Performs the change password action.<p>
281      *
282      * @throws JspException if inclusion of error element fails
283      */

284     public void actionChangePassword() throws JspException JavaDoc {
285
286         // save initialized instance of this class in request attribute for included sub-elements
287
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
288         String JavaDoc newPwd = getParamNewPassword();
289         String JavaDoc oldPwd = getParamOldPassword();
290         // set the action parameter, reset the password parameters
291
setAction(ACTION_DEFAULT);
292         setParamOldPassword(null);
293         setParamNewPassword(null);
294
295         try {
296             CmsPasswordInfo pwdInfo = new CmsPasswordInfo(getCms());
297             pwdInfo.setCurrentPwd(oldPwd);
298             pwdInfo.setNewPwd(newPwd);
299             pwdInfo.setConfirmation(newPwd);
300             pwdInfo.applyChanges();
301         } catch (Throwable JavaDoc e) {
302             // failed setting the new password, show error dialog
303
setAction(ACTION_ERROR);
304             includeErrorpage(this, e);
305         }
306     }
307
308     /**
309      * Performs the save operation of the modified user settings.<p>
310      */

311     public void actionSave() {
312
313         HttpServletRequest JavaDoc request = getJsp().getRequest();
314         // save initialized instance of this class in request attribute for included sub-elements
315
request.setAttribute(SESSION_WORKPLACE_CLASS, this);
316
317         // special case: set the preferred editor settings in the user settings object
318
CmsUserSettings userSettings = new CmsUserSettings(getCms(), getSettings().getUser());
319         // first set the old preferred editors
320
m_userSettings.setEditorSettings(userSettings.getEditorSettings());
321         // then set the old synchronization settings
322
m_userSettings.setSynchronizeSettings(userSettings.getSynchronizeSettings());
323         Enumeration JavaDoc en = request.getParameterNames();
324         while (en.hasMoreElements()) {
325             // search all request parameters for the presence of the preferred editor parameters
326
String JavaDoc paramName = (String JavaDoc)en.nextElement();
327             if (paramName.startsWith(PARAM_PREFERREDEDITOR_PREFIX)) {
328                 String JavaDoc paramValue = request.getParameter(paramName);
329                 if (paramValue != null && !INPUT_DEFAULT.equals(paramValue.trim())) {
330                     // set selected editor for this resource type
331
m_userSettings.setPreferredEditor(
332                         paramName.substring(PARAM_PREFERREDEDITOR_PREFIX.length()),
333                         CmsEncoder.decode(paramValue));
334                 } else {
335                     // reset preferred editor for this resource type
336
m_userSettings.setPreferredEditor(paramName.substring(PARAM_PREFERREDEDITOR_PREFIX.length()), null);
337                 }
338             }
339         }
340
341         // set the current user in the settings object
342
m_userSettings.setUser(getSettings().getUser());
343         try {
344             // write the user settings to the db
345
m_userSettings.save(getCms());
346         } catch (CmsException e) {
347             // should usually never happen
348
if (LOG.isInfoEnabled()) {
349                 LOG.info(e.getLocalizedMessage());
350             }
351         }
352
353         // update the preferences and project after saving
354
updatePreferences(getCms(), getJsp().getRequest());
355
356         try {
357             String JavaDoc projectName = m_userSettings.getStartProject();
358             CmsProject project = getCms().readProject(projectName);
359             getCms().getRequestContext().setCurrentProject(project);
360             getSettings().setProject(project.getId());
361         } catch (Exception JavaDoc e) {
362             // should usually never happen
363
LOG.error(e.getLocalizedMessage());
364         }
365
366         // now determine if the dialog has to be closed or not
367
try {
368             if (DIALOG_SET.equals(getParamAction())) {
369                 // after "set" action, leave dialog open
370
Map JavaDoc params = new HashMap JavaDoc();
371                 params.put(PARAM_TAB, String.valueOf(getActiveTab()));
372                 params.put(PARAM_SETPRESSED, Boolean.TRUE.toString());
373                 sendForward(getJsp().getRequestContext().getUri(), params);
374             } else {
375                 // forward to dialog with action set to reload the workplace
376
Map JavaDoc params = new HashMap JavaDoc();
377                 params.put(PARAM_ACTION, DIALOG_RELOAD);
378                 sendForward(getJsp().getRequestContext().getUri(), params);
379             }
380         } catch (IOException JavaDoc e) {
381             // error during forward, do nothing
382
if (LOG.isInfoEnabled()) {
383                 LOG.info(e.getLocalizedMessage());
384             }
385         } catch (ServletException JavaDoc e) {
386             // error during forward, do nothing
387
if (LOG.isInfoEnabled()) {
388                 LOG.info(e.getLocalizedMessage());
389             }
390         }
391     }
392
393     /**
394      * Builds the html for the default copy file mode select box.<p>
395      *
396      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
397      * @return the html for the default copy file mode select box
398      */

399     public String JavaDoc buildSelectCopyFileMode(String JavaDoc htmlAttributes) {
400
401         List JavaDoc options = new ArrayList JavaDoc(2);
402         options.add(key(Messages.GUI_PREF_COPY_AS_SIBLING_0));
403         options.add(key(Messages.GUI_COPY_AS_NEW_0));
404         List JavaDoc values = new ArrayList JavaDoc(2);
405         values.add(String.valueOf(CmsResource.COPY_AS_SIBLING));
406         values.add(String.valueOf(CmsResource.COPY_AS_NEW));
407         int selectedIndex = values.indexOf(getParamTabDiCopyFileMode());
408         return buildSelect(htmlAttributes, options, values, selectedIndex);
409     }
410
411     /**
412      * Builds the html for the default copy folder mode select box.<p>
413      *
414      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
415      * @return the html for the default copy folder mode select box
416      */

417     public String JavaDoc buildSelectCopyFolderMode(String JavaDoc htmlAttributes) {
418
419         List JavaDoc options = new ArrayList JavaDoc(3);
420         options.add(key(Messages.GUI_PREF_COPY_AS_SIBLINGS_0));
421         options.add(key(Messages.GUI_PREF_PRESERVE_SIBLINGS_RESOURCES_0));
422         options.add(key(Messages.GUI_PREF_COPY_AS_NEW_0));
423         List JavaDoc values = new ArrayList JavaDoc(3);
424         values.add(String.valueOf(CmsResource.COPY_AS_SIBLING));
425         values.add(String.valueOf(CmsResource.COPY_PRESERVE_SIBLING));
426         values.add(String.valueOf(CmsResource.COPY_AS_NEW));
427         int selectedIndex = values.indexOf(getParamTabDiCopyFolderMode());
428         return buildSelect(htmlAttributes, options, values, selectedIndex);
429     }
430
431     /**
432      * Builds the html for the default delete file mode select box.<p>
433      *
434      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
435      * @return the html for the default delete file mode select box
436      */

437     public String JavaDoc buildSelectDeleteFileMode(String JavaDoc htmlAttributes) {
438
439         List JavaDoc options = new ArrayList JavaDoc(2);
440         options.add(key(Messages.GUI_PREF_PRESERVE_SIBLINGS_0));
441         options.add(key(Messages.GUI_PREF_DELETE_SIBLINGS_0));
442         List JavaDoc values = new ArrayList JavaDoc(2);
443         values.add(String.valueOf(CmsResource.DELETE_PRESERVE_SIBLINGS));
444         values.add(String.valueOf(CmsResource.DELETE_REMOVE_SIBLINGS));
445         int selectedIndex = values.indexOf(getParamTabDiDeleteFileMode());
446         return buildSelect(htmlAttributes, options, values, selectedIndex);
447     }
448
449     /**
450      * Builds the html for the direct edit button style select box.<p>
451      *
452      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
453      * @return the html for the direct edit button style select box
454      */

455     public String JavaDoc buildSelectDirectEditButtonStyle(String JavaDoc htmlAttributes) {
456
457         int selectedIndex = Integer.parseInt(getParamTabEdDirectEditButtonStyle());
458         return buildSelectButtonStyle(htmlAttributes, selectedIndex);
459     }
460
461     /**
462      * Builds the html for the editor button style select box.<p>
463      *
464      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
465      * @return the html for the editor button style select box
466      */

467     public String JavaDoc buildSelectEditorButtonStyle(String JavaDoc htmlAttributes) {
468
469         int selectedIndex = Integer.parseInt(getParamTabEdButtonStyle());
470         return buildSelectButtonStyle(htmlAttributes, selectedIndex);
471     }
472
473     /**
474      * Builds the html for the explorer button style select box.<p>
475      *
476      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
477      * @return the html for the explorer button style select box
478      */

479     public String JavaDoc buildSelectExplorerButtonStyle(String JavaDoc htmlAttributes) {
480
481         int selectedIndex = Integer.parseInt(getParamTabExButtonStyle());
482         return buildSelectButtonStyle(htmlAttributes, selectedIndex);
483     }
484
485     /**
486      * Builds the html for the explorer number of entries per page select box.<p>
487      *
488      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
489      * @return the html for the explorer number of entries per page select box
490      */

491     public String JavaDoc buildSelectExplorerFileEntries(String JavaDoc htmlAttributes) {
492
493         String JavaDoc[] opts = new String JavaDoc[] {"10", "25", "50", "100", key(Messages.GUI_LABEL_UNLIMITED_0)};
494         List JavaDoc options = new ArrayList JavaDoc(java.util.Arrays.asList(opts));
495         String JavaDoc[] vals = new String JavaDoc[] {"10", "25", "50", "100", "" + Integer.MAX_VALUE};
496         int selectedIndex = 2;
497         for (int i = 0; i < vals.length; i++) {
498             if (vals[i].equals(getParamTabExFileEntries())) {
499                 selectedIndex = i;
500             }
501         }
502         List JavaDoc values = new ArrayList JavaDoc(java.util.Arrays.asList(vals));
503         return buildSelect(htmlAttributes, options, values, selectedIndex);
504     }
505
506     /**
507      * Builds the html for the task startup filter select box.<p>
508      *
509      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
510      * @return the html for the task startup filter select box
511      */

512     public String JavaDoc buildSelectFilter(String JavaDoc htmlAttributes) {
513
514         List JavaDoc options = new ArrayList JavaDoc(16);
515         List JavaDoc values = new ArrayList JavaDoc(16);
516         int selectedIndex = -1;
517         int counter = 0;
518
519         for (int i = 1; i < 4; i++) {
520             for (char k = 'a'; k < 'd'; k++) {
521                 options.add(key(
522                     Messages.getTaskKey(CmsTaskService.TASK_FILTER + k + i)));
523                 values.add("" + k + i);
524                 if (("" + k + i).equals(getParamTabWfFilter())) {
525                     selectedIndex = counter;
526                 }
527                 counter++;
528             }
529             options.add(SPACER);
530             values.add("");
531             counter++;
532         }
533         for (int i = 1; i < 4; i++) {
534             options.add(key(Messages.getTaskKey(CmsTaskService.TASK_FILTER + "d" + i)));
535             values.add("d" + i);
536             if (("d" + i).equals(getParamTabWfFilter())) {
537                 selectedIndex = counter;
538             }
539             counter++;
540         }
541         return buildSelect(htmlAttributes, options, values, selectedIndex);
542     }
543
544     /**
545      * Builds the html for the language select box of the start settings.<p>
546      *
547      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
548      * @return the html for the language select box
549      */

550     public String JavaDoc buildSelectLanguage(String JavaDoc htmlAttributes) {
551
552         // get available locales from the workplace manager
553
List JavaDoc locales = OpenCms.getWorkplaceManager().getLocales();
554         List JavaDoc options = new ArrayList JavaDoc(locales.size());
555         List JavaDoc values = new ArrayList JavaDoc(locales.size());
556         int checkedIndex = 0;
557         int counter = 0;
558         Iterator JavaDoc i = locales.iterator();
559         Locale JavaDoc setLocale = getSettings().getUserSettings().getLocale();
560         while (i.hasNext()) {
561             Locale JavaDoc currentLocale = (Locale JavaDoc)i.next();
562             // add all locales to the select box
563
String JavaDoc language = currentLocale.getDisplayLanguage(setLocale);
564             if (CmsStringUtil.isNotEmpty(currentLocale.getCountry())) {
565                 language = language + " (" + currentLocale.getDisplayCountry(setLocale) + ")";
566             }
567             if (CmsStringUtil.isNotEmpty(currentLocale.getVariant())) {
568                 language = language + " (" + currentLocale.getDisplayVariant(setLocale) + ")";
569             }
570             options.add(language);
571             values.add(currentLocale.toString());
572             if (getParamTabWpLanguage().equals(currentLocale.toString())) {
573                 // mark the currently active locale
574
checkedIndex = counter;
575             }
576             counter++;
577         }
578         return buildSelect(htmlAttributes, options, values, checkedIndex);
579     }
580
581     /**
582      * Builds the html for the preferred editors select boxes of the editor settings.<p>
583      *
584      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
585      * @return the html for the preferred editors select boxes
586      */

587     public String JavaDoc buildSelectPreferredEditors(String JavaDoc htmlAttributes) {
588
589         StringBuffer JavaDoc result = new StringBuffer JavaDoc(1024);
590         HttpServletRequest JavaDoc request = getJsp().getRequest();
591         if (htmlAttributes != null) {
592             htmlAttributes += " name=\"" + PARAM_PREFERREDEDITOR_PREFIX;
593         }
594         Map JavaDoc resourceEditors = OpenCms.getWorkplaceManager().getWorkplaceEditorManager().getConfigurableEditors();
595         if (resourceEditors != null) {
596             // first: iterate over the resource types and consider order from configuration
597
Iterator JavaDoc i = resourceEditors.keySet().iterator();
598
599             SortedMap JavaDoc rankResources = new TreeMap JavaDoc();
600             while (i.hasNext()) {
601                 String JavaDoc currentResourceType = (String JavaDoc)i.next();
602                 CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
603                     currentResourceType);
604                 rankResources.put(new Float JavaDoc(settings.getNewResourceOrder()), currentResourceType);
605             }
606
607             while (rankResources.size() > 0) {
608                 // get editor configuration with lowest order
609
Float JavaDoc keyVal = (Float JavaDoc)rankResources.firstKey();
610                 String JavaDoc currentResourceType = (String JavaDoc)rankResources.get(keyVal);
611
612                 SortedMap JavaDoc availableEditors = (TreeMap JavaDoc)resourceEditors.get(currentResourceType);
613                 if (availableEditors != null && availableEditors.size() > 0) {
614                     String JavaDoc preSelection = computeEditorPreselection(request, currentResourceType);
615                     List JavaDoc options = new ArrayList JavaDoc(availableEditors.size() + 1);
616                     List JavaDoc values = new ArrayList JavaDoc(availableEditors.size() + 1);
617                     options.add(key(Messages.GUI_PREF_EDITOR_BEST_0));
618                     values.add(INPUT_DEFAULT);
619                     // second: iteration over the available editors for the resource type
620
int selectedIndex = 0;
621                     int counter = 1;
622                     while (availableEditors.size() > 0) {
623                         Float JavaDoc key = (Float JavaDoc)availableEditors.lastKey();
624                         CmsWorkplaceEditorConfiguration conf = (CmsWorkplaceEditorConfiguration)availableEditors.get(key);
625                         options.add(keyDefault(conf.getEditorLabel(), conf.getEditorLabel()));
626                         values.add(conf.getEditorUri());
627                         if (conf.getEditorUri().equals(preSelection)) {
628                             selectedIndex = counter;
629                         }
630                         counter++;
631                         availableEditors.remove(key);
632                     }
633
634                     // create the table row for the current resource type
635
result.append("<tr>\n\t<td style=\"white-space: nowrap;\">");
636                     String JavaDoc localizedName = CmsWorkplaceMessages.getResourceName(this, currentResourceType);
637                     result.append(localizedName);
638                     result.append("</td>\n\t<td>");
639                     result.append(buildSelect(
640                         htmlAttributes + currentResourceType + "\"",
641                         options,
642                         values,
643                         selectedIndex));
644                     result.append("</td>\n</tr>\n");
645                 }
646                 rankResources.remove(keyVal);
647             }
648         }
649         return result.toString();
650     }
651
652     /**
653      * Builds the html for the project select box of the start settings.<p>
654      *
655      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
656      * @return the html for the project select box
657      */

658     public String JavaDoc buildSelectProject(String JavaDoc htmlAttributes) {
659
660         try {
661             List JavaDoc allProjects = getCms().getAllAccessibleProjects();
662             List JavaDoc options = new ArrayList JavaDoc(allProjects.size());
663             List JavaDoc values = new ArrayList JavaDoc(allProjects.size());
664             int checkedIndex = 0;
665             String JavaDoc startProject = "";
666
667             startProject = getParamTabWpProject();
668
669             for (int i = 0, n = allProjects.size(); i < n; i++) {
670                 CmsProject project = (CmsProject)allProjects.get(i);
671                 options.add(project.getName());
672                 //values.add("" + project.getId());
673
values.add(project.getName());
674                 if (startProject.equals(project.getName())) {
675                     checkedIndex = i;
676                 }
677             }
678             return buildSelect(htmlAttributes, options, values, checkedIndex);
679         } catch (CmsException e) {
680             // should usually never happen
681
LOG.error(e.getLocalizedMessage());
682             return getSettings().getProject() + "";
683         }
684     }
685
686     /**
687      * Builds the html for the default publish siblings mode select box.<p>
688      *
689      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
690      * @return the html for the default publish siblings mode select box
691      */

692     public String JavaDoc buildSelectPublishSiblings(String JavaDoc htmlAttributes) {
693
694         List JavaDoc options = new ArrayList JavaDoc(2);
695         options.add(key(Messages.GUI_PREF_PUBLISH_SIBLINGS_0));
696         options.add(key(Messages.GUI_PREF_PUBLISH_ONLY_SELECTED_0));
697         List JavaDoc values = new ArrayList JavaDoc(2);
698         values.add(CmsStringUtil.TRUE);
699         values.add(CmsStringUtil.FALSE);
700         int selectedIndex = values.indexOf(getParamTabDiPublishFileMode());
701         return buildSelect(htmlAttributes, options, values, selectedIndex);
702     }
703
704     /**
705      * Builds the html for the workplace report type select box.<p>
706      *
707      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
708      * @return the html for the workplace report type select box
709      */

710     public String JavaDoc buildSelectReportType(String JavaDoc htmlAttributes) {
711
712         List JavaDoc options = new ArrayList JavaDoc(2);
713         options.add(key(Messages.GUI_LABEL_SIMPLE_0));
714         options.add(key(Messages.GUI_LABEL_EXTENDED_0));
715         String JavaDoc[] vals = new String JavaDoc[] {I_CmsReport.REPORT_TYPE_SIMPLE, I_CmsReport.REPORT_TYPE_EXTENDED};
716         List JavaDoc values = new ArrayList JavaDoc(java.util.Arrays.asList(vals));
717         int selectedIndex = 0;
718         if (I_CmsReport.REPORT_TYPE_EXTENDED.equals(getParamTabWpReportType())) {
719             selectedIndex = 1;
720         }
721         return buildSelect(htmlAttributes, options, values, selectedIndex);
722     }
723
724     /**
725      * Builds the html for the workplace start site select box.<p>
726      *
727      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
728      * @return the html for the workplace start site select box
729      */

730     public String JavaDoc buildSelectSite(String JavaDoc htmlAttributes) {
731
732         List JavaDoc options = new ArrayList JavaDoc();
733         List JavaDoc values = new ArrayList JavaDoc();
734         int selectedIndex = 0;
735
736         List JavaDoc sites = CmsSiteManager.getAvailableSites(getCms(), true);
737
738         Iterator JavaDoc i = sites.iterator();
739         int pos = 0;
740         while (i.hasNext()) {
741             CmsSite site = (CmsSite)i.next();
742             String JavaDoc siteRoot = site.getSiteRoot();
743             if (!siteRoot.endsWith("/")) {
744                 siteRoot += "/";
745             }
746             values.add(siteRoot);
747             options.add(site.getTitle());
748             if (siteRoot.equals(getParamTabWpSite())) {
749                 // this is the user's currently chosen site
750
selectedIndex = pos;
751             }
752             pos++;
753         }
754
755         return buildSelect(htmlAttributes, options, values, selectedIndex);
756     }
757
758     /**
759      * Returns a html select box filled with the views accessible by the current user.<p>
760      *
761      * @param htmlAttributes attributes that will be inserted into the generated html
762      * @return a html select box filled with the views accessible by the current user
763      */

764     public String JavaDoc buildSelectView(String JavaDoc htmlAttributes) {
765
766         List JavaDoc options = new ArrayList JavaDoc();
767         List JavaDoc values = new ArrayList JavaDoc();
768         int selectedIndex = 0;
769
770         // loop through the vectors and fill the result vectors
771
Iterator JavaDoc i = OpenCms.getWorkplaceManager().getViews().iterator();
772         int count = -1;
773         while (i.hasNext()) {
774             count++;
775             CmsWorkplaceView view = (CmsWorkplaceView)i.next();
776
777             boolean visible = true;
778             try {
779                 getCms().readResource(view.getUri());
780             } catch (CmsException e) {
781                 // should usually never happen
782
if (LOG.isInfoEnabled()) {
783                     LOG.info(e.getLocalizedMessage());
784                 }
785                 visible = false;
786             }
787             if (visible) {
788                 String JavaDoc localizedKey = resolveMacros(view.getKey());
789                 options.add(localizedKey);
790                 values.add(view.getUri());
791
792                 if (view.getUri().equals(getParamTabWpView())) {
793                     selectedIndex = count;
794                 }
795             }
796         }
797
798         return buildSelect(htmlAttributes, options, values, selectedIndex);
799     }
800
801     /**
802      * Builds the html for the workplace button style select box.<p>
803      *
804      * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
805      * @return the html for the workplace button style select box
806      */

807     public String JavaDoc buildSelectWorkplaceButtonStyle(String JavaDoc htmlAttributes) {
808
809         int selectedIndex = Integer.parseInt(getParamTabWpButtonStyle());
810         return buildSelectButtonStyle(htmlAttributes, selectedIndex);
811     }
812
813     /**
814      * Builds the html code for the static user information table (tab 4).<p>
815      *
816      * @return the html code for the static user information table
817      */

818     public String JavaDoc buildUserInformation() {
819
820         StringBuffer JavaDoc result = new StringBuffer JavaDoc(512);
821         CmsUser user = getSettings().getUser();
822
823         result.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n");
824         result.append("<tr>\n");
825         result.append("\t<td style=\"width: 25%;\">");
826         result.append(key(Messages.GUI_LABEL_USER_0));
827         result.append("</td>\n");
828         result.append("\t<td class=\"textbold\" style=\"width: 25%;\">");
829         result.append(user.getName());
830         result.append("</td>\n");
831         result.append("\t<td style=\"width: 25%;\">");
832         result.append(key(Messages.GUI_LABEL_EMAIL_0));
833         result.append("</td>\n");
834         result.append("\t<td class=\"textbold\" style=\"width: 25%;\">");
835         result.append(user.getEmail());
836         result.append("</td>\n");
837         result.append("</tr>\n");
838
839         result.append("<tr>\n");
840         result.append("\t<td>");
841         result.append(key(Messages.GUI_LABEL_LASTNAME_0));
842         result.append("</td>\n");
843         result.append("\t<td class=\"textbold\">");
844         result.append(user.getLastname());
845         result.append("</td>\n");
846         result.append("\t<td rowspan=\"3\" style=\"vertical-align: top;\">");
847         result.append(key(Messages.GUI_INPUT_ADRESS_0));
848         result.append("</td>\n");
849
850         String JavaDoc address = user.getAddress();
851
852         result.append("\t<td rowspan=\"3\" class=\"textbold\" style=\"vertical-align: top;\">");
853         result.append(address);
854         result.append("</td>\n");
855         result.append("</tr>\n");
856
857         result.append("<tr>\n");
858         result.append("\t<td>");
859         result.append(key(Messages.GUI_LABEL_FIRSTNAME_0));
860         result.append("</td>\n");
861         result.append("\t<td class=\"textbold\">");
862         result.append(user.getFirstname());
863         result.append("</td>\n");
864         result.append("</tr>\n");
865
866         result.append("<tr>\n");
867         result.append("\t<td>");
868         result.append(key(Messages.GUI_LABEL_DESCRIPTION_0));
869         result.append("</td>\n");
870         result.append("\t<td class=\"textbold\">");
871         result.append(user.getDescription());
872         result.append("</td>\n");
873         result.append("</tr>\n");
874         result.append("</table>\n");
875
876         return result.toString();
877     }
878
879     /**
880      * Returns the new password value.<p>
881      *
882      * @return the new password value
883      */

884     public String JavaDoc getParamNewPassword() {
885
886         return m_paramNewPassword;
887     }
888
889     /**
890      * Returns the old password value.<p>
891      *
892      * @return the old password value
893      */

894     public String JavaDoc getParamOldPassword() {
895
896         return m_paramOldPassword;
897     }
898
899     /**
900      * Returns the "copy file default" setting.<p>
901      *
902      * @return the "copy file default" setting
903      */

904     public String JavaDoc getParamTabDiCopyFileMode() {
905
906         return "" + m_userSettings.getDialogCopyFileMode();
907     }
908
909     /**
910      * Returns the "copy folder default" setting.<p>
911      *
912      * @return the "copy folder default" setting
913      */

914     public String JavaDoc getParamTabDiCopyFolderMode() {
915
916         return "" + m_userSettings.getDialogCopyFolderMode();
917     }
918
919     /**
920      * Returns the "delete file default" setting.<p>
921      *
922      * @return the "delete file default" setting
923      */

924     public String JavaDoc getParamTabDiDeleteFileMode() {
925
926         return "" + m_userSettings.getDialogDeleteFileMode();
927     }
928
929     /**
930      * Returns the "expand inherited permissions" default setting.<p>
931      *
932      * @return the "expand inherited permissions" default setting
933      */

934     public String JavaDoc getParamTabDiPermissionsExpandInherited() {
935
936         return isParamEnabled(m_userSettings.getDialogExpandInheritedPermissions());
937     }
938
939     /**
940      * Returns the "expand current users permissions" default setting.<p>
941      *
942      * @return the "expand current users permissions" default setting
943      */

944     public String JavaDoc getParamTabDiPermissionsExpandUser() {
945
946         return isParamEnabled(m_userSettings.getDialogExpandUserPermissions());
947     }
948
949     /**
950      * Returns the "inherit permissions on folders" default setting.<p>
951      *
952      * @return the "inherit permissions on folders" default setting
953      */

954     public String JavaDoc getParamTabDiPermissionsInheritOnFolder() {
955
956         return isParamEnabled(m_userSettings.getDialogPermissionsInheritOnFolder());
957     }
958
959     /**
960      * Returns the "publish file siblings default" setting.<p>
961      *
962      * @return the "publish file siblings default" setting
963      */

964     public String JavaDoc getParamTabDiPublishFileMode() {
965
966         return "" + m_userSettings.getDialogPublishSiblings();
967     }
968
969     /**
970      * Returns the "display lock dialog" setting.<p>
971      *
972      * @return <code>"true"</code> if the "display lock dialog" input field is checked, otherwise ""
973      */

974     public String JavaDoc getParamTabDiShowLock() {
975
976         return isParamEnabled(m_userSettings.getDialogShowLock());
977     }
978
979     /**
980      * Returns the "editor button style" setting.<p>
981      *
982      * @return the "editor button style" setting
983      */

984     public String JavaDoc getParamTabEdButtonStyle() {
985
986         return "" + m_userSettings.getEditorButtonStyle();
987     }
988
989     /**
990      * Returns the "direct edit button style" setting.<p>
991      *
992      * @return the "direct edit button style" setting
993      */

994     public String JavaDoc getParamTabEdDirectEditButtonStyle() {
995
996         return "" + m_userSettings.getDirectEditButtonStyle();
997     }
998
999     /**
1000     * Returns the "explorer button style" setting.<p>
1001     *
1002     * @return the "explorer button style" setting
1003     */

1004    public String JavaDoc getParamTabExButtonStyle() {
1005
1006        return "" + m_userSettings.getExplorerButtonStyle();
1007    }
1008
1009    /**
1010     * Returns the "display file creation date" setting.<p>
1011     *
1012     * @return <code>"true"</code> if the file creation date input field is checked, otherwise ""
1013     */

1014    public String JavaDoc getParamTabExFileDateCreated() {
1015
1016        return isParamEnabled(m_userSettings.showExplorerFileDateCreated());
1017    }
1018
1019    /**
1020     * Returns the "display file date expired" setting.<p>
1021     *
1022     * @return <code>"true"</code> if the file date expired input field is checked, otherwise ""
1023     */

1024    public String JavaDoc getParamTabExFileDateExpired() {
1025
1026        return isParamEnabled(m_userSettings.showExplorerFileDateExpired());
1027    }
1028
1029    /**
1030     * Returns the "display file last modification date" setting.<p>
1031     *
1032     * @return <code>"true"</code> if the file last modification date input field is checked, otherwise ""
1033     */

1034    public String JavaDoc getParamTabExFileDateLastModified() {
1035
1036        return isParamEnabled(m_userSettings.showExplorerFileDateLastModified());
1037    }
1038
1039    /**
1040     * Returns the "display file date released" setting.<p>
1041     *
1042     * @return <code>"true"</code> if the file date released input field is checked, otherwise ""
1043     */

1044    public String JavaDoc getParamTabExFileDateReleased() {
1045
1046        return isParamEnabled(m_userSettings.showExplorerFileDateReleased());
1047    }
1048
1049    /**
1050     * Returns the "explorer number of entries per page" setting.<p>
1051     *
1052     * @return the "explorer number of entries per page" setting
1053     */

1054    public String JavaDoc getParamTabExFileEntries() {
1055
1056        return "" + m_userSettings.getExplorerFileEntries();
1057    }
1058
1059    /**
1060     * Returns the "display file locked by" setting.<p>
1061     *
1062     * @return <code>"true"</code> if the file locked by input field is checked, otherwise ""
1063     */

1064    public String JavaDoc getParamTabExFileLockedBy() {
1065
1066        return isParamEnabled(m_userSettings.showExplorerFileLockedBy());
1067    }
1068
1069    /**
1070     * Returns the "display file permissions" setting.<p>
1071     *
1072     * @return <code>"true"</code> if the file permissions input field is checked, otherwise ""
1073     */

1074    public String JavaDoc getParamTabExFilePermissions() {
1075
1076        return isParamEnabled(m_userSettings.showExplorerFilePermissions());
1077    }
1078
1079    /**
1080     * Returns the "display file size" setting.<p>
1081     *
1082     * @return <code>"true"</code> if the file size input field is checked, otherwise ""
1083     */

1084    public String JavaDoc getParamTabExFileSize() {
1085
1086        return isParamEnabled(m_userSettings.showExplorerFileSize());
1087    }
1088
1089    /**
1090     * Returns the "display file state" setting.<p>
1091     *
1092     * @return <code>"true"</code> if the file state input field is checked, otherwise ""
1093     */

1094    public String JavaDoc getParamTabExFileState() {
1095
1096        return isParamEnabled(m_userSettings.showExplorerFileState());
1097    }
1098
1099    /**
1100     * Returns the "display file title" setting.<p>
1101     *
1102     * @return <code>"true"</code> if the file title input field is checked, otherwise ""
1103     */

1104    public String JavaDoc getParamTabExFileTitle() {
1105
1106        return isParamEnabled(m_userSettings.showExplorerFileTitle());
1107    }
1108
1109    /**
1110     * Returns the "display file type" setting.<p>
1111     *
1112     * @return <code>"true"</code> if the file type input field is checked, otherwise ""
1113     */

1114    public String JavaDoc getParamTabExFileType() {
1115
1116        return isParamEnabled(m_userSettings.showExplorerFileType());
1117    }
1118
1119    /**
1120     * Returns the "display file created by" setting.<p>
1121     *
1122     * @return <code>"true"</code> if the file created by input field is checked, otherwise ""
1123     */

1124    public String JavaDoc getParamTabExFileUserCreated() {
1125
1126        return isParamEnabled(m_userSettings.showExplorerFileUserCreated());
1127    }
1128
1129    /**
1130     * Returns the "display file last modified by" setting.<p>
1131     *
1132     * @return <code>"true"</code> if the file last modified by input field is checked, otherwise ""
1133     */

1134    public String JavaDoc getParamTabExFileUserLastModified() {
1135
1136        return isParamEnabled(m_userSettings.showExplorerFileUserLastModified());
1137    }
1138
1139    /**
1140     * Returns the "task startup filter" setting.<p>
1141     *
1142     * @return the "task startup filter" setting
1143     */

1144    public String JavaDoc getParamTabWfFilter() {
1145
1146        return m_userSettings.getTaskStartupFilter();
1147    }
1148
1149    /**
1150     * Returns the "message when accepted" setting.<p>
1151     *
1152     * @return the "message when accepted" setting
1153     */

1154    public String JavaDoc getParamTabWfMessageAccepted() {
1155
1156        return isParamEnabled(m_userSettings.getTaskMessageAccepted());
1157    }
1158
1159    /**
1160     * Returns the "message when completed" setting.<p>
1161     *
1162     * @return the "message when completed" setting
1163     */

1164    public String JavaDoc getParamTabWfMessageCompleted() {
1165
1166        return isParamEnabled(m_userSettings.getTaskMessageCompleted());
1167    }
1168
1169    /**
1170     * Returns the "message when forwarded" setting.<p>
1171     *
1172     * @return the "message when forwarded" setting
1173     */

1174    public String JavaDoc getParamTabWfMessageForwarded() {
1175
1176        return isParamEnabled(m_userSettings.getTaskMessageForwarded());
1177    }
1178
1179    /**
1180     * Returns the "inform all role members" setting.<p>
1181     *
1182     * @return <code>"true"</code> if the "inform all role members" input field is checked, otherwise ""
1183     */

1184    public String JavaDoc getParamTabWfMessageMembers() {
1185
1186        return isParamEnabled(m_userSettings.getTaskMessageMembers());
1187    }
1188
1189    /**
1190     * returns the "show all projects" setting.<p>
1191     *
1192     * @return the "show all projects" setting
1193     */

1194    public String JavaDoc getParamTabWfShowAllProjects() {
1195
1196        return isParamEnabled(m_userSettings.getTaskShowAllProjects());
1197    }
1198
1199    /**
1200     * Returns the "workplace button style" setting.<p>
1201     *
1202     * @return the "workplace button style" setting
1203     */

1204    public String JavaDoc getParamTabWpButtonStyle() {
1205
1206        return "" + m_userSettings.getWorkplaceButtonStyle();
1207    }
1208
1209    /**
1210     * Returns the "start folder" setting.<p>
1211     *
1212     * @return the "start folder" setting
1213     */

1214    public String JavaDoc getParamTabWpFolder() {
1215
1216        return m_userSettings.getStartFolder();
1217    }
1218
1219    /**
1220     * Returns the start language setting.<p>
1221     *
1222     * @return the start language setting
1223     */

1224    public String JavaDoc getParamTabWpLanguage() {
1225
1226        return m_userSettings.getLocale().toString();
1227    }
1228
1229    /**
1230     * Returns the start project setting.<p>
1231     *
1232     * @return the start project setting
1233     */

1234    public String JavaDoc getParamTabWpProject() {
1235
1236        return m_userSettings.getStartProject();
1237    }
1238
1239    /**
1240     * Returns the "workplace report type" setting.<p>
1241     *
1242     * @return the "workplace report type" setting
1243     */

1244    public String JavaDoc getParamTabWpReportType() {
1245
1246        return m_userSettings.getWorkplaceReportType();
1247    }
1248
1249    /**
1250     * Returns the "workplace restrict explorer view" setting.<p>
1251     *
1252     * @return the "workplace restrict explorer view" setting
1253     */

1254    public String JavaDoc getParamTabWpRestrictExplorerView() {
1255
1256        return "" + m_userSettings.getRestrictExplorerView();
1257    }
1258
1259    /**
1260     * Returns the "start site" setting.<p>
1261     *
1262     * @return the "start site" setting
1263     */

1264    public String JavaDoc getParamTabWpSite() {
1265
1266        return m_userSettings.getStartSite();
1267    }
1268
1269    /**
1270     * Returns the "use upload applet" setting.<p>
1271     *
1272     * @return <code>"true"</code> if the "use upload applet" input is checked, otherwise ""
1273     */

1274    public String JavaDoc getParamTabWpUseUploadApplet() {
1275
1276        return isParamEnabled(m_userSettings.useUploadApplet());
1277    }
1278
1279    /**
1280     * Returns the start view setting.<p>
1281     *
1282     * @return the start view setting
1283     */

1284    public String JavaDoc getParamTabWpView() {
1285
1286        return m_userSettings.getStartView();
1287    }
1288
1289    /**
1290     * @see org.opencms.workplace.CmsTabDialog#getTabParameterOrder()
1291     */

1292    public List JavaDoc getTabParameterOrder() {
1293
1294        ArrayList JavaDoc orderList = new ArrayList JavaDoc(5);
1295        orderList.add("tabwp");
1296        orderList.add("tabex");
1297        orderList.add("tabdi");
1298        orderList.add("tabed");
1299        orderList.add("tabwf");
1300        orderList.add("tabup");
1301        return orderList;
1302    }
1303
1304    /**
1305     * @see org.opencms.workplace.CmsTabDialog#getTabs()
1306     */

1307    public List JavaDoc getTabs() {
1308
1309        ArrayList JavaDoc tabList = new ArrayList JavaDoc(6);
1310        tabList.add(key(Messages.GUI_PREF_PANEL_WORKPLACE_0));
1311        tabList.add(key(Messages.GUI_PREF_PANEL_EXPLORER_0));
1312        tabList.add(key(Messages.GUI_PREF_PANEL_DIALOGS_0));
1313        tabList.add(key(Messages.GUI_PREF_PANEL_EDITORS_0));
1314        tabList.add(key(Messages.GUI_PREF_PANEL_TASK_0));
1315        tabList.add(key(Messages.GUI_PREF_PANEL_USER_0));
1316        return tabList;
1317    }
1318
1319    /**
1320     * Helper method to add the "checked" attribute to an input field.<p>
1321     *
1322     * @param paramValue the parameter value, if <code>"true"</code>, the "checked" attribute will be returned
1323     * @return the "checked" attribute or an empty String
1324     */

1325    public String JavaDoc isChecked(String JavaDoc paramValue) {
1326
1327        if (Boolean.valueOf(paramValue).booleanValue()) {
1328            return " checked=\"checked\"";
1329        }
1330        return "";
1331    }
1332
1333    /**
1334     * Sets the new password value.<p>
1335     *
1336     * @param newPwd the new password value
1337     */

1338    public void setParamNewPassword(String JavaDoc newPwd) {
1339
1340        m_paramNewPassword = newPwd;
1341    }
1342
1343    /**
1344     * Sets the old password value.<p>
1345     *
1346     * @param oldPwd the old password value
1347     */

1348    public void setParamOldPassword(String JavaDoc oldPwd) {
1349
1350        m_paramOldPassword = oldPwd;
1351    }
1352
1353    /**
1354     * Sets the "copy file default" setting.<p>
1355     *
1356     * @param value the "copy file default" setting
1357     */

1358    public void setParamTabDiCopyFileMode(String JavaDoc value) {
1359
1360        try {
1361            m_userSettings.setDialogCopyFileMode(Integer.parseInt(value));
1362        } catch (Throwable JavaDoc t) {
1363            // should usually never happen
1364
}
1365    }
1366
1367    /**
1368     * Sets the "copy folder default" setting.<p>
1369     *
1370     * @param value the "copy folder default" setting
1371     */

1372    public void setParamTabDiCopyFolderMode(String JavaDoc value) {
1373
1374        try {
1375            m_userSettings.setDialogCopyFolderMode(Integer.parseInt(value));
1376        } catch (Throwable JavaDoc t) {
1377            // should usually never happen
1378
}
1379    }
1380
1381    /**
1382     * Sets the "delete file siblings default" setting.<p>
1383     *
1384     * @param value the "delete file siblings default" setting
1385     */

1386    public void setParamTabDiDeleteFileMode(String JavaDoc value) {
1387
1388        try {
1389            m_userSettings.setDialogDeleteFileMode(Integer.parseInt(value));
1390        } catch (Throwable JavaDoc t) {
1391            // should usually never happen
1392
}
1393    }
1394
1395    /**
1396     * Sets the "expand inherited permissions" default setting.<p>
1397     *
1398     * @param value the "expand inherited permissions" default setting
1399     */

1400    public void setParamTabDiPermissionsExpandInherited(String JavaDoc value) {
1401
1402        m_userSettings.setDialogExpandInheritedPermissions(Boolean.valueOf(value).booleanValue());
1403    }
1404
1405    /**
1406     * Sets the "expand current users permissions" default setting.<p>
1407     *
1408     * @param value the "expand current users permissions" default setting
1409     */

1410    public void setParamTabDiPermissionsExpandUser(String JavaDoc value) {
1411
1412        m_userSettings.setDialogExpandUserPermissions(Boolean.valueOf(value).booleanValue());
1413    }
1414
1415    /**
1416     * Sets the "inherit permissions on folders" default setting.<p>
1417     *
1418     * @param value the "inherit permissions on folders" default setting
1419     */

1420    public void setParamTabDiPermissionsInheritOnFolder(String JavaDoc value) {
1421
1422        m_userSettings.setDialogPermissionsInheritOnFolder(Boolean.valueOf(value).booleanValue());
1423    }
1424
1425    /**
1426     * Sets the "publish file siblings default" setting.<p>
1427     *
1428     * @param value the "publish file siblings default" setting
1429     */

1430    public void setParamTabDiPublishFileMode(String JavaDoc value) {
1431
1432        m_userSettings.setDialogPublishSiblings(Boolean.valueOf(value).booleanValue());
1433    }
1434
1435    /**
1436     * Sets the "display lock dialog" setting.<p>
1437     *
1438     * @param value <code>"true"</code> to enable the "display lock dialog" setting, all others to disable
1439     */

1440    public void setParamTabDiShowLock(String JavaDoc value) {
1441
1442        m_userSettings.setDialogShowLock(Boolean.valueOf(value).booleanValue());
1443    }
1444
1445    /**
1446     * Sets the "editor button style" setting.<p>
1447     *
1448     * @param value a String representation of an int value to set the "editor button style" setting
1449     */

1450    public void setParamTabEdButtonStyle(String JavaDoc value) {
1451
1452        try {
1453            m_userSettings.setEditorButtonStyle(Integer.parseInt(value));
1454        } catch (Throwable JavaDoc t) {
1455            // should usually never happen
1456
}
1457    }
1458
1459    /**
1460     * Sets the "direct edit button style" setting.<p>
1461     *
1462     * @param value a String representation of an int value to set the "direct edit button style" setting
1463     */

1464    public void setParamTabEdDirectEditButtonStyle(String JavaDoc value) {
1465
1466        try {
1467            m_userSettings.setDirectEditButtonStyle(Integer.parseInt(value));
1468        } catch (Throwable JavaDoc t) {
1469            // should usually never happen
1470
}
1471    }
1472
1473    /**
1474     * Sets the "explorer button style" setting.<p>
1475     *
1476     * @param value a String representation of an int value to set the "explorer button style" setting
1477     */

1478    public void setParamTabExButtonStyle(String JavaDoc value) {
1479
1480        try {
1481            m_userSettings.setExplorerButtonStyle(Integer.parseInt(value));
1482        } catch (Throwable JavaDoc t) {
1483            // should usually never happen
1484
}
1485    }
1486
1487    /**
1488     * Sets the "display file creation date" setting.<p>
1489     *
1490     * @param value <code>"true"</code> to enable the "display file creation date" setting, all others to disable
1491     */

1492    public void setParamTabExFileDateCreated(String JavaDoc value) {
1493
1494        m_userSettings.setShowExplorerFileDateCreated(Boolean.valueOf(value).booleanValue());
1495    }
1496
1497    /**
1498     * Sets the "display file expired date" setting.<p>
1499     *
1500     * @param value <code>"true"</code> to enable the "display file expired date" setting, all others to disable
1501     */

1502    public void setParamTabExFileDateExpired(String JavaDoc value) {
1503
1504        m_userSettings.setShowExplorerFileDateExpired(Boolean.valueOf(value).booleanValue());
1505    }
1506
1507    /**
1508     * Sets the "display file last modification date" setting.<p>
1509     *
1510     * @param value <code>"true"</code> to enable the "display file last modification date" setting, all others to disable
1511     */

1512    public void setParamTabExFileDateLastModified(String JavaDoc value) {
1513
1514        m_userSettings.setShowExplorerFileDateLastModified(Boolean.valueOf(value).booleanValue());
1515    }
1516
1517    /**
1518     * Sets the "display file released date" setting.<p>
1519     *
1520     * @param value <code>"true"</code> to enable the "display file released date" setting, all others to disable
1521     */

1522    public void setParamTabExFileDateReleased(String JavaDoc value) {
1523
1524        m_userSettings.setShowExplorerFileDateReleased(Boolean.valueOf(value).booleanValue());
1525    }
1526
1527    /**
1528     * Sets the "explorer number of entries per page" setting.<p>
1529     *
1530     * @param value a String representation of an int value to set the "number of entries per page" setting
1531     */

1532    public void setParamTabExFileEntries(String JavaDoc value) {
1533
1534        try {
1535            m_userSettings.setExplorerFileEntries(Integer.parseInt(value));
1536        } catch (Throwable JavaDoc t) {
1537            // should usually never happen
1538
}
1539    }
1540
1541    /**
1542     * Sets the "display file locked by" setting.<p>
1543     *
1544     * @param value <code>"true"</code> to enable the "display file locked by" setting, all others to disable
1545     */

1546    public void setParamTabExFileLockedBy(String JavaDoc value) {
1547
1548        m_userSettings.setShowExplorerFileLockedBy(Boolean.valueOf(value).booleanValue());
1549    }
1550
1551    /**
1552     * Sets the "display file permissions" setting.<p>
1553     *
1554     * @param value <code>"true"</code> to enable the "display file permissions" setting, all others to disable
1555     */

1556    public void setParamTabExFilePermissions(String JavaDoc value) {
1557
1558        m_userSettings.setShowExplorerFilePermissions(Boolean.valueOf(value).booleanValue());
1559    }
1560
1561    /**
1562     * Sets the "display file size" setting.<p>
1563     *
1564     * @param value <code>"true"</code> to enable the "display file size" setting, all others to disable
1565     */

1566    public void setParamTabExFileSize(String JavaDoc value) {
1567
1568        m_userSettings.setShowExplorerFileSize(Boolean.valueOf(value).booleanValue());
1569    }
1570
1571    /**
1572     * Sets the "display file state" setting.<p>
1573     *
1574     * @param value <code>"true"</code> to enable the "display file state" setting, all others to disable
1575     */

1576    public void setParamTabExFileState(String JavaDoc value) {
1577
1578        m_userSettings.setShowExplorerFileState(Boolean.valueOf(value).booleanValue());
1579    }
1580
1581    /**
1582     * Sets the "display file title" setting.<p>
1583     *
1584     * @param value <code>"true"</code> to enable the "display file title" setting, all others to disable
1585     */

1586    public void setParamTabExFileTitle(String JavaDoc value) {
1587
1588        m_userSettings.setShowExplorerFileTitle(Boolean.valueOf(value).booleanValue());
1589    }
1590
1591    /**
1592     * Sets the "display file type" setting.<p>
1593     *
1594     * @param value <code>"true"</code> to enable the "display file type" setting, all others to disable
1595     */

1596    public void setParamTabExFileType(String JavaDoc value) {
1597
1598        m_userSettings.setShowExplorerFileType(Boolean.valueOf(value).booleanValue());
1599    }
1600
1601    /**
1602     * Sets the "display file created by" setting.<p>
1603     *
1604     * @param value <code>"true"</code> to enable the "display file created by" setting, all others to disable
1605     */

1606    public void setParamTabExFileUserCreated(String JavaDoc value) {
1607
1608        m_userSettings.setShowExplorerFileUserCreated(Boolean.valueOf(value).booleanValue());
1609    }
1610
1611    /**
1612     * Sets the "display file last modified by" setting.<p>
1613     *
1614     * @param value <code>"true"</code> to enable the "display file last modified by" setting, all others to disable
1615     */

1616    public void setParamTabExFileUserLastModified(String JavaDoc value) {
1617
1618        m_userSettings.setShowExplorerFileUserLastModified(Boolean.valueOf(value).booleanValue());
1619    }
1620
1621    /**
1622     * Sets the "task startup filter" setting.<p>
1623     *
1624     * @param filter the "task startup filter" setting
1625     */

1626    public void setParamTabWfFilter(String JavaDoc filter) {
1627
1628        if ("".equals(filter)) {
1629            filter = "a1";
1630        }
1631        m_userSettings.setTaskStartupFilter(filter);
1632    }
1633
1634    /**
1635     * Sets the "message when accepted" setting.<p>
1636     *
1637     * @param value the "message when accepted" setting
1638     */

1639    public void setParamTabWfMessageAccepted(String JavaDoc value) {
1640
1641        m_userSettings.setTaskMessageAccepted(Boolean.valueOf(value).booleanValue());
1642    }
1643
1644    /**
1645     * Sets the "message when completed" setting.<p>
1646     *
1647     * @param value the "message when completed" setting
1648     */

1649    public void setParamTabWfMessageCompleted(String JavaDoc value) {
1650
1651        m_userSettings.setTaskMessageCompleted(Boolean.valueOf(value).booleanValue());
1652    }
1653
1654    /**
1655     * Sets the "message when forwarded" setting.<p>
1656     *
1657     * @param value the "message when forwarded" setting
1658     */

1659    public void setParamTabWfMessageForwarded(String JavaDoc value) {
1660
1661        m_userSettings.setTaskMessageForwarded(Boolean.valueOf(value).booleanValue());
1662    }
1663
1664    /**
1665     * Sets the "inform all role members" setting.<p>
1666     *
1667     * @param value <code>"true"</code> to enable the "inform all role members" setting, all others to disable
1668     */

1669    public void setParamTabWfMessageMembers(String JavaDoc value) {
1670
1671        m_userSettings.setTaskMessageMembers(Boolean.valueOf(value).booleanValue());
1672    }
1673
1674    /**
1675     * Sets the "show all projects" setting.<p>
1676     *
1677     * @param value the "show all projects" setting
1678     */

1679    public void setParamTabWfShowAllProjects(String JavaDoc value) {
1680
1681        m_userSettings.setTaskShowAllProjects(Boolean.valueOf(value).booleanValue());
1682    }
1683
1684    /**
1685     * Sets the "workplace button style" setting.<p>
1686     *
1687     * @param value a String representation of an int value to set the "workplace button style" setting
1688     */

1689    public void setParamTabWpButtonStyle(String JavaDoc value) {
1690
1691        try {
1692            m_userSettings.setWorkplaceButtonStyle(Integer.parseInt(value));
1693        } catch (Throwable JavaDoc t) {
1694            // should usually never happen
1695
}
1696    }
1697
1698    /**
1699     * Sets the "start folder" setting.<p>
1700     *
1701     * @param value the start folder to show in the explorer view
1702     */

1703    public void setParamTabWpFolder(String JavaDoc value) {
1704
1705        m_userSettings.setStartFolder(value);
1706    }
1707
1708    /**
1709     * Sets the start language setting.<p>
1710     *
1711     * @param value the start language setting
1712     */

1713    public void setParamTabWpLanguage(String JavaDoc value) {
1714
1715        m_userSettings.setLocale(CmsLocaleManager.getLocale(value));
1716    }
1717
1718    /**
1719     * Sets the start project setting.<p>
1720     *
1721     * @param value the start project setting
1722     */

1723    public void setParamTabWpProject(String JavaDoc value) {
1724
1725        m_userSettings.setStartProject(value);
1726    }
1727
1728    /**
1729     * Sets the "workplace report type" setting.<p>
1730     *
1731     * @param value the "workplace report type" setting
1732     */

1733    public void setParamTabWpReportType(String JavaDoc value) {
1734
1735        if (I_CmsReport.REPORT_TYPE_SIMPLE.equals(value) || I_CmsReport.REPORT_TYPE_EXTENDED.equals(value)) {
1736            // set only if valid parameter value is found
1737
m_userSettings.setWorkplaceReportType(value);
1738        }
1739    }
1740
1741    /**
1742     * Sets the "workplace restrict explorer view" setting.<p>
1743     *
1744     * @param value the "workplace restrict explorer view" setting
1745     */

1746    public void setParamTabWpRestrictExplorerView(String JavaDoc value) {
1747
1748        m_userSettings.setRestrictExplorerView(Boolean.valueOf(value).booleanValue());
1749    }
1750
1751    /**
1752     * Sets the "start site" setting.<p>
1753     *
1754     * @param value the start site to show in the explorer view
1755     */

1756    public void setParamTabWpSite(String JavaDoc value) {
1757
1758        m_userSettings.setStartSite(value);
1759    }
1760
1761    /**
1762     * Sets the "use upload applet" setting.<p>
1763     *
1764     * @param value <code>"true"</code> to enable the "use upload applet" setting, all others to disable
1765     */

1766    public void setParamTabWpUseUploadApplet(String JavaDoc value) {
1767
1768        m_userSettings.setUseUploadApplet(Boolean.valueOf(value).booleanValue());
1769    }
1770
1771    /**
1772     * Sets the start view setting.<p>
1773     *
1774     * @param value the start view setting
1775     */

1776    public void setParamTabWpView(String JavaDoc value) {
1777
1778        m_userSettings.setStartView(value);
1779    }
1780
1781    /**
1782     * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
1783     */

1784    protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest JavaDoc request) {
1785
1786        // create an empty user settings object
1787
m_userSettings = new CmsUserSettings();
1788        // fill the parameter values in the get/set methods
1789
fillParamValues(request);
1790
1791        // get the active tab from request parameter or display first tab
1792
getActiveTab();
1793
1794        // set the dialog type
1795
setParamDialogtype(DIALOG_TYPE);
1796        // set the action for the JSP switch
1797
if (DIALOG_SET.equals(getParamAction())) {
1798            setAction(ACTION_SET);
1799        } else if (DIALOG_OK.equals(getParamAction())) {
1800            setAction(ACTION_OK);
1801        } else if (DIALOG_RELOAD.equals(getParamAction())) {
1802            setAction(ACTION_RELOAD);
1803        } else if (DIALOG_CANCEL.equals(getParamAction())) {
1804            setAction(ACTION_CANCEL);
1805        } else if (DIALOG_CHPWD.equals(getParamAction())) {
1806            setAction(ACTION_CHPWD);
1807        } else {
1808            if (!DIALOG_SWITCHTAB.equals(getParamAction())) {
1809                // first call of preferences dialog, fill param values with current settings
1810
fillUserSettings();
1811            }
1812
1813            setAction(ACTION_DEFAULT);
1814            // build title for preferences dialog
1815
setParamTitle(key(Messages.GUI_PREF_0));
1816        }
1817
1818    }
1819
1820    /**
1821     * Returns the values of all parameter methods of this workplace class instance.<p>
1822     *
1823     * This overwrites the super method because of the possible dynamic editor selection entries.<p>
1824     *
1825     * @return the values of all parameter methods of this workplace class instance
1826     */

1827    protected Map JavaDoc paramValues() {
1828
1829        Map JavaDoc map = super.paramValues();
1830        HttpServletRequest JavaDoc request = getJsp().getRequest();
1831        Enumeration JavaDoc en = request.getParameterNames();
1832        while (en.hasMoreElements()) {
1833            String JavaDoc paramName = (String JavaDoc)en.nextElement();
1834            if (paramName.startsWith(PARAM_PREFERREDEDITOR_PREFIX)) {
1835                String JavaDoc paramValue = request.getParameter(paramName);
1836                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(paramValue)) {
1837                    map.put(paramName, CmsEncoder.decode(paramValue));
1838                }
1839            }
1840        }
1841        return map;
1842    }
1843
1844    /**
1845     * Updates the user preferences after changes have been made.<p>
1846     *
1847     * @param cms the current cms context
1848     * @param req the current http request
1849     */

1850    protected void updatePreferences(CmsObject cms, HttpServletRequest JavaDoc req) {
1851
1852        HttpSession JavaDoc session = req.getSession(false);
1853        if (session == null) {
1854            return;
1855        }
1856        CmsWorkplaceSettings settings = (CmsWorkplaceSettings)session.getAttribute(CmsWorkplaceManager.SESSION_WORKPLACE_SETTINGS);
1857        if (settings == null) {
1858            return;
1859        }
1860        // keep old synchronize settings
1861
CmsSynchronizeSettings synchronizeSettings = settings.getUserSettings().getSynchronizeSettings();
1862        settings = CmsWorkplace.initWorkplaceSettings(cms, settings, true);
1863        settings.getUserSettings().setSynchronizeSettings(synchronizeSettings);
1864    }
1865
1866    /**
1867     * Builds the html for a common button style select box.<p>
1868     *
1869     * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
1870     * @param selectedIndex the index of the selected option
1871     * @return the html for the common button style select box
1872     */

1873    private String JavaDoc buildSelectButtonStyle(String JavaDoc htmlAttributes, int selectedIndex) {
1874
1875        List JavaDoc options = new ArrayList JavaDoc(3);
1876        options.add(key(Messages.GUI_PREF_BUTTONSTYLE_IMG_0));
1877        options.add(key(Messages.GUI_PREF_BUTTONSTYLE_IMGTXT_0));
1878        options.add(key(Messages.GUI_PREF_BUTTONSTYLE_TXT_0));
1879        String JavaDoc[] vals = new String JavaDoc[] {"0", "1", "2"};
1880        List JavaDoc values = new ArrayList JavaDoc(java.util.Arrays.asList(vals));
1881        return buildSelect(htmlAttributes, options, values, selectedIndex);
1882    }
1883
1884    /**
1885     * Returns the preferred editor preselection value either from the request, if not present, from the user settings.<p>
1886     *
1887     * @param request the current http servlet request
1888     * @param resourceType the preferred editors resource type
1889     * @return the preferred editor preselection value or null, if none found
1890     */

1891    private String JavaDoc computeEditorPreselection(HttpServletRequest JavaDoc request, String JavaDoc resourceType) {
1892
1893        // first check presence of the setting in request parameter
1894
String JavaDoc preSelection = request.getParameter(PARAM_PREFERREDEDITOR_PREFIX + resourceType);
1895        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(preSelection)) {
1896            return CmsEncoder.decode(preSelection);
1897        } else {
1898            // no value found in request, check current user settings (not the member!)
1899
CmsUserSettings userSettings = new CmsUserSettings(getCms(), getSettings().getUser());
1900            return userSettings.getPreferredEditor(resourceType);
1901
1902        }
1903    }
1904
1905    /**
1906     * Fills the parameter values according to the settings of the current user.<p>
1907     *
1908     * This method is called once when first displaying the preferences dialog.<p>
1909     */

1910    private void fillUserSettings() {
1911
1912        m_userSettings = new CmsUserSettings(getCms(), getSettings().getUser());
1913    }
1914
1915    /**
1916     * Helper method for the request parameter methods to return a String depending on the boolean parameter.<p>
1917     *
1918     * @param isEnabled the boolean variable to check
1919     * @return <code>"true"</code> if isEnabled is true, otherwise ""
1920     */

1921    private String JavaDoc isParamEnabled(boolean isEnabled) {
1922
1923        if (isEnabled) {
1924            return CmsStringUtil.TRUE;
1925        }
1926        return "";
1927    }
1928}
Popular Tags