DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.autoform
Class ViewerRenderer

java.lang.Object
  extended by org.dlese.dpc.schemedit.autoform.Renderer
      extended by org.dlese.dpc.schemedit.autoform.RendererImpl
          extended by org.dlese.dpc.schemedit.autoform.ViewerRenderer
Direct Known Subclasses:
EditorViewerRenderer

public class ViewerRenderer
extends RendererImpl

Renders JSP for viewing metadata records within the DCS (as opposed to within a metadata editor).

Shows only elements that are either required or that have values. Element labels have "editMe" links that open a metadata editor to the selected element for editing.

Author:
ostwald

Field Summary
 
Fields inherited from class org.dlese.dpc.schemedit.autoform.RendererImpl
DISPLAY_MODE, EDIT_MODE
 
Fields inherited from class org.dlese.dpc.schemedit.autoform.Renderer
df, formBeanName, normalizedXPath, parent, repeatingComplexSingletonChildPath, rhelper, root, schemaNode, sh, typeDef, typeName, xpath
 
Constructor Summary
ViewerRenderer()
           
 
Method Summary
 ComplexTypeLabel getComplexTypeLabel(String xpath, String siblingPath, String indexId)
          Gets the complexTypeLabel attribute of the ViewerRenderer object
 Element getDeleteController(String itemPath, String elementName)
          Gets the deleteController attribute of the ViewerRenderer object
protected  Element getEditMeTag(String xpath)
          Gets the editMeTag attribute of the ViewerRenderer object
protected  Element getEditMeTag(String xpath, String siblingPath, String indexId)
          creates a jsp tag (st:dcsViewEditMeLabel) that renders a label as a link that will open the metadata editor to this field.
 Element getInputElement(String xpath, SchemaNode schemaNode, GlobalDef typeDef)
          Gets the inputElement attribute of the ViewerRenderer object
 Element getMultiSelectInput(String xpath)
          Renders a multiSelect input (a set of of checkboxes) as an Element.
 Element getOptionalItemControl(String xpath)
          View pages do not have conrols!
 Element getRenderedField_1(String xpath, Label label, Element inputField)
          Formats the label and value for the current node.
 Element getRenderedField_2(String xpath, Label label, Element inputField)
          Gets the labelledInputField_2 attribute of the ViewerRenderer object
 Element getRenderedField(String xpath, Label label, Element inputField)
          Gets the labelledInputField attribute of the ViewerRenderer object
 SimpleTypeLabel getSimpleTypeLabel(String xpath, String siblingPath, String indexId)
          Gets the simpleTypeLabel attribute of the ViewerRenderer object
protected  Element getStaticSimpleValue(String xpath)
          Displays the value of the element at specified xpath
 Element hasValueTest(String xpath)
          test for whether a node has a value
 Element missingValueTest(String xpath)
          test for whether a node has a value
 void renderAttribute()
          Render an attribute
 void renderChoice(Element choiceElement)
          Render a choice Compositor
 void renderComplexTypeConcrete()
          A complexType is displayed iff: it is required or it satisfies the viewNode predicate.
 void renderRepeatingElement()
          Render a repeating element
 void renderSequence(Element sequence)
          Render a Sequence Compositor
 void renderSimpleTypeConcrete()
          Concrete render method for SimpleType elements
 void renderSubElements()
          Render the subElements of the current typeDefinition
 void renderSubElements(List subElements)
          Render the provided list of subelements
static void setDebug(boolean verbose)
          Sets the debug attribute of the ViewerRenderer class
 
Methods inherited from class org.dlese.dpc.schemedit.autoform.RendererImpl
bestPracticesLink, doInit, getBooleanInput, getComboUnionInput, getComplexTypeLabel, getInputHelperElement, getLabelText, getLanguageInput, getMultiBoxInput, getMultiBoxLabel, getReadOnlyElement, getRenderedField, getRenderMode, getSelectInput, getShowNSPrefixInLabels, getSimpleTypeLabel, getTextAreaInput, getTextAreaInput, getTextInput, getToolHelp, getXpath, isDisplayMode, isEditMode, renderDerivedContentModel, renderDerivedTextOnlyModel, renderInputElement, renderModelGroup, renderRepeatingSubstitutionGroup, renderSubElements, report, setRenderMode, setShowNSPrefixInLabels, showXsdStringElement
 
Methods inherited from class org.dlese.dpc.schemedit.autoform.Renderer
doInit, getDiv, getDiv, getLevel, getSchemaNamespace, getSchemaNSPrefix, getXmlFormat, init, jspQuotedString, renderComplexType, renderNode, renderSimpleType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewerRenderer

public ViewerRenderer()
Method Detail

renderAttribute

public void renderAttribute()
Render an attribute

Overrides:
renderAttribute in class RendererImpl

renderSimpleTypeConcrete

public void renderSimpleTypeConcrete()
Concrete render method for SimpleType elements

Overrides:
renderSimpleTypeConcrete in class RendererImpl

renderChoice

public void renderChoice(Element choiceElement)
Render a choice Compositor

Overrides:
renderChoice in class RendererImpl
Parameters:
choiceElement - NOT YET DOCUMENTED

renderComplexTypeConcrete

public void renderComplexTypeConcrete()
A complexType is displayed iff: it is required or it satisfies the viewNode predicate.

approach:

  • a tester element (viewNode) implements the jsp to insure it should be shown
  • the tester node is attached to this nodes parent in the render tree.

    Overrides:
    renderComplexTypeConcrete in class RendererImpl

  • renderSequence

    public void renderSequence(Element sequence)
    Render a Sequence Compositor

    Overrides:
    renderSequence in class RendererImpl
    Parameters:
    sequence - The Sequence element

    renderRepeatingElement

    public void renderRepeatingElement()
    Render a repeating element

    Overrides:
    renderRepeatingElement in class RendererImpl

    renderSubElements

    public void renderSubElements(List subElements)
    Render the provided list of subelements

    Overrides:
    renderSubElements in class RendererImpl
    Parameters:
    subElements - list of subElements to render

    renderSubElements

    public void renderSubElements()
    Render the subElements of the current typeDefinition

    Overrides:
    renderSubElements in class RendererImpl

    getInputElement

    public Element getInputElement(String xpath,
                                   SchemaNode schemaNode,
                                   GlobalDef typeDef)
    Gets the inputElement attribute of the ViewerRenderer object

    Overrides:
    getInputElement in class RendererImpl
    Parameters:
    xpath - xpath of inputElement
    schemaNode - schemaNode of element
    typeDef - typeDef of element
    Returns:
    The inputElement value

    getStaticSimpleValue

    protected Element getStaticSimpleValue(String xpath)
    Displays the value of the element at specified xpath

    Parameters:
    xpath - xpath of element for which we render the value
    Returns:
    The textInput value

    getMultiSelectInput

    public Element getMultiSelectInput(String xpath)
    Renders a multiSelect input (a set of of checkboxes) as an Element. The multiSelect is represented as a HTML table

    Overrides:
    getMultiSelectInput in class RendererImpl
    Parameters:
    xpath - xpath of element for which we render an input
    Returns:
    The multiSelectInput as an element

    getOptionalItemControl

    public Element getOptionalItemControl(String xpath)
    View pages do not have conrols!

    Overrides:
    getOptionalItemControl in class RendererImpl
    Parameters:
    xpath - NOT YET DOCUMENTED
    Returns:
    null

    getDeleteController

    public Element getDeleteController(String itemPath,
                                       String elementName)
    Gets the deleteController attribute of the ViewerRenderer object

    Overrides:
    getDeleteController in class RendererImpl
    Parameters:
    itemPath - NOT YET DOCUMENTED
    elementName - NOT YET DOCUMENTED
    Returns:
    The deleteController value

    getSimpleTypeLabel

    public SimpleTypeLabel getSimpleTypeLabel(String xpath,
                                              String siblingPath,
                                              String indexId)
    Gets the simpleTypeLabel attribute of the ViewerRenderer object

    Overrides:
    getSimpleTypeLabel in class RendererImpl
    Parameters:
    xpath - NOT YET DOCUMENTED
    siblingPath - NOT YET DOCUMENTED
    indexId - NOT YET DOCUMENTED
    Returns:
    The simpleTypeLabel value

    getComplexTypeLabel

    public ComplexTypeLabel getComplexTypeLabel(String xpath,
                                                String siblingPath,
                                                String indexId)
    Gets the complexTypeLabel attribute of the ViewerRenderer object

    Overrides:
    getComplexTypeLabel in class RendererImpl
    Parameters:
    xpath - normalized xpath to the field for this label
    siblingPath - xpath to reach all siblings
    indexId - jsp variable used to generate indicies for repeating fields
    Returns:
    The complexTypeLabel value

    getEditMeTag

    protected Element getEditMeTag(String xpath)
    Gets the editMeTag attribute of the ViewerRenderer object

    Parameters:
    xpath - NOT YET DOCUMENTED
    Returns:
    The editMeTag value

    getEditMeTag

    protected Element getEditMeTag(String xpath,
                                   String siblingPath,
                                   String indexId)
    creates a jsp tag (st:dcsViewEditMeLabel) that renders a label as a link that will open the metadata editor to this field.

    If provided, siblingPath parameter includes indexing (e.g., /record/general_${index+1}_) to make the proper link to an indexed field.

    Parameters:
    xpath - NOT YET DOCUMENTED
    siblingPath - NOT YET DOCUMENTED
    indexId - NOT YET DOCUMENTED
    Returns:
    The editMeTag value

    getRenderedField

    public Element getRenderedField(String xpath,
                                    Label label,
                                    Element inputField)
    Gets the labelledInputField attribute of the ViewerRenderer object

    Overrides:
    getRenderedField in class RendererImpl
    Parameters:
    xpath - NOT YET DOCUMENTED
    label - NOT YET DOCUMENTED
    inputField - NOT YET DOCUMENTED
    Returns:
    The labelledInputField value

    getRenderedField_2

    public Element getRenderedField_2(String xpath,
                                      Label label,
                                      Element inputField)
    Gets the labelledInputField_2 attribute of the ViewerRenderer object

    Parameters:
    xpath - NOT YET DOCUMENTED
    label - NOT YET DOCUMENTED
    inputField - NOT YET DOCUMENTED
    Returns:
    The labelledInputField_2 value

    getRenderedField_1

    public Element getRenderedField_1(String xpath,
                                      Label label,
                                      Element inputField)
    Formats the label and value for the current node.

    NOTE: this probably shouldn't be here, since it is misnamed (it does not have anything to do with "input"). To fix this problem we have to change super classes to differentiate between renders that create edit inputs and those that simply display values.

    Parameters:
    xpath - NOT YET DOCUMENTED
    label - NOT YET DOCUMENTED
    inputField - NOT YET DOCUMENTED
    Returns:
    The labelledInputField_1 value

    missingValueTest

    public Element missingValueTest(String xpath)
    test for whether a node has a value

    Parameters:
    xpath - NOT YET DOCUMENTED
    Returns:
    NOT YET DOCUMENTED

    hasValueTest

    public Element hasValueTest(String xpath)
    test for whether a node has a value

    Parameters:
    xpath - NOT YET DOCUMENTED
    Returns:
    NOT YET DOCUMENTED

    setDebug

    public static void setDebug(boolean verbose)
    Sets the debug attribute of the ViewerRenderer class

    Parameters:
    verbose - The new debug value

    DLESE Tools
    v1.6.0