KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/workplace/CmsXmlWpInputDefFile.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.CmsFile;
33 import org.opencms.file.CmsObject;
34 import org.opencms.main.CmsException;
35
36 import com.opencms.template.A_CmsXmlContent;
37
38 /**
39  * Content definition for the workplace input element definition file.
40  *
41  * @author Michael Emmerich
42  * @author Alexander Lucas
43  * @version $Revision: 1.2 $ $Date: 2005/06/27 23:22:07 $
44  *
45  * @deprecated Will not be supported past the OpenCms 6 release.
46  */

47
48 public class CmsXmlWpInputDefFile extends A_CmsXmlContent {
49     
50     /**
51      * Default constructor.
52      */

53     
54     public CmsXmlWpInputDefFile() throws CmsException {
55         super();
56     }
57     
58     /**
59      * Constructor for creating a new object containing the content
60      * of the given filename.
61      *
62      * @param cms CmsObject object for accessing system resources.
63      * @param filename Name of the body file that shoul be read.
64      */

65     
66     public CmsXmlWpInputDefFile(CmsObject cms, CmsFile file) throws CmsException {
67         super();
68         init(cms, file);
69     }
70     
71     /**
72      * Constructor for creating a new object containing the content
73      * of the given filename.
74      *
75      * @param cms CmsObject object for accessing system resources.
76      * @param filename Name of the body file that shoul be read.
77      */

78     
79     public CmsXmlWpInputDefFile(CmsObject cms, String JavaDoc filename) throws CmsException {
80         super();
81         init(cms, filename);
82     }
83     
84     /**
85      * Gets a description of this content type.
86      * @return Content type description.
87      */

88     
89     public String JavaDoc getContentDescription() {
90         return "OpenCms workplace inputs";
91     }
92     
93     /**
94      * Gets the processed data for a input field.
95      * @param styleClass The style class of this input field.
96      * @param name The name of this input field.
97      * @param size The size of this input field
98      * @param length The input length of this input field.
99      * @param value The value of this input field.
100      * @param action The action of this input field.
101      * @return Processed input field.
102      * @throws CmsException
103      */

104     
105     public String JavaDoc getInput(String JavaDoc styleClass, String JavaDoc name, String JavaDoc size, String JavaDoc length,
106             String JavaDoc value, String JavaDoc action) throws CmsException {
107         setData(CmsWorkplaceDefault.C_INPUT_CLASS, styleClass);
108         setData(CmsWorkplaceDefault.C_INPUT_NAME, name);
109         setData(CmsWorkplaceDefault.C_INPUT_SIZE, size);
110         setData(CmsWorkplaceDefault.C_INPUT_LENGTH, length);
111         setData(CmsWorkplaceDefault.C_INPUT_VALUE, value);
112         setData(CmsWorkplaceDefault.C_INPUT_ACTION, action);
113         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_INPUTFIELD);
114     }
115     
116     /**
117      * Gets the processed data for a password field.
118      * @param styleClass The style class of this password field.
119      * @param name The name of this password field.
120      * @param size The size of this password field
121      * @param length The input length of this password field.
122      * @return Processed password field.
123      * @throws CmsException
124      */

125     
126     public String JavaDoc getPassword(String JavaDoc styleClass, String JavaDoc name, String JavaDoc size, String JavaDoc length) throws CmsException {
127         setData(CmsWorkplaceDefault.C_INPUT_CLASS, styleClass);
128         setData(CmsWorkplaceDefault.C_INPUT_NAME, name);
129         setData(CmsWorkplaceDefault.C_INPUT_SIZE, size);
130         setData(CmsWorkplaceDefault.C_INPUT_LENGTH, length);
131         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_PASSWORD);
132     }
133     
134     public String JavaDoc getSelectBoxEnd() throws CmsException {
135         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_SELECTBOX_END);
136     }
137     
138     public String JavaDoc getSelectBoxOption(String JavaDoc name, String JavaDoc value) throws CmsException {
139         setData(CmsWorkplaceDefault.C_SELECTBOX_OPTIONNAME, name);
140         setData(CmsWorkplaceDefault.C_SELECTBOX_OPTIONVALUE, value);
141         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_SELECTBOX_OPTION);
142     }
143     
144     public String JavaDoc getSelectBoxSelOption(String JavaDoc name, String JavaDoc value) throws CmsException {
145         setData(CmsWorkplaceDefault.C_SELECTBOX_OPTIONNAME, name);
146         setData(CmsWorkplaceDefault.C_SELECTBOX_OPTIONVALUE, value);
147         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_SELECTBOX_SELOPTION);
148     }
149     
150     public String JavaDoc getSelectBoxStart(String JavaDoc classname, String JavaDoc name, String JavaDoc width,
151             String JavaDoc onchange, String JavaDoc size) throws CmsException {
152         if(classname == null || "".equals(classname)) {
153             setData(CmsWorkplaceDefault.C_SELECTBOX_CLASS, "");
154         }
155         else {
156             setData(CmsWorkplaceDefault.C_SELECTBOX_CLASSNAME, classname);
157             setData(CmsWorkplaceDefault.C_SELECTBOX_CLASS, getProcessedData(CmsWorkplaceDefault.C_TAG_SELECTBOX_CLASS));
158         }
159         setData(CmsWorkplaceDefault.C_SELECTBOX_NAME, name);
160         setData(CmsWorkplaceDefault.C_SELECTBOX_WIDTH, width);
161         setData(CmsWorkplaceDefault.C_SELECTBOX_ONCHANGE, onchange);
162         setData(CmsWorkplaceDefault.C_SELECTBOX_SIZE, size);
163         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_SELECTBOX_START);
164     }
165     
166     public String JavaDoc getSelectBoxStartDiv(String JavaDoc classname, String JavaDoc name, String JavaDoc width,
167             String JavaDoc onchange, String JavaDoc size) throws CmsException {
168         if(classname == null || "".equals(classname)) {
169             setData(CmsWorkplaceDefault.C_SELECTBOX_CLASS, "");
170         }
171         else {
172             setData(CmsWorkplaceDefault.C_SELECTBOX_CLASSNAME, classname);
173             setData(CmsWorkplaceDefault.C_SELECTBOX_CLASS, getProcessedData(CmsWorkplaceDefault.C_TAG_SELECTBOX_CLASS));
174         }
175         setData(CmsWorkplaceDefault.C_SELECTBOX_NAME, name);
176         setData(CmsWorkplaceDefault.C_SELECTBOX_WIDTH, width);
177         setData(CmsWorkplaceDefault.C_SELECTBOX_ONCHANGE, onchange);
178         setData(CmsWorkplaceDefault.C_SELECTBOX_SIZE, size);
179         return getProcessedDataValue(CmsWorkplaceDefault.C_TAG_SELECTBOX_START_DIV);
180     }
181     
182     /**
183      * Gets the expected tagname for the XML documents of this content type
184      * @return Expected XML tagname.
185      */

186     
187     public String JavaDoc getXmlDocumentTagName() {
188         return "WP_INPUTS";
189     }
190 }
191
Popular Tags