KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/editors/directedit/I_CmsDirectEditProvider.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 import org.opencms.configuration.I_CmsConfigurationParameterHandler;
35 import org.opencms.file.CmsObject;
36
37 import javax.servlet.jsp.JspException JavaDoc;
38 import javax.servlet.jsp.PageContext JavaDoc;
39
40 /**
41  * Provides the methods to generate the "direct edit" HTML fragments that are inserted
42  * in the generated pages in offline mode.<p>
43  *
44  * In case you want to implement this, it's a good idea to extend from {@link A_CmsDirectEditProvider}
45  * or {@link CmsDirectEditDefaultProvider} as these already contain the required low level logic.<p>
46  *
47  * The default direct edit provider used can be configured in <code>opencms-workplace.xml</code> in the
48  * <code>&lt;directeditprovider class="..." /&gt;</code> node. The standard provider is the
49  * {@link CmsDirectEditDefaultProvider}.<p>
50  *
51  * @author Alexander Kandzior
52  *
53  * @version $Revision: 1.2 $
54  *
55  * @since 6.2.3
56  *
57  * @see CmsDirectEditDefaultProvider
58  * @see CmsDirectEditTextButtonProvider
59  * @see CmsDirectEditJspIncludeProvider
60  * @see org.opencms.jsp.CmsJspTagEditable
61  */

62 public interface I_CmsDirectEditProvider extends I_CmsConfigurationParameterHandler, Cloneable JavaDoc {
63
64     /** Key to identify the direct edit provider instance. */
65     String JavaDoc ATTRIBUTE_DIRECT_EDIT_PROVIDER = "org.opencms.workplace.editors.directedit.__directEditProvider";
66
67     /** Key to identify the direct edit provider parameteres. */
68     String JavaDoc ATTRIBUTE_DIRECT_EDIT_PROVIDER_PARAMS = "org.opencms.workplace.editors.directedit.__directEditProviderParams";
69
70     /**
71      * Initialize method for a new instance of the direct edit provider.<p>
72      *
73      * @param cms the current users OpenCms context
74      * @param mode the direct edit mode to use
75      * @param fileName link to a file that contains the direct edit HTML elements (optional)
76      */

77     void init(CmsObject cms, CmsDirectEditMode mode, String JavaDoc fileName);
78
79     /**
80      * Inserts the "end direct edit" HTML in the provided JSP page context.<p>
81      *
82      * @param context the JSP page context to insert the HTML to
83      *
84      * @throws JspException in case something goes wrong
85      */

86     void insertDirectEditEnd(PageContext JavaDoc context) throws JspException JavaDoc;
87
88     /**
89      * Inserts the "direct edit header" HTML in the provided JSP page context.<p>
90      *
91      * @param context the JSP page context to insert the HTML to
92      * @param params the parameters for the direct edit includes
93      *
94      * @throws JspException in case something goes wrong
95      */

96     void insertDirectEditIncludes(PageContext JavaDoc context, CmsDirectEditParams params) throws JspException JavaDoc;
97
98     /**
99      * Inserts the "start direct edit" HTML in the provided JSP page context.<p>
100      *
101      * @param context the JSP page context to insert the HTML to
102      * @param params the parameters for the direct edit call
103      *
104      * @return <code>true</code> in case a direct edit element was opened, <code>false</code> otherwise
105      *
106      * @throws JspException in case something goes wrong
107      */

108     boolean insertDirectEditStart(PageContext JavaDoc context, CmsDirectEditParams params) throws JspException JavaDoc;
109
110     /**
111      * Returns <code>true</code> if this provider (currently) operates in manual mode.<p>
112      *
113      * In manual mode the direct edit HTML is inserted with <code>&lt;cms:enditable mode="manual" /&gt</code>
114      * tags. Otherwise the direct edit HTML is automatically inserted in the current page.<p>
115      *
116      * Some providers may not be able to operate in manual mode. These will always return <code>false</code>.<p>
117      *
118      * @param mode the mode of the current direct edit element
119      *
120      * @return <code>true</code> if this provider (currently) operates in manual mode
121      */

122     boolean isManual(CmsDirectEditMode mode);
123
124     /**
125      * Creates a new instance of this direct edit provider with the same basic configuration.<p>
126      *
127      * @return a new instance of this direct edit provider with the same basic configuration
128      */

129     I_CmsDirectEditProvider newInstance();
130 }
Popular Tags