KickJava   Java API By Example, From Geeks To Geeks.

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


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

28
29
30 package com.opencms.workplace;
31
32 import org.opencms.db.CmsUserSettings;
33 import org.opencms.file.CmsObject;
34 import org.opencms.file.CmsRequestContext;
35 import org.opencms.file.CmsUser;
36 import org.opencms.i18n.CmsEncoder;
37 import org.opencms.importexport.CmsCompatibleCheck;
38 import org.opencms.main.CmsException;
39 import org.opencms.main.OpenCms;
40 import org.opencms.workplace.CmsWorkplace;
41 import org.opencms.workplace.editors.CmsDefaultPageEditor;
42 import org.opencms.workplace.explorer.CmsTree;
43
44 import com.opencms.core.I_CmsConstants;
45 import com.opencms.core.I_CmsSession;
46 import com.opencms.legacy.CmsLegacyException;
47 import com.opencms.legacy.CmsXmlTemplateLoader;
48 import com.opencms.template.A_CmsXmlContent;
49 import com.opencms.template.CmsCacheDirectives;
50 import com.opencms.template.CmsXmlTemplate;
51 import com.opencms.template.CmsXmlTemplateFile;
52
53 import java.util.Enumeration JavaDoc;
54 import java.util.Hashtable JavaDoc;
55 import java.util.StringTokenizer JavaDoc;
56 import java.util.Vector JavaDoc;
57
58 /**
59  * Common template class for displaying OpenCms workplace screens.
60  * <P>
61  * Reads template files of the content type <code>CmsXmlWpTemplateFile</code>.
62  * <P>
63  * Most special workplace classes may extend this class.
64  *
65  * @author Alexander Lucas
66  * @version $Revision: 1.5 $ $Date: 2005/06/27 23:22:07 $
67  * @see com.opencms.workplace.CmsXmlWpTemplateFile
68  *
69  * @deprecated Will not be supported past the OpenCms 6 release.
70  */

71
72 public class CmsWorkplaceDefault extends CmsXmlTemplate implements I_CmsConstants {
73
74     /** URL of the pics folder in the webserver's docroot */
75     private static String JavaDoc m_resourcesUri = null;
76
77     /** URL of the pics folder in the webserver's docroot */
78     private static String JavaDoc m_scriptsUri = null;
79
80     /** Reference to the config file */
81     private CmsXmlWpConfigFile m_configFile = null;
82
83
84     /** classes of the different option values for editor view select boxes. */
85     protected String JavaDoc[] C_SELECTBOX_EDITORVIEWS_CLASSES = {
86         "com.opencms.workplace.CmsEditor", "com.opencms.workplace.CmsEditor"
87     };
88
89     /** The filename to the backbuttontemplate. */
90     public static final String JavaDoc C_ADMIN_BACK_BUTTON = "adminbackbuttontemplate";
91
92     /** Name of the template containing messagebox definitions. */
93     public static final String JavaDoc C_BOXTEMPLATE = "messageboxTemplate";
94
95     /** Action for the button. */
96     public static final String JavaDoc C_BUTTON_ACTION = "action";
97
98     /** Alt text of the button. */
99     public static final String JavaDoc C_BUTTON_ALT = "alt";
100
101     /** href text of the button. */
102     public static final String JavaDoc C_BUTTON_HREF = "href";
103
104     /** method that should be used for deciding to (de)activate the button. */
105     public static final String JavaDoc C_BUTTON_METHOD = "method";
106
107     /** Name of the button. */
108     public static final String JavaDoc C_BUTTON_NAME = "name";
109
110     /** Style of the button. */
111     public static final String JavaDoc C_BUTTON_STYLE = "class";
112
113     /** Value of the button. */
114     public static final String JavaDoc C_BUTTON_VALUE = "value";
115
116     /** width of the button. */
117     public static final String JavaDoc C_BUTTON_WIDTH = "width";
118
119     /** Name of the template containing button definitions. */
120     public static final String JavaDoc C_BUTTONTEMPLATE = "ButtonTemplate";
121
122     /** The filename to the projectlisttemplate. */
123     public static final String JavaDoc C_CONTEXTMENUE_TEMPLATEFILE = "contexttemplate";
124
125     /** Number of images to be shown per page in the download browser. */
126     public static final int C_DOWNBROWSER_MAXENTRIES = 30;
127
128     /** Exit action. */
129     public static final String JavaDoc C_EDIT_ACTION_EXIT = "exit";
130
131     /** Save action. */
132     public static final String JavaDoc C_EDIT_ACTION_SAVE = "save";
133
134     /** Save &amp; Exit action. */
135     public static final String JavaDoc C_EDIT_ACTION_SAVEEXIT = "saveexit";
136
137     /** Link of the error box. */
138     public static final String JavaDoc C_ERROR_LINK = "ref";
139
140     /** Message of the error box. */
141     public static final String JavaDoc C_ERROR_MESSAGE = "message";
142
143     /** Button label of the error box. */
144     public static final String JavaDoc C_ERROR_MSG_BUTTON = "msgbutton";
145
146     /** Button label of the error box. */
147     public static final String JavaDoc C_ERROR_MSG_DETAILS = "details";
148
149     /** Static text in the error box. */
150     public static final String JavaDoc C_ERROR_MSG_REASON = "msgreason";
151
152     /** Reason of the error box. */
153     public static final String JavaDoc C_ERROR_REASON = "reason";
154
155     /** Suggestion of the error box. */
156     public static final String JavaDoc C_ERROR_SUGGESTION = "suggestion";
157
158     /** Title of the error box. */
159     public static final String JavaDoc C_ERROR_TITLE = "title";
160
161     /** Name of the template containing error field definitions. */
162     public static final String JavaDoc C_ERRORTEMPLATE = "errorTemplate";
163
164     /** The access value column. */
165     public static final String JavaDoc C_FILELIST_ACCESS_VALUE = "ACCESS_VALUE";
166
167     /** The changed value column. */
168     public static final String JavaDoc C_FILELIST_CHANGED_VALUE = "CHANGED_VALUE";
169
170     /** The stylesheet class to be used for a file or folder entry. */
171     public static final String JavaDoc C_FILELIST_CLASS_VALUE = "OUTPUT_CLASS";
172
173     /** The access column. */
174     public static final String JavaDoc C_FILELIST_COLUMN_ACCESS = "COLUMN_ACCESS";
175
176     /** The changed column. */
177     public static final String JavaDoc C_FILELIST_COLUMN_CHANGED = "COLUMN_CHANGED";
178
179     /** The customizable column. */
180     public static final String JavaDoc C_FILELIST_COLUMN_CUSTOMIZED = "COLUMN_CUSTOMIZED";
181
182     /** The customizable value column. */
183     public static final String JavaDoc C_FILELIST_COLUMN_CUSTOMIZED_VALUE = "COLUMN_CUSTOMIZED_VALUE";
184
185     /** The group column. */
186     public static final String JavaDoc C_FILELIST_COLUMN_GROUP = "COLUMN_GROUP";
187
188     /** The locked column. */
189     public static final String JavaDoc C_FILELIST_COLUMN_LOCKED = "COLUMN_LOCKED";
190
191     /** The name column. */
192     public static final String JavaDoc C_FILELIST_COLUMN_NAME = "COLUMN_NAME";
193
194     /** The owner column. */
195     public static final String JavaDoc C_FILELIST_COLUMN_OWNER = "COLUMN_OWNER";
196
197     /** The size column. */
198     public static final String JavaDoc C_FILELIST_COLUMN_SIZE = "COLUMN_SIZE";
199
200     /** The state column. */
201     public static final String JavaDoc C_FILELIST_COLUMN_STATE = "COLUMN_STATE";
202
203     /** The title column. */
204     public static final String JavaDoc C_FILELIST_COLUMN_TITLE = "COLUMN_TITLE";
205
206     /** The type column. */
207     public static final String JavaDoc C_FILELIST_COLUMN_TYPE = "COLUMN_TYPE";
208
209     /** customized template value for the file list. */
210     public static final String JavaDoc C_FILELIST_CUSTOMTEMPLATE = "customtemplate";
211
212     /** Flag for displaying the group column. */
213     public static final int C_FILELIST_GROUP = 64;
214
215     /** The group value column. */
216     public static final String JavaDoc C_FILELIST_GROUP_VALUE = "GROUP_VALUE";
217
218     /** The icon value column. */
219     public static final String JavaDoc C_FILELIST_ICON_VALUE = "ICON_VALUE";
220
221     /** The link for a file or folder entry. */
222     public static final String JavaDoc C_FILELIST_LINK_VALUE = "LINK_VALUE";
223
224     /** The lock value column. */
225     public static final String JavaDoc C_FILELIST_LOCK_VALUE = "LOCK_VALUE";
226
227     /** The lockedby value column. */
228     public static final String JavaDoc C_FILELIST_LOCKED_VALUE = "LOCKED_VALUE";
229
230     /** The name value column. */
231     public static final String JavaDoc C_FILELIST_NAME_VALUE = "NAME_VALUE";
232
233     /** The owner value column. */
234     public static final String JavaDoc C_FILELIST_OWNER_VALUE = "OWNER_VALUE";
235
236     /** The size value column. */
237     public static final String JavaDoc C_FILELIST_SIZE_VALUE = "SIZE_VALUE";
238
239     /** The state value column. */
240     public static final String JavaDoc C_FILELIST_STATE_VALUE = "STATE_VALUE";
241
242     /** The suffix for file list values. */
243     public static final String JavaDoc C_FILELIST_SUFFIX_VALUE = "_VALUE";
244
245     /** The title value column. */
246     public static final String JavaDoc C_FILELIST_TITLE_VALUE = "TITLE_VALUE";
247
248     /** The type value column. */
249     public static final String JavaDoc C_FILELIST_TYPE_VALUE = "TYPE_VALUE";
250
251     /** template value for the file list. */
252     public static final String JavaDoc C_FILELIST_TEMPLATE = "template";
253
254     /** Action for the icon. */
255     public static final String JavaDoc C_ICON_ACTION = "action";
256
257     /** method that should be used for deciding to (de)activate the icon. */
258     public static final String JavaDoc C_ICON_ACTIVE_METHOD = "activemethod";
259
260     /** The default icon. */
261     public static final String JavaDoc C_ICON_DEFAULT = "ic_file_othertype.gif";
262
263     /** The extension for the icon images. */
264     public static final String JavaDoc C_ICON_EXTENSION = ".gif";
265
266     /** href text of the icon. */
267     public static final String JavaDoc C_ICON_HREF = "href";
268
269     /** Label of the icon. */
270     public static final String JavaDoc C_ICON_LABEL = "label";
271
272     /** Name of the icon. */
273     public static final String JavaDoc C_ICON_NAME = "name";
274
275     /** The prefix for the icon images. */
276     public static final String JavaDoc C_ICON_PREFIX = "ic_file_";
277
278     /** href target of the icon. */
279     public static final String JavaDoc C_ICON_TARGET = "target";
280
281     /** The filename to the icontemplate. */
282     public static final String JavaDoc C_ICON_TEMPLATEFILE = "icontemplate";
283
284     /** method that should be used for deciding whether the icon is visible. */
285     public static final String JavaDoc C_ICON_VISIBLE_METHOD = "visiblemethod";
286
287     /** Action of the input field. */
288     public static final String JavaDoc C_INPUT_ACTION = "action";
289
290     /** Style class of the input field. */
291     public static final String JavaDoc C_INPUT_CLASS = "class";
292
293     /** Length of the input field. */
294     public static final String JavaDoc C_INPUT_LENGTH = "length";
295
296     /** Method of the input field. */
297     public static final String JavaDoc C_INPUT_METHOD = "method";
298
299     /** Name of the input field. */
300     public static final String JavaDoc C_INPUT_NAME = "name";
301
302     /** Size of the input field. */
303     public static final String JavaDoc C_INPUT_SIZE = "size";
304
305     /** Value of the input field. */
306     public static final String JavaDoc C_INPUT_VALUE = "value";
307
308     /** Name of the template containing input field definitions. */
309     public static final String JavaDoc C_INPUTTEMPLATE = "inputTemplate";
310
311     /** Name of the value. */
312     public static final String JavaDoc C_LABEL_VALUE = "value";
313
314     /** Name of the template containing label definitions. */
315     public static final String JavaDoc C_LABELTEMPLATE = "labelTemplate";
316
317     /** Prefix for button texts in the language file. */
318     public static final String JavaDoc C_LANG_BUTTON = "button";
319
320     /** Prefix for button texts in the language file. */
321     public static final String JavaDoc C_LANG_ICON = "icon";
322
323     /** Prefix for label texts in the language file. */
324     public static final String JavaDoc C_LANG_LABEL = "label";
325
326     /** Prefix for label texts in the language file. */
327     public static final String JavaDoc C_LANG_TITLE = "title";
328
329     /** First button of the messagebox. */
330     public static final String JavaDoc C_MESSAGE_BUTTON1 = "button1";
331
332     /** Second button of the messagebox. */
333     public static final String JavaDoc C_MESSAGE_BUTTON2 = "button2";
334
335     /** Link on button2 of the messagebox. */
336     public static final String JavaDoc C_MESSAGE_FILENAME = "filename";
337
338     /** Link on button1 of the messagebox. */
339     public static final String JavaDoc C_MESSAGE_LINK1 = "link1";
340
341     /** Link on button2 of the messagebox. */
342     public static final String JavaDoc C_MESSAGE_LINK2 = "link2";
343
344     /** First message of the messagebox. */
345     public static final String JavaDoc C_MESSAGE_MESSAGE1 = "message1";
346
347     /** Second message of the messagebox. */
348     public static final String JavaDoc C_MESSAGE_MESSAGE2 = "message2";
349
350     /** Title of the messagebox. */
351     public static final String JavaDoc C_MESSAGE_TITLE = "title";
352
353     /** the modules packetname key. */
354     public static final String JavaDoc C_MODULE_PACKETNAME = "packetname";
355
356     /** Method of the modulelist field. */
357     public static final String JavaDoc C_MODULELIST_AUTHOR = "author";
358
359     /** Method of the modulelist field. */
360     public static final String JavaDoc C_MODULELIST_DATECREATED = "datecreated";
361
362     /** Method of the modulelist field. */
363     public static final String JavaDoc C_MODULELIST_DATEUPLOADED = "dateuploaded";
364
365     /** Method of the modulelist field. */
366     public static final String JavaDoc C_MODULELIST_IDX = "idx";
367
368     /** Method of the modulelist field. */
369     public static final String JavaDoc C_MODULELIST_METHOD = "method";
370
371     /** Method of the modulelist field. */
372     public static final String JavaDoc C_MODULELIST_NAME = "name";
373
374     /** Method of the modulelist field. */
375     public static final String JavaDoc C_MODULELIST_NICE_NAME = "nicename";
376
377     /** The filename to the modulelisttemplate. */
378     public static final String JavaDoc C_MODULELIST_TEMPLATEFILE = "moduletemplate";
379
380     /** Method of the modulelist field. */
381     public static final String JavaDoc C_MODULELIST_VERSION = "version";
382
383     /** Panel defintion for explorer settings. */
384     public static final String JavaDoc C_PANEL_EXPLORER = "explorer";
385
386     /** Link URL for each panel. */
387     public static final String JavaDoc C_PANEL_LINK = "link";
388
389     /** Text for each panel. */
390     public static final String JavaDoc C_PANEL_NAME = "panelname";
391
392     /** Panel defintion for start settings. */
393     public static final String JavaDoc C_PANEL_START = "start";
394
395     /** Panel defintion for task settings. */
396     public static final String JavaDoc C_PANEL_TASK = "task";
397
398     /** Panel defintion for user settings. */
399     public static final String JavaDoc C_PANEL_USER = "user";
400
401     /** Name of the template containing panel bar definitions. */
402     public static final String JavaDoc C_PANELTEMPLATE = "panelTemplate";
403
404     /** Parameter for action commands. */
405     public static final String JavaDoc C_PARA_ACTION = "action";
406
407     /** Parameter name of "cancel" value. */
408     public static final String JavaDoc C_PARA_CANCEL = "CANCEL";
409
410     /** Parameter for text/html editor content. */
411     public static final String JavaDoc C_PARA_CONTENT = "content";
412
413     /** Parameter for the default value. */
414     public static final String JavaDoc C_PARA_DEFAULT = "DEFAULT";
415
416     /** Parameter for a deleting a file. */
417     public static final String JavaDoc C_PARA_DELETE = "delete";
418
419     /** Parameter for description. */
420     public static final String JavaDoc C_PARA_DESCRIPTION = "description";
421
422     /** Parameter for the explorersettings value. */
423     public static final String JavaDoc C_PARA_EXPLORERSETTINGS = "EXPLORERSETTINGS";
424
425     /** Parameter for a filecontent. */
426     public static final String JavaDoc C_PARA_FILECONTENT = "filecontent";
427
428     /** Parameter for filelist. */
429     public static final String JavaDoc C_PARA_FILELIST = "filelist";
430
431     /** Parameter for filter. */
432     public static final String JavaDoc C_PARA_FILTER = "filter";
433
434     /** Parameter for a flag. */
435     public static final String JavaDoc C_PARA_FLAGS = "flags";
436
437     /** Parameter for foldername. */
438     public static final String JavaDoc C_PARA_FOLDER = "folder";
439
440     /** Parameter for foldertree. */
441     public static final String JavaDoc C_PARA_FOLDERTREE = "foldertree";
442
443     /** Parameter for a formname. */
444     public static final String JavaDoc C_PARA_FORMNAME = "formname";
445
446     /** Parameter for initial load. */
447     public static final String JavaDoc C_PARA_INITIAL = "initial";
448
449     /** Parameter for java script filenames. */
450     public static final String JavaDoc C_PARA_JSFILE = "jsfile";
451
452     /** Parameter for keywords. */
453     public static final String JavaDoc C_PARA_KEYWORDS = "keywords";
454
455     /** Parameter for layout. */
456     public static final String JavaDoc C_PARA_LAYOUT = "default_body";
457
458     /** Parameter for a link. */
459     public static final String JavaDoc C_PARA_LINK = "link";
460
461     /** Parameter for locking pages. */
462     public static final String JavaDoc C_PARA_LOCK = "lock";
463
464     /** Parameter for maximum pages. */
465     public static final String JavaDoc C_PARA_MAXPAGE = "maxpage";
466
467     /** Parameter for a name. */
468     public static final String JavaDoc C_PARA_NAME = "name";
469
470     /** Parameter for a navigation position. */
471     public static final String JavaDoc C_PARA_NAVPOS = "navpos";
472
473     /** Parameter for a navigation title. */
474     public static final String JavaDoc C_PARA_NAVTEXT = "navtitle";
475
476     /** Parameter for a new accessflags. */
477     public static final String JavaDoc C_PARA_NEWACCESS = "newaccess";
478
479     /** Parameter for a new file. */
480     public static final String JavaDoc C_PARA_NEWFILE = "newfile";
481
482     /** Parameter for a new folder. */
483     public static final String JavaDoc C_PARA_NEWFOLDER = "newfolder";
484
485     /** Parameter for a new group. */
486     public static final String JavaDoc C_PARA_NEWGROUP = "newgroup";
487
488     /** Parameter for a new owner. */
489     public static final String JavaDoc C_PARA_NEWOWNER = "newowner";
490
491     /** Parameter for the new password. */
492     public static final String JavaDoc C_PARA_NEWPWD = "newpwd";
493
494     /** Parameter for the password repeat. */
495     public static final String JavaDoc C_PARA_NEWPWDREPEAT = "newpwdrepeat";
496
497     /** Parameter for a new type. */
498     public static final String JavaDoc C_PARA_NEWTYPE = "newtype";
499
500     /** Parameter for the ok value. */
501     public static final String JavaDoc C_PARA_OK = "OK";
502
503     /** Parameter for the previous panel. */
504     public static final String JavaDoc C_PARA_OLDPANEL = "oldpanel";
505
506     /** Parameter for the old password. */
507     public static final String JavaDoc C_PARA_OLDPWD = "oldpwd";
508
509     /** Parameter for page number. */
510     public static final String JavaDoc C_PARA_PAGE = "page";
511
512     /** Parameter for a panel. */
513     public static final String JavaDoc C_PARA_PANEL = "panel";
514
515     /** Parameter for previous filelist. */
516     public static final String JavaDoc C_PARA_PREVIOUSLIST = "previous";
517
518     /** Parameter for a project. */
519     public static final String JavaDoc C_PARA_PROJECT = "project";
520
521     /** Parameter for properties. */
522     public static final String JavaDoc C_PARA_PROPERTYDEF = "property";
523
524     /** Parameter for startprojectid. */
525     public static final String JavaDoc C_PARA_STARTPROJECTID = "startProjectId";
526
527     /** Parameter for the startsettings value. */
528     public static final String JavaDoc C_PARA_STARTSETTINGS = "STARTSETTINGS";
529
530     /** Parameter for starttaskid. */
531     public static final String JavaDoc C_PARA_STARTTASKID = "startTaskId";
532
533     /** Parameter for submitting data. */
534     public static final String JavaDoc C_PARA_SUBMIT = "SUBMIT";
535
536     /** Parameter for the tasksettings value. */
537     public static final String JavaDoc C_PARA_TASKSETTINGS = "TASKSETTINGS";
538
539     /** Parameter for a template. */
540     public static final String JavaDoc C_PARA_TEMPLATE = "template";
541
542     /** Parameter for a title. */
543     public static final String JavaDoc C_PARA_TITLE = "title";
544
545     /** Parameter for unlocking pages. */
546     public static final String JavaDoc C_PARA_UNLOCK = "unlock";
547
548     /** Parameter for url. */
549     public static final String JavaDoc C_PARA_URL = "URL";
550
551     /** Parameter for the usersettings value. */
552     public static final String JavaDoc C_PARA_USERSETTINGS = "USERSETTINGS";
553
554     /** Parameter for a variable. */
555     public static final String JavaDoc C_PARA_VARIABLE = "variable";
556
557     /** Parameter for view name. */
558     public static final String JavaDoc C_PARA_VIEW = "view";
559
560     /** Parameter for viewfile. */
561     public static final String JavaDoc C_PARA_VIEWFILE = "viewfile";
562
563     /** Parameter for a filename. */
564     public static final String JavaDoc C_PARA_RESOURCE = "resource";
565
566     /** Number of images to be shown per page in the picture browser. */
567     public static final int C_PICBROWSER_MAXIMAGES = 15;
568
569     /** The preferences update. */
570     public static final String JavaDoc C_PREFERENCES_UPDATE = "../action/preferences_update.html";
571
572     /** The filename to the prefs scroller template file. */
573     public static final String JavaDoc C_PREFSSCROLLER_TEMPLATEFILE = "prefsscrollerTemplate";
574
575     /** Method of the projectlist field. */
576     public static final String JavaDoc C_PROJECTLIST_DATECREATED = "datecreated";
577
578     /** Method of the projectlist field. */
579     public static final String JavaDoc C_PROJECTLIST_DESCRIPTION = "description";
580
581     /** Method of the projectlist field. */
582     public static final String JavaDoc C_PROJECTLIST_IDX = "idx";
583
584     /** Method of the projectlist field. */
585     public static final String JavaDoc C_PROJECTLIST_LOCKSTATE = "lockstate";
586
587     /** Method of the projectlist field. */
588     public static final String JavaDoc C_PROJECTLIST_MENU = "menu";
589
590     /** Method of the projectlist field. */
591     public static final String JavaDoc C_PROJECTLIST_METHOD = "method";
592
593     /** Method of the projectlist field. */
594     public static final String JavaDoc C_PROJECTLIST_NAME = "name";
595
596     /** Method of the projectlist field. */
597     public static final String JavaDoc C_PROJECTLIST_NAME_ESCAPED = "name_escaped";
598
599     /** Method of the projectlist field. */
600     public static final String JavaDoc C_PROJECTLIST_OWNER = "owner";
601
602     /** Method of the projectlist field. */
603     public static final String JavaDoc C_PROJECTLIST_PROJECTID = "id";
604
605     /** Method of the projectlist field. */
606     public static final String JavaDoc C_PROJECTLIST_PROJECTMANAGER = "projectmanager";
607
608     /** Method of the projectlist field. */
609     public static final String JavaDoc C_PROJECTLIST_PROJECTWORKER = "projectworker";
610
611     /** Method of the projectlist field. */
612     public static final String JavaDoc C_PROJECTLIST_STATE = "STATE";
613
614     /** Method of the projectlist field. */
615     public static final String JavaDoc C_PROJECTLIST_STATE_LOCKED = "project.state.FILESLOCKED";
616
617     /** Method of the projectlist field. */
618     public static final String JavaDoc C_PROJECTLIST_STATE_UNLOCKED = "project.state.FILESUNLOCKED";
619
620     /** The filename to the projectlisttemplate. */
621     public static final String JavaDoc C_PROJECTLIST_TEMPLATEFILE = "projecttemplate";
622
623     /** Parameter of projectnew. */
624     public static final String JavaDoc C_PROJECTNEW_DESCRIPTION = "DESCRIPTION";
625
626     /** Templateselector of projectnew. */
627     public static final String JavaDoc C_PROJECTNEW_DONE = "done";
628
629     /** Templateselector of projectnew. */
630     public static final String JavaDoc C_PROJECTNEW_ERROR = "error";
631
632     /** Parameter of projectnew. */
633     public static final String JavaDoc C_PROJECTNEW_FOLDER = "selectallfolders";
634
635     /** Parameter of projectnew. */
636     public static final String JavaDoc C_PROJECTNEW_GROUP = "GROUP";
637
638     /** Parameter of projectnew. */
639     public static final String JavaDoc C_PROJECTNEW_MANAGERGROUP = "MANAGERGROUP";
640
641     /** Parameter of projectnew. */
642     public static final String JavaDoc C_PROJECTNEW_NAME = "NAME";
643
644     /** Parameter of projectnew. */
645     public static final String JavaDoc C_PROJECTNEW_TYPE = "TYPE";
646
647     /** Stylesheet class string of the radio button. */
648     public static final String JavaDoc C_RADIO_CLASS = "class";
649
650     /** Stylesheet class name of the radio button. */
651     public static final String JavaDoc C_RADIO_CLASSNAME = "classname";
652
653     /** Datablock conatining the optional entry for the image. */
654     public static final String JavaDoc C_RADIO_IMAGEENTRY = "imageentry";
655
656     /** Name of the radio button image name. */
657     public static final String JavaDoc C_RADIO_IMAGENAME = "image";
658
659     /** Datablock conatining the image option. */
660     public static final String JavaDoc C_RADIO_IMAGEOPTION = "optionalimage";
661
662     /** Name of the radio button link. */
663     public static final String JavaDoc C_RADIO_LINK = "link";
664
665     /** Method of the radio buttons. */
666     public static final String JavaDoc C_RADIO_METHOD = "method";
667
668     /** Name of the radio button value. */
669     public static final String JavaDoc C_RADIO_NAME = "name";
670
671     /** Name of the radio ordering information. */
672     public static final String JavaDoc C_RADIO_ORDER = "order";
673
674     /** Name of the radio buttons. */
675     public static final String JavaDoc C_RADIO_RADIONAME = "radioname";
676
677     /** Datablock conatining the optional entry for the "checked" option. */
678     public static final String JavaDoc C_RADIO_SELECTEDENTRY = "selectedentry";
679
680     /** Datablock conatining the "checked" option. */
681     public static final String JavaDoc C_RADIO_SELECTEDOPTION = "optionalselected";
682
683     /** Name of the template containing radiobutton definitions. */
684     public static final String JavaDoc C_RADIOTEMPLATE = "radioTemplate";
685
686     /** Stylesheet class string of the select box. */
687     public static final String JavaDoc C_SELECTBOX_CLASS = "class";
688
689     /** Stylesheet class name of the select box. */
690     public static final String JavaDoc C_SELECTBOX_CLASSNAME = "classname";
691
692     /** Div flag of the select box. */
693     public static final String JavaDoc C_SELECTBOX_DIV = "div";
694
695     /** default selected option value for editor view select boxes. */
696     public static final int[] C_SELECTBOX_EDITORVIEWS_DEFAULT = {0, 1};
697
698     /** templates of the different option values for editor view select boxes. */
699     public static final String JavaDoc[] C_SELECTBOX_EDITORVIEWS_TEMPLATES = {"edit_html_main", "edit_text_main"};
700
701     /** Method of the select box. */
702     public static final String JavaDoc C_SELECTBOX_METHOD = "method";
703
704     /** Name of the select box. */
705     public static final String JavaDoc C_SELECTBOX_NAME = "name";
706
707     /** Onchange of the select box. */
708     public static final String JavaDoc C_SELECTBOX_ONCHANGE = "onchange";
709
710     /** option name of the select box. */
711     public static final String JavaDoc C_SELECTBOX_OPTIONNAME = "name";
712
713     /** option value of the select box. */
714     public static final String JavaDoc C_SELECTBOX_OPTIONVALUE = "value";
715
716     /** Size of the select box. */
717     public static final String JavaDoc C_SELECTBOX_SIZE = "size";
718
719     /** Width of the select box. */
720     public static final String JavaDoc C_SELECTBOX_WIDTH = "width";
721
722     /** Stylesheet class name of the select box. */
723     public static final String JavaDoc C_SELECTBOX_WIDTHNAME = "widthname";
724
725     /** The modules administration data. */
726     public static final String JavaDoc C_SESSION_MODULE_ADMIN_DATA = "module_admin_data";
727
728     /** The modules administration property description. */
729     public static final String JavaDoc C_SESSION_MODULE_ADMIN_PROP_DESCR = "module_admin_props_desr";
730
731     /** The modules administration property names. */
732     public static final String JavaDoc C_SESSION_MODULE_ADMIN_PROP_NAMES = "module_admin_props_names";
733
734     /** The modules administration property type. */
735     public static final String JavaDoc C_SESSION_MODULE_ADMIN_PROP_TYP = "module_admin_props_typ";
736
737     /** the modules administration property value. */
738     public static final String JavaDoc C_SESSION_MODULE_ADMIN_PROP_VAL = "module_admin_props_value";
739
740     /** The modules checksum. */
741     public static final String JavaDoc C_SESSION_MODULE_CHECKSUM = "modulechecksum";
742
743     /** The step of module deletion. */
744     public static final String JavaDoc C_SESSION_MODULE_DELETE_STEP = "moduledeletestep";
745
746     /** The exclusions of the modulelisttemplate. */
747     public static final String JavaDoc C_SESSION_MODULE_EXCLUSION = "moduleexclusion";
748
749     /** The "module in use" flag. */
750     public static final String JavaDoc C_SESSION_MODULE_INUSE = "moduleinuse";
751
752     /** The missing files of the modulelisttemplate. */
753     public static final String JavaDoc C_SESSION_MODULE_MISSFILES = "modulemissfiles";
754
755     /** The modules project files. */
756     public static final String JavaDoc C_SESSION_MODULE_PROJECTFILES = "moduleprojectfiles";
757
758     /** The property files of the modulelisttemplate. */
759     public static final String JavaDoc C_SESSION_MODULE_PROPFILES = "modulepropfiles";
760
761     /** Constant for session-key. */
762     public static final String JavaDoc C_SESSION_TASK_ALLPROJECTS = "task_allprojects";
763
764     /** Constant for session-key. */
765     public static final String JavaDoc C_SESSION_TASK_FILTER = "task_filter";
766
767     /** Name of the errorbox tag in the error definiton template. */
768     public static final String JavaDoc C_TAG_ERRORBOX = "errorbox";
769
770     /** Name of the error?page tag in the error definiton template. */
771     public static final String JavaDoc C_TAG_ERRORPAGE = "errorpagedefinition";
772
773     /** Name of the label tag in the input definiton template. */
774     public static final String JavaDoc C_TAG_INPUTFIELD = "inputfield";
775
776     /** Name of the label tag in the label definition template. */
777     public static final String JavaDoc C_TAG_LABEL = "label";
778
779     /** Name of the errorbox tag in the error definiton template. */
780     public static final String JavaDoc C_TAG_MESSAGEBOX = "messagepage";
781
782     /** Name of the label tag in the label definition template. */
783     public static final String JavaDoc C_TAG_MODULELIST_DEFAULT = "defaultmodulelist";
784
785     /** Panel bar sequence for active background in the panel bar definiton template. */
786     public static final String JavaDoc C_TAG_PANEL_BGACTIVE = "paneldef.bgactive";
787
788     /** Panel bar sequence for inactive background in the panel bar definiton template. */
789     public static final String JavaDoc C_TAG_PANEL_BGINACTIVE = "paneldef.bginactive";
790
791     /** Panel bar ending sequence tag in the panel bar definiton template. */
792     public static final String JavaDoc C_TAG_PANEL_ENDSEQ = "paneldef.endseq";
793
794     /** Panel bar sequence for separating background and text area in the panel bar definiton template. */
795     public static final String JavaDoc C_TAG_PANEL_SEPBGTEXT = "paneldef.sepbgtext";
796
797     /** Panel bar starting sequence tag in the panel bar definiton template. */
798     public static final String JavaDoc C_TAG_PANEL_STARTSEQ = "paneldef.startseq";
799
800     /** Panel bar sequence for active text in the panel bar definiton template. */
801     public static final String JavaDoc C_TAG_PANEL_TEXTACTIVE = "paneldef.textactive";
802
803     /** Panel bar sequence for inactive text in the panel bar definiton template. */
804     public static final String JavaDoc C_TAG_PANEL_TEXTINACTIVE = "paneldef.textinactive";
805
806     /** Name of the password tag in the input definiton template. */
807     public static final String JavaDoc C_TAG_PASSWORD = "password";
808
809     /** Name of the label tag in the label definition template. */
810     public static final String JavaDoc C_TAG_PROJECTLIST_DEFAULT = "defaultprojectlist";
811
812     /** Name of the label tag in the label definition template. */
813     public static final String JavaDoc C_TAG_PROJECTLIST_SNAPLOCK = "snaplock";
814
815     /** Name of the radio "class" option tag in the input definiton template. */
816     public static final String JavaDoc C_TAG_RADIO_CLASS = "radiobuttons.class";
817
818     /** Name of the radion column entry tag in the input definiton template. */
819     public static final String JavaDoc C_TAG_RADIO_COLENTRY = "radiobuttons.colentry";
820
821     /** Name of the radion row entry tag in the input definiton template. */
822     public static final String JavaDoc C_TAG_RADIO_ROWENTRY = "radiobuttons.rowentry";
823
824     /** Name of the selectbox "class" option tag in the input definiton template. */
825     public static final String JavaDoc C_TAG_SELECTBOX_CLASS = "selectbox.class";
826
827     /** Name of the select end tag in the input definiton template. */
828     public static final String JavaDoc C_TAG_SELECTBOX_END = "selectbox.end";
829
830     /** Name of the (select) option tag in the input definiton template. */
831     public static final String JavaDoc C_TAG_SELECTBOX_OPTION = "selectbox.option";
832
833     /** Name of the (select) selected option tag in the input definiton template. */
834     public static final String JavaDoc C_TAG_SELECTBOX_SELOPTION = "selectbox.seloption";
835
836     /** Name of the select start tag in the input definiton template. */
837     public static final String JavaDoc C_TAG_SELECTBOX_START = "selectbox.start";
838
839     /** Name of the select div start tag in the input definiton template. */
840     public static final String JavaDoc C_TAG_SELECTBOX_START_DIV = "selectbox.startdiv";
841
842     /** Name of the selectbox "width" option tag in the input definiton template. */
843     public static final String JavaDoc C_TAG_SELECTBOX_WIDTH = "selectbox.width";
844
845     /** Name of the startup tag in the input definiton template. */
846     public static final String JavaDoc C_TAG_STARTUP = "STARTUP";
847
848     /** Name of the submitbutton tag in the button definiton template. */
849     public static final String JavaDoc C_TAG_SUBMITBUTTON = "submitbutton";
850
851     /** The filename to the taskdocu template. */
852     public static final String JavaDoc C_TASKDOCU_TEMPLATEFILE = "tasklistdoctemplate";
853
854     /** The filename to the projectlisttemplate. */
855     public static final String JavaDoc C_TASKLIST_TEMPLATEFILE = "tasklisttemplate";
856
857     /** Constant for task-log. */
858     public static final int C_TASKLOGTYPE_ACCEPTED = 101;
859
860     /** Constant for task-log. */
861     public static final int C_TASKLOGTYPE_CALL = 107;
862
863     /** Constant for task-log. */
864     public static final int C_TASKLOGTYPE_COMMENT = 102;
865
866     /** Constant for task-log. */
867     public static final int C_TASKLOGTYPE_CREATED = 100;
868
869     /** Constant for task-log. */
870     public static final int C_TASKLOGTYPE_DUECHANGED = 108;
871
872     /** Constant for task-log. */
873     public static final int C_TASKLOGTYPE_FORWARDED = 106;
874
875     /** Constant for task-log. */
876     public static final int C_TASKLOGTYPE_OK = 104;
877
878     /** Constant for task-log. */
879     public static final int C_TASKLOGTYPE_PRIORITYCHANGED = 109;
880
881     /** Constant for task-log. */
882     public static final int C_TASKLOGTYPE_REACTIVATED = 105;
883
884     /** Constant for task-log. */
885     public static final int C_TASKLOGTYPE_TAKE = 103;
886
887     /** Taskparameter. */
888     public static final String JavaDoc C_TASKPARA_ACCEPTATION = "acceptation";
889
890     /** Taskparameter. */
891     public static final String JavaDoc C_TASKPARA_ALL = "all";
892
893     /** Taskparameter. */
894     public static final String JavaDoc C_TASKPARA_COMPLETION = "completion";
895
896     /** Taskparameter. */
897     public static final String JavaDoc C_TASKPARA_DELIVERY = "delivery";
898
899     /** Name of the filelist preferences. */
900     public static final String JavaDoc C_USERPREF_FILELIST = "filelist";
901
902     /** Parameter of user management. */
903     public static final String JavaDoc C_USERS_NAME = "USERNAME";
904
905     /** Directory name of content internal folder. */
906     public static final String JavaDoc C_VFS_DIR_INTERNAL = "internal/";
907
908     /** Directory name of module locales path. */
909     public static final String JavaDoc C_VFS_DIR_LOCALES = "locales/";
910
911     /**
912      * Path to the login folder.<p>
913      *
914      * It's important to note that this does NOT end with a /
915      * as most other path constants do!<p>
916      */

917     public static final String JavaDoc VFS_PATH_LOGIN = CmsWorkplace.VFS_PATH_SYSTEM + "login";
918
919     /** Path to content default_bodies folder. */
920     public static final String JavaDoc C_VFS_PATH_DEFAULT_BODIES = CmsCompatibleCheck.VFS_PATH_DEFAULTMODULE + CmsWorkplace.VFS_DIR_DEFAULTBODIES;
921
922     /** Path to module demo folder (deprecated since version 5.0 beta 2). */
923     public static final String JavaDoc C_VFS_PATH_MODULEDEMOS = CmsWorkplace.VFS_PATH_MODULES + "moduledemos/";
924
925     /** Path to online help pages. */
926     public static final String JavaDoc C_VFS_PATH_HELP = CmsWorkplace.VFS_PATH_WORKPLACE + "help/";
927
928     /** Path to scripts. */
929     public static final String JavaDoc C_VFS_PATH_SCRIPTS = CmsWorkplace.VFS_PATH_WORKPLACE + "scripts/";
930
931     /** Path to download gallery folder. */
932     public static final String JavaDoc C_VFS_GALLERY_DOWNLOAD = CmsWorkplace.VFS_PATH_GALLERIES + "download/";
933
934     /** Path to externallink gallery folder. */
935     public static final String JavaDoc C_VFS_GALLERY_EXTERNALLINKS = CmsWorkplace.VFS_PATH_GALLERIES + "externallinks/";
936
937     /** Path to html gallery folder. */
938     public static final String JavaDoc C_VFS_GALLERY_HTML = CmsWorkplace.VFS_PATH_GALLERIES + "htmlgalleries/";
939
940     /** Path to pics gallery folder. */
941     public static final String JavaDoc C_VFS_GALLERY_PICS = CmsWorkplace.VFS_PATH_GALLERIES + "pics/";
942
943     /** Path to content internal folder. */
944     public static final String JavaDoc C_VFS_PATH_DEFAULT_INTERNAL = CmsWorkplace.VFS_PATH_WORKPLACE + "templates/";
945
946     /** The channel tree. */
947     public static final String JavaDoc C_WP_CHANNEL_TREE = "../action/channel_tree.html";
948
949     /** The explorer file list. */
950     public static final String JavaDoc C_WP_EXPLORER_FILELIST = "../action/explorer_files.html";
951
952     /** The preferences user panel. */
953     public static final String JavaDoc C_WP_EXPLORER_PREFERENCES = "../action/preferences.html?panel=user";
954
955     /** The explorer tree. */
956     public static final String JavaDoc C_WP_EXPLORER_TREE = "../action/explorer_tree.html";
957
958     /** The folder tree. */
959     public static final String JavaDoc C_WP_FOLDER_TREE = "../action/folder_tree.html";
960
961     /** The workplace. */
962     public static final String JavaDoc C_WP_RELOAD = "../action/workplace_reload.html";
963
964     /**
965      * Checks a Java System property for containing the given value
966      * @param propertyName Name of the property
967      * @param value Value that should be checked
968      * @return <code>true</code> if the property contains the value, <code>false</code> otherwise
969      */

970     protected boolean checkJavaProperty(String JavaDoc propertyName, String JavaDoc value) {
971         boolean result = false;
972         String JavaDoc prop = null;
973         try {
974             prop = System.getProperty(propertyName);
975             if(prop != null && prop.equals(value)) {
976                 result = true;
977             }
978             return result;
979         }
980         catch(Exception JavaDoc e) {
981             return false;
982         }
983     }
984
985     /**
986      * Used by workplace icons to decide whether the icon should
987      * be activated or not. Icons will use this method if the attribute <code>method="doNotShow"</code>
988      * is defined in the <code>&lt;ICON&gt;</code> tag.
989      * <P>
990      * This method always returns <code>false</code> thus icons controlled by
991      * this method will never be activated.
992      *
993      * @param cms CmsObject Object for accessing system resources <em>(not used here)</em>.
994      * @param lang reference to the currently valid language file <em>(not used here)</em>.
995      * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
996      * @return <code>false</code>.
997      */

998     public Boolean JavaDoc doNotShow(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) {
999         return new Boolean JavaDoc(false);
1000    }
1001
1002    /**
1003     * Gets a reference to the default config file.
1004     * The path to this file ist stored in <code>C_WORKPLACE_INI</code>
1005     *
1006     * @param cms CmsObject Object for accessing system resources.
1007     * @return Reference to the config file.
1008     * @throws CmsException
1009     */

1010    public CmsXmlWpConfigFile getConfigFile(CmsObject cms) throws CmsException {
1011
1012        //if(m_configFile == null) {
1013
m_configFile = new CmsXmlWpConfigFile(cms);
1014
1015        //}
1016
return m_configFile;
1017    }
1018
1019    /**
1020     * Help method used to fill the vectors returned to
1021     * <code>CmsSelectBox</code> with constant values.
1022     * @param names Vector to be filled with the appropriate values in this method.
1023     * @param values Vector to be filled with the appropriate values in this method.
1024     * @param content String array containing the elements to be set.
1025     * @param lang reference to the currently valid language file
1026     */

1027    protected void getConstantSelectEntries(Vector JavaDoc names, Vector JavaDoc values, String JavaDoc[] contents,
1028            CmsXmlLanguageFile lang) throws CmsException {
1029        for(int i = 0;i < contents.length;i++) {
1030            String JavaDoc value = contents[i];
1031            values.addElement(value);
1032            String JavaDoc s = lang.getLanguageValue("select." + value);
1033            if ((s == null) || s.startsWith("???")) s = value;
1034            names.addElement(s);
1035        }
1036    }
1037
1038    /**
1039     * Gets all fonts available in the WYSIWYG editor.
1040     *
1041     * The given vectors <code>names</code> and <code>values</code> will
1042     * be filled with the appropriate information to be used for building
1043     * a select box.
1044     *
1045     * @param cms CmsObject Object for accessing system resources.
1046     * @param lang reference to the currently valid language file
1047     * @param names Vector to be filled with the appropriate values in this method.
1048     * @param values Vector to be filled with the appropriate values in this method.
1049     * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
1050     * @return Index representing the user's current workplace view in the vectors.
1051     * @throws CmsException
1052     */

1053    public Integer JavaDoc getFonts(CmsObject cms, CmsXmlLanguageFile lang, Vector JavaDoc names, Vector JavaDoc values,
1054            Hashtable JavaDoc parameters) throws CmsException {
1055        for(int i = 0;i < CmsDefaultPageEditor.SELECTBOX_FONTS.length; i++) {
1056            String JavaDoc value = CmsDefaultPageEditor.SELECTBOX_FONTS[i];
1057            values.addElement(value);
1058            names.addElement(value);
1059        }
1060        return new Integer JavaDoc(0);
1061    }
1062
1063    /**
1064     * Gets the key that should be used to cache the results of
1065     * this template class.
1066     *
1067     * @param cms CmsObject Object for accessing system resources
1068     * @param templateFile Filename of the template file
1069     * @param parameters Hashtable with all template class parameters.
1070     * @param templateSelector template section that should be processed.
1071     * @return key that can be used for caching
1072     */

1073    public Object JavaDoc getKey(CmsObject cms, String JavaDoc templateFile, Hashtable JavaDoc parameters, String JavaDoc templateSelector) {
1074
1075        CmsRequestContext reqContext = cms.getRequestContext();
1076
1077        String JavaDoc result = ""
1078            + reqContext.currentProject().getId()
1079            + ":"
1080            + reqContext.currentUser().getName()
1081            + reqContext.addSiteRoot(templateFile);
1082        Enumeration JavaDoc keys = parameters.keys();
1083
1084        // select the right language to use
1085
String JavaDoc currentLanguage = null;
1086
1087        CmsUserSettings settings = new CmsUserSettings(cms);
1088        currentLanguage = settings.getLocale().toString();
1089
1090        while(keys.hasMoreElements()) {
1091            String JavaDoc key = (String JavaDoc)keys.nextElement();
1092            result = result + key + parameters.get(key);
1093        }
1094        result = result + templateSelector + currentLanguage;
1095        return result;
1096    }
1097
1098    /**
1099     * Get the currently valid <code>lasturl</code> parameter that can be
1100     * used for redirecting to the previous workplace screen.
1101     * @param cms Cms object for accessing system resources.
1102     * @param parameters User parameters.
1103     * @return <code>lasturl</code> parameter.
1104     */

1105    protected String JavaDoc getLastUrl(CmsObject cms, Hashtable JavaDoc parameters) {
1106        I_CmsSession session = CmsXmlTemplateLoader.getSession(cms.getRequestContext(), true);
1107        String JavaDoc lasturl = (String JavaDoc)parameters.get("lasturl");
1108
1109        // Lasturl parameter will be taken either from the parameter hashtable
1110
// (if exists) or from the session storage.
1111
// If neccessary, session storage will be updated.
1112
StringBuffer JavaDoc encLasturl = new StringBuffer JavaDoc();
1113        boolean notfirst = false;
1114        if(lasturl != null) {
1115
1116            // Fine. A lasturl parameter was found in session or parameter hashtable.
1117
// Check, if the URL parameters of the last url have to be encoded.
1118
int asteriskIdx = lasturl.indexOf("?");
1119            if(asteriskIdx > -1 && (asteriskIdx < (lasturl.length() - 1))) {
1120
1121                // In fact, there are URL parameters
1122
encLasturl.append(lasturl.substring(0, asteriskIdx + 1));
1123                String JavaDoc queryString = lasturl.substring(asteriskIdx + 1);
1124                StringTokenizer JavaDoc st = new StringTokenizer JavaDoc(queryString, "&");
1125                while(st.hasMoreTokens()) {
1126
1127                    // Loop through all URL parameters
1128
String JavaDoc currToken = st.nextToken();
1129                    if(currToken != null && !"".equals(currToken)) {
1130
1131                        // Look for the "=" character to divide parameter name and value
1132
int idx = currToken.indexOf("=");
1133                        if(notfirst) {
1134                            encLasturl.append("&");
1135                        }
1136                        else {
1137                            notfirst = true;
1138                        }
1139                        if(idx > -1) {
1140
1141                            // A parameter name/value pair was found.
1142
// Encode the parameter value and write back!
1143
String JavaDoc key = currToken.substring(0, idx);
1144                            String JavaDoc value = (idx < (currToken.length() - 1)) ? currToken.substring(idx + 1) : "";
1145                            encLasturl.append(key);
1146                            encLasturl.append("=");
1147                            encLasturl.append(CmsEncoder.escape(value,
1148                                cms.getRequestContext().getEncoding()));
1149                        }
1150                        else {
1151
1152                            // Something strange happened.
1153
// Maybe a parameter without "=" ?
1154
// Write back without encoding!
1155
encLasturl.append(currToken);
1156                        }
1157                    }
1158                }
1159                lasturl = encLasturl.toString();
1160            }
1161            session.putValue("lasturl", lasturl);
1162        }
1163        else {
1164            lasturl = (String JavaDoc)session.getValue("lasturl");
1165        }
1166        return lasturl;
1167    }
1168
1169    /**
1170     * Reads in the template file and starts the XML parser for the expected
1171     * content type <class>CmsXmlWpTemplateFile</code>
1172     *
1173     * @param cms CmsObject Object for accessing system resources.
1174     * @param templateFile Filename of the template file.
1175     * @param elementName Element name of this template in our parent template.
1176     * @param parameters Hashtable with all template class parameters.
1177     * @param templateSelector template section that should be processed.
1178     */

1179    public CmsXmlTemplateFile getOwnTemplateFile(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName,
1180            Hashtable JavaDoc parameters, String JavaDoc templateSelector) throws CmsException {
1181        CmsXmlWpTemplateFile xmlTemplateDocument = new CmsXmlWpTemplateFile(cms, templateFile);
1182        return xmlTemplateDocument;
1183    }
1184    
1185    /**
1186     * Checks if the current user is <strong>administrator</strong>.
1187     * <P>
1188     * This method is used by workplace icons to decide whether the icon should
1189     * be activated or not. Icons will use this method if the attribute <code>method="isAdministrator"</code>
1190     * is defined in the <code>&lt;ICON&gt;</code> tag.
1191     *
1192     * @param cms CmsObject Object for accessing system resources <em>(not used here)</em>.
1193     * @param lang reference to the currently valid language file <em>(not used here)</em>.
1194     * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
1195     * @return <code>true</code> if the current user is in the Administrators Group, <code>false</code> otherwise.
1196     * @throws CmsException if there were errors while accessing project data.
1197     */

1198    public Boolean JavaDoc isAdmin(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) throws CmsException {
1199        return new Boolean JavaDoc(cms.isAdmin());
1200    }
1201
1202    /**
1203     * Same as above, only that this returns always 'false'.
1204     * Can be used to quickly deactivate unwanted icons on the workplace even
1205     * for then admin by just adding "False" to isAdmin call in file property.
1206     */

1207    public Boolean JavaDoc isAdminFalse(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) throws CmsException {
1208        return new Boolean JavaDoc(false);
1209    }
1210    
1211    /**
1212     * Checks if the current user is the administrator <strong>Admin</strong>.
1213     * <P>
1214     * This method is used by workplace icons to decide whether the icon should
1215     * be activated or not.
1216     *
1217     * @param cms CmsObject Object for accessing system resources <em>(not used here)</em>.
1218     * @param lang reference to the currently valid language file <em>(not used here)</em>.
1219     * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
1220     * @return <code>true</code> if the current user is the user Admin, <code>false</code> otherwise.
1221     * @throws CmsException if there were errors while accessing project data.
1222     */

1223    public Boolean JavaDoc isTheAdminUser(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) throws CmsException {
1224        CmsRequestContext reqCont = cms.getRequestContext();
1225        if(cms.isAdmin()){
1226            return new Boolean JavaDoc(reqCont.currentUser().getName().equals(OpenCms.getDefaultUsers().getUserAdmin()));
1227        }else{
1228            return new Boolean JavaDoc(false);
1229        }
1230    }
1231
1232    /**
1233     * Indicates if the results of this class are cacheable.
1234     *
1235     * @param cms CmsObject Object for accessing system resources
1236     * @param templateFile Filename of the template file
1237     * @param elementName Element name of this template in our parent template.
1238     * @param parameters Hashtable with all template class parameters.
1239     * @param templateSelector template section that should be processed.
1240     * @return <EM>true</EM> if cacheable, <EM>false</EM> otherwise.
1241     */

1242    public boolean isCacheable(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName, Hashtable JavaDoc parameters, String JavaDoc templateSelector) {
1243        return false;
1244    }
1245
1246    /**
1247     * gets the caching information from the current template class.
1248     *
1249     * @param cms CmsObject Object for accessing system resources
1250     * @param templateFile Filename of the template file
1251     * @param elementName Element name of this template in our parent template.
1252     * @param parameters Hashtable with all template class parameters.
1253     * @param templateSelector template section that should be processed.
1254     * @return <EM>true</EM> if this class may stream it's results, <EM>false</EM> otherwise.
1255     */

1256    public CmsCacheDirectives getCacheDirectives(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName, Hashtable JavaDoc parameters, String JavaDoc templateSelector) {
1257        return new CmsCacheDirectives(false);
1258    }
1259
1260    /**
1261     * Indicates if the current template class is able to stream it's results
1262     * directly to the response oputput stream.
1263     * <P>
1264     * Classes must not set this feature, if they might throw special
1265     * exception that cause HTTP errors (e.g. 404/Not Found), or if they
1266     * might send HTTP redirects.
1267     * <p>
1268     * If a class sets this feature, it has to check the
1269     * isStreaming() property of the RequestContext. If this is set
1270     * to <code>true</code> the results must be streamed directly
1271     * to the output stream. If it is <code>false</code> the results
1272     * must not be streamed.
1273     * <P>
1274     * Complex classes that are able top include other subtemplates
1275     * have to check the streaming ability of their subclasses here!
1276     *
1277     * @param cms CmsObject Object for accessing system resources
1278     * @param templateFile Filename of the template file
1279     * @param elementName Element name of this template in our parent template.
1280     * @param parameters Hashtable with all template class parameters.
1281     * @param templateSelector template section that should be processed.
1282     * @return <EM>true</EM> if this class may stream it's results, <EM>false</EM> otherwise.
1283     */

1284    public boolean isStreamable(CmsObject cms, String JavaDoc templateFile, String JavaDoc elementName, Hashtable JavaDoc parameters, String JavaDoc templateSelector) {
1285        return false;
1286    }
1287
1288    /**
1289     * Checks if the current project is <STRONG>not</STRONG> the "Online" project.
1290     * <P>
1291     * This method is used by workplace icons to decide whether the icon should
1292     * be activated or not. Icons will use this method if the attribute <code>method="isNotOnlineProject"</code>
1293     * is defined in the <code>&lt;ICON&gt;</code> tag.
1294     *
1295     * @param cms CmsObject Object for accessing system resources <em>(not used here)</em>.
1296     * @param lang reference to the currently valid language file <em>(not used here)</em>.
1297     * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
1298     * @return <code>true</code> if the current project is the online project, <code>false</code> otherwise.
1299     * @throws CmsException if there were errors while accessing project data.
1300     */

1301    public Boolean JavaDoc isNotOnlineProject(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) throws CmsException {
1302        CmsRequestContext reqCont = cms.getRequestContext();
1303        return new Boolean JavaDoc(!reqCont.currentProject().isOnlineProject());
1304    }
1305
1306    /**
1307     * Checks if the current project is the "Online" project.
1308     * <P>
1309     * This method is used by workplace icons to decide whether the icon should
1310     * be activated or not. Icons will use this method if the attribute <code>method="isOnlineProject"</code>
1311     * is defined in the <code>&lt;ICON&gt;</code> tag.
1312     *
1313     * @param cms CmsObject Object for accessing system resources <em>(not used here)</em>.
1314     * @param lang reference to the currently valid language file <em>(not used here)</em>.
1315     * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
1316     * @return <code>true</code> if the current project is the online project, <code>false</code> otherwise.
1317     * @throws CmsException if there were errors while accessing project data.
1318     */

1319    public Boolean JavaDoc isOnlineProject(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) throws CmsException {
1320        CmsRequestContext reqCont = cms.getRequestContext();
1321        return new Boolean JavaDoc(reqCont.currentProject().isOnlineProject());
1322    }
1323
1324    /**
1325     * Checks if the current user is <STRONG>Project manager</STRONG>.
1326     * <P>
1327     * This method is used by workplace icons to decide whether the icon should
1328     * be activated or not. Icons will use this method if the attribute <code>method="isProjectManager"</code>
1329     * is defined in the <code>&lt;ICON&gt;</code> tag.
1330     *
1331     * @param cms CmsObject Object for accessing system resources <em>(not used here)</em>.
1332     * @param lang reference to the currently valid language file <em>(not used here)</em>.
1333     * @param parameters Hashtable containing all user parameters <em>(not used here)</em>.
1334     * @return <code>true</code> if the current project is the online project, <code>false</code> otherwise.
1335     * @throws CmsException if there were errors while accessing project data.
1336     */

1337    public Boolean JavaDoc isProjectManager(CmsObject cms, CmsXmlLanguageFile lang, Hashtable JavaDoc parameters) throws CmsException {
1338        return new Boolean JavaDoc(cms.isManagerOfProject());
1339    }
1340
1341    /**
1342     * User method to generate an URI for the system resources folder.<p>
1343     *
1344     * All pictures and style sheets should reside in the docroot of the webserver for
1345     * performance reasons. This folder can be mounted into the OpenCms system to
1346     * make it accessible for the OpenCms explorer.<p>
1347     *
1348     * The path to the docroot can be set in the workplace ini.<p>
1349     *
1350     * In any workplace template file, this method can be invoked by
1351     * <code>&lt;METHOD name="resourcesUri"&gt;<em>PictureName</em>&lt;/METHOD&gt;</code>.<p>
1352     *
1353     * <b>Warning:</b> Using this method, only workplace resources, usually residing
1354     * in the <code>/system/workplace/resources</code> folder, can be accessed.
1355     *
1356     * @param cms CmsObject Object for accessing system resources.
1357     * @param tagcontent Unused in this special case of a user method. Can be ignored.
1358     * @param doc Reference to the A_CmsXmlContent object of the initiating XML document <em>(not used here)</em>.
1359     * @param userObj Hashtable with parameters <em>(not used here)</em>.
1360     * @return String with the resources URI
1361     * @throws CmsException
1362     */

1363    public Object JavaDoc resourcesUri(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1364        if(m_resourcesUri == null) {
1365            CmsXmlWpConfigFile configFile = new CmsXmlWpConfigFile(cms);
1366            m_resourcesUri = configFile.getWpPicturePath();
1367        }
1368        if (tagcontent == null) return m_resourcesUri;
1369        return m_resourcesUri + tagcontent;
1370    }
1371    
1372    /**
1373     * User method to generate an URI for the system scripts folder.<p>
1374     *
1375     * @param cms CmsObject Object for accessing system resources.
1376     * @param tagcontent Unused in this special case of a user method. Can be ignored.
1377     * @param doc Reference to the A_CmsXmlContent object of the initiating XML document <em>(not used here)</em>.
1378     * @param userObj Hashtable with parameters <em>(not used here)</em>.
1379     * @return String with the scripts URI
1380     * @throws CmsException
1381     */

1382    public Object JavaDoc scriptsUri(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1383        if(m_scriptsUri == null) {
1384            m_scriptsUri = CmsXmlTemplateLoader.getRequest(cms.getRequestContext()).getServletUrl() + CmsWorkplaceDefault.C_VFS_PATH_SCRIPTS;
1385        }
1386        if (tagcontent == null) return m_scriptsUri;
1387        return m_scriptsUri + tagcontent;
1388    }
1389
1390    /**
1391     * @deprecated use {@link #resourcesUri(CmsObject, String, A_CmsXmlContent, Object)} instead
1392     */

1393    public Object JavaDoc picsUrl(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1394        return resourcesUri(cms, tagcontent, doc, userObj);
1395    }
1396    
1397    /**
1398     * User method to generate the JavaScript for the tree initialization.<p>
1399     *
1400     * @param cms CmsObject Object for accessing system resources.
1401     * @param tagcontent Unused in this special case of a user method. Can be ignored.
1402     * @param doc Reference to the A_CmsXmlContent object of the initiating XML document <em>(not used here)</em>.
1403     * @param userObj Hashtable with parameters <em>(not used here)</em>.
1404     * @return String with the JavaScript for the tree initialization
1405     * @throws CmsException if something goes wrong
1406     */

1407    public Object JavaDoc initTree(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1408        String JavaDoc skinUri = CmsXmlTemplateLoader.getRequest(cms.getRequestContext()).getWebAppUrl() + "/resources/";
1409        return CmsTree.initTree(cms, cms.getRequestContext().getEncoding(), skinUri);
1410    }
1411    
1412    /**
1413     * Starts the processing of the given template file by calling the
1414     * <code>getProcessedTemplateContent()</code> method of the content defintition
1415     * of the corresponding content type.
1416     * <P>
1417     * Any exceptions thrown while processing the template will be caught,
1418     * printed and and thrown again.
1419     *
1420     * @param cms CmsObject Object for accessing system resources.
1421     * @param xmlTemplateDocument XML parsed document of the content type "XML template file" or
1422     * any derived content type.
1423     * @param elementName Element name of this template in our parent template.
1424     * @param parameters Hashtable with all template class parameters.
1425     * @param templateSelector template section that should be processed.
1426     * @return Content of the template and all subtemplates.
1427     * @throws CmsException
1428     */

1429    protected byte[] startProcessing(CmsObject cms, CmsXmlTemplateFile xmlTemplateDocument, String JavaDoc elementName,
1430            Hashtable JavaDoc parameters, String JavaDoc templateSelector) throws CmsException {
1431
1432        // checks if the access was with the correct port. If not it sends a not found error
1433
if( checkPort(cms) ) {
1434            String JavaDoc lasturl = getLastUrl(cms, parameters);
1435            // Since we are in the workplace, no browser caching is allowed here.
1436
// Set all caching information to "no-cache".
1437
// Don't bother about the internal caching here! Workplace users should be forced
1438
// to reload the workplace pages at every request.
1439
//HTTP 1.1
1440
CmsXmlTemplateLoader.getResponse(cms.getRequestContext()).setHeader("Cache-Control", "no-cache");
1441            //HTTP 1.0
1442
CmsXmlTemplateLoader.getResponse(cms.getRequestContext()).setHeader("Pragma", "no-cache");
1443            ((CmsXmlWpTemplateFile)xmlTemplateDocument).setData("lasturl", lasturl);
1444            return super.startProcessing(cms, xmlTemplateDocument, elementName, parameters, templateSelector);
1445        } else {
1446            throw new CmsLegacyException("No access to the workplace with this port", CmsLegacyException.C_NOT_FOUND);
1447        }
1448    }
1449
1450    /**
1451     * Checks, if the request is running on the correct port. With the opencms.properties
1452     * the access to the workplace can be limitted to a user defined port. With this
1453     * feature a firewall can block all outside requests to this port with the result
1454     * the workplace is only available in the local net segment.
1455     * @param cms the CmsObject to check the port with.
1456     */

1457    protected boolean checkPort(CmsObject cms) {
1458        return true;
1459    }
1460
1461    /**
1462     * User method to get the name of the user.
1463     *
1464     * @param cms CmsObject Object for accessing system resources.
1465     * @param tagcontent Unused in this special case of a user method. Can be ignored.
1466     * @param doc Reference to the A_CmsXmlContent object of the initiating XLM document <em>(not used here)</em>.
1467     * @param userObj Hashtable with parameters <em>(not used here)</em>.
1468     * @return String with the pics URL.
1469     * @throws CmsException
1470     */

1471    public Object JavaDoc userName(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1472        return CmsUser.getFullName(cms.getRequestContext().currentUser());
1473    }
1474    
1475
1476    /**
1477     * Returns the explorer file URI (required for compatibility to the JSP workplace).<p>
1478     *
1479     * @param cms for accessing system resources.
1480     * @param tagcontent additional parameter passed to the method <em>(not used here)</em>.
1481     * @param doc reference to the A_CmsXmlContent object of the initiating XML document <em>(not used here)</em>.
1482     * @param userObj Hashtable with parameters <em>(not used here)</em>.
1483     * @return String the explorer file URI
1484     * @throws CmsException if something goes wring
1485     */

1486    public Object JavaDoc explorerFileUri(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1487        return CmsWorkplaceAction.getExplorerFileUri(CmsXmlTemplateLoader.getRequest(cms.getRequestContext()).getOriginalRequest());
1488    }
1489    
1490    /**
1491     * Returns the explorer file URI with the full path, including context
1492     * (required for compatibility to the JSP workplace).<p>
1493     *
1494     * @param cms for accessing system resources.
1495     * @param tagcontent additional parameter passed to the method <em>(not used here)</em>.
1496     * @param doc reference to the A_CmsXmlContent object of the initiating XML document <em>(not used here)</em>.
1497     * @param userObj Hashtable with parameters <em>(not used here)</em>.
1498     * @return String the explorer file URI
1499     * @throws CmsException if something goes wring
1500     */

1501    public Object JavaDoc explorerFileFullUri(CmsObject cms, String JavaDoc tagcontent, A_CmsXmlContent doc, Object JavaDoc userObj) throws CmsException {
1502        return CmsWorkplaceAction.getExplorerFileFullUri(cms, CmsXmlTemplateLoader.getRequest(cms.getRequestContext()).getOriginalRequest());
1503    }
1504}
1505
Popular Tags