KickJava   Java API By Example, From Geeks To Geeks.

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


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

31
32 package org.opencms.workplace.commons;
33
34 import org.opencms.file.CmsProject;
35 import org.opencms.file.CmsProperty;
36 import org.opencms.file.CmsPropertyDefinition;
37 import org.opencms.file.CmsResource;
38 import org.opencms.file.CmsResourceFilter;
39 import org.opencms.file.types.CmsResourceTypeXmlPage;
40 import org.opencms.i18n.CmsEncoder;
41 import org.opencms.jsp.CmsJspActionElement;
42 import org.opencms.lock.CmsLock;
43 import org.opencms.main.CmsException;
44 import org.opencms.main.CmsLog;
45 import org.opencms.main.OpenCms;
46 import org.opencms.security.CmsPermissionSet;
47 import org.opencms.util.CmsRequestUtil;
48 import org.opencms.util.CmsStringUtil;
49 import org.opencms.util.CmsUriSplitter;
50 import org.opencms.workplace.CmsDialogSelector;
51 import org.opencms.workplace.CmsTabDialog;
52 import org.opencms.workplace.CmsWorkplace;
53 import org.opencms.workplace.CmsWorkplaceSettings;
54 import org.opencms.workplace.I_CmsDialogHandler;
55 import org.opencms.workplace.explorer.CmsExplorerTypeSettings;
56
57 import java.io.IOException JavaDoc;
58 import java.util.ArrayList JavaDoc;
59 import java.util.Collections JavaDoc;
60 import java.util.HashMap JavaDoc;
61 import java.util.Iterator JavaDoc;
62 import java.util.List JavaDoc;
63 import java.util.Map JavaDoc;
64 import java.util.RandomAccess JavaDoc;
65
66 import javax.servlet.ServletException JavaDoc;
67 import javax.servlet.http.HttpServletRequest JavaDoc;
68 import javax.servlet.http.HttpServletResponse JavaDoc;
69 import javax.servlet.jsp.JspException JavaDoc;
70 import javax.servlet.jsp.PageContext JavaDoc;
71
72 import org.apache.commons.logging.Log;
73
74 /**
75  * Provides methods for the properties dialog.<p>
76  *
77  * The following files use this class:
78  * <ul>
79  * <li>/commons/property_advanced.jsp
80  * </ul>
81  * <p>
82  *
83  * @author Andreas Zahner
84  *
85  * @version $Revision: 1.28 $
86  *
87  * @since 6.0.0
88  */

89 public class CmsPropertyAdvanced extends CmsTabDialog implements I_CmsDialogHandler {
90
91     /** Value for the action: save defined property. */
92     public static final int ACTION_SAVE_DEFINE = 400;
93     /** Value for the action: save edited properties. */
94     public static final int ACTION_SAVE_EDIT = 300;
95     /** Value for the action: show define property form. */
96     public static final int ACTION_SHOW_DEFINE = 200;
97     /** Value for the action: show edit properties form. */
98     public static final int ACTION_SHOW_EDIT = 100;
99
100     /** Constant for the "Define" button in the build button method. */
101     public static final int BUTTON_DEFINE = 201;
102     /** Constant for the "Finish" button in the build button method. */
103     public static final int BUTTON_FINISH = 202;
104
105     /** Request parameter value for the action: save defined property. */
106     public static final String JavaDoc DIALOG_SAVE_DEFINE = "savedefine";
107     /** Request parameter value for the action: save edited properties. */
108     public static final String JavaDoc DIALOG_SAVE_EDIT = "saveedit";
109     /** Request parameter value for the action: show information form. */
110     public static final String JavaDoc DIALOG_SHOW_DEFAULT = "default";
111     /** Request parameter value for the action: show define property form. */
112     public static final String JavaDoc DIALOG_SHOW_DEFINE = "define";
113     /** Request parameter value for the action: show edit properties form. */
114     public static final String JavaDoc DIALOG_SHOW_EDIT = "edit";
115
116     /** The dialog type. */
117     public static final String JavaDoc DIALOG_TYPE = "property";
118
119     /** Value for the dialog mode: new resource wizard. */
120     public static final String JavaDoc MODE_WIZARD = "wizard";
121     /** Value for the dialog mode: new resource wizard with creation of index page for new folder. */
122     public static final String JavaDoc MODE_WIZARD_CREATEINDEX = "wizardcreateindex";
123     /** Value for the dialog mode: new resource wizard with index page created in new folder. */
124     public static final String JavaDoc MODE_WIZARD_INDEXCREATED = "wizardindexcreated";
125
126     /** Key name for the resource panel. */
127     public static final String JavaDoc PANEL_RESOURCE = "panel.properties.resource";
128     /** Key name for the structure panel. */
129     public static final String JavaDoc PANEL_STRUCTURE = "panel.properties.structure";
130
131     /** Request parameter name for the new property definition. */
132     public static final String JavaDoc PARAM_DIALOGMODE = "dialogmode";
133     /** Request parameter name for the new property definition. */
134     public static final String JavaDoc PARAM_NEWPROPERTY = "newproperty";
135
136     /** Prefix for the hidden fields. */
137     public static final String JavaDoc PREFIX_HIDDEN = "valhidden";
138     /** Prefix for the hidden resource value. */
139     public static final String JavaDoc PREFIX_RESOURCE = "valresource";
140     /** Prefix for the hidden structure value. */
141     public static final String JavaDoc PREFIX_STRUCTURE = "valstructure";
142     /** Prefix for the use property checkboxes. */
143     public static final String JavaDoc PREFIX_USEPROPERTY = "useprop";
144     /** Prefix for the input values. */
145     public static final String JavaDoc PREFIX_VALUE = "valprop";
146     
147     /** Name for the shared (resource) property tab. */
148     public static final String JavaDoc TAB_RESOURCE = "tabres";
149     /** Name for the individual (structure) property tab. */
150     public static final String JavaDoc TAB_STRUCTURE = "tabstr";
151
152     /** The URI to the customized property dialog. */
153     public static final String JavaDoc URI_PROPERTY_CUSTOM_DIALOG = PATH_DIALOGS + "property_custom.jsp";
154
155     /** The URI to the standard property dialog. */
156     public static final String JavaDoc URI_PROPERTY_DIALOG = PATH_DIALOGS + "property_advanced.jsp";
157
158     /** The URI to the property dialog handler. */
159     public static final String JavaDoc URI_PROPERTY_DIALOG_HANDLER = PATH_DIALOGS + "property.jsp";
160
161     /** The log object for this class. */
162     private static final Log LOG = CmsLog.getLog(CmsPropertyAdvanced.class);
163
164     /** Helper object storing the current editable state of the resource. */
165     private Boolean JavaDoc m_isEditable;
166
167     /** Helper to determine if the edited resource is a folder. */
168     private boolean m_isFolder;
169
170     /** Helper stores the mode this dialog is in, because it can be called from "new" wizard. */
171     private String JavaDoc m_paramDialogMode;
172
173     /** Request parameter members. */
174     private String JavaDoc m_paramNewproperty;
175     private String JavaDoc m_paramUseTempfileProject;
176
177     /** Stores the values of properties in a String array. */
178     private List JavaDoc m_propertyValues;
179
180     /** Helper to determine if the user switched the tab views of the dialog. */
181     private boolean m_tabSwitched;
182
183     /**
184      * Default constructor needed for dialog handler implementation.<p>
185      *
186      * Do not use this constructor on JSP pages.<p>
187      */

188     public CmsPropertyAdvanced() {
189
190         super(null);
191     }
192
193     /**
194      * Public constructor with JSP action element.<p>
195      *
196      * @param jsp an initialized JSP action element
197      */

198     public CmsPropertyAdvanced(CmsJspActionElement jsp) {
199
200         super(jsp);
201     }
202
203     /**
204      * Public constructor with JSP variables.<p>
205      *
206      * @param context the JSP page context
207      * @param req the JSP request
208      * @param res the JSP response
209      */

210     public CmsPropertyAdvanced(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
211
212         this(new CmsJspActionElement(context, req, res));
213     }
214
215     /**
216      * Transforms a list of CmsProperty objects with structure and resource values into a map with
217      * CmsProperty object values keyed by property keys.<p>
218      *
219      * @param list a list of CmsProperty objects
220      * @return a map with CmsPropery object values keyed by property keys
221      */

222     public static Map JavaDoc getPropertyMap(List JavaDoc list) {
223
224         Map JavaDoc result = null;
225         String JavaDoc key = null;
226         CmsProperty property = null;
227
228         if (list == null || list.size() == 0) {
229             return Collections.EMPTY_MAP;
230         }
231
232         result = new HashMap JavaDoc();
233
234         // choose the fastest method to iterate the list
235
if (list instanceof RandomAccess JavaDoc) {
236             for (int i = 0, n = list.size(); i < n; i++) {
237                 property = (CmsProperty)list.get(i);
238                 key = property.getName();
239                 result.put(key, property);
240             }
241         } else {
242             Iterator JavaDoc i = list.iterator();
243             while (i.hasNext()) {
244                 property = (CmsProperty)i.next();
245                 key = property.getName();
246                 result.put(key, property);
247             }
248         }
249
250         return result;
251     }
252
253     /**
254      * Used to close the current JSP dialog.<p>
255      *
256      * This method overwrites the close dialog method in the super class,
257      * because in case a new folder is created, after this dialog a new xml page might be created.<p>
258      *
259      * It tries to include the URI stored in the workplace settings.
260      * This URI is determined by the frame name, which has to be set
261      * in the framename parameter.<p>
262      *
263      * @throws JspException if including an element fails
264      */

265     public void actionCloseDialog() throws JspException JavaDoc {
266
267         if (getAction() == ACTION_SAVE_EDIT && MODE_WIZARD_CREATEINDEX.equals(getParamDialogmode())) {
268             // special case: a new xmlpage resource will be created in wizard mode after closing the dialog
269
String JavaDoc newFolder = getParamResource();
270             if (!newFolder.endsWith("/")) {
271                 newFolder += "/";
272             }
273             // set the current explorer resource to the new created folder
274
getSettings().setExplorerResource(newFolder);
275             String JavaDoc newUri = PATH_DIALOGS
276                 + OpenCms.getWorkplaceManager().getExplorerTypeSetting(CmsResourceTypeXmlPage.getStaticTypeName()).getNewResourceUri();
277             try {
278                 // forward to new xmlpage dialog
279
CmsUriSplitter splitter = new CmsUriSplitter(newUri);
280                 Map JavaDoc params = CmsRequestUtil.createParameterMap(splitter.getQuery());
281                 params.put(PARAM_DIALOGMODE, MODE_WIZARD_CREATEINDEX);
282                 sendForward(splitter.getPrefix(), params);
283                 return;
284             } catch (IOException JavaDoc e) {
285                 LOG.error(Messages.get().getBundle().key(Messages.ERR_REDIRECT_XMLPAGE_DIALOG_1, PATH_DIALOGS + newUri));
286             } catch (ServletException JavaDoc e) {
287                 LOG.error(Messages.get().getBundle().key(Messages.ERR_REDIRECT_XMLPAGE_DIALOG_1, PATH_DIALOGS + newUri));
288             }
289         } else if (getAction() == ACTION_SAVE_EDIT && MODE_WIZARD.equals(getParamDialogmode())) {
290             // set request attribute to reload the folder tree after creating a folder in wizard mode
291
try {
292                 CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);
293                 if (res.isFolder()) {
294                     List JavaDoc folderList = new ArrayList JavaDoc(1);
295                     folderList.add(CmsResource.getParentFolder(getParamResource()));
296                     getJsp().getRequest().setAttribute(REQUEST_ATTRIBUTE_RELOADTREE, folderList);
297                 }
298             } catch (CmsException e) {
299                 // should usually never happen
300
if (LOG.isInfoEnabled()) {
301                     LOG.info(e.getLocalizedMessage());
302                 }
303             }
304         } else if (MODE_WIZARD_INDEXCREATED.equals(getParamDialogmode())) {
305             // set request attribute to reload the folder tree after creating an xml page in a new created folder in wizard mode
306
getSettings().setExplorerResource(
307                 CmsResource.getParentFolder(CmsResource.getParentFolder(getParamResource())));
308             List JavaDoc folderList = new ArrayList JavaDoc(1);
309             folderList.add(CmsResource.getParentFolder(CmsResource.getParentFolder(getParamResource())));
310             getJsp().getRequest().setAttribute(REQUEST_ATTRIBUTE_RELOADTREE, folderList);
311         }
312         super.actionCloseDialog();
313     }
314
315     /**
316      * Performs the define property action, will be called by the JSP page.<p>
317      *
318      * @throws JspException if problems including sub-elements occur
319      */

320     public void actionDefine() throws JspException JavaDoc {
321
322         // save initialized instance of this class in request attribute for included sub-elements
323
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
324         try {
325             performDefineOperation();
326             // set the request parameters before returning to the overview
327
setParamAction(DIALOG_SHOW_DEFAULT);
328             setParamNewproperty(null);
329             sendForward(CmsWorkplace.VFS_PATH_COMMONS + "property_advanced.jsp", paramsAsParameterMap());
330         } catch (Throwable JavaDoc e) {
331             // error defining property, show error dialog
332
includeErrorpage(this, e);
333         }
334     }
335
336     /**
337      * Deletes the current resource if the dialog is in wizard mode.<p>
338      *
339      * If the dialog is not in wizard mode, the resource is not deleted.<p>
340      *
341      * @throws JspException if including the error page fails
342      */

343     public void actionDeleteResource() throws JspException JavaDoc {
344
345         if (getParamDialogmode() != null && getParamDialogmode().startsWith(MODE_WIZARD)) {
346             // only delete resource if dialog mode is a wizard mode
347
try {
348                 getCms().deleteResource(getParamResource(), CmsResource.DELETE_PRESERVE_SIBLINGS);
349             } catch (Throwable JavaDoc e) {
350                 // error deleting the resource, show error dialog
351
includeErrorpage(this, e);
352             }
353         }
354     }
355
356     /**
357      * Performs the edit properties action, will be called by the JSP page.<p>
358      *
359      * @param request the HttpServletRequest
360      * @throws JspException if problems including sub-elements occur
361      */

362     public void actionEdit(HttpServletRequest JavaDoc request) throws JspException JavaDoc {
363
364         // save initialized instance of this class in request attribute for included sub-elements
365
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
366         try {
367             if (isEditable()) {
368                 performDialogOperation(request);
369             }
370         } catch (Throwable JavaDoc e) {
371             // error editing property, show error dialog
372
includeErrorpage(this, e);
373         }
374     }
375
376     /**
377      * Creates the HTML String for the active properties overview of the current resource.<p>
378      *
379      * @return the HTML output String for active properties of the resource
380      */

381     public String JavaDoc buildActivePropertiesList() {
382
383         StringBuffer JavaDoc retValue = new StringBuffer JavaDoc(256);
384         List JavaDoc propertyDef = new ArrayList JavaDoc();
385         try {
386             // get all property definitions
387
propertyDef = getCms().readAllPropertyDefinitions();
388         } catch (CmsException e) {
389             // should usually never happen
390
if (LOG.isInfoEnabled()) {
391                 LOG.info(e.getLocalizedMessage());
392             }
393         }
394
395         Iterator JavaDoc j = propertyDef.iterator();
396         int i = 0;
397         while (j.hasNext()) {
398             CmsPropertyDefinition curProperty = (CmsPropertyDefinition)j.next();
399             retValue.append(CmsEncoder.escapeXml(curProperty.getName()));
400             if ((i + 1) < propertyDef.size()) {
401                 retValue.append("<br>");
402             }
403             i++;
404         }
405
406         return retValue.toString();
407     }
408
409     /**
410      * Creates the HTML String for the edit properties form.<p>
411      *
412      * The values of the form are set delayed, have a look at the
413      * JavaDoc of buildSetFormValues() for a detailed description.<p>
414      *
415      * @return the HTML output String for the edit properties form
416      */

417     public String JavaDoc buildEditForm() {
418
419         StringBuffer JavaDoc result = new StringBuffer JavaDoc(4096);
420
421         // get currently active tab
422
String JavaDoc activeTab = getActiveTabName();
423
424         // initialize "disabled" attribute for the input fields
425
String JavaDoc disabled = "";
426         if (!isEditable()) {
427             disabled = " disabled=\"disabled\"";
428         }
429
430         // get all properties for the resource
431
List JavaDoc properties = getPropertyValues();
432
433         // check for presence of property definitions, should always be true
434
if (properties.size() > 0) {
435             // there are properties defined for this resource, build the form list
436
result.append("<table border=\"0\">\n");
437             result.append("<tr>\n");
438             result.append("\t<td class=\"textbold\">");
439             result.append(key(Messages.GUI_PROPERTY_0));
440             result.append("</td>\n");
441             result.append("\t<td class=\"textbold\">");
442             result.append(key(Messages.GUI_PROPERTY_VALUE_0));
443             result.append("</td>\n");
444             result.append("\t<td class=\"textbold\" style=\"white-space: nowrap;\">");
445             result.append(key(Messages.GUI_PROPERTY_USED_0));
446             result.append("</td>\n");
447             result.append("</tr>\n");
448             result.append("<tr><td colspan=\"3\"><span style=\"height: 6px;\"></span></td></tr>\n");
449
450             // show all possible properties for the resource
451
Iterator JavaDoc i = properties.iterator();
452             while (i.hasNext()) {
453                 String JavaDoc[] curProp = (String JavaDoc[])i.next();
454                 // create a single property row
455
result.append(buildPropertyRow(curProp[0], curProp[1], curProp[2], curProp[3], disabled, activeTab));
456             }
457             result.append("</table>");
458         } else {
459             // there are no properties defined for this resource, show nothing (should never happen)
460
result.append(key(Messages.GUI_PROPERTY_ADVANCED_NO_PROPDEFS_0));
461         }
462         return result.toString();
463     }
464
465     /**
466      * Builds the JavaScript to set the property form values delayed.<p>
467      *
468      * The values of the properties are not inserted directly in the &lt;input&gt; tag,
469      * because there is a display issue when the property values are very long.
470      * This method creates JavaScript to set the property input field values delayed.
471      * On the JSP, the code which is created from this method has to be executed delayed after
472      * the creation of the html form, e.g. in the &lt;body&gt; tag with the attribute
473      * onload="window.setTimeout('doSet()',50);".<p>
474      *
475      * @return the JavaScript to set the property form values delayed
476      */

477     public String JavaDoc buildSetFormValues() {
478
479         StringBuffer JavaDoc result = new StringBuffer JavaDoc(1024);
480         // get currently active tab
481
String JavaDoc activeTab = getActiveTabName();
482         // get structure panel name
483
String JavaDoc structurePanelName = key(Messages.GUI_PROPERTIES_INDIVIDUAL_0);
484         Iterator JavaDoc i = getPropertyValues().iterator();
485         while (i.hasNext()) {
486             String JavaDoc[] curProp = (String JavaDoc[])i.next();
487             // determine the shown value
488
String JavaDoc shownValue = curProp[1];
489             // in "shared properties" form, show resource value if no structure value is set
490
if (structurePanelName.equals(activeTab) && "".equals(curProp[2]) && !"".equals(curProp[3])) {
491                 shownValue = curProp[3];
492             }
493             if (!"".equals(shownValue)) {
494                 // create the JS output for a single property if not empty
495
result.append("\tdocument.getElementById(\"");
496                 result.append(PREFIX_VALUE);
497                 result.append(curProp[0]);
498                 result.append("\").value = \"");
499                 result.append(CmsStringUtil.escapeJavaScript(shownValue));
500                 result.append("\";\n");
501             }
502
503         }
504         return result.toString();
505     }
506
507     /**
508      * Builds a button row with an "Ok", a "Cancel" and a "Define" button.<p>
509      *
510      * @return the button row
511      */

512     public String JavaDoc dialogButtonsOkCancelDefine() {
513
514         if (isEditable()) {
515             int okButton = BUTTON_OK;
516             if (getParamDialogmode() != null && getParamDialogmode().startsWith(MODE_WIZARD)) {
517                 // in wizard mode, display finish button instead of ok button
518
okButton = BUTTON_FINISH;
519             }
520             return dialogButtons(new int[] {okButton, BUTTON_CANCEL, BUTTON_DEFINE}, new String JavaDoc[] {
521                 null,
522                 null,
523                 "onclick=\"definePropertyForm();\""});
524         } else {
525             return dialogButtons(new int[] {BUTTON_CLOSE}, new String JavaDoc[] {null});
526
527         }
528     }
529
530     /**
531      * @see org.opencms.workplace.I_CmsDialogHandler#getDialogHandler()
532      */

533     public String JavaDoc getDialogHandler() {
534
535         return CmsDialogSelector.DIALOG_PROPERTY;
536     }
537
538     /**
539      * @see org.opencms.workplace.I_CmsDialogHandler#getDialogUri(java.lang.String, CmsJspActionElement)
540      */

541     public String JavaDoc getDialogUri(String JavaDoc resource, CmsJspActionElement jsp) {
542
543         try {
544             CmsResource res = jsp.getCmsObject().readResource(resource, CmsResourceFilter.ALL);
545             if (res.getTypeId() == CmsResourceTypeXmlPage.getStaticTypeId()) {
546                 // display special property dialog for xmlpage types
547
return PATH_WORKPLACE + "editors/dialogs/property.jsp";
548             }
549             String JavaDoc resTypeName = OpenCms.getResourceManager().getResourceType(res.getTypeId()).getTypeName();
550             // get settings for resource type
551
CmsExplorerTypeSettings settings = getSettingsForType(resTypeName);
552             if (settings.isPropertiesEnabled()) {
553                 // special properties for this type enabled, display customized dialog
554
return URI_PROPERTY_CUSTOM_DIALOG;
555             }
556         } catch (CmsException e) {
557             // should usually never happen
558
if (LOG.isInfoEnabled()) {
559                 LOG.info(e.getLocalizedMessage());
560             }
561         }
562         return URI_PROPERTY_DIALOG;
563     }
564
565     /**
566      * Returns the value of the dialogmode parameter,
567      * or null if this parameter was not provided.<p>
568      *
569      * The dialogmode parameter stores the different modes of the property dialog,
570      * e.g. for displaying other buttons in the new resource wizard.<p>
571      *
572      * @return the value of the usetempfileproject parameter
573      */

574     public String JavaDoc getParamDialogmode() {
575
576         return m_paramDialogMode;
577     }
578
579     /**
580      * Returns the value of the new property parameter,
581      * or null if this parameter was not provided.<p>
582      *
583      * The new property parameter stores the name of the
584      * new defined property.<p>
585      *
586      * @return the value of the new property parameter
587      */

588     public String JavaDoc getParamNewproperty() {
589
590         return m_paramNewproperty;
591     }
592
593     /**
594      * Returns the value of the usetempfileproject parameter,
595      * or null if this parameter was not provided.<p>
596      *
597      * The usetempfileproject parameter stores if the file resides
598      * in the temp file project.<p>
599      *
600      * @return the value of the usetempfileproject parameter
601      */

602     public String JavaDoc getParamUsetempfileproject() {
603
604         return m_paramUseTempfileProject;
605     }
606
607     /**
608      * @see org.opencms.workplace.CmsTabDialog#getTabParameterOrder()
609      */

610     public List JavaDoc getTabParameterOrder() {
611
612         ArrayList JavaDoc orderList = new ArrayList JavaDoc(2);
613         orderList.add(TAB_STRUCTURE);
614         orderList.add(TAB_RESOURCE);
615         return orderList;
616     }
617
618     /**
619      * @see org.opencms.workplace.CmsTabDialog#getTabs()
620      */

621     public List JavaDoc getTabs() {
622
623         ArrayList JavaDoc tabList = new ArrayList JavaDoc(2);
624         if (OpenCms.getWorkplaceManager().isEnableAdvancedPropertyTabs()) {
625             // tabs are enabled, show both tabs except for folders
626
if (m_isFolder) {
627                 // resource is a folder, show only the individual properties tab
628
tabList.add(key(Messages.GUI_PROPERTIES_INDIVIDUAL_0));
629             } else {
630                 // resource is no folder, show both tabs
631
tabList.add(key(Messages.GUI_PROPERTIES_INDIVIDUAL_0));
632                 tabList.add(key(Messages.GUI_PROPERTIES_SHARED_0));
633             }
634         } else {
635             // tabs are disabled, show only the configured tab except for folders
636
if (m_isFolder || OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) {
637                 tabList.add(key(Messages.GUI_PROPERTIES_INDIVIDUAL_0));
638             } else {
639                 tabList.add(key(Messages.GUI_PROPERTIES_SHARED_0));
640             }
641         }
642         return tabList;
643     }
644
645     /**
646      * Sets the value of the dialogmode parameter.<p>
647      *
648      * @param value the value to set
649      */

650     public void setParamDialogmode(String JavaDoc value) {
651
652         m_paramDialogMode = value;
653     }
654
655     /**
656      * Sets the value of the new property parameter.<p>
657      *
658      * @param value the value to set
659      */

660     public void setParamNewproperty(String JavaDoc value) {
661
662         m_paramNewproperty = value;
663     }
664
665     /**
666      * Sets the value of the usetempfileproject parameter.<p>
667      *
668      * @param value the value to set
669      */

670     public void setParamUsetempfileproject(String JavaDoc value) {
671
672         m_paramUseTempfileProject = value;
673     }
674
675     /**
676      * @see org.opencms.workplace.CmsDialog#dialogButtonsHtml(java.lang.StringBuffer, int, java.lang.String)
677      */

678     protected void dialogButtonsHtml(StringBuffer JavaDoc result, int button, String JavaDoc attribute) {
679
680         attribute = appendDelimiter(attribute);
681
682         switch (button) {
683             case BUTTON_DEFINE:
684                 result.append("<input name=\"define\" type=\"button\" value=\"");
685                 result.append(key(Messages.GUI_PROPERTY_DEFINE_0));
686                 result.append("\" class=\"dialogbutton\"");
687                 result.append(attribute);
688                 result.append(">\n");
689                 break;
690             case BUTTON_FINISH:
691                 result.append("<input name=\"finish\" type=\"submit\" value=\"");
692                 result.append(key(Messages.GUI_PROPERTY_FINISH_0));
693                 result.append("\" class=\"dialogbutton\"");
694                 result.append(attribute);
695                 result.append(">\n");
696                 break;
697             default:
698                 super.dialogButtonsHtml(result, button, attribute);
699         }
700     }
701
702     /**
703      * Returns the explorer type settings of the resource type, considering eventual references to another type.<p>
704      *
705      * @param resTypeName the resource type name
706      * @return the explorer type settings of the resource type
707      */

708     protected CmsExplorerTypeSettings getSettingsForType(String JavaDoc resTypeName) {
709         
710         // get settings for resource type
711
CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(resTypeName);
712         if (CmsStringUtil.isNotEmpty(settings.getReference())) {
713             // refers to another resource type, get settings of referred type
714
settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(settings.getReference());
715         }
716         return settings;
717     }
718
719     /**
720      * @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
721      */

722     protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest JavaDoc request) {
723
724         // fill the parameter values in the get/set methods
725
fillParamValues(request);
726
727         // get the active tab from request parameter or display first tab
728
getActiveTab();
729
730         // check the resource type of the edited resource
731
m_isFolder = false;
732         try {
733             CmsResource resource = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);
734             if (resource.isFolder()) {
735                 m_isFolder = true;
736                 if (!getParamResource().endsWith("/")) {
737                     // append folder separator to resource name
738
setParamResource(getParamResource() + "/");
739                 }
740             }
741         } catch (CmsException e) {
742             // error reading resource, log the error
743
LOG.error(e.getLocalizedMessage());
744         }
745
746         // set the dialog type
747
setParamDialogtype(DIALOG_TYPE);
748         boolean isPopup = Boolean.valueOf(getParamIsPopup()).booleanValue();
749         // set the action for the JSP switch
750
if (DIALOG_SHOW_DEFINE.equals(getParamAction())) {
751             setAction(ACTION_SHOW_DEFINE);
752             setParamTitle(key(Messages.GUI_PROPERTY_NEW_DEF_1, new Object JavaDoc[] {CmsResource.getName(getParamResource())}));
753         } else if (DIALOG_SAVE_EDIT.equals(getParamAction())) {
754             if (isPopup) {
755                 setAction(ACTION_CLOSEPOPUP_SAVE);
756             } else {
757                 setAction(ACTION_SAVE_EDIT);
758             }
759         } else if (DIALOG_SAVE_DEFINE.equals(getParamAction())) {
760             setAction(ACTION_SAVE_DEFINE);
761         } else if (DIALOG_CANCEL.equals(getParamAction())) {
762             if (isPopup) {
763                 setAction(ACTION_CLOSEPOPUP);
764             } else {
765                 setAction(ACTION_CANCEL);
766             }
767         } else {
768             // set the default action: show edit form
769
setAction(ACTION_DEFAULT);
770             if (!isEditable()) {
771                 setParamTitle(key(Messages.GUI_PROPERTIES_OF_1,
772                     new Object JavaDoc[] {CmsResource.getName(getParamResource())}));
773             } else {
774                 setParamTitle(key(Messages.GUI_PROPERTIES_EDIT_1,
775                     new Object JavaDoc[] {CmsResource.getName(getParamResource())}));
776             }
777             // check if the user switched a tab
778
m_tabSwitched = false;
779             if (DIALOG_SWITCHTAB.equals(getParamAction())) {
780                 m_tabSwitched = true;
781             }
782         }
783     }
784
785     /**
786      * Returns whether the properties are editable or not depending on the lock state of the resource and the current project.<p>
787      *
788      * @return true if properties are editable, otherwise false
789      */

790     protected boolean isEditable() {
791
792         if (m_isEditable == null) {
793
794             if (getCms().getRequestContext().currentProject().getId() == CmsProject.ONLINE_PROJECT_ID
795                 || !getCms().isInsideCurrentProject(getParamResource())) {
796                 // we are in the online project or resource does not belong to project, no editing allowed
797
m_isEditable = new Boolean JavaDoc(false);
798
799             } else {
800                 // we are in an offline project
801

802                 // check permissions
803
if (!checkResourcePermissions(CmsPermissionSet.ACCESS_WRITE, false)) {
804                     getSettings().setErrorMessage(null);
805                     m_isEditable = new Boolean JavaDoc(false);
806                     return m_isEditable.booleanValue();
807                 }
808
809                 // check lock state
810
String JavaDoc resourceName = getParamResource();
811                 CmsResource file = null;
812                 CmsLock lock = null;
813                 try {
814                     file = getCms().readResource(resourceName, CmsResourceFilter.ALL);
815                     // check if resource is a folder
816
if (file.isFolder() && !resourceName.endsWith("/")) {
817                         resourceName += "/";
818                     }
819                 } catch (CmsException e) {
820                     // should usually never happen
821
if (LOG.isInfoEnabled()) {
822                         LOG.info(e.getLocalizedMessage());
823                     }
824                 }
825
826                 try {
827                     // get the lock for the resource
828
lock = getCms().getLock(resourceName);
829                 } catch (CmsException e) {
830                     lock = CmsLock.getNullLock();
831
832                     if (LOG.isErrorEnabled()) {
833                         LOG.error(e.getLocalizedMessage(), e);
834                     }
835                 }
836
837                 if (!lock.isNullLock()) {
838                     // determine if resource is editable...
839
if (lock.getType() != CmsLock.TYPE_SHARED_EXCLUSIVE
840                         && lock.getType() != CmsLock.TYPE_SHARED_INHERITED
841                         && lock.getUserId().equals(getCms().getRequestContext().currentUser().getId())) {
842                         // lock is not shared and belongs to the current user
843
if (getCms().getRequestContext().currentProject().getId() == lock.getProjectId()
844                             || Boolean.valueOf(getParamUsetempfileproject()).booleanValue()) {
845                             // resource is locked in the current project or the tempfileproject is used
846
m_isEditable = new Boolean JavaDoc(true);
847                             return m_isEditable.booleanValue();
848                         }
849                     }
850                 } else if (OpenCms.getWorkplaceManager().autoLockResources()) {
851                     m_isEditable = new Boolean JavaDoc(true);
852                     return m_isEditable.booleanValue();
853                 }
854                 // lock is null or belongs to other user and/or project, properties are not editable
855
m_isEditable = new Boolean JavaDoc(false);
856             }
857         }
858         return m_isEditable.booleanValue();
859     }
860
861     /**
862      * Builds the html for a single property entry row.<p>
863      *
864      * The output depends on the currently active tab (shared or individual properties)
865      * and on the present values of the current property.<p>
866      *
867      * The values of the property are not inserted directly in the &lt;input&gt; tag,
868      * because there is a display issue when the property values are very long.
869      * Have a look at buildSetFormValues() for a detailed description.<p>
870      *
871      * @param propName the name of the property
872      * @param propValue the displayed value of the property
873      * @param valueStructure the structure value of the property
874      * @param valueResource the resource value of the property
875      * @param disabled contains attribute String to disable the fields
876      * @param activeTab the name of the currently active dialog tab
877      * @return the html for a single property entry row
878      */

879     private StringBuffer JavaDoc buildPropertyRow(
880         String JavaDoc propName,
881         String JavaDoc propValue,
882         String JavaDoc valueStructure,
883         String JavaDoc valueResource,
884         String JavaDoc disabled,
885         String JavaDoc activeTab) {
886
887         StringBuffer JavaDoc result = new StringBuffer JavaDoc(256);
888         String JavaDoc structurePanelName = key(Messages.GUI_PROPERTIES_INDIVIDUAL_0);
889         String JavaDoc inputAttrs = "class=\"maxwidth\"";
890         if (structurePanelName.equals(activeTab)) {
891             // in "shared properties" form, show resource value if no structure value is set
892
if ("".equals(valueStructure) && !"".equals(valueResource)) {
893                 inputAttrs = "class=\"dialogmarkedfield\"";
894             }
895         }
896         result.append("<tr>\n");
897         result.append("\t<td style=\"white-space: nowrap;\">" + propName);
898         result.append("</td>\n");
899         result.append("\t<td class=\"maxwidth\">");
900         
901         // build text input field
902
result.append("<input type=\"text\" ");
903         result.append(inputAttrs);
904         result.append(" name=\"");
905         result.append(PREFIX_VALUE);
906         result.append(propName);
907         result.append("\" id=\"");
908         result.append(PREFIX_VALUE);
909         result.append(propName);
910         result.append("\"");
911         result.append(" onFocus=\"deleteResEntry('");
912         result.append(propName);
913         result.append("', '");
914         result.append(activeTab);
915         result.append("');\"");
916         result.append(" onBlur=\"checkResEntry('");
917         result.append(propName);
918         result.append("', '");
919         result.append(activeTab);
920         result.append("');\" onKeyup=\"checkValue('");
921         result.append(propName);
922         result.append("', '");
923         result.append(activeTab);
924         result.append("');\"");
925         result.append(disabled);
926         result.append(">");
927         
928         // build hidden input field for structure value
929
result.append("<input type=\"hidden\" name=\"");
930         result.append(PREFIX_STRUCTURE);
931         result.append(propName);
932         result.append("\" id=\"");
933         result.append(PREFIX_STRUCTURE);
934         result.append(propName);
935         result.append("\" value=\"");
936         result.append(CmsEncoder.escapeXml(valueStructure));
937         result.append("\">");
938         
939         // build hidden input field for resource value
940
result.append("<input type=\"hidden\" name=\"");
941         result.append(PREFIX_RESOURCE);
942         result.append(propName);
943         result.append("\" id=\"");
944         result.append(PREFIX_RESOURCE);
945         result.append(propName);
946         result.append("\" value=\"");
947         result.append(CmsEncoder.escapeXml(valueResource));
948         result.append("\"></td>\n");
949         result.append("\t<td class=\"textcenter\">");
950         if (!"".equals(propValue)) {
951             // show checkbox only for non empty value
952
String JavaDoc prefix = PREFIX_RESOURCE;
953             if (structurePanelName.equals(activeTab)) {
954                 prefix = PREFIX_STRUCTURE;
955             }
956             result.append("<input type=\"checkbox\" name=\"");
957             result.append(PREFIX_USEPROPERTY);
958             result.append(propName);
959             result.append("\" id=\"");
960             result.append(PREFIX_USEPROPERTY);
961             result.append(propName);
962             result.append("\" value=\"true\"");
963             result.append(disabled);
964             result.append(" checked=\"checked\" onClick=\"toggleDelete('");
965             result.append(propName);
966             result.append("', '");
967             result.append(prefix);
968             result.append("', '");
969             result.append(activeTab);
970             result.append("');\">");
971         } else {
972             result.append("&nbsp;");
973         }
974         result.append("</td>\n");
975         result.append("</tr>\n");
976         return result;
977     }
978
979     /**
980      * Creates a list of String arrays containing the property names and values.<p>
981      *
982      * The list items consist of the following Strings:
983      * <ol>
984      * <li>The name of the property</li>
985      * <li>The currently active property value</li>
986      * <li>The value of the structure</li>
987      * <li>The value of the resource</li>
988      * </ol>
989      *
990      * @return the list of property values in display order
991      */

992     private List JavaDoc getPropertyValues() {
993
994         // check if list has to be generated
995
if (m_propertyValues == null) {
996
997             // get currently active tab
998
String JavaDoc activeTab = getActiveTabName();
999             String JavaDoc structurePanelName = key(Messages.GUI_PROPERTIES_INDIVIDUAL_0);
1000
1001            // get all properties for the resource
1002
List JavaDoc propertyDef = new ArrayList JavaDoc();
1003            try {
1004                propertyDef = getCms().readAllPropertyDefinitions();
1005            } catch (CmsException e) {
1006                // should usually never happen
1007
if (LOG.isInfoEnabled()) {
1008                    LOG.info(e.getLocalizedMessage());
1009                }
1010            }
1011            m_propertyValues = new ArrayList JavaDoc(propertyDef.size());
1012
1013            // get all used properties for the resource
1014
Map JavaDoc activeProperties = null;
1015            if (!m_tabSwitched) {
1016                try {
1017                    activeProperties = CmsPropertyAdvanced.getPropertyMap(getCms().readPropertyObjects(
1018                        getParamResource(),
1019                        false));
1020                } catch (CmsException e) {
1021                    // should usually never happen
1022
if (LOG.isInfoEnabled()) {
1023                        LOG.info(e.getLocalizedMessage());
1024                    }
1025                    activeProperties = new HashMap JavaDoc();
1026                }
1027            }
1028
1029            // iterate over all possible properties for the resource
1030
Iterator JavaDoc i = propertyDef.iterator();
1031            while (i.hasNext()) {
1032                CmsPropertyDefinition currentPropertyDef = (CmsPropertyDefinition)i.next();
1033                String JavaDoc propName = CmsEncoder.escapeXml(currentPropertyDef.getName());
1034                String JavaDoc propValue = "";
1035                String JavaDoc valueStructure = "";
1036                String JavaDoc valueResource = "";
1037                if (m_tabSwitched) {
1038                    // switched the tab, get values from hidden fields
1039
if (structurePanelName.equals(activeTab)) {
1040                        // structure form
1041
propValue = getJsp().getRequest().getParameter(PREFIX_STRUCTURE + propName);
1042                        valueStructure = getJsp().getRequest().getParameter(PREFIX_STRUCTURE + propName);
1043                        if (!isEditable()) {
1044                            // values from disabled fields are not posted
1045
valueResource = getJsp().getRequest().getParameter(PREFIX_RESOURCE + propName);
1046                        } else {
1047                            valueResource = getJsp().getRequest().getParameter(PREFIX_VALUE + propName);
1048                        }
1049                    } else {
1050                        // resource form
1051
propValue = getJsp().getRequest().getParameter(PREFIX_RESOURCE + propName);
1052                        if (!isEditable()) {
1053                            // values from disabled fields are not posted
1054
valueStructure = getJsp().getRequest().getParameter(PREFIX_STRUCTURE + propName);
1055                        } else {
1056                            valueStructure = getJsp().getRequest().getParameter(PREFIX_VALUE + propName);
1057                        }
1058                        valueResource = getJsp().getRequest().getParameter(PREFIX_RESOURCE + propName);
1059                        if (valueStructure != null
1060                            && !"".equals(valueStructure.trim())
1061                            && valueStructure.equals(valueResource)) {
1062                            // the resource value was shown in the input field, set structure value to empty String
1063
valueStructure = "";
1064                        }
1065                    }
1066                } else {
1067                    // initial call of edit form, get property values from database
1068
CmsProperty currentProperty = (CmsProperty)activeProperties.get(propName);
1069                    if (currentProperty == null) {
1070                        currentProperty = new CmsProperty();
1071                    }
1072                    if (structurePanelName.equals(activeTab)) {
1073                        // show the structure properties
1074
propValue = currentProperty.getStructureValue();
1075                    } else {
1076                        // show the resource properties
1077
propValue = currentProperty.getResourceValue();
1078                    }
1079                    valueStructure = currentProperty.getStructureValue();
1080                    valueResource = currentProperty.getResourceValue();
1081                    // check values for null
1082
if (propValue == null) {
1083                        propValue = "";
1084                    }
1085                    if (valueStructure == null) {
1086                        valueStructure = "";
1087                    }
1088                    if (valueResource == null) {
1089                        valueResource = "";
1090                    }
1091                }
1092                // remove unnecessary blanks from values
1093
propValue = propValue.trim();
1094                valueStructure = valueStructure.trim();
1095                valueResource = valueResource.trim();
1096                String JavaDoc[] property = new String JavaDoc[] {propName, propValue, valueStructure, valueResource};
1097                m_propertyValues.add(property);
1098            }
1099        }
1100        // return the filled list
1101
return m_propertyValues;
1102    }
1103
1104    /**
1105     * Performs the definition of a new property.<p>
1106     *
1107     * @return true, if the new property was created, otherwise false
1108     * @throws CmsException if creation is not successful
1109     */

1110    private boolean performDefineOperation() throws CmsException {
1111
1112        boolean useTempfileProject = Boolean.valueOf(getParamUsetempfileproject()).booleanValue();
1113        try {
1114            if (useTempfileProject) {
1115                switchToTempProject();
1116            }
1117            String JavaDoc newProperty = getParamNewproperty();
1118            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(newProperty)) {
1119                getCms().createPropertyDefinition(newProperty);
1120                return true;
1121            } else {
1122                throw new CmsException(Messages.get().container(Messages.ERR_INVALID_PROP_0));
1123            }
1124        } finally {
1125            if (useTempfileProject) {
1126                switchToCurrentProject();
1127            }
1128        }
1129    }
1130
1131    /**
1132     * Performs the editing of the resources properties.<p>
1133     *
1134     * @param request the HttpServletRequest
1135     * @return true, if the properties were successfully changed, otherwise false
1136     * @throws CmsException if editing is not successful
1137     */

1138    private boolean performDialogOperation(HttpServletRequest JavaDoc request) throws CmsException {
1139
1140        List JavaDoc propertyDef = getCms().readAllPropertyDefinitions();
1141        boolean useTempfileProject = Boolean.valueOf(getParamUsetempfileproject()).booleanValue();
1142        try {
1143            if (useTempfileProject) {
1144                switchToTempProject();
1145            }
1146            Map JavaDoc activeProperties = getPropertyMap(getCms().readPropertyObjects(getParamResource(), false));
1147            String JavaDoc activeTab = getActiveTabName();
1148            List JavaDoc propertiesToWrite = new ArrayList JavaDoc();
1149
1150            // check all property definitions of the resource for new values
1151
Iterator JavaDoc i = propertyDef.iterator();
1152            while (i.hasNext()) {
1153                CmsPropertyDefinition curPropDef = (CmsPropertyDefinition)i.next();
1154                String JavaDoc propName = CmsEncoder.escapeXml(curPropDef.getName());
1155                String JavaDoc valueStructure = null;
1156                String JavaDoc valueResource = null;
1157
1158                if (key(Messages.GUI_PROPERTIES_INDIVIDUAL_0).equals(activeTab)) {
1159                    // get parameters from the structure tab
1160
valueStructure = request.getParameter(PREFIX_VALUE + propName);
1161                    valueResource = request.getParameter(PREFIX_RESOURCE + propName);
1162                    if (valueStructure != null
1163                        && !"".equals(valueStructure.trim())
1164                        && valueStructure.equals(valueResource)) {
1165                        // the resource value was shown/entered in input field, set structure value to empty String
1166
valueStructure = "";
1167                    }
1168                } else {
1169                    // get parameters from the resource tab
1170
valueStructure = request.getParameter(PREFIX_STRUCTURE + propName);
1171                    valueResource = request.getParameter(PREFIX_VALUE + propName);
1172                }
1173
1174                // check values for blanks and null
1175
if (valueStructure != null) {
1176                    valueStructure = valueStructure.trim();
1177                }
1178
1179                if (valueResource != null) {
1180                    valueResource = valueResource.trim();
1181                }
1182
1183                // create new CmsProperty object to store
1184
CmsProperty newProperty = new CmsProperty();
1185                newProperty.setName(curPropDef.getName());
1186                newProperty.setStructureValue(valueStructure);
1187                newProperty.setResourceValue(valueResource);
1188
1189                // get the old property values
1190
CmsProperty oldProperty = (CmsProperty)activeProperties.get(curPropDef.getName());
1191                if (oldProperty == null) {
1192                    // property was not set, create new empty property object
1193
oldProperty = new CmsProperty();
1194                    oldProperty.setName(curPropDef.getName());
1195                }
1196
1197                boolean writeStructureValue = false;
1198                boolean writeResourceValue = false;
1199                String JavaDoc oldValue = oldProperty.getStructureValue();
1200                String JavaDoc newValue = newProperty.getStructureValue();
1201
1202                // write the structure value if the existing structure value is not null and we want to delete the structure value
1203
writeStructureValue = (oldValue != null && newProperty.isDeleteStructureValue());
1204                // or if we want to write a value which is neither the delete value or an empty value
1205
writeStructureValue |= !newValue.equals(oldValue)
1206                    && !"".equalsIgnoreCase(newValue)
1207                    && !CmsProperty.DELETE_VALUE.equalsIgnoreCase(newValue);
1208                // set the structure value explicitly to null to leave it as is in the database
1209
if (!writeStructureValue) {
1210                    newProperty.setStructureValue(null);
1211                }
1212
1213                oldValue = oldProperty.getResourceValue();
1214                newValue = newProperty.getResourceValue();
1215
1216                // write the resource value if the existing resource value is not null and we want to delete the resource value
1217
writeResourceValue = (oldValue != null && newProperty.isDeleteResourceValue());
1218                // or if we want to write a value which is neither the delete value or an empty value
1219
writeResourceValue |= !newValue.equals(oldValue)
1220                    && !"".equalsIgnoreCase(newValue)
1221                    && !CmsProperty.DELETE_VALUE.equalsIgnoreCase(newValue);
1222                // set the resource value explicitly to null to leave it as is in the database
1223
if (!writeResourceValue) {
1224                    newProperty.setResourceValue(null);
1225                }
1226
1227                if (writeStructureValue || writeResourceValue) {
1228                    // add property to list only if property values have changed
1229
propertiesToWrite.add(newProperty);
1230                }
1231            }
1232            if (propertiesToWrite.size() > 0) {
1233                // lock resource if autolock is enabled
1234
checkLock(getParamResource());
1235                //write the new property values
1236
getCms().writePropertyObjects(getParamResource(), propertiesToWrite);
1237            }
1238        } finally {
1239            if (useTempfileProject) {
1240                switchToCurrentProject();
1241            }
1242        }
1243        return true;
1244    }
1245
1246}
1247
Popular Tags