org.opencms.jsp
Class CmsJspTagEditable

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.opencms.jsp.CmsJspTagEditable
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class CmsJspTagEditable
extends javax.servlet.jsp.tagext.BodyTagSupport

Implementation of "editable" tag, also used to provide generate the direct edit buttons in the "include" tag.

Since:
6.0.0
Version:
$Revision: 1.23 $
See Also:
Serialized Form

Field Summary
protected  java.lang.String m_file
          file with editable elements.
 
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
static java.lang.String createEditOptions(boolean showEdit, boolean showDelete, boolean showNew)
          Returns an option String for the direct editor generated from the provided values.
 int doEndTag()
          Simply send our name and value to our appropriate ancestor.
 int doStartTag()
           
static void editableTagAction(javax.servlet.jsp.PageContext context, java.lang.String filename, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
          Editable action method.
 java.lang.String getFile()
          Gets the file with elements for direct editing.
static java.lang.String includeDirectEditElement(javax.servlet.jsp.PageContext context, java.lang.String element, java.lang.String editTarget, java.lang.String editElement, java.lang.String editOptions, java.lang.String editPermissions, java.lang.String createLink)
          Includes the "direct edit" element that adds HTML for the editable area to the output page.
 void release()
          Releases any resources we may have (or inherit).
 void setFile(java.lang.String file)
          Sets the file with elements for direct editing.
 
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

m_file

protected java.lang.String m_file
file with editable elements.

Constructor Detail

CmsJspTagEditable

public CmsJspTagEditable()
Method Detail

createEditOptions

public static java.lang.String createEditOptions(boolean showEdit,
                                                 boolean showDelete,
                                                 boolean showNew)
Returns an option String for the direct editor generated from the provided values.

Parameters:
showEdit - indicates that the edit button should be shown
showDelete - indicates that the delete button should be shown
showNew - indicates that the new button should be shown
Returns:
an option String for the direct editor generated from the provided values

editableTagAction

public static void editableTagAction(javax.servlet.jsp.PageContext context,
                                     java.lang.String filename,
                                     javax.servlet.ServletRequest req,
                                     javax.servlet.ServletResponse res)
                              throws javax.servlet.jsp.JspException
Editable action method.

Parameters:
context - the current JSP page context
filename - the source for direct edit elements
req - the current request
res - current response
Throws:
javax.servlet.jsp.JspException - never

includeDirectEditElement

public static java.lang.String includeDirectEditElement(javax.servlet.jsp.PageContext context,
                                                        java.lang.String element,
                                                        java.lang.String editTarget,
                                                        java.lang.String editElement,
                                                        java.lang.String editOptions,
                                                        java.lang.String editPermissions,
                                                        java.lang.String createLink)
                                                 throws javax.servlet.jsp.JspException
Includes the "direct edit" element that adds HTML for the editable area to the output page.

Parameters:
context - the current JSP page context
element - the editor element to include
editTarget - the direct edit target
editElement - the direct edit element
editOptions - the direct edit options
editPermissions - the direct edit permissions
createLink - the direct edit create link
Returns:
the direct edit permissions
Throws:
javax.servlet.jsp.JspException - in case something goes wrong

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Simply send our name and value to our appropriate ancestor.

Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException - (never thrown, required by interface)

doStartTag

public int doStartTag()
Returns:
EVAL_BODY_BUFFERED
See Also:
Tag.doStartTag()

getFile

public java.lang.String getFile()
Gets the file with elements for direct editing.

Returns:
the file

release

public void release()
Releases any resources we may have (or inherit).


setFile

public void setFile(java.lang.String file)
Sets the file with elements for direct editing.

Parameters:
file - the file to set