KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/workplace/CmsXmlWpButtonsDefFile.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 button element definition file.
40  *
41  * @author Alexander Lucas
42  * @author Michael Emmerich
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 CmsXmlWpButtonsDefFile extends A_CmsXmlContent {
49     
50     /**
51      * Default constructor.
52      */

53     
54     public CmsXmlWpButtonsDefFile() 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 CmsXmlWpButtonsDefFile(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 CmsXmlWpButtonsDefFile(CmsObject cms, String JavaDoc filename) throws CmsException {
80         super();
81         init(cms, filename);
82     }
83     
84     /**
85      * Gets the processed data for a button.
86      * @return Processed button.
87      * @throws CmsException
88      */

89     
90     public String JavaDoc getButton(String JavaDoc name, String JavaDoc action, String JavaDoc alt,
91             String JavaDoc href, Object JavaDoc callingObject) throws CmsException {
92         setData("name", name);
93         setData("action", action);
94         setData("alt", alt);
95         setData("href", href);
96         return getProcessedDataValue("defaultbutton", callingObject);
97     }
98     
99     /**
100      * Gets the processed data for a button separator.
101      * @return Processed button separator.
102      * @throws CmsException
103      */

104     
105     public String JavaDoc getButtonSeparator(Object JavaDoc callingObject) throws CmsException {
106         return getProcessedDataValue("buttonseparator", callingObject);
107     }
108     
109     /**
110      * Gets the processed data for a submit button.
111      * @return Processed button.
112      * @throws CmsException
113      */

114     
115     public String JavaDoc getButtonSubmit(String JavaDoc name, String JavaDoc action, String JavaDoc value,
116             String JavaDoc style, String JavaDoc width) throws CmsException {
117         setData(CmsWorkplaceDefault.C_BUTTON_NAME, name);
118         setData(CmsWorkplaceDefault.C_BUTTON_ACTION, action);
119         setData(CmsWorkplaceDefault.C_BUTTON_VALUE, value);
120         setData(CmsWorkplaceDefault.C_BUTTON_STYLE, style);
121         setData(CmsWorkplaceDefault.C_BUTTON_WIDTH, width);
122         return getProcessedDataValue("submitbutton");
123     }
124     
125     /**
126      * Gets the processed data for a text button.
127      * @return Processed button.
128      * @throws CmsException
129      */

130     
131     public String JavaDoc getButtonText(String JavaDoc name, String JavaDoc action, String JavaDoc value,
132             String JavaDoc style, String JavaDoc width) throws CmsException {
133         setData(CmsWorkplaceDefault.C_BUTTON_NAME, name);
134         setData(CmsWorkplaceDefault.C_BUTTON_ACTION, action);
135         setData(CmsWorkplaceDefault.C_BUTTON_VALUE, value);
136         setData(CmsWorkplaceDefault.C_BUTTON_STYLE, style);
137         setData(CmsWorkplaceDefault.C_BUTTON_WIDTH, width);
138         return getProcessedDataValue("textbutton");
139     }
140     
141     /**
142      * Gets a description of this content type.
143      * @return Content type description.
144      */

145     
146     public String JavaDoc getContentDescription() {
147         return "OpenCms workplace buttons definition";
148     }
149     
150     /**
151      * Gets the processed data for a deactivated button.
152      * @return Processed button.
153      * @throws CmsException
154      */

155     
156     public String JavaDoc getDeactivatedButton(String JavaDoc name, String JavaDoc action, String JavaDoc alt, String JavaDoc href,
157             Object JavaDoc callingObject) throws CmsException {
158         setData("name", name);
159         setData("action", action);
160         setData("alt", alt);
161         setData("href", href);
162         return getProcessedDataValue("deactivatedbutton", callingObject);
163     }
164     
165     /**
166      * Gets the processed data for a javascript button.
167      * @return Processed button.
168      * @throws CmsException
169      */

170     
171     public String JavaDoc getJavascriptButton(String JavaDoc name, String JavaDoc action, String JavaDoc alt,
172             String JavaDoc href, Object JavaDoc callingObject) throws CmsException {
173         setData("name", name);
174         setData("action", action);
175         setData("alt", alt);
176         setData("href", href);
177         return getProcessedDataValue("javascriptbutton", callingObject);
178     }
179     
180     /**
181      * Gets the expected tagname for the XML documents of this content type
182      * @return Expected XML tagname.
183      */

184     
185     public String JavaDoc getXmlDocumentTagName() {
186         return "WP_BUTTONS";
187     }
188 }
189
Popular Tags