KickJava   Java API By Example, From Geeks To Geeks.

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


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

28
29
30 package com.opencms.workplace;
31
32 import org.opencms.file.CmsObject;
33 import org.opencms.main.CmsException;
34 import org.opencms.workplace.CmsWorkplace;
35
36 import com.opencms.legacy.CmsXmlTemplateLoader;
37
38 import java.util.Vector JavaDoc;
39
40 /**
41  * Definition of some paths for the workplace. Currently some are static,
42  * but can be switched to read from configurations like registry.
43  *
44  * @author Alexander Lucas
45  * @author Michael Emmerich
46  * @author Andreas Schouten
47  * @version $Revision: 1.2 $ $Date: 2005/06/27 23:22:07 $
48  *
49  * @deprecated Will not be supported past the OpenCms 6 release.
50  */

51
52 public class CmsXmlWpConfigFile {
53
54     /** The cms object to get access to OpenCms */
55     private CmsObject m_cms = null;
56
57     /**
58      * Default constructor.
59      */

60
61     public CmsXmlWpConfigFile() throws CmsException {
62     }
63
64     /**
65      * Constructor for creating a new config file object.
66      * The parameter cms is not needed at the moment.
67      *
68      * @param cms CmsObject object for accessing system resources.
69      */

70     public CmsXmlWpConfigFile(CmsObject cms) throws CmsException {
71         m_cms = cms;
72     }
73
74     /**
75      * Gets the path at which the folders with the download galleries are
76      * @return Path for download galleries.
77      */

78     public String JavaDoc getDownGalleryPath(){
79         return CmsWorkplaceDefault.C_VFS_GALLERY_DOWNLOAD;
80     }
81
82     /**
83      * Gets the path at which the folders with the html galleries are
84      * @return Path for html galleries.
85      */

86     public String JavaDoc getHtmlGalleryPath(){
87         return CmsWorkplaceDefault.C_VFS_GALLERY_HTML;
88     }
89
90     /**
91      * Gets the path at which the folders with the picture galleries are
92      * @return Path for picture galleries.
93      */

94     public String JavaDoc getPicGalleryPath(){
95         return CmsWorkplaceDefault.C_VFS_GALLERY_PICS;
96     }
97
98     /**
99      * Gets the path at which the folders with the externallink galleries are
100      * @return Path for externallink galleries.
101      */

102     public String JavaDoc getLinkGalleryPath() {
103         return CmsWorkplaceDefault.C_VFS_GALLERY_EXTERNALLINKS;
104     }
105     
106     /**
107      * Gets the path for OpenCms language files.
108      * @return Path for language files.
109      * @throws CmsException if the corresponding XML tag doesn't exist in the workplace definition file.
110      * @deprecated Use the constant value I_CmsWpConstants.C_VFS_PATH_LOCALES instead
111      */

112     public String JavaDoc getLanguagePath() throws CmsException {
113         return CmsWorkplace.VFS_PATH_LOCALES;
114     }
115
116     /**
117      * Gets the path for OpenCms workplace action files.
118      * @return Path for OpenCms workplace action files.
119      * @throws CmsException if the corresponding XML tag doesn't exist in the workplace definition file.
120      */

121     public String JavaDoc getWorkplaceActionPath() throws CmsException {
122         return CmsWorkplace.VFS_PATH_WORKPLACE + "action/";
123     }
124
125     /**
126      * Gets the path for OpenCms workplace administration files.
127      * @return Path for OpenCms workplace administration files.
128      * @throws CmsException if the corresponding XML tag doesn't exist in the workplace definition file.
129      */

130     public String JavaDoc getWorkplaceAdministrationPath() throws CmsException {
131         return CmsWorkplace.VFS_PATH_WORKPLACE + "administration/";
132     }
133     
134     /** Flag to indicate what setting the value of "UseWpPicturesFromVFS" in the registry.xml is */
135     private static boolean m_useWpPicturesFromVFS = true;
136     /** Path in the VFS if "UseWpPicturesFromVFS" is true */
137     private static String JavaDoc m_useWpPicturesFromVFSPath = null;
138     /** URI of the resources, including application context and servlet name (if required) */
139     private static String JavaDoc m_resourceUri = null;
140
141     /**
142      * Gets the path for system picture files.
143      * @return Path for picture files.
144      * @throws CmsException if the corresponding XML tag doesn't exist in the workplace definition file.
145      */

146     public String JavaDoc getWpPicturePath() throws CmsException {
147         if (m_useWpPicturesFromVFSPath == null) {
148             // Check registry for setting of workplace images
149
m_useWpPicturesFromVFS = false;
150             m_useWpPicturesFromVFSPath = CmsXmlTemplateLoader.getRequest(m_cms.getRequestContext()).getServletUrl() + CmsWorkplace.VFS_PATH_RESOURCES;
151             if (m_useWpPicturesFromVFS) {
152                 m_resourceUri = m_useWpPicturesFromVFSPath;
153             } else {
154                 m_resourceUri = CmsXmlTemplateLoader.getRequest(m_cms.getRequestContext()).getWebAppUrl() + CmsWorkplace.RFS_PATH_RESOURCES;
155             }
156         }
157         return m_resourceUri;
158     }
159
160     public void getWorkplaceIniData(Vector JavaDoc names, Vector JavaDoc values, String JavaDoc tag, String JavaDoc element) throws CmsException {
161         if(tag.equals("NEWRESOURCES")) {
162             names.add("folder"); values.add("explorer_files_new_folder.html");
163             names.add("page"); values.add("explorer_files_new_page.html");
164             // names.add("pdfpage"); values.add("explorer_files_new_pdfpage.html");
165
names.add("link"); values.add("explorer_files_new_link.html");
166             names.add("othertype"); values.add("explorer_files_new_othertype.html");
167             names.add("upload"); values.add("explorer_files_new_upload.html");
168         } else {
169             names.add("plain"); values.add("plain");
170             names.add("jsp"); values.add("jsp");
171             names.add("newpage"); values.add("newpage");
172             names.add("XMLTemplate"); values.add("XMLTemplate");
173             names.add("binary"); values.add("binary");
174             names.add("image"); values.add("image");
175         }
176     }
177
178 }
179
Popular Tags