DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.autoform.mde
Class MdeRepeatingNode

java.lang.Object
  extended by org.dlese.dpc.schemedit.autoform.mde.MdeNode
      extended by org.dlese.dpc.schemedit.autoform.mde.MdeRepeatingNode
Direct Known Subclasses:
MdeRepeatingAnyType, MdeRepeatingComplexType, MdeRepeatingDerivedContentModel, MdeRepeatingDerivedTextOnlyModel, MdeRepeatingSimpleType, MdeRepeatingSubstitutionGroup

public abstract class MdeRepeatingNode
extends MdeNode

Abstract base class for renderning MetadataEditor fields for a repeating node. Principle contribution is getRepeatingContentBox method, which builds a box (a "div" element) into which each repetition of the repeating nodes is placed (by concrete classes).

Author:
ostwald


Field Summary
 
Fields inherited from class org.dlese.dpc.schemedit.autoform.mde.MdeNode
df, formBeanName, inputHelperFile, normalizedXPath, parent, renderer, rhelper, schemaNode, sh, typeDef, xpath
 
Constructor Summary
MdeRepeatingNode(RendererImpl renderer)
          Constructor for the MdeRepeatingNode object
 
Method Summary
protected  Element emptyRepeatingElement()
          Render jsp element for adding a new repeating element that will be shown when there are no existing values for this field in the instance document.
protected  Element getIteration(String itemPath, String siblingPath, String indexId)
          Creates a repeatIteration element and attaches it to the parent.
protected  Element getRepeatingContentBox(String itemPath)
          Create a "box" for the contents of each repitition of this node, which is filled by the subclasses which build upon this method.
protected  void insertRepeatingDisplaySetup(Element baseDiv)
          Creates JSP to set the *id* for a particular node, and then to determine the display_state of that node from the collapseBean and assign it to a javascript variable.
 Element newSiblingController()
          Create new item controller that goes at the bottom of a repeating node to allow user to create a new element (sibling).
protected  void prtln(String s)
          NOT YET DOCUMENTED
abstract  void render()
          Render method is supplied by concrete classes
static void setDebug(boolean bool)
          Sets the debug attribute of the MdeRepeatingNode class
 
Methods inherited from class org.dlese.dpc.schemedit.autoform.mde.MdeNode
addHtmlComment, attachElementDebugInfo, attachElementDebugInfo, attachElementId, attachLabelDebugInfo, attachLabelDebugInfo, attachLabelDebugInfo, bestPracticesLink, embedDebugInfo, getDiv, getDiv, getInputElement, getInputHelperFile, getInstanceSchemaNamespace, getMode, getQualifiedAttributeName, getQualifiedElementName, getRenderedField, getRenderedNoInputField, getRenderedNoInputField, getRenderedNoInputField, getToolHelp, insertDisplaySetup, insertHtmlComment, isDisplayMode, isEditMode, newRenderer, newRenderer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MdeRepeatingNode

public MdeRepeatingNode(RendererImpl renderer)
Constructor for the MdeRepeatingNode object

Parameters:
renderer - the Renderer instance for this node
Method Detail

render

public abstract void render()
Render method is supplied by concrete classes

Specified by:
render in class MdeNode

getRepeatingContentBox

protected Element getRepeatingContentBox(String itemPath)
Create a "box" for the contents of each repitition of this node, which is filled by the subclasses which build upon this method.

Parameters:
itemPath - xpath with indexing to support iteration
Returns:
The repeatingContentBox value

getIteration

protected Element getIteration(String itemPath,
                               String siblingPath,
                               String indexId)
Creates a repeatIteration element and attaches it to the parent. The iteration element takes care of assigning an indexed path (i.e., *itemPath*) to the repeating items. The iteration construct is used as a framework to render the repeating elements (siblings) and their contents.

jsp example:

Parameters:
itemPath - path to individual nodes (including indexing)
siblingPath - The path shared by each of the repeating nodes
indexId - The symbol used to create the index in jsp that differentiates the repeating nodes
Returns:
A jsp iteration construct in which the repeating nodes are rendered.

insertRepeatingDisplaySetup

protected void insertRepeatingDisplaySetup(Element baseDiv)
Creates JSP to set the *id* for a particular node, and then to determine the display_state of that node from the collapseBean and assign it to a javascript variable. These elements all attached to provided baseDiv.

Parameters:
baseDiv - Element to which created elements are attached.

newSiblingController

public Element newSiblingController()
Create new item controller that goes at the bottom of a repeating node to allow user to create a new element (sibling).

This controller is not displayed in the case when the parent element is empty. In that case, the new item control is displayed with the parent element.

Returns:
Control element to add a new sibling to this repeating node.

emptyRepeatingElement

protected Element emptyRepeatingElement()
Render jsp element for adding a new repeating element that will be shown when there are no existing values for this field in the instance document.

Returns:
NOT YET DOCUMENTED

setDebug

public static void setDebug(boolean bool)
Sets the debug attribute of the MdeRepeatingNode class

Parameters:
bool - The new debug value

prtln

protected void prtln(String s)
NOT YET DOCUMENTED

Overrides:
prtln in class MdeNode
Parameters:
s - NOT YET DOCUMENTED

DLESE Tools
v1.6.0