KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > configuration > CmsWorkplaceConfiguration


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/configuration/CmsWorkplaceConfiguration.java,v $
3  * Date : $Date: 2006/10/26 12:25:35 $
4  * Version: $Revision: 1.43 $
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.configuration;
33
34 import org.opencms.db.CmsExportPoint;
35 import org.opencms.main.CmsLog;
36 import org.opencms.main.OpenCms;
37 import org.opencms.util.CmsRfsFileViewer;
38 import org.opencms.util.CmsStringUtil;
39 import org.opencms.workplace.CmsWorkplaceManager;
40 import org.opencms.workplace.explorer.CmsExplorerContextMenu;
41 import org.opencms.workplace.explorer.CmsExplorerContextMenuItem;
42 import org.opencms.workplace.explorer.CmsExplorerTypeAccess;
43 import org.opencms.workplace.explorer.CmsExplorerTypeSettings;
44 import org.opencms.workplace.tools.CmsToolManager;
45 import org.opencms.workplace.tools.CmsToolRootHandler;
46
47 import java.util.ArrayList JavaDoc;
48 import java.util.Arrays JavaDoc;
49 import java.util.Collections JavaDoc;
50 import java.util.Iterator JavaDoc;
51 import java.util.List JavaDoc;
52 import java.util.Map JavaDoc;
53 import java.util.Set JavaDoc;
54
55 import org.apache.commons.digester.Digester;
56
57 import org.dom4j.Element;
58
59 /**
60  * Import/Export master configuration class.<p>
61  *
62  * @author Alexander Kandzior
63  *
64  * @version $Revision: 1.43 $
65  *
66  * @since 6.0.0
67  */

68 public class CmsWorkplaceConfiguration extends A_CmsXmlConfiguration implements I_CmsXmlConfiguration {
69
70     /** The "autosetnavigation" attribute. */
71     public static final String JavaDoc A_AUTOSETNAVIGATION = "autosetnavigation";
72
73     /** The "autosettitle" attribute. */
74     public static final String JavaDoc A_AUTOSETTITLE = "autosettitle";
75
76     /** The "page" attribute. */
77     public static final String JavaDoc A_PAGE = "page";
78
79     /** The "permissions" attribute. */
80     public static final String JavaDoc A_PERMISSIONS = "permissions";
81
82     /** The "principal" attribute. */
83     public static final String JavaDoc A_PRINCIPAL = "principal";
84
85     /** The "reference" attribute. */
86     public static final String JavaDoc A_REFERENCE = "reference";
87
88     /** The "rules" attribute. */
89     public static final String JavaDoc A_RULES = "rules";
90
91     /** The "shownavigation" attribute. */
92     public static final String JavaDoc A_SHOWNAVIGATION = "shownavigation";
93
94     /** The "target" attribute. */
95     public static final String JavaDoc A_TARGET = "target";
96
97     /** The name of the DTD for this configuration. */
98     public static final String JavaDoc CONFIGURATION_DTD_NAME = "opencms-workplace.dtd";
99
100     /** The name of the default XML file for this configuration. */
101     public static final String JavaDoc DEFAULT_XML_FILE_NAME = "opencms-workplace.xml";
102
103     /** The name of the access control node. */
104     public static final String JavaDoc N_ACCESSCONTROL = "accesscontrol";
105
106     /** The name of the access entry node. */
107     public static final String JavaDoc N_ACCESSENTRY = "accessentry";
108
109     /** The name of the autolock node. */
110     public static final String JavaDoc N_AUTOLOCK = "autolock";
111
112     /** The node name of the buttonstyle node. */
113     public static final String JavaDoc N_BUTTONSTYLE = "buttonstyle";
114
115     /** The name of the context menu node. */
116     public static final String JavaDoc N_CONTEXTMENU = "contextmenu";
117
118     /** The node name of the datecreated column node. */
119     public static final String JavaDoc N_DATECREATED = "show-datecreated";
120
121     /** The node name of the date expired column node. */
122     public static final String JavaDoc N_DATEEXPIRED = "show-dateexpired";
123
124     /** The node name of the datelastmodified column node. */
125     public static final String JavaDoc N_DATELASTMODIFIED = "show-datelastmodified";
126
127     /** The node name of the date released column node. */
128     public static final String JavaDoc N_DATERELEASED = "show-datereleased";
129
130     /** The name of the default access control node. */
131     public static final String JavaDoc N_DEFAULTACCESSCONTROL = "defaultaccesscontrol";
132
133     /** The name of the node for the default locale. */
134     public static final String JavaDoc N_DEFAULTLOCALE = "defaultlocale";
135
136     /** The node name of the default preferences node. */
137     public static final String JavaDoc N_DEFAULTPREFERENCES = "default-preferences";
138
139     /** The name of the default properties node. */
140     public static final String JavaDoc N_DEFAULTPROPERTIES = "defaultproperties";
141
142     /** The name of the default properties on structure node. */
143     public static final String JavaDoc N_DEFAULTPROPERTIESONSTRUCTURE = "defaultpropertiesonstructure";
144
145     /** The name of the default property node. */
146     public static final String JavaDoc N_DEFAULTPROPERTY = "defaultproperty";
147
148     /** Individual workplace handler node name. */
149     public static final String JavaDoc N_DIALOGHANDLER = "dialoghandler";
150
151     /** The main workplace handler node name. */
152     public static final String JavaDoc N_DIALOGHANDLERS = "dialoghandlers";
153
154     /** The node name of the dialogs defaultsettings node. */
155     public static final String JavaDoc N_DIALOGSDEFAULTSETTINGS = "dialogs-defaultsettings";
156
157     /** The node name of the dialogs preferences node. */
158     public static final String JavaDoc N_DIALOGSPREFERENCES = "dialogs-preferences";
159
160     /** The node name of the direct edit provider node. */
161     public static final String JavaDoc N_DIRECTEDITPROVIDER = "directeditprovider";
162
163     /** The node name of the directedit style node. */
164     public static final String JavaDoc N_DIRECTEDITSTYLE = "directeditstyle";
165
166     /** The node name of the directpublish node. */
167     public static final String JavaDoc N_DIRECTPUBLISH = "directpublish";
168
169     /** The name of the edit options node. */
170     public static final String JavaDoc N_EDITOPTIONS = "editoptions";
171
172     /** The node name of the editor node. */
173     public static final String JavaDoc N_EDITOR = "editor";
174
175     /** The name of the editor action node. */
176     public static final String JavaDoc N_EDITORACTION = "editoraction";
177
178     /** The node name of the editors general options node. */
179     public static final String JavaDoc N_EDITORGENERALOPTIONS = "editors-generaloptions";
180
181     /** The name of the editor handler node. */
182     public static final String JavaDoc N_EDITORHANDLER = "editorhandler";
183
184     /** The node name of the editors preferences node. */
185     public static final String JavaDoc N_EDITORPREFERENCES = "editors-preferences";
186
187     /** The node name of the editors preferred editors node. */
188     public static final String JavaDoc N_EDITORPREFERREDEDITORS = "editors-preferrededitors";
189
190     /** The name of the "enable advanced property tabs" node. */
191     public static final String JavaDoc N_ENABLEADVANCEDPROPERTYTABS = "enableadvancedpropertytabs";
192
193     /** The subname of the rfsfilesettings/enabled node. */
194     public static final String JavaDoc N_ENABLED = "enabled";
195
196     /** The name of the "user management enabled" node. */
197     public static final String JavaDoc N_ENABLEUSERMGMT = "enableusermanagement";
198
199     /** The node name of the file entries node. */
200     public static final String JavaDoc N_ENTRIES = "entries";
201
202     /** The name of the entry node. */
203     public static final String JavaDoc N_ENTRY = "entry";
204
205     /** The name of the expand inherited permissions node. */
206     public static final String JavaDoc N_EXPANDPERMISSIONSINHERITED = "expand-permissionsinherited";
207
208     /** The name of the expand user permissions node. */
209     public static final String JavaDoc N_EXPANDPERMISSIONSUSER = "expand-permissionsuser";
210
211     /** The node name of the explorer displayoptions node. */
212     public static final String JavaDoc N_EXPLORERDISPLAYOPTIONS = "explorer-displayoptions";
213
214     /** The node name of the explorer generaloptions node. */
215     public static final String JavaDoc N_EXPLORERGENERALOPTIONS = "explorer-generaloptions";
216
217     /** The node name of the explorer preferences node. */
218     public static final String JavaDoc N_EXPLORERPREFERENCES = "explorer-preferences";
219
220     /** The name of the explorer type node. */
221     public static final String JavaDoc N_EXPLORERTYPE = "explorertype";
222
223     /** The name of the explorer types node. */
224     public static final String JavaDoc N_EXPLORERTYPES = "explorertypes";
225
226     /** The node name of the file copy node. */
227     public static final String JavaDoc N_FILECOPY = "filecopy";
228
229     /** The node name of the file deletion node. */
230     public static final String JavaDoc N_FILEDELETION = "filedeletion";
231
232     /** The subname of the rfsfilesettings/fileEncoding node. */
233     public static final String JavaDoc N_FILEENCODING = "fileEncoding";
234
235     /** The subname of the rfsfilesettings/filePath node. */
236     public static final String JavaDoc N_FILEPATH = "filePath";
237
238     /** The node name of the start folder node. */
239     public static final String JavaDoc N_FOLDER = "folder";
240
241     /** The node name of the folder copy node. */
242     public static final String JavaDoc N_FOLDERCOPY = "foldercopy";
243
244     /** The node name of the helptext node. */
245     public static final String JavaDoc N_HELPTEXT = "helptext";
246
247     /** The node name of the inform role members node. */
248     public static final String JavaDoc N_INFORMROLEMEMBERS = "informrolemembers";
249
250     /** The subname of the rfsfilesettings/isLogfile node. */
251     public static final String JavaDoc N_ISLOGFILE = "isLogfile";
252
253     /** The node name of the key node. */
254     public static final String JavaDoc N_KEY = "key";
255
256     /** The name of the "labeled folders" node. */
257     public static final String JavaDoc N_LABELEDFOLDERS = "labeledfolders";
258
259     /** The node name of the locale node. */
260     public static final String JavaDoc N_LOCALE = "locale";
261
262     /** The name of the "localized folders" node. */
263     public static final String JavaDoc N_LOCALIZEDFOLDERS = "localizedfolders";
264
265     /** The node name of the lockedby column node. */
266     public static final String JavaDoc N_LOCKEDBY = "show-lockedby";
267
268     /** The name of the "max file upload size" node. */
269     public static final String JavaDoc N_MAXUPLOADSIZE = "maxfileuploadsize";
270
271     /** The node name of the message-accepted node. */
272     public static final String JavaDoc N_MESSAGEACCEPTED = "message-accepted";
273
274     /** The node name of the message-completed node. */
275     public static final String JavaDoc N_MESSAGECOMPLETED = "message-completed";
276
277     /** The node name of the message-forwarded node. */
278     public static final String JavaDoc N_MESSAGEFORWARDED = "message-forwarded";
279
280     /** The name of the context menu node. */
281     public static final String JavaDoc N_MULTICONTEXTMENU = "multicontextmenu";
282
283     /** The name of the "create new folder with index page" node. */
284     public static final String JavaDoc N_NEWFOLDERCREATEINDEXPAGE = "newfolder-createindexpage";
285
286     /** The name of the "create new folder with edit properties" node. */
287     public static final String JavaDoc N_NEWFOLDEREDITPROPERTIES = "newfolder-editproperties";
288
289     /** The name of the new resource node. */
290     public static final String JavaDoc N_NEWRESOURCE = "newresource";
291
292     /** The node name of the permissions column node. */
293     public static final String JavaDoc N_PERMISSIONS = "show-permissions";
294
295     /** The name of the inherit permissions on folder node. */
296     public static final String JavaDoc N_PERMISSIONSINHERITONFOLDER = "permissions-inheritonfolder";
297
298     /** The node name of the project node. */
299     public static final String JavaDoc N_PROJECT = "project";
300
301     /** The node name of the publish button appearance node. */
302     public static final String JavaDoc N_PUBLISHBUTTONAPPEARANCE = "publishbuttonappearance";
303
304     /** The node name of the report type node. */
305     public static final String JavaDoc N_REPORTTYPE = "reporttype";
306
307     /** The node name of the restrict explorer view node. */
308     public static final String JavaDoc N_RESTRICTEXPLORERVIEW = "restrictexplorerview";
309
310     /** The node name of the rfsfileviewsettings node. */
311     public static final String JavaDoc N_RFSFILEVIEWESETTINGS = "rfsfileviewsettings";
312
313     /** The node name of the root node. */
314     public static final String JavaDoc N_ROOT = "root";
315
316     /** The node name of the roots node. */
317     public static final String JavaDoc N_ROOTS = "roots";
318
319     /** The name of the separator node. */
320     public static final String JavaDoc N_SEPARATOR = "separator";
321
322     /** The node name of the show lock node. */
323     public static final String JavaDoc N_SHOWEXPORTSETTINGS = "showexportsettings";
324
325     /** The node name of the show lock node. */
326     public static final String JavaDoc N_SHOWLOCK = "showlock";
327
328     /** The node name of the show messages node. */
329     public static final String JavaDoc N_SHOWMESSAGES = "showmessages";
330
331     /** The node name of the showprojects node. */
332     public static final String JavaDoc N_SHOWPROJECTS = "showprojects";
333
334     /** The node name of the size column node. */
335     public static final String JavaDoc N_SIZE = "show-size";
336
337     /** The node name of the startupfilter node. */
338     public static final String JavaDoc N_STARTUPFILTER = "startupfilter";
339
340     /** The node name of the state column node. */
341     public static final String JavaDoc N_STATE = "show-state";
342
343     /** The node name of the title column node. */
344     public static final String JavaDoc N_TITLE = "show-title";
345
346     /** The node name of the tool-manager node. */
347     public static final String JavaDoc N_TOOLMANAGER = "tool-manager";
348
349     /** The node name of the type column node. */
350     public static final String JavaDoc N_TYPE = "show-type";
351
352     /** The node name of the uploadapplet node. */
353     public static final String JavaDoc N_UPLOADAPPLET = "uploadapplet";
354
355     /** The node name of the uri node. */
356     public static final String JavaDoc N_URI = "uri";
357
358     /** The node name of the user created node. */
359     public static final String JavaDoc N_USERCREATED = "show-usercreated";
360
361     /** The node name of the user lastmodified node. */
362     public static final String JavaDoc N_USERLASTMODIFIED = "show-userlastmodified";
363
364     /** The subname of the rfsfilesettings/windowSize node. */
365     public static final String JavaDoc N_WINDOWSIZE = "windowSize";
366
367     /** The node name of the workflow node. */
368     public static final String JavaDoc N_WORKFLOW = "workflow";
369
370     /** The node name of the workflow default settings node. */
371     public static final String JavaDoc N_WORKFLOWDEFAULTSETTINGS = "workflow-defaultsettings";
372
373     /** The node name of the workflow general options node. */
374     public static final String JavaDoc N_WORKFLOWGENERALOPTIONS = "workflow-generaloptions";
375
376     /** The node name of the workflow preferences node. */
377     public static final String JavaDoc N_WORKFLOWPREFERENCES = "workflow-preferences";
378
379     /** The node name of the master workplace node. */
380     public static final String JavaDoc N_WORKPLACE = "workplace";
381
382     /** The node name of the workplace general options node. */
383     public static final String JavaDoc N_WORKPLACEGENERALOPTIONS = "workplace-generaloptions";
384
385     /** The node name of the workplace preferences node. */
386     public static final String JavaDoc N_WORKPLACEPREFERENCES = "workplace-preferences";
387
388     /** The node name of the workplace startup settings node. */
389     public static final String JavaDoc N_WORKPLACESTARTUPSETTINGS = "workplace-startupsettings";
390
391     /** The node name of the view node. */
392     public static final String JavaDoc N_WORKPLACEVIEW = "workplaceview";
393
394     /** The configured workplace manager. */
395     private CmsWorkplaceManager m_workplaceManager;
396
397     /**
398      * Public constructor, will be called by configuration manager.<p>
399      */

400     public CmsWorkplaceConfiguration() {
401
402         setXmlFileName(DEFAULT_XML_FILE_NAME);
403         if (CmsLog.INIT.isInfoEnabled()) {
404             CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_WORKPLACE_INIT_0));
405         }
406     }
407
408     /**
409      * Adds the explorer type rules to the given digester.<p>
410      *
411      * @param digester the digester to add the rules to
412      */

413     public static void addExplorerTypeXmlRules(Digester digester) {
414
415         // add explorer type settings
416
digester.addObjectCreate("*/" + N_EXPLORERTYPE, CmsExplorerTypeSettings.class);
417         digester.addSetNext("*/" + N_EXPLORERTYPE, "addExplorerTypeSetting");
418
419         digester.addCallMethod("*/" + N_EXPLORERTYPE, "setTypeAttributes", 4);
420         digester.addCallParam("*/" + N_EXPLORERTYPE, 0, A_NAME);
421         digester.addCallParam("*/" + N_EXPLORERTYPE, 1, A_KEY);
422         digester.addCallParam("*/" + N_EXPLORERTYPE, 2, A_ICON);
423         digester.addCallParam("*/" + N_EXPLORERTYPE, 3, A_REFERENCE);
424
425         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, "setNewResourceHandlerClassName", 1);
426         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, 0, A_HANDLER);
427         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, "setNewResourceUri", 1);
428         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, 0, A_URI);
429         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, "setNewResourceOrder", 1);
430         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, 0, A_ORDER);
431         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, "setNewResourcePage", 1);
432         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, 0, A_PAGE);
433
434         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, "setAutoSetNavigation", 1);
435         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, 0, A_AUTOSETNAVIGATION);
436         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, "setAutoSetTitle", 1);
437         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_NEWRESOURCE, 0, A_AUTOSETTITLE);
438
439         digester.addObjectCreate("*/" + N_EXPLORERTYPE + "/" + N_ACCESSCONTROL, CmsExplorerTypeAccess.class);
440         digester.addSetNext("*/" + N_EXPLORERTYPE + "/" + N_ACCESSCONTROL, "setAccess");
441
442         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_ACCESSCONTROL + "/" + N_ACCESSENTRY, "addAccessEntry", 2);
443         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_ACCESSCONTROL + "/" + N_ACCESSENTRY, 0, A_PRINCIPAL);
444         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_ACCESSCONTROL + "/" + N_ACCESSENTRY, 1, A_PERMISSIONS);
445
446         digester.addCallMethod(
447             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_DEFAULTPROPERTIES,
448             "setPropertyDefaults",
449             2);
450         digester.addCallParam("*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_DEFAULTPROPERTIES, 0, A_ENABLED);
451         digester.addCallParam(
452             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_DEFAULTPROPERTIES,
453             1,
454             A_SHOWNAVIGATION);
455
456         digester.addCallMethod("*/"
457             + N_EXPLORERTYPE
458             + "/"
459             + N_EDITOPTIONS
460             + "/"
461             + N_DEFAULTPROPERTIES
462             + "/"
463             + N_PROPERTY, "addProperty", 1);
464         digester.addCallParam("*/"
465             + N_EXPLORERTYPE
466             + "/"
467             + N_EDITOPTIONS
468             + "/"
469             + N_DEFAULTPROPERTIES
470             + "/"
471             + N_PROPERTY, 0, A_NAME);
472
473         digester.addCallMethod("*/"
474             + N_EXPLORERTYPE
475             + "/"
476             + N_EDITOPTIONS
477             + "/"
478             + N_DEFAULTPROPERTIES
479             + "/"
480             + N_DEFAULTPROPERTY, "addProperty", 1);
481         digester.addCallParam("*/"
482             + N_EXPLORERTYPE
483             + "/"
484             + N_EDITOPTIONS
485             + "/"
486             + N_DEFAULTPROPERTIES
487             + "/"
488             + N_DEFAULTPROPERTY, 0, A_NAME);
489
490         digester.addCallMethod(
491             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_ENTRY,
492             "addContextMenuEntry",
493             5);
494         digester.addCallParam(
495             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_ENTRY,
496             0,
497             A_KEY);
498         digester.addCallParam(
499             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_ENTRY,
500             1,
501             A_URI);
502         digester.addCallParam(
503             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_ENTRY,
504             2,
505             A_RULES);
506         digester.addCallParam(
507             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_ENTRY,
508             3,
509             A_TARGET);
510         digester.addCallParam(
511             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_ENTRY,
512             4,
513             A_ORDER);
514
515         digester.addCallMethod(
516             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_SEPARATOR,
517             "addContextMenuSeparator",
518             1);
519         digester.addCallParam(
520             "*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU + "/" + N_SEPARATOR,
521             0,
522             A_ORDER);
523
524         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS + "/" + N_CONTEXTMENU, "createContextMenu");
525         digester.addCallMethod("*/" + N_EXPLORERTYPE + "/" + N_EDITOPTIONS, "setEditOptions");
526     }
527
528     /**
529      * Creates the xml output for explorer type nodes.<p>
530      *
531      * @param startNode the startnode to add all rescource types to
532      * @param explorerTypes the list of explorer types
533      * @param module true if the XML tree for the module config should be generated, false otherwise
534      */

535     public static void generateExplorerTypesXml(Element startNode, List JavaDoc explorerTypes, boolean module) {
536
537         // we need the default access node later to check if the explorer type is an individual setting
538
CmsExplorerTypeAccess defaultAccess = null;
539         if (OpenCms.getWorkplaceManager() != null) {
540             defaultAccess = OpenCms.getWorkplaceManager().getDefaultAccess();
541         }
542
543         Iterator JavaDoc i = explorerTypes.iterator();
544         while (i.hasNext()) {
545             // create an explorer type node
546
CmsExplorerTypeSettings settings = (CmsExplorerTypeSettings)i.next();
547
548             if (settings.isAddititionalModuleExplorerType() == module) {
549                 Element explorerTypeElement = startNode.addElement(N_EXPLORERTYPE);
550                 explorerTypeElement.addAttribute(A_NAME, settings.getName());
551                 explorerTypeElement.addAttribute(A_KEY, settings.getKey());
552                 explorerTypeElement.addAttribute(A_ICON, settings.getIcon());
553                 if (settings.getReference() != null) {
554                     explorerTypeElement.addAttribute(A_REFERENCE, settings.getReference());
555                 }
556                 // create subnode <newresource>
557
Element newResElement = explorerTypeElement.addElement(N_NEWRESOURCE);
558                 if (CmsStringUtil.isNotEmpty(settings.getNewResourcePage())) {
559                     newResElement.addAttribute(A_PAGE, settings.getNewResourcePage());
560                 }
561                 newResElement.addAttribute(A_HANDLER, settings.getNewResourceHandlerClassName());
562                 newResElement.addAttribute(A_URI, settings.getNewResourceUri());
563                 newResElement.addAttribute(A_ORDER, settings.getNewResourceOrder());
564                 newResElement.addAttribute(A_AUTOSETNAVIGATION, String.valueOf(settings.isAutoSetNavigation()));
565                 newResElement.addAttribute(A_AUTOSETTITLE, String.valueOf(settings.isAutoSetTitle()));
566                 // create subnode <accesscontrol>
567
CmsExplorerTypeAccess access = settings.getAccess();
568                 if (access != defaultAccess) {
569                     // don't output the node if this is in fact the default access settings
570
List JavaDoc accessEntries = new ArrayList JavaDoc(access.getAccessEntries().keySet());
571                     // sort accessEntries
572
Collections.sort(accessEntries);
573                     if (accessEntries.size() > 0) {
574                         Element accessControlElement = explorerTypeElement.addElement(N_ACCESSCONTROL);
575                         Iterator JavaDoc k = accessEntries.iterator();
576                         while (k.hasNext()) {
577                             String JavaDoc key = (String JavaDoc)k.next();
578                             String JavaDoc value = (String JavaDoc)settings.getAccess().getAccessEntries().get(key);
579                             Element accessEntryElement = accessControlElement.addElement(N_ACCESSENTRY);
580                             accessEntryElement.addAttribute(A_PRINCIPAL, key);
581                             accessEntryElement.addAttribute(A_PERMISSIONS, value);
582                         }
583                     }
584                 }
585                 // create subnode <editoptions>
586
if (settings.hasEditOptions()) {
587                     Element editOptionsElement = explorerTypeElement.addElement(N_EDITOPTIONS);
588                     Element defaultPropertiesElement = editOptionsElement.addElement(N_DEFAULTPROPERTIES);
589                     defaultPropertiesElement.addAttribute(A_ENABLED, String.valueOf(settings.isPropertiesEnabled()));
590                     defaultPropertiesElement.addAttribute(A_SHOWNAVIGATION, String.valueOf(settings.isShowNavigation()));
591                     Iterator JavaDoc m = settings.getProperties().iterator();
592                     String JavaDoc propNode = N_PROPERTY;
593                     if (module) {
594                         propNode = N_DEFAULTPROPERTY;
595                     }
596                     while (m.hasNext()) {
597                         defaultPropertiesElement.addElement(propNode).addAttribute(A_NAME, (String JavaDoc)m.next());
598                     }
599                     Element contextMenuElement = editOptionsElement.addElement(N_CONTEXTMENU);
600                     m = settings.getContextMenuEntries().iterator();
601                     while (m.hasNext()) {
602                         CmsExplorerContextMenuItem item = (CmsExplorerContextMenuItem)m.next();
603                         Element itemElement;
604                         if (CmsExplorerContextMenuItem.TYPE_ENTRY.equals(item.getType())) {
605                             // create an <entry> node
606
itemElement = contextMenuElement.addElement(N_ENTRY);
607                             itemElement.addAttribute(A_KEY, item.getKey());
608                             itemElement.addAttribute(A_URI, item.getUri());
609                             if (item.getTarget() != null) {
610                                 itemElement.addAttribute(A_TARGET, item.getTarget());
611                             }
612                             itemElement.addAttribute(A_RULES, item.getRules());
613                         } else {
614                             // create a <separator> node
615
itemElement = contextMenuElement.addElement(N_SEPARATOR);
616                         }
617                         itemElement.addAttribute(A_ORDER, "" + item.getOrder());
618                     }
619                 }
620             }
621         }
622     }
623
624     /**
625      * @see org.opencms.configuration.I_CmsXmlConfiguration#addXmlDigesterRules(org.apache.commons.digester.Digester)
626      */

627     public void addXmlDigesterRules(Digester digester) {
628
629         // add finish rule
630
digester.addCallMethod("*/" + N_WORKPLACE, "initializeFinished");
631
632         // generic <param> parameter rules
633
digester.addCallMethod(
634             "*/" + I_CmsXmlConfiguration.N_PARAM,
635             I_CmsConfigurationParameterHandler.ADD_PARAMETER_METHOD,
636             2);
637         digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 0, I_CmsXmlConfiguration.A_NAME);
638         digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 1);
639
640         // creation of the import/export manager
641
digester.addObjectCreate("*/" + N_WORKPLACE, CmsWorkplaceManager.class);
642         // import/export manager finished
643
digester.addSetNext("*/" + N_WORKPLACE, "setWorkplaceManager");
644
645         // add default locale rule
646
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_DEFAULTLOCALE, "setDefaultLocale", 0);
647
648         digester.addObjectCreate("*/"
649             + N_WORKPLACE
650             + "/"
651             + N_EXPLORERTYPES
652             + "/"
653             + N_DEFAULTACCESSCONTROL
654             + "/"
655             + N_ACCESSCONTROL, CmsExplorerTypeAccess.class);
656         digester.addSetNext("*/"
657             + N_WORKPLACE
658             + "/"
659             + N_EXPLORERTYPES
660             + "/"
661             + N_DEFAULTACCESSCONTROL
662             + "/"
663             + N_ACCESSCONTROL, "setDefaultAccess");
664
665         digester.addCallMethod("*/"
666             + N_WORKPLACE
667             + "/"
668             + N_EXPLORERTYPES
669             + "/"
670             + N_DEFAULTACCESSCONTROL
671             + "/"
672             + N_ACCESSCONTROL
673             + "/"
674             + N_ACCESSENTRY, "addAccessEntry", 2);
675         digester.addCallParam("*/"
676             + N_WORKPLACE
677             + "/"
678             + N_EXPLORERTYPES
679             + "/"
680             + N_DEFAULTACCESSCONTROL
681             + "/"
682             + N_ACCESSCONTROL
683             + "/"
684             + N_ACCESSENTRY, 0, A_PRINCIPAL);
685         digester.addCallParam("*/"
686             + N_WORKPLACE
687             + "/"
688             + N_EXPLORERTYPES
689             + "/"
690             + N_DEFAULTACCESSCONTROL
691             + "/"
692             + N_ACCESSCONTROL
693             + "/"
694             + N_ACCESSENTRY, 1, A_PERMISSIONS);
695
696         // add multi context menu
697
digester.addObjectCreate(
698             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU,
699             CmsExplorerContextMenu.class);
700         digester.addSetNext(
701             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU,
702             "setMultiContextMenu");
703
704         digester.addCallMethod(
705             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_ENTRY,
706             "addMenuEntry",
707             5);
708         digester.addCallParam(
709             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_ENTRY,
710             0,
711             A_KEY);
712         digester.addCallParam(
713             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_ENTRY,
714             1,
715             A_URI);
716         digester.addCallParam(
717             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_ENTRY,
718             2,
719             A_RULES);
720         digester.addCallParam(
721             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_ENTRY,
722             3,
723             A_TARGET);
724         digester.addCallParam(
725             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_ENTRY,
726             4,
727             A_ORDER);
728
729         digester.addCallMethod("*/"
730             + N_WORKPLACE
731             + "/"
732             + N_EXPLORERTYPES
733             + "/"
734             + N_MULTICONTEXTMENU
735             + "/"
736             + N_SEPARATOR, "addMenuSeparator", 1);
737         digester.addCallParam(
738             "*/" + N_WORKPLACE + "/" + N_EXPLORERTYPES + "/" + N_MULTICONTEXTMENU + "/" + N_SEPARATOR,
739             0,
740             A_ORDER);
741
742         // add default properties on structure setting
743
digester.addCallMethod(
744             "*/" + N_WORKPLACE + "/" + N_DEFAULTPROPERTIESONSTRUCTURE,
745             "setDefaultPropertiesOnStructure",
746             0);
747
748         // add default properties on structure setting
749
digester.addCallMethod(
750             "*/" + N_WORKPLACE + "/" + N_ENABLEADVANCEDPROPERTYTABS,
751             "setEnableAdvancedPropertyTabs",
752             0);
753
754         // add rules for dialog handlers
755
digester.addObjectCreate(
756             "*/" + N_WORKPLACE + "/" + N_DIALOGHANDLERS + "/" + N_DIALOGHANDLER,
757             A_CLASS,
758             CmsConfigurationException.class);
759         digester.addSetNext("*/" + N_WORKPLACE + "/" + N_DIALOGHANDLERS + "/" + N_DIALOGHANDLER, "addDialogHandler");
760
761         // add rules for editor handler
762
digester.addObjectCreate("*/" + N_WORKPLACE + "/" + N_EDITORHANDLER, A_CLASS, CmsConfigurationException.class);
763         digester.addSetNext("*/" + N_WORKPLACE + "/" + N_EDITORHANDLER, "setEditorHandler");
764
765         // add rules for editor action handler
766
digester.addObjectCreate("*/" + N_WORKPLACE + "/" + N_EDITORACTION, A_CLASS, CmsConfigurationException.class);
767         digester.addSetNext("*/" + N_WORKPLACE + "/" + N_EDITORACTION, "setEditorAction");
768
769         // add rules for direct edit provider
770
digester.addObjectCreate(
771             "*/" + N_WORKPLACE + "/" + N_DIRECTEDITPROVIDER,
772             A_CLASS,
773             CmsConfigurationException.class);
774         digester.addCallMethod(
775             "*/" + N_WORKPLACE + "/" + N_DIRECTEDITPROVIDER,
776             I_CmsConfigurationParameterHandler.INIT_CONFIGURATION_METHOD);
777         digester.addSetNext("*/" + N_WORKPLACE + "/" + N_DIRECTEDITPROVIDER, "setDirectEditProvider");
778
779         // add rules for the workplace export points
780
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_EXPORTPOINTS + "/" + N_EXPORTPOINT, "addExportPoint", 2);
781         digester.addCallParam("*/" + N_WORKPLACE + "/" + N_EXPORTPOINTS + "/" + N_EXPORTPOINT, 0, A_URI);
782         digester.addCallParam("*/" + N_WORKPLACE + "/" + N_EXPORTPOINTS + "/" + N_EXPORTPOINT, 1, A_DESTINATION);
783
784         // add autolock rule
785
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_AUTOLOCK, "setAutoLock", 0);
786
787         // add user management enabled rule
788
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_ENABLEUSERMGMT, "setUserManagementEnabled", 0);
789
790         // add max file upload size rule
791
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_MAXUPLOADSIZE, "setFileMaxUploadSize", 0);
792
793         // add labeled folders rule
794
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_LABELEDFOLDERS + "/" + N_RESOURCE, "addLabeledFolder", 1);
795         digester.addCallParam("*/" + N_WORKPLACE + "/" + N_LABELEDFOLDERS + "/" + N_RESOURCE, 0, A_URI);
796
797         // add localized folders rule
798
digester.addCallMethod(
799             "*/" + N_WORKPLACE + "/" + N_LOCALIZEDFOLDERS + "/" + N_RESOURCE,
800             "addLocalizedFolder",
801             1);
802         digester.addCallParam("*/" + N_WORKPLACE + "/" + N_LOCALIZEDFOLDERS + "/" + N_RESOURCE, 0, A_URI);
803
804         // add workflow settings
805
digester.addCallMethod("*/" + N_WORKPLACE + "/" + N_WORKFLOW + "/" + N_SHOWMESSAGES, "setWorkflowMessage", 0);
806
807         // add fileViewSettings rules
808
digester.addObjectCreate("*/" + N_RFSFILEVIEWESETTINGS, CmsRfsFileViewer.class);
809         digester.addBeanPropertySetter("*/" + N_RFSFILEVIEWESETTINGS + "/" + N_FILEPATH);
810         digester.addBeanPropertySetter("*/" + N_RFSFILEVIEWESETTINGS + "/" + N_ENABLED);
811         digester.addBeanPropertySetter("*/" + N_RFSFILEVIEWESETTINGS + "/" + N_FILEENCODING);
812         digester.addBeanPropertySetter("*/" + N_RFSFILEVIEWESETTINGS + "/" + N_ISLOGFILE);
813         digester.addBeanPropertySetter("*/" + N_RFSFILEVIEWESETTINGS + "/" + N_WINDOWSIZE);
814
815         // Cms specific rule similar to SetNextRule with implicit first CmsObject argument (remains null).
816
digester.addRule("*/" + N_RFSFILEVIEWESETTINGS, new CmsSetNextRule(
817             "setFileViewSettings",
818             CmsRfsFileViewer.class));
819
820         // add explorer type rules
821
addExplorerTypeXmlRules(digester);
822
823         // creation of the default user settings
824
digester.addObjectCreate("*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES, CmsDefaultUserSettings.class);
825         digester.addSetNext("*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES, "setDefaultUserSettings");
826
827         // add workplace preferences generaloptions rules
828
digester.addCallMethod("*/"
829             + N_WORKPLACE
830             + "/"
831             + N_DEFAULTPREFERENCES
832             + "/"
833             + N_WORKPLACEPREFERENCES
834             + "/"
835             + N_WORKPLACEGENERALOPTIONS
836             + "/"
837             + N_BUTTONSTYLE, "setWorkplaceButtonStyle", 0);
838         digester.addCallMethod("*/"
839             + N_WORKPLACE
840             + "/"
841             + N_DEFAULTPREFERENCES
842             + "/"
843             + N_WORKPLACEPREFERENCES
844             + "/"
845             + N_WORKPLACEGENERALOPTIONS
846             + "/"
847             + N_REPORTTYPE, "setWorkplaceReportType", 0);
848         digester.addCallMethod("*/"
849             + N_WORKPLACE
850             + "/"
851             + N_DEFAULTPREFERENCES
852             + "/"
853             + N_WORKPLACEPREFERENCES
854             + "/"
855             + N_WORKPLACEGENERALOPTIONS
856             + "/"
857             + N_UPLOADAPPLET, "setUploadApplet", 0);
858         digester.addCallMethod("*/"
859             + N_WORKPLACE
860             + "/"
861             + N_DEFAULTPREFERENCES
862             + "/"
863             + N_WORKPLACEPREFERENCES
864             + "/"
865             + N_WORKPLACEGENERALOPTIONS
866             + "/"
867             + N_PUBLISHBUTTONAPPEARANCE, "setPublishButtonAppearance", 0);
868
869         // add rules for the new folder dialog settings
870
digester.addCallMethod("*/"
871             + N_WORKPLACE
872             + "/"
873             + N_DEFAULTPREFERENCES
874             + "/"
875             + N_WORKPLACEPREFERENCES
876             + "/"
877             + N_WORKPLACEGENERALOPTIONS
878             + "/"
879             + N_NEWFOLDEREDITPROPERTIES, "setNewFolderEditProperties", 0);
880
881         digester.addCallMethod("*/"
882             + N_WORKPLACE
883             + "/"
884             + N_DEFAULTPREFERENCES
885             + "/"
886             + N_WORKPLACEPREFERENCES
887             + "/"
888             + N_WORKPLACEGENERALOPTIONS
889             + "/"
890             + N_NEWFOLDERCREATEINDEXPAGE, "setNewFolderCreateIndexPage", 0);
891
892         // add workplace preferences startupsettings rules
893
digester.addCallMethod("*/"
894             + N_WORKPLACE
895             + "/"
896             + N_DEFAULTPREFERENCES
897             + "/"
898             + N_WORKPLACEPREFERENCES
899             + "/"
900             + N_WORKPLACESTARTUPSETTINGS
901             + "/"
902             + N_LOCALE, "setLocale", 0);
903         digester.addCallMethod("*/"
904             + N_WORKPLACE
905             + "/"
906             + N_DEFAULTPREFERENCES
907             + "/"
908             + N_WORKPLACEPREFERENCES
909             + "/"
910             + N_WORKPLACESTARTUPSETTINGS
911             + "/"
912             + N_PROJECT, "setStartProject", 0);
913         digester.addCallMethod("*/"
914             + N_WORKPLACE
915             + "/"
916             + N_DEFAULTPREFERENCES
917             + "/"
918             + N_WORKPLACEPREFERENCES
919             + "/"
920             + N_WORKPLACESTARTUPSETTINGS
921             + "/"
922             + N_WORKPLACEVIEW, "setStartView", 0);
923         digester.addCallMethod("*/"
924             + N_WORKPLACE
925             + "/"
926             + N_DEFAULTPREFERENCES
927             + "/"
928             + N_WORKPLACEPREFERENCES
929             + "/"
930             + N_WORKPLACESTARTUPSETTINGS
931             + "/"
932             + N_FOLDER, "setStartFolder", 0);
933         digester.addCallMethod("*/"
934             + N_WORKPLACE
935             + "/"
936             + N_DEFAULTPREFERENCES
937             + "/"
938             + N_WORKPLACEPREFERENCES
939             + "/"
940             + N_WORKPLACESTARTUPSETTINGS
941             + "/"
942             + N_SITE, "setStartSite", 0);
943         digester.addCallMethod("*/"
944             + N_WORKPLACE
945             + "/"
946             + N_DEFAULTPREFERENCES
947             + "/"
948             + N_WORKPLACEPREFERENCES
949             + "/"
950             + N_WORKPLACESTARTUPSETTINGS
951             + "/"
952             + N_RESTRICTEXPLORERVIEW, "setRestrictExplorerView", 0);
953
954         // add explorer preferences generaloptions rules
955
digester.addCallMethod("*/"
956             + N_WORKPLACE
957             + "/"
958             + N_DEFAULTPREFERENCES
959             + "/"
960             + N_EXPLORERPREFERENCES
961             + "/"
962             + N_EXPLORERGENERALOPTIONS
963             + "/"
964             + N_BUTTONSTYLE, "setExplorerButtonStyle", 0);
965         digester.addCallMethod("*/"
966             + N_WORKPLACE
967             + "/"
968             + N_DEFAULTPREFERENCES
969             + "/"
970             + N_EXPLORERPREFERENCES
971             + "/"
972             + N_EXPLORERGENERALOPTIONS
973             + "/"
974             + N_ENTRIES, "setExplorerFileEntries", 0);
975
976         // add explorer display options rules
977
digester.addCallMethod("*/"
978             + N_WORKPLACE
979             + "/"
980             + N_DEFAULTPREFERENCES
981             + "/"
982             + N_EXPLORERPREFERENCES
983             + "/"
984             + N_EXPLORERDISPLAYOPTIONS
985             + "/"
986             + N_TITLE, "setShowExplorerFileTitle", 0);
987         digester.addCallMethod("*/"
988             + N_WORKPLACE
989             + "/"
990             + N_DEFAULTPREFERENCES
991             + "/"
992             + N_EXPLORERPREFERENCES
993             + "/"
994             + N_EXPLORERDISPLAYOPTIONS
995             + "/"
996             + N_TYPE, "setShowExplorerFileType", 0);
997         digester.addCallMethod("*/"
998             + N_WORKPLACE
999             + "/"
1000            + N_DEFAULTPREFERENCES
1001            + "/"
1002            + N_EXPLORERPREFERENCES
1003            + "/"
1004            + N_EXPLORERDISPLAYOPTIONS
1005            + "/"
1006            + N_DATELASTMODIFIED, "setShowExplorerFileDateLastModified", 0);
1007        digester.addCallMethod("*/"
1008            + N_WORKPLACE
1009            + "/"
1010            + N_DEFAULTPREFERENCES
1011            + "/"
1012            + N_EXPLORERPREFERENCES
1013            + "/"
1014            + N_EXPLORERDISPLAYOPTIONS
1015            + "/"
1016            + N_DATECREATED, "setShowExplorerFileDateCreated", 0);
1017        digester.addCallMethod("*/"
1018            + N_WORKPLACE
1019            + "/"
1020            + N_DEFAULTPREFERENCES
1021            + "/"
1022            + N_EXPLORERPREFERENCES
1023            + "/"
1024            + N_EXPLORERDISPLAYOPTIONS
1025            + "/"
1026            + N_LOCKEDBY, "setShowExplorerFileLockedBy", 0);
1027        digester.addCallMethod("*/"
1028            + N_WORKPLACE
1029            + "/"
1030            + N_DEFAULTPREFERENCES
1031            + "/"
1032            + N_EXPLORERPREFERENCES
1033            + "/"
1034            + N_EXPLORERDISPLAYOPTIONS
1035            + "/"
1036            + N_PERMISSIONS, "setShowExplorerFilePermissions", 0);
1037        digester.addCallMethod("*/"
1038            + N_WORKPLACE
1039            + "/"
1040            + N_DEFAULTPREFERENCES
1041            + "/"
1042            + N_EXPLORERPREFERENCES
1043            + "/"
1044            + N_EXPLORERDISPLAYOPTIONS
1045            + "/"
1046            + N_SIZE, "setShowExplorerFileSize", 0);
1047        digester.addCallMethod("*/"
1048            + N_WORKPLACE
1049            + "/"
1050            + N_DEFAULTPREFERENCES
1051            + "/"
1052            + N_EXPLORERPREFERENCES
1053            + "/"
1054            + N_EXPLORERDISPLAYOPTIONS
1055            + "/"
1056            + N_STATE, "setShowExplorerFileState", 0);
1057        digester.addCallMethod("*/"
1058            + N_WORKPLACE
1059            + "/"
1060            + N_DEFAULTPREFERENCES
1061            + "/"
1062            + N_EXPLORERPREFERENCES
1063            + "/"
1064            + N_EXPLORERDISPLAYOPTIONS
1065            + "/"
1066            + N_USERLASTMODIFIED, "setShowExplorerFileUserLastModified", 0);
1067        digester.addCallMethod("*/"
1068            + N_WORKPLACE
1069            + "/"
1070            + N_DEFAULTPREFERENCES
1071            + "/"
1072            + N_EXPLORERPREFERENCES
1073            + "/"
1074            + N_EXPLORERDISPLAYOPTIONS
1075            + "/"
1076            + N_USERCREATED, "setShowExplorerFileUserCreated", 0);
1077        digester.addCallMethod("*/"
1078            + N_WORKPLACE
1079            + "/"
1080            + N_DEFAULTPREFERENCES
1081            + "/"
1082            + N_EXPLORERPREFERENCES
1083            + "/"
1084            + N_EXPLORERDISPLAYOPTIONS
1085            + "/"
1086            + N_DATERELEASED, "setShowExplorerFileDateReleased", 0);
1087        digester.addCallMethod("*/"
1088            + N_WORKPLACE
1089            + "/"
1090            + N_DEFAULTPREFERENCES
1091            + "/"
1092            + N_EXPLORERPREFERENCES
1093            + "/"
1094            + N_EXPLORERDISPLAYOPTIONS
1095            + "/"
1096            + N_DATEEXPIRED, "setShowExplorerFileDateExpired", 0);
1097
1098        // add dialog preferences rules
1099
digester.addCallMethod("*/"
1100            + N_WORKPLACE
1101            + "/"
1102            + N_DEFAULTPREFERENCES
1103            + "/"
1104            + N_DIALOGSPREFERENCES
1105            + "/"
1106            + N_DIALOGSDEFAULTSETTINGS
1107            + "/"
1108            + N_FILECOPY, "setDialogCopyFileMode", 0);
1109        digester.addCallMethod("*/"
1110            + N_WORKPLACE
1111            + "/"
1112            + N_DEFAULTPREFERENCES
1113            + "/"
1114            + N_DIALOGSPREFERENCES
1115            + "/"
1116            + N_DIALOGSDEFAULTSETTINGS
1117            + "/"
1118            + N_FOLDERCOPY, "setDialogCopyFolderMode", 0);
1119        digester.addCallMethod("*/"
1120            + N_WORKPLACE
1121            + "/"
1122            + N_DEFAULTPREFERENCES
1123            + "/"
1124            + N_DIALOGSPREFERENCES
1125            + "/"
1126            + N_DIALOGSDEFAULTSETTINGS
1127            + "/"
1128            + N_FILEDELETION, "setDialogDeleteFileMode", 0);
1129        digester.addCallMethod("*/"
1130            + N_WORKPLACE
1131            + "/"
1132            + N_DEFAULTPREFERENCES
1133            + "/"
1134            + N_DIALOGSPREFERENCES
1135            + "/"
1136            + N_DIALOGSDEFAULTSETTINGS
1137            + "/"
1138            + N_DIRECTPUBLISH, "setDialogPublishSiblings", 0);
1139        digester.addCallMethod("*/"
1140            + N_WORKPLACE
1141            + "/"
1142            + N_DEFAULTPREFERENCES
1143            + "/"
1144            + N_DIALOGSPREFERENCES
1145            + "/"
1146            + N_DIALOGSDEFAULTSETTINGS
1147            + "/"
1148            + N_SHOWLOCK, "setShowLockDialog", 0);
1149        digester.addCallMethod("*/"
1150            + N_WORKPLACE
1151            + "/"
1152            + N_DEFAULTPREFERENCES
1153            + "/"
1154            + N_DIALOGSPREFERENCES
1155            + "/"
1156            + N_DIALOGSDEFAULTSETTINGS
1157            + "/"
1158            + N_SHOWEXPORTSETTINGS, "setShowExportSettingsDialog", 0);
1159        digester.addCallMethod("*/"
1160            + N_WORKPLACE
1161            + "/"
1162            + N_DEFAULTPREFERENCES
1163            + "/"
1164            + N_DIALOGSPREFERENCES
1165            + "/"
1166            + N_DIALOGSDEFAULTSETTINGS
1167            + "/"
1168            + N_PERMISSIONSINHERITONFOLDER, "setDialogPermissionsInheritOnFolder", 0);
1169        digester.addCallMethod("*/"
1170            + N_WORKPLACE
1171            + "/"
1172            + N_DEFAULTPREFERENCES
1173            + "/"
1174            + N_DIALOGSPREFERENCES
1175            + "/"
1176            + N_DIALOGSDEFAULTSETTINGS
1177            + "/"
1178            + N_EXPANDPERMISSIONSINHERITED, "setDialogExpandInheritedPermissions", 0);
1179        digester.addCallMethod("*/"
1180            + N_WORKPLACE
1181            + "/"
1182            + N_DEFAULTPREFERENCES
1183            + "/"
1184            + N_DIALOGSPREFERENCES
1185            + "/"
1186            + N_DIALOGSDEFAULTSETTINGS
1187            + "/"
1188            + N_EXPANDPERMISSIONSUSER, "setDialogExpandUserPermissions", 0);
1189
1190        // add editor generaloptions rules
1191
digester.addCallMethod("*/"
1192            + N_WORKPLACE
1193            + "/"
1194            + N_DEFAULTPREFERENCES
1195            + "/"
1196            + N_EDITORPREFERENCES
1197            + "/"
1198            + N_EDITORGENERALOPTIONS
1199            + "/"
1200            + N_BUTTONSTYLE, "setEditorButtonStyle", 0);
1201        digester.addCallMethod("*/"
1202            + N_WORKPLACE
1203            + "/"
1204            + N_DEFAULTPREFERENCES
1205            + "/"
1206            + N_EDITORPREFERENCES
1207            + "/"
1208            + N_EDITORGENERALOPTIONS
1209            + "/"
1210            + N_DIRECTEDITSTYLE, "setDirectEditButtonStyle", 0);
1211
1212        // add editor preferrededitor rules
1213
digester.addCallMethod("*/"
1214            + N_WORKPLACE
1215            + "/"
1216            + N_DEFAULTPREFERENCES
1217            + "/"
1218            + N_EDITORPREFERENCES
1219            + "/"
1220            + N_EDITORPREFERREDEDITORS
1221            + "/"
1222            + N_EDITOR, "setPreferredEditor", 2);
1223        digester.addCallParam("*/"
1224            + N_WORKPLACE
1225            + "/"
1226            + N_DEFAULTPREFERENCES
1227            + "/"
1228            + N_EDITORPREFERENCES
1229            + "/"
1230            + N_EDITORPREFERREDEDITORS
1231            + "/"
1232            + N_EDITOR, 0, A_TYPE);
1233        digester.addCallParam("*/"
1234            + N_WORKPLACE
1235            + "/"
1236            + N_DEFAULTPREFERENCES
1237            + "/"
1238            + N_EDITORPREFERENCES
1239            + "/"
1240            + N_EDITORPREFERREDEDITORS
1241            + "/"
1242            + N_EDITOR, 1, A_VALUE);
1243
1244        // add workflow generaloptions rules
1245
digester.addCallMethod("*/"
1246            + N_WORKPLACE
1247            + "/"
1248            + N_DEFAULTPREFERENCES
1249            + "/"
1250            + N_WORKFLOWPREFERENCES
1251            + "/"
1252            + N_WORKFLOWGENERALOPTIONS
1253            + "/"
1254            + N_STARTUPFILTER, "setTaskStartupFilterDefault", 0);
1255        digester.addCallMethod("*/"
1256            + N_WORKPLACE
1257            + "/"
1258            + N_DEFAULTPREFERENCES
1259            + "/"
1260            + N_WORKFLOWPREFERENCES
1261            + "/"
1262            + N_WORKFLOWGENERALOPTIONS
1263            + "/"
1264            + N_SHOWPROJECTS, "setTaskShowAllProjects", 0);
1265
1266        // add workflow defaultsettings rules
1267
digester.addCallMethod("*/"
1268            + N_WORKPLACE
1269            + "/"
1270            + N_DEFAULTPREFERENCES
1271            + "/"
1272            + N_WORKFLOWPREFERENCES
1273            + "/"
1274            + N_WORKFLOWDEFAULTSETTINGS
1275            + "/"
1276            + N_MESSAGEACCEPTED, "setTaskMessageAccepted", 0);
1277        digester.addCallMethod("*/"
1278            + N_WORKPLACE
1279            + "/"
1280            + N_DEFAULTPREFERENCES
1281            + "/"
1282            + N_WORKFLOWPREFERENCES
1283            + "/"
1284            + N_WORKFLOWDEFAULTSETTINGS
1285            + "/"
1286            + N_MESSAGEFORWARDED, "setTaskMessageForwarded", 0);
1287        digester.addCallMethod("*/"
1288            + N_WORKPLACE
1289            + "/"
1290            + N_DEFAULTPREFERENCES
1291            + "/"
1292            + N_WORKFLOWPREFERENCES
1293            + "/"
1294            + N_WORKFLOWDEFAULTSETTINGS
1295            + "/"
1296            + N_MESSAGECOMPLETED, "setTaskMessageCompleted", 0);
1297        digester.addCallMethod("*/"
1298            + N_WORKPLACE
1299            + "/"
1300            + N_DEFAULTPREFERENCES
1301            + "/"
1302            + N_WORKFLOWPREFERENCES
1303            + "/"
1304            + N_WORKFLOWDEFAULTSETTINGS
1305            + "/"
1306            + N_INFORMROLEMEMBERS, "setTaskMessageMembers", 0);
1307
1308        // add tool-manager
1309
String JavaDoc rulePath = "*/" + N_TOOLMANAGER;
1310        digester.addObjectCreate(rulePath, CmsToolManager.class);
1311        digester.addSetNext(rulePath, "setToolManager");
1312        // add tool-manager roots
1313
rulePath += "/" + N_ROOTS + "/" + N_ROOT;
1314        digester.addObjectCreate(rulePath, CmsToolRootHandler.class);
1315        digester.addSetNext(rulePath, "addToolRoot");
1316        digester.addBeanPropertySetter(rulePath + "/" + N_KEY);
1317        digester.addBeanPropertySetter(rulePath + "/" + N_URI);
1318        digester.addBeanPropertySetter(rulePath + "/" + N_NAME);
1319        digester.addBeanPropertySetter(rulePath + "/" + N_HELPTEXT, "helpText");
1320    }
1321
1322    /**
1323     * @see org.opencms.configuration.I_CmsXmlConfiguration#generateXml(org.dom4j.Element)
1324     */

1325    public Element generateXml(Element parent) {
1326
1327        // generate workplace node and subnodes
1328
Element workplaceElement = parent.addElement(N_WORKPLACE);
1329        Iterator JavaDoc i;
1330
1331        // add default locale
1332
workplaceElement.addElement(N_DEFAULTLOCALE).setText(m_workplaceManager.getDefaultLocale().toString());
1333
1334        // add <localizedfolders> subnode
1335
Element localizedElement = workplaceElement.addElement(N_LOCALIZEDFOLDERS);
1336        Iterator JavaDoc localizedIterator = m_workplaceManager.getLocalizedFolders().iterator();
1337        while (localizedIterator.hasNext()) {
1338            // add <resource uri=""/> element(s)
1339
localizedElement.addElement(N_RESOURCE).addAttribute(A_URI, (String JavaDoc)localizedIterator.next());
1340        }
1341
1342        // add <dialoghandlers> subnode
1343
Element dialogElement = workplaceElement.addElement(N_DIALOGHANDLERS);
1344        Map JavaDoc dialogs = m_workplaceManager.getDialogHandler();
1345        String JavaDoc[] keys = (String JavaDoc[])dialogs.keySet().toArray(new String JavaDoc[0]);
1346        Arrays.sort(keys);
1347
1348        for (int j = 0; j < keys.length; j++) {
1349            String JavaDoc name = keys[j];
1350            dialogElement.addElement(N_DIALOGHANDLER).addAttribute(A_CLASS, dialogs.get(name).getClass().getName());
1351        }
1352
1353        // add miscellaneous editor subnodes
1354
workplaceElement.addElement(N_EDITORHANDLER).addAttribute(
1355            A_CLASS,
1356            m_workplaceManager.getEditorHandler().getClass().getName());
1357        workplaceElement.addElement(N_EDITORACTION).addAttribute(
1358            A_CLASS,
1359            m_workplaceManager.getEditorActionHandler().getClass().getName());
1360
1361        I_CmsConfigurationParameterHandler deProvider = m_workplaceManager.getDirectEditProvider();
1362        Element deProviderNode = workplaceElement.addElement(N_DIRECTEDITPROVIDER).addAttribute(
1363            A_CLASS,
1364            deProvider.getClass().getName());
1365        Map JavaDoc deProviderConfig = deProvider.getConfiguration();
1366        if (deProviderConfig != null) {
1367            Iterator JavaDoc it = deProviderConfig.entrySet().iterator();
1368            while (it.hasNext()) {
1369                Map.Entry JavaDoc entry = (Map.Entry JavaDoc)it.next();
1370                String JavaDoc name = (String JavaDoc)entry.getKey();
1371                String JavaDoc value = (String JavaDoc)entry.getValue();
1372                Element paramNode = deProviderNode.addElement(N_PARAM);
1373                paramNode.addAttribute(A_NAME, name);
1374                paramNode.addText(value);
1375            }
1376        }
1377
1378        // add <exportpoints> subnode
1379
Element resourceloadersElement = workplaceElement.addElement(N_EXPORTPOINTS);
1380        Set JavaDoc points = m_workplaceManager.getExportPoints();
1381        i = points.iterator();
1382        while (i.hasNext()) {
1383            CmsExportPoint point = (CmsExportPoint)i.next();
1384            resourceloadersElement.addElement(N_EXPORTPOINT).addAttribute(A_URI, point.getUri()).addAttribute(
1385                A_DESTINATION,
1386                point.getConfiguredDestination());
1387        }
1388
1389        // add miscellaneous configuration nodes
1390
workplaceElement.addElement(N_AUTOLOCK).setText(new Boolean JavaDoc(m_workplaceManager.autoLockResources()).toString());
1391        workplaceElement.addElement(N_ENABLEUSERMGMT).setText(
1392            new Boolean JavaDoc(m_workplaceManager.showUserGroupIcon()).toString());
1393        workplaceElement.addElement(N_DEFAULTPROPERTIESONSTRUCTURE).setText(
1394            new Boolean JavaDoc(m_workplaceManager.isDefaultPropertiesOnStructure()).toString());
1395        workplaceElement.addElement(N_ENABLEADVANCEDPROPERTYTABS).setText(
1396            new Boolean JavaDoc(m_workplaceManager.isEnableAdvancedPropertyTabs()).toString());
1397        workplaceElement.addElement(N_MAXUPLOADSIZE).setText(
1398            new Integer JavaDoc(m_workplaceManager.getFileMaxUploadSize()).toString());
1399
1400        // add <labeledfolders> resource list
1401
Element labeledElement = workplaceElement.addElement(N_LABELEDFOLDERS);
1402        i = m_workplaceManager.getLabelSiteFolders().iterator();
1403        while (i.hasNext()) {
1404            labeledElement.addElement(N_RESOURCE).addAttribute(A_URI, (String JavaDoc)i.next());
1405        }
1406
1407        // add <workflow> node
1408
if (m_workplaceManager.isEnableWorkflowMessages()) {
1409            Element workflow = workplaceElement.addElement(N_WORKFLOW);
1410            workflow.addElement(N_SHOWMESSAGES).setText(
1411                new Boolean JavaDoc(m_workplaceManager.isEnableWorkflowMessages()).toString());
1412        }
1413
1414        // add <rfsfileviewsettings> node
1415
CmsRfsFileViewer viewSettings = m_workplaceManager.getFileViewSettings();
1416        Element fileViewElement = workplaceElement.addElement(N_RFSFILEVIEWESETTINGS);
1417        String JavaDoc filePath = viewSettings.getFilePath();
1418        if (filePath != null) {
1419            fileViewElement.addElement(N_FILEPATH).setText(filePath);
1420        }
1421        fileViewElement.addElement(N_ENABLED).setText(String.valueOf(viewSettings.isEnabled()));
1422        fileViewElement.addElement(N_FILEENCODING).setText(viewSettings.getFileEncoding());
1423        fileViewElement.addElement(N_ISLOGFILE).setText(String.valueOf(viewSettings.getIsLogfile()));
1424        fileViewElement.addElement(N_WINDOWSIZE).setText(String.valueOf(viewSettings.getWindowSize()));
1425
1426        // add <explorertypes> node
1427
Element explorerTypesElement = workplaceElement.addElement(N_EXPLORERTYPES);
1428        List JavaDoc explorerTypes = m_workplaceManager.getExplorerTypeSettings();
1429        generateExplorerTypesXml(explorerTypesElement, explorerTypes, false);
1430
1431        // add the <defaultaccesscontrol> node
1432
Element defaultAccessControlElement = explorerTypesElement.addElement(N_DEFAULTACCESSCONTROL);
1433        // create subnode <accesscontrol>
1434
List JavaDoc accessEntries = new ArrayList JavaDoc();
1435        // sort accessEntries
1436
CmsExplorerTypeAccess access = m_workplaceManager.getDefaultAccess();
1437        Iterator JavaDoc iter = access.getAccessEntries().keySet().iterator();
1438        while (iter.hasNext()) {
1439            accessEntries.add(iter.next());
1440        }
1441        Collections.sort(accessEntries);
1442
1443        if (accessEntries.size() > 0) {
1444            Element accessControlElement = defaultAccessControlElement.addElement(N_ACCESSCONTROL);
1445            Iterator JavaDoc k = accessEntries.iterator();
1446
1447            while (k.hasNext()) {
1448                String JavaDoc key = (String JavaDoc)k.next();
1449                String JavaDoc value = (String JavaDoc)m_workplaceManager.getDefaultAccess().getAccessEntries().get(key);
1450                Element accessEntryElement = accessControlElement.addElement(N_ACCESSENTRY);
1451                accessEntryElement.addAttribute(A_PRINCIPAL, key);
1452                accessEntryElement.addAttribute(A_PERMISSIONS, value);
1453            }
1454        }
1455
1456        // add the <multicontextmenu> node
1457
i = m_workplaceManager.getMultiContextMenu().getAllEntries().iterator();
1458        if (i.hasNext()) {
1459            // only generate the node if entries are defined
1460
Element contextMenuElement = explorerTypesElement.addElement(N_MULTICONTEXTMENU);
1461            while (i.hasNext()) {
1462                CmsExplorerContextMenuItem item = (CmsExplorerContextMenuItem)i.next();
1463                Element itemElement;
1464                if (CmsExplorerContextMenuItem.TYPE_ENTRY.equals(item.getType())) {
1465                    // create an <entry> node
1466
itemElement = contextMenuElement.addElement(N_ENTRY);
1467                    itemElement.addAttribute(A_KEY, item.getKey());
1468                    itemElement.addAttribute(A_URI, item.getUri());
1469                    if (item.getTarget() != null) {
1470                        itemElement.addAttribute(A_TARGET, item.getTarget());
1471                    }
1472                    String JavaDoc rules = item.getRules();
1473                    if (CmsStringUtil.isEmptyOrWhitespaceOnly(rules)) {
1474                        rules = "";
1475                    }
1476                    itemElement.addAttribute(A_RULES, rules);
1477                } else {
1478                    // create a <separator> node
1479
itemElement = contextMenuElement.addElement(N_SEPARATOR);
1480                }
1481                itemElement.addAttribute(A_ORDER, "" + item.getOrder());
1482            }
1483        }
1484
1485        // add the <default-preferences> user settings main node
1486
Element defaultPreferences = workplaceElement.addElement(N_DEFAULTPREFERENCES);
1487        // add the <workplace-preferences> node
1488
Element workplacePreferences = defaultPreferences.addElement(N_WORKPLACEPREFERENCES);
1489        // add the <workplace-generaloptions> node
1490
Element workplaceGeneraloptions = workplacePreferences.addElement(N_WORKPLACEGENERALOPTIONS);
1491        // add the <buttonstyle> node
1492
workplaceGeneraloptions.addElement(N_BUTTONSTYLE).setText(
1493            m_workplaceManager.getDefaultUserSettings().getWorkplaceButtonStyleString());
1494        // add the <reporttype> node
1495
workplaceGeneraloptions.addElement(N_REPORTTYPE).setText(
1496            m_workplaceManager.getDefaultUserSettings().getWorkplaceReportType());
1497        // add the <uploadapplet> node
1498
workplaceGeneraloptions.addElement(N_UPLOADAPPLET).setText(
1499            m_workplaceManager.getDefaultUserSettings().getUploadAppletString());
1500        // add the <publishbuttonappearance> node if not empty
1501
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_workplaceManager.getDefaultUserSettings().getPublishButtonAppearance())) {
1502            workplaceGeneraloptions.addElement(N_PUBLISHBUTTONAPPEARANCE).setText(
1503                m_workplaceManager.getDefaultUserSettings().getPublishButtonAppearance());
1504        }
1505
1506        // add the configuration for new folders
1507
// <newfolder-editproperties>
1508
workplaceGeneraloptions.addElement(N_NEWFOLDEREDITPROPERTIES).setText(
1509            m_workplaceManager.getDefaultUserSettings().getNewFolderEditProperties().toString());
1510        // <createIndexPageChecked>
1511
workplaceGeneraloptions.addElement(N_NEWFOLDERCREATEINDEXPAGE).setText(
1512            m_workplaceManager.getDefaultUserSettings().getNewFolderCreateIndexPage().toString());
1513
1514        // add the <workplace-startupsettings> node
1515
Element workplaceStartupsettings = workplacePreferences.addElement(N_WORKPLACESTARTUPSETTINGS);
1516        // add the <locale> node
1517
workplaceStartupsettings.addElement(N_LOCALE).setText(
1518            m_workplaceManager.getDefaultUserSettings().getLocale().toString());
1519        // add the <project> node
1520
workplaceStartupsettings.addElement(N_PROJECT).setText(
1521            m_workplaceManager.getDefaultUserSettings().getStartProject());
1522        // add the <view> node
1523
workplaceStartupsettings.addElement(N_WORKPLACEVIEW).setText(
1524            m_workplaceManager.getDefaultUserSettings().getStartView());
1525        // add the <folder> node
1526
workplaceStartupsettings.addElement(N_FOLDER).setText(
1527            m_workplaceManager.getDefaultUserSettings().getStartFolder());
1528        // add the <site> node
1529
workplaceStartupsettings.addElement(N_SITE).setText(m_workplaceManager.getDefaultUserSettings().getStartSite());
1530        // add the <restrictexplorerview> node
1531
workplaceStartupsettings.addElement(N_RESTRICTEXPLORERVIEW).setText(
1532            m_workplaceManager.getDefaultUserSettings().getRestrictExplorerViewString());
1533
1534        // add the <explorer-preferences> node
1535
Element explorerPreferences = defaultPreferences.addElement(N_EXPLORERPREFERENCES);
1536        // add the <explorer-generaloptions> node
1537
Element explorerGeneraloptions = explorerPreferences.addElement(N_EXPLORERGENERALOPTIONS);
1538        // add the <buttonstyle> node
1539
explorerGeneraloptions.addElement(N_BUTTONSTYLE).setText(
1540            m_workplaceManager.getDefaultUserSettings().getExplorerButtonStyleString());
1541        // add the <reporttype> node
1542
explorerGeneraloptions.addElement(N_ENTRIES).setText(
1543            "" + m_workplaceManager.getDefaultUserSettings().getExplorerFileEntries());
1544        // add the <explorer-displayoption> node
1545
Element explorerDisplayoptions = explorerPreferences.addElement(N_EXPLORERDISPLAYOPTIONS);
1546        // add the <show-title> node
1547
explorerDisplayoptions.addElement(N_TITLE).setText(
1548            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileTitle());
1549        // add the <show-type> node
1550
explorerDisplayoptions.addElement(N_TYPE).setText(
1551            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileType());
1552        // add the <show-datelastmodified> node
1553
explorerDisplayoptions.addElement(N_DATELASTMODIFIED).setText(
1554            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileDateLastModified());
1555        // add the <show-datecreated> node
1556
explorerDisplayoptions.addElement(N_DATECREATED).setText(
1557            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileDateCreated());
1558        // add the <show-lockedby> node
1559
explorerDisplayoptions.addElement(N_LOCKEDBY).setText(
1560            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileLockedBy());
1561        // add the <show-permissions> node
1562
explorerDisplayoptions.addElement(N_PERMISSIONS).setText(
1563            m_workplaceManager.getDefaultUserSettings().getShowExplorerFilePermissions());
1564        // add the <show-size> node
1565
explorerDisplayoptions.addElement(N_SIZE).setText(
1566            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileSize());
1567        // add the <show-state> node
1568
explorerDisplayoptions.addElement(N_STATE).setText(
1569            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileState());
1570        // add the <show-userlastmodified> node
1571
explorerDisplayoptions.addElement(N_USERLASTMODIFIED).setText(
1572            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileUserLastModified());
1573        // add the <show-usercreated> node
1574
explorerDisplayoptions.addElement(N_USERCREATED).setText(
1575            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileUserCreated());
1576        // add the <show-datereleased> node
1577
explorerDisplayoptions.addElement(N_DATERELEASED).setText(
1578            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileDateReleased());
1579        // add the <show-dateexpired> node
1580
explorerDisplayoptions.addElement(N_DATEEXPIRED).setText(
1581            m_workplaceManager.getDefaultUserSettings().getShowExplorerFileDateExpired());
1582
1583        // add the <dialog-preferences> node
1584
Element dialogPreferences = defaultPreferences.addElement(N_DIALOGSPREFERENCES);
1585        // add the <dialog-defaultsettings> node
1586
Element dialogDefaultSettings = dialogPreferences.addElement(N_DIALOGSDEFAULTSETTINGS);
1587        // add the <filecopy> node
1588
dialogDefaultSettings.addElement(N_FILECOPY).setText(
1589            m_workplaceManager.getDefaultUserSettings().getDialogCopyFileModeString());
1590        // add the <foldercopy> node
1591
dialogDefaultSettings.addElement(N_FOLDERCOPY).setText(
1592            m_workplaceManager.getDefaultUserSettings().getDialogCopyFolderModeString());
1593        // add the <filedeletion> node
1594
dialogDefaultSettings.addElement(N_FILEDELETION).setText(
1595            m_workplaceManager.getDefaultUserSettings().getDialogDeleteFileModeString());
1596        // add the <directpublish> node
1597
dialogDefaultSettings.addElement(N_DIRECTPUBLISH).setText(
1598            m_workplaceManager.getDefaultUserSettings().getDialogPublishSiblingsString());
1599        // add the <showlock> node
1600
dialogDefaultSettings.addElement(N_SHOWLOCK).setText(
1601            m_workplaceManager.getDefaultUserSettings().getDialogShowLockString());
1602        // add the <showexportsettings> node
1603
dialogDefaultSettings.addElement(N_SHOWEXPORTSETTINGS).setText(
1604            m_workplaceManager.getDefaultUserSettings().getDialogShowExportSettingsString());
1605        // add the <expand-permissionsuser> node
1606
dialogDefaultSettings.addElement(N_EXPANDPERMISSIONSUSER).setText(
1607            m_workplaceManager.getDefaultUserSettings().getDialogExpandUserPermissionsString());
1608        // add the <expand-permissionsinherited> node
1609
dialogDefaultSettings.addElement(N_EXPANDPERMISSIONSINHERITED).setText(
1610            m_workplaceManager.getDefaultUserSettings().getDialogExpandInheritedPermissionsString());
1611        // add the <permissions-inheritonfolder> node
1612
dialogDefaultSettings.addElement(N_PERMISSIONSINHERITONFOLDER).setText(
1613            m_workplaceManager.getDefaultUserSettings().getDialogPermissionsInheritOnFolderString());
1614
1615        // add the <editors-preferences> node
1616
Element editorsPreferences = defaultPreferences.addElement(N_EDITORPREFERENCES);
1617        // add the <editors-generaloptions> node
1618
Element editorGeneraloptions = editorsPreferences.addElement(N_EDITORGENERALOPTIONS);
1619        // add the <buttonstyle> node
1620
editorGeneraloptions.addElement(N_BUTTONSTYLE).setText(
1621            m_workplaceManager.getDefaultUserSettings().getEditorButtonStyleString());
1622        // add the <directedit> node
1623
editorGeneraloptions.addElement(N_DIRECTEDITSTYLE).setText(
1624            m_workplaceManager.getDefaultUserSettings().getDirectEditButtonStyleString());
1625        // add the <editors-preferrededitors> node
1626
Element editorPreferrededitors = editorsPreferences.addElement(N_EDITORPREFERREDEDITORS);
1627        // add the <editor> nodes
1628
Iterator JavaDoc editors = m_workplaceManager.getDefaultUserSettings().getEditorSettings().keySet().iterator();
1629        while (editors.hasNext()) {
1630            String JavaDoc type = (String JavaDoc)editors.next();
1631            String JavaDoc value = m_workplaceManager.getDefaultUserSettings().getPreferredEditor(type);
1632            Element editor = editorPreferrededitors.addElement(N_EDITOR);
1633            editor.addAttribute(A_TYPE, type);
1634            editor.addAttribute(A_VALUE, value);
1635        }
1636
1637        // add the <workflow-prefernces> node
1638
Element workflowPreferences = defaultPreferences.addElement(N_WORKFLOWPREFERENCES);
1639        // add the <workflow-generaloptions> node
1640
Element workflowGeneraloptions = workflowPreferences.addElement(N_WORKFLOWGENERALOPTIONS);
1641        // add the <startupfilter> node
1642
workflowGeneraloptions.addElement(N_STARTUPFILTER).setText(
1643            m_workplaceManager.getDefaultUserSettings().getTaskStartupFilterDefault());
1644        // add the <showprojects> node
1645
workflowGeneraloptions.addElement(N_SHOWPROJECTS).setText(
1646            m_workplaceManager.getDefaultUserSettings().getTaskShowAllProjectsString());
1647        // add the <workflow-defaultsettings> node
1648
Element workflowDefaultsettings = workflowPreferences.addElement(N_WORKFLOWDEFAULTSETTINGS);
1649        // add the <message-accepted> node
1650
workflowDefaultsettings.addElement(N_MESSAGEACCEPTED).setText(
1651            m_workplaceManager.getDefaultUserSettings().getTaskMessageAcceptedString());
1652        // add the <message-forwarded> node
1653
workflowDefaultsettings.addElement(N_MESSAGEFORWARDED).setText(
1654            m_workplaceManager.getDefaultUserSettings().getTaskMessageForwardedString());
1655        // add the <message-completed> node
1656
workflowDefaultsettings.addElement(N_MESSAGECOMPLETED).setText(
1657            m_workplaceManager.getDefaultUserSettings().getTaskMessageCompletedString());
1658        // add the <informrolemembers> node
1659
workflowDefaultsettings.addElement(N_INFORMROLEMEMBERS).setText(
1660            m_workplaceManager.getDefaultUserSettings().getTaskMessageMembersString());
1661
1662        Element toolManagerElement = workplaceElement.addElement(N_TOOLMANAGER);
1663        Element rootsElement = toolManagerElement.addElement(N_ROOTS);
1664        Iterator JavaDoc it = m_workplaceManager.getToolManager().getToolRoots().iterator();
1665        while (it.hasNext()) {
1666            CmsToolRootHandler root = (CmsToolRootHandler)it.next();
1667            Element rootElement = rootsElement.addElement(N_ROOT);
1668            rootElement.addElement(N_KEY).addText(root.getKey());
1669            rootElement.addElement(N_URI).addText(root.getUri());
1670            rootElement.addElement(N_NAME).addText(root.getName());
1671            rootElement.addElement(N_HELPTEXT).addText(root.getHelpText());
1672        }
1673
1674        // return the configured node
1675
return workplaceElement;
1676    }
1677
1678    /**
1679     * @see org.opencms.configuration.I_CmsXmlConfiguration#getDtdFilename()
1680     */

1681    public String JavaDoc getDtdFilename() {
1682
1683        return CONFIGURATION_DTD_NAME;
1684    }
1685
1686    /**
1687     * Returns the initialized workplace manager.<p>
1688     *
1689     * @return the initialized workplace manager
1690     */

1691    public CmsWorkplaceManager getWorkplaceManager() {
1692
1693        return m_workplaceManager;
1694    }
1695
1696    /**
1697     * Will be called when configuration of this object is finished.<p>
1698     */

1699    public void initializeFinished() {
1700
1701        if (CmsLog.INIT.isInfoEnabled()) {
1702            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_WORKPLACE_FINISHED_0));
1703        }
1704    }
1705
1706    /**
1707     * Sets the generated workplace manager.<p>
1708     *
1709     * @param manager the workplace manager to set
1710     */

1711    public void setWorkplaceManager(CmsWorkplaceManager manager) {
1712
1713        m_workplaceManager = manager;
1714        if (CmsLog.INIT.isInfoEnabled()) {
1715            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_WORKPLACE_INIT_FINISHED_0));
1716        }
1717    }
1718}
Popular Tags