org.mmbase.bridge.jsp.taglib.editor
Class EditTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended byorg.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended byorg.mmbase.bridge.jsp.taglib.editor.EditTag
All Implemented Interfaces:
BodyTag, IterationTag, ParamHandler, Serializable, Tag

public class EditTag
extends CloudReferrerTag
implements ParamHandler

The EditTag collects the nodenrs, fields and queries of the FieldTags in its body. FieldTags register these with the EditTag. You can pass these values to an editor by creating an url for example like YAMMEditor does which gives access to the editor yammeditor.jsp.
If you like you can extend Editor to create your own way to edit MMBase content. Edit the edittag.xml resources file to add your class in the MMBase config/taglib directory to let the EditTag know about it. The class BasicEditor gives an example how to generate an url to the basic jsp editors and my_editors.

Since:
MMBase-1.8
Version:
$Id: EditTag.java,v 1.17 2006/07/15 11:50:47 michiel Exp $
Author:
André van Toly, Michiel Meeuwissen
See Also:
Editor, BasicEditor, YAMMEditor, Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
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
EditTag()
           
 
Method Summary
 void addParameter(String key, Object value)
          Parameters of this tag.
 int doAfterBody()
           
 int doEndTag()
          Pass all gathered information to the implementing editor, get the the result back and write it to the page.
 int doStartTag()
          Start the EditTag, put the implementations found in its resources in a Map, consult the attribute type which implementation to use and instantiate it.
 String getType()
          The type of editor, see config/taglib/edittag.xml for different types or add your own editor.
protected static void readXML(InputSource edittagSource)
          'reads' a resource XML and puts its values in a Map with types of edittags
 void registerField(Query query, int nodenr, String fieldName)
          Here is were the FieldTag registers its fields and some associated and maybe usefull information with the EditTag.
 void setType(String t)
          The type of editor, add your own editor in config/taglib/edittag.xml.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
fillStandardParameters, findCloudProvider, findCloudProvider, getCloudContext, getCloudVar, getLocale, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
findLoopOrQuery, findParentTag, findParentTag, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getDefaultLocale, getEscapedValue, getId, getObject, getObjectConditional, getPageContext, getPageContextTag, getReferid, getString, getTaglibVersion, getTimeZone, getWriterValue, haveBody, release, setContext, setEscape, setId, setJspvar, setListdelimiter, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, 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, setParent
 

Constructor Detail

EditTag

public EditTag()
Method Detail

readXML

protected static void readXML(InputSource edittagSource)
'reads' a resource XML and puts its values in a Map with types of edittags


setType

public void setType(String t)
             throws JspTagException
The type of editor, add your own editor in config/taglib/edittag.xml.

Parameters:
t - String with editor type.
Throws:
JspTagException

getType

public String getType()
               throws JspTagException
The type of editor, see config/taglib/edittag.xml for different types or add your own editor.

Returns:
String stating the type of editor the tag refers to.
Throws:
JspTagException

addParameter

public void addParameter(String key,
                         Object value)
                  throws JspTagException
Parameters of this tag. The tag's type is defined in its attribute, but you can give it as much parameters as you like to controll your implementations behaviour.

Specified by:
addParameter in interface ParamHandler
Parameters:
key - String with a key
value - Object with a value
Throws:
JspTagException

doStartTag

public int doStartTag()
               throws JspTagException
Start the EditTag, put the implementations found in its resources in a Map, consult the attribute type which implementation to use and instantiate it.

Specified by:
doStartTag in interface Tag
Throws:
JspTagException

doEndTag

public int doEndTag()
             throws JspTagException
Pass all gathered information to the implementing editor, get the the result back and write it to the page.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class ContextReferrerTag
Throws:
JspTagException

registerField

public void registerField(Query query,
                          int nodenr,
                          String fieldName)
Here is were the FieldTag registers its fields and some associated and maybe usefull information with the EditTag.

Parameters:
query - SearchQuery object that delivered the field
nodenr - int with the number of the node the field belongs to
fieldName - String with the fieldname

doAfterBody

public int doAfterBody()
                throws JspTagException
Specified by:
doAfterBody in interface IterationTag
Throws:
JspTagException


MMBase build 1.8.1.20060716