|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspTagEditable
public class CmsJspTagEditable
Implementation of the <cms:editable/>
tag.
This class is also used to generate the direct edit buttons for the
<cms:include editable="..." />
and <cms:contentload editable="..." />
tags.
Since OpenCms version 6.2.3, the direct edit button HTML generated is controlled by an instance of I_CmsDirectEditProvider
.
The default direct edit provider used can be configured in opencms-workplace.xml
in the
<directeditprovider class="..." />
node. The standard provider is
CmsDirectEditDefaultProvider
.
It's possible to override the default provider onm a page-by-page basis by initializing direct edit with
<cms:editable provider="...." />
on top of the page.
Since OpenCms version 6.2.3, it is also possible to place the HTML of the direct edit buttons manually.
This is intended for pages where the template HTML is not compatible with the direct edit HTML,
which usually results in a funny placement of the direct edit buttons in a totally wrong position.
To do manual placement of the direct edit buttons, you need to place <cms:editable mode="manual">
and
</cms:editable>
around your HTML. Both tags (start and end) will insert HTML according to
the used I_CmsDirectEditProvider
. The direct edit provider used must also support manual
placing, or the manual tags will be ignored and the HTML will be inserted at the automatic position.
A provider which support manual placing is the CmsDirectEditTextButtonProvider
.
Field Summary | |
---|---|
protected java.lang.String |
m_file
File with editable elements. |
protected CmsDirectEditMode |
m_mode
Indicates which direct edit mode is active. |
protected java.lang.String |
m_provider
Class name of the direct edit provider. |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
CmsJspTagEditable()
|
Method Summary | |
---|---|
int |
doEndTag()
Close the direct edit tag, also prints the direct edit HTML to the current page. |
int |
doStartTag()
Opens the direct edit tag, if manual mode is set then the next start HTML for the direct edit buttons is printed to the page. |
static void |
editableTagAction(javax.servlet.jsp.PageContext context,
java.lang.String provider,
CmsDirectEditMode mode,
java.lang.String fileName)
Editable action method. |
static void |
endDirectEdit(javax.servlet.jsp.PageContext context)
Closes the current direct edit element. |
static I_CmsDirectEditProvider |
getDirectEditProvider(javax.servlet.jsp.PageContext context)
Returns the current initialized instance of the direct edit provider. |
protected static CmsDirectEditParams |
getDirectEditProviderParams(javax.servlet.jsp.PageContext context)
Returns the current initialized instance of the direct edit provider parameters from the given page context. |
java.lang.String |
getFile()
Gets the file with elements for direct editing. |
java.lang.String |
getMode()
Returns the direct edit mode. |
java.lang.String |
getProvider()
Returns the class name of the direct edit provider. |
void |
release()
Releases any resources we may have (or inherit). |
protected static void |
setDirectEditProvider(javax.servlet.jsp.PageContext context,
I_CmsDirectEditProvider provider)
Sets the current initialized instance of the direct edit provider. |
protected static void |
setDirectEditProviderParams(javax.servlet.jsp.PageContext context,
CmsDirectEditParams params)
Sets the current initialized instance of the direct edit provider parameters to the page context. |
void |
setFile(java.lang.String file)
Sets the file with elements for direct editing. |
void |
setMode(java.lang.String mode)
Sets the direct edit mode. |
void |
setProvider(java.lang.String provider)
Sets the class name of the direct edit provider. |
static boolean |
startDirectEdit(javax.servlet.jsp.PageContext context,
CmsDirectEditParams params)
Includes the "direct edit" start element that adds HTML for the editable area to the output page. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setPageContext, setParent |
Field Detail |
---|
protected java.lang.String m_file
protected transient CmsDirectEditMode m_mode
protected java.lang.String m_provider
Constructor Detail |
---|
public CmsJspTagEditable()
Method Detail |
---|
public static void editableTagAction(javax.servlet.jsp.PageContext context, java.lang.String provider, CmsDirectEditMode mode, java.lang.String fileName) throws javax.servlet.jsp.JspException
context
- the current JSP page contextprovider
- the class name of the direct edit privider to use (may be null
, which means use the default)mode
- the direct edit mode to use (may be null
, which means current use mode on page)fileName
- optional filename parameter for the direct edit provider (may be null
, which means use the default)
javax.servlet.jsp.JspException
- in case something goes wrongpublic static void endDirectEdit(javax.servlet.jsp.PageContext context) throws javax.servlet.jsp.JspException
context
- the current JSP page context
javax.servlet.jsp.JspException
- in case something goes wrongpublic static I_CmsDirectEditProvider getDirectEditProvider(javax.servlet.jsp.PageContext context)
context
- the current JSP page context
public static boolean startDirectEdit(javax.servlet.jsp.PageContext context, CmsDirectEditParams params) throws javax.servlet.jsp.JspException
context
- the current JSP page contextparams
- the direct edit parameters
true
in case a direct edit element has been opened
javax.servlet.jsp.JspException
- in case something goes wrongprotected static CmsDirectEditParams getDirectEditProviderParams(javax.servlet.jsp.PageContext context)
Also removes the parameters from the given page context.
context
- the current JSP page context
protected static void setDirectEditProvider(javax.servlet.jsp.PageContext context, I_CmsDirectEditProvider provider)
context
- the current JSP page contextprovider
- the current initialized instance of the direct edit provider to setprotected static void setDirectEditProviderParams(javax.servlet.jsp.PageContext context, CmsDirectEditParams params)
context
- the current JSP page contextparams
- the current initialized instance of the direct edit provider parameters to setpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
Tag.EVAL_PAGE
javax.servlet.jsp.JspException
- in case something goes wrongpublic int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
Tag.EVAL_BODY_INCLUDE
javax.servlet.jsp.JspException
- in case something goes wrongpublic java.lang.String getFile()
public java.lang.String getMode()
public java.lang.String getProvider()
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
public void setFile(java.lang.String file)
file
- the file to setpublic void setMode(java.lang.String mode)
mode
- the direct edit mode to setpublic void setProvider(java.lang.String provider)
provider
- the class name of the direct edit provider to set
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |