001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/editors/directedit/CmsDirectEditParams.java,v $
003: * Date : $Date: 2008-02-27 12:05:54 $
004: * Version: $Revision: 1.5 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.workplace.editors.directedit;
033:
034: /**
035: * A parameter set to start a direct edit element, for internal use only.<p>
036: *
037: * @author Alexander Kandzior
038: *
039: * @version $Revision: 1.5 $
040: *
041: * @since 6.2.3
042: */
043: public class CmsDirectEditParams {
044:
045: /** The selected element in the target content.*/
046: protected String m_element;
047:
048: /** The link to the current page useed when closing an editor or dialog. */
049: protected String m_linkForClose;
050:
051: /** The link to create a new VFS resource of the edited type. */
052: protected String m_linkForNew;
053:
054: /** The direct edit mode to use. */
055: protected CmsDirectEditMode m_mode;
056:
057: /** The direct edit options to display buttons for. */
058: protected CmsDirectEditButtonSelection m_options;
059:
060: /** The edit target VFS resource name. */
061: protected String m_resourceName;
062:
063: /**
064: * Creates a new direct edit parameter set usually used for including the head HTML.<p>
065: *
066: * @param linkForClose the link to the current page useed when closing an editor or dialog
067: */
068: public CmsDirectEditParams(String linkForClose) {
069:
070: m_resourceName = null;
071: m_options = null;
072: m_element = null;
073: m_linkForNew = null;
074: m_linkForClose = linkForClose;
075: m_mode = CmsDirectEditMode.TRUE;
076: }
077:
078: /**
079: * Creates a new direct edit parameter set usually used within a XML content load loop for a <code>xmlcontent</code>.<p>
080: *
081: * @param resourceName the edit target VFS resource name
082: * @param options the direct edit options to display buttons for
083: * @param linkForNew the link to create a new VFS resource of the edited type
084: * @param mode the direct edit mode to use
085: */
086: public CmsDirectEditParams(String resourceName,
087: CmsDirectEditButtonSelection options,
088: CmsDirectEditMode mode, String linkForNew) {
089:
090: m_resourceName = resourceName;
091: m_options = options;
092: m_element = null;
093: m_linkForNew = linkForNew;
094: m_linkForClose = null;
095: m_mode = mode != null ? mode : CmsDirectEditMode.TRUE;
096: }
097:
098: /**
099: * Creates a new direct edit parameter set usually used within a <code>cms:include</code> call for a <code>xmlpage</code>.<p>
100: *
101: * @param resourceName the edit target VFS resource name
102: * @param element the selected element in the target content
103: */
104: public CmsDirectEditParams(String resourceName, String element) {
105:
106: m_resourceName = resourceName;
107: m_options = CmsDirectEditButtonSelection.EDIT;
108: m_element = element;
109: m_linkForNew = null;
110: m_linkForClose = null;
111: m_mode = CmsDirectEditMode.TRUE;
112: }
113:
114: /**
115: * Returns the direct edit buttons selection to display.<p>
116: *
117: * @return the direct edit buttons selection to display
118: */
119: public CmsDirectEditButtonSelection getButtonSelection() {
120:
121: return m_options;
122: }
123:
124: /**
125: * Returns the selected element in the target content.<p>
126: *
127: * @return the selected element in the target content
128: */
129: public String getElement() {
130:
131: return m_element;
132: }
133:
134: /**
135: * Returns the link to the current page useed when closing an editor or dialog.<p>
136: *
137: * @return the link to the current page useed when closing an editor or dialog
138: */
139: public String getLinkForClose() {
140:
141: return m_linkForClose;
142: }
143:
144: /**
145: * Returns the link to delete the selected VFS resource.<p>
146: *
147: * @return the link to delete the selected VFS resource
148: */
149: public String getLinkForDelete() {
150:
151: return "/system/workplace/commons/delete.jsp";
152: }
153:
154: /**
155: * Returns the link to edit the selected VFS resource (element).<p>
156: *
157: * @return the link to edit the selected VFS resource (element)
158: */
159: public String getLinkForEdit() {
160:
161: return "/system/workplace/editors/editor.jsp";
162: }
163:
164: /**
165: * Returns the link to create a new VFS resource of the edited type.<p>
166: *
167: * @return the link to create a new VFS resource of the edited type
168: */
169: public String getLinkForNew() {
170:
171: return m_linkForNew;
172: }
173:
174: /**
175: * Returns the direct edit mode.<p>
176: *
177: * @return the direct edit mode
178: */
179: public CmsDirectEditMode getMode() {
180:
181: return m_mode;
182: }
183:
184: /**
185: * Returns the edit target VFS resource name.<p>
186: *
187: * @return the edit target VFS resource name
188: */
189: public String getResourceName() {
190:
191: return m_resourceName;
192: }
193: }
|