biz.c24.io.api.web
Class StructureTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by biz.c24.io.api.web.StructureTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class StructureTag
extends javax.servlet.jsp.tagext.TagSupport

A tag library for displaying the structure of a complex data object and allowing the user to add / remove fields and edit the data contained in it.
The tag library descriptor should contain the following entry:

 <tag>
     <name>tag name</name>
     <tagclass>biz.c24.customtags.SwiftStructureTag</tagclass>
     <bodycontent>JSP</bodycontent>
     <attribute>
         <name>object</name>
         <required>true</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
     <attribute>
         <name>editable</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
     <attribute>
         <name>addImage</name>
         <required>true</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
     <attribute>
         <name>removeImage</name>
         <required>true</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
     <attribute>
         <name>inputNamePrefix</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
     <attribute>
         <name>jspName</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
 </tag>
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
StructureTag()
           
 
Method Summary
 int doStartTag()
           
protected  void generate(ComplexDataObject obj, DataComponent c, ValidationEvent[] errors, boolean visible, int thisDepth)
           
protected  void generate(ComplexDataObject obj, ValidationEvent[] errors, boolean visible)
           
protected  void generateAddRemoveButtons(ComplexDataObject obj, DataComponent c, ValidationEvent[] errors, Object value, int index, int thisDepth, boolean visible, boolean parserError)
           
protected  void generateName(ComplexDataObject obj, DataComponent c, ValidationEvent[] errors, Object value, int index, int thisDepth, boolean visible, boolean parserError)
           
protected  void generateRow(ComplexDataObject obj, DataComponent c, ValidationEvent[] errors, Object value, int index, boolean visible, boolean parserError, int thisDepth)
           
protected  void generateValue(ComplexDataObject obj, DataComponent c, ValidationEvent[] errors, Object value, int index, int thisDepth, boolean viewable, boolean parserError)
           
protected  void generateValueCustom(DataComponent c, String value, String xpath, boolean valid)
           
 String getAddImage()
          Returns the path to the image used on the add buttons.
 String getEditable()
          Gets whether this tag allows editing.
 String getInputNamePrefix()
          Returns the prefix to be used on the names of the input fields.
 String getJspName()
          Returns the name of the calling JSP.
 ComplexDataObject getObject()
          Returns the object.
 String getRemoveImage()
          Returns the path to the image used on the remove buttons.
protected  boolean isGenerateValueCustom(DataComponent c)
           
 void setAddImage(String addImage)
          Sets the path to the image used on the add buttons.
 void setEditable(String editable)
          Sets whether this tag allows editing.
 void setInputNamePrefix(String inputNamePrefix)
          Sets the prefix to be used on the names of the input fields.
 void setJspName(String jspName)
          Sets the name of the calling JSP.
 void setObject(ComplexDataObject object)
          Sets the object.
 void setRemoveImage(String removeImage)
          Sets the path to the image used on the remove buttons.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructureTag

public StructureTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

generate

protected void generate(ComplexDataObject obj,
                        ValidationEvent[] errors,
                        boolean visible)
                 throws IOException
Throws:
IOException

generate

protected void generate(ComplexDataObject obj,
                        DataComponent c,
                        ValidationEvent[] errors,
                        boolean visible,
                        int thisDepth)
                 throws IOException
Throws:
IOException

generateRow

protected void generateRow(ComplexDataObject obj,
                           DataComponent c,
                           ValidationEvent[] errors,
                           Object value,
                           int index,
                           boolean visible,
                           boolean parserError,
                           int thisDepth)
                    throws IOException
Throws:
IOException

generateAddRemoveButtons

protected void generateAddRemoveButtons(ComplexDataObject obj,
                                        DataComponent c,
                                        ValidationEvent[] errors,
                                        Object value,
                                        int index,
                                        int thisDepth,
                                        boolean visible,
                                        boolean parserError)
                                 throws IOException
Throws:
IOException

generateName

protected void generateName(ComplexDataObject obj,
                            DataComponent c,
                            ValidationEvent[] errors,
                            Object value,
                            int index,
                            int thisDepth,
                            boolean visible,
                            boolean parserError)
                     throws IOException
Throws:
IOException

generateValue

protected void generateValue(ComplexDataObject obj,
                             DataComponent c,
                             ValidationEvent[] errors,
                             Object value,
                             int index,
                             int thisDepth,
                             boolean viewable,
                             boolean parserError)
                      throws IOException
Throws:
IOException

isGenerateValueCustom

protected boolean isGenerateValueCustom(DataComponent c)

generateValueCustom

protected void generateValueCustom(DataComponent c,
                                   String value,
                                   String xpath,
                                   boolean valid)
                            throws IOException
Throws:
IOException

getObject

public ComplexDataObject getObject()
Returns the object.

Returns:
The object.

setObject

public void setObject(ComplexDataObject object)
Sets the object.

Parameters:
object - The object.

getEditable

public String getEditable()
Gets whether this tag allows editing.

Returns:
Whether this tab should allow editing.

setEditable

public void setEditable(String editable)
Sets whether this tag allows editing.

Parameters:
editable - Whether this tab should allow editing.

getAddImage

public String getAddImage()
Returns the path to the image used on the add buttons.

Returns:
The path.

setAddImage

public void setAddImage(String addImage)
Sets the path to the image used on the add buttons.

Parameters:
addImage - The path.

getRemoveImage

public String getRemoveImage()
Returns the path to the image used on the remove buttons.

Returns:
The path.

setRemoveImage

public void setRemoveImage(String removeImage)
Sets the path to the image used on the remove buttons.

Parameters:
removeImage - The path.

getInputNamePrefix

public String getInputNamePrefix()
Returns the prefix to be used on the names of the input fields.

Returns:
The prefix.

setInputNamePrefix

public void setInputNamePrefix(String inputNamePrefix)
Sets the prefix to be used on the names of the input fields.

Parameters:
inputNamePrefix - The prefix.

getJspName

public String getJspName()
Returns the name of the calling JSP.

Returns:
The jsp name.

setJspName

public void setJspName(String jspName)
Sets the name of the calling JSP.

Parameters:
jspName - The jsp name.


C24 Technologies © 2002-2012: All Rights Reserved.