KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > editors > directedit > CmsDirectEditParams


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/editors/directedit/CmsDirectEditParams.java,v $
3  * Date : $Date: 2006/10/26 12:25:34 $
4  * Version: $Revision: 1.2 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (C) 2002 - 2005 Alkacon Software (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, 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.editors.directedit;
33
34 /**
35  * A parameter set to start a direct edit element, for internal use only.<p>
36  *
37  * @author Alexander Kandzior
38  *
39  * @version $Revision: 1.2 $
40  *
41  * @since 6.2.3
42  */

43 public class CmsDirectEditParams {
44
45     /** The selected element in the target content.*/
46     protected String JavaDoc m_element;
47
48     /** The link to the current page useed when closing an editor or dialog. */
49     protected String JavaDoc m_linkForClose;
50
51     /** The link to create a new VFS resource of the edited type. */
52     protected String JavaDoc m_linkForNew;
53
54     /** The direct edit mode to use. */
55     protected CmsDirectEditMode m_mode;
56
57     /** The direct edit options to display buttons for. */
58     protected CmsDirectEditButtonSelection m_options;
59
60     /** The edit target VFS resource name. */
61     protected String JavaDoc m_resourceName;
62
63     /**
64      * Creates a new direct edit parameter set usually used for including the head HTML.<p>
65      *
66      * @param linkForClose the link to the current page useed when closing an editor or dialog
67      */

68     public CmsDirectEditParams(String JavaDoc linkForClose) {
69
70         m_resourceName = null;
71         m_options = null;
72         m_element = null;
73         m_linkForNew = null;
74         m_linkForClose = linkForClose;
75         m_mode = CmsDirectEditMode.TRUE;
76     }
77
78     /**
79      * Creates a new direct edit parameter set usually used within a XML content load loop for a <code>xmlcontent</code>.<p>
80      *
81      * @param resourceName the edit target VFS resource name
82      * @param options the direct edit options to display buttons for
83      * @param linkForNew the link to create a new VFS resource of the edited type
84      * @param mode the direct edit mode to use
85      */

86     public CmsDirectEditParams(
87         String JavaDoc resourceName,
88         CmsDirectEditButtonSelection options,
89         CmsDirectEditMode mode,
90         String JavaDoc linkForNew) {
91
92         m_resourceName = resourceName;
93         m_options = options;
94         m_element = null;
95         m_linkForNew = linkForNew;
96         m_linkForClose = null;
97         m_mode = mode != null ? mode : CmsDirectEditMode.TRUE;
98     }
99
100     /**
101      * Creates a new direct edit parameter set usually used within a <code>cms:include</code> call for a <code>xmlpage</code>.<p>
102      *
103      * @param resourceName the edit target VFS resource name
104      * @param element the selected element in the target content
105      */

106     public CmsDirectEditParams(String JavaDoc resourceName, String JavaDoc element) {
107
108         m_resourceName = resourceName;
109         m_options = CmsDirectEditButtonSelection.EDIT;
110         m_element = element;
111         m_linkForNew = null;
112         m_linkForClose = null;
113         m_mode = CmsDirectEditMode.TRUE;
114     }
115
116     /**
117      * Returns the direct edit buttons selection to display.<p>
118      *
119      * @return the direct edit buttons selection to display
120      */

121     public CmsDirectEditButtonSelection getButtonSelection() {
122
123         return m_options;
124     }
125
126     /**
127      * Returns the selected element in the target content.<p>
128      *
129      * @return the selected element in the target content
130      */

131     public String JavaDoc getElement() {
132
133         return m_element;
134     }
135
136     /**
137      * Returns the link to the current page useed when closing an editor or dialog.<p>
138      *
139      * @return the link to the current page useed when closing an editor or dialog
140      */

141     public String JavaDoc getLinkForClose() {
142
143         return m_linkForClose;
144     }
145
146     /**
147      * Returns the link to delete the selected VFS resource.<p>
148      *
149      * @return the link to delete the selected VFS resource
150      */

151     public String JavaDoc getLinkForDelete() {
152
153         return "/system/workplace/commons/delete.jsp";
154     }
155
156     /**
157      * Returns the link to edit the selected VFS resource (element).<p>
158      *
159      * @return the link to edit the selected VFS resource (element)
160      */

161     public String JavaDoc getLinkForEdit() {
162
163         return "/system/workplace/editors/editor.jsp";
164     }
165
166     /**
167      * Returns the link to create a new VFS resource of the edited type.<p>
168      *
169      * @return the link to create a new VFS resource of the edited type
170      */

171     public String JavaDoc getLinkForNew() {
172
173         return m_linkForNew;
174     }
175
176     /**
177      * Returns the direct edit mode.<p>
178      *
179      * @return the direct edit mode
180      */

181     public CmsDirectEditMode getMode() {
182
183         return m_mode;
184     }
185
186     /**
187      * Returns the edit target VFS resource name.<p>
188      *
189      * @return the edit target VFS resource name
190      */

191     public String JavaDoc getResourceName() {
192
193         return m_resourceName;
194     }
195 }
Popular Tags