Class MdeRepeatingNode

java.lang.Object
org.dlese.dpc.schemedit.autoform.mde.MdeNode
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

  • Constructor Details

    • MdeRepeatingNode

      public MdeRepeatingNode(RendererImpl renderer)
      Constructor for the MdeRepeatingNode object
      Parameters:
      renderer - the Renderer instance for this node
  • Method Details

    • render

      public abstract void render()
      Render method is supplied by concrete classes
      Specified by:
      render in class MdeNode
    • getRepeatingContentBox

      protected org.dom4j.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 org.dom4j.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: invalid input: '<'logic:iterate indexId="index" id="item" name="sef" property="repeatingMembersOf(/itemRecord/general/keywords/keyword)"> invalid input: '<'c:set var="itemPath" scope="page" value="/itemRecord/general/keywords/keyword_${keword+1}" />

      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(org.dom4j.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 org.dom4j.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 org.dom4j.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