Class CollapseBean

java.lang.Object
org.dlese.dpc.schemedit.display.CollapseBean
All Implemented Interfaces:
Serializable

public class CollapseBean extends Object implements Serializable
Maintains the state of collapsible nodes in the metadata Editor. States are OPENED and CLOSED, and the default is controlled by setDefaultState.
Author:
ostwald
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    Description of the Field
    static String
    Description of the Field
    static String
    Description of the Field
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the CollapseBean object
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all state information from the CollapseBean.
    void
    Set the state of the current element (the value returned by getId) to CLOSED.
    void
    Set the state of the specified element to CLOSED.
    void
    Debugging utility
    void
    Opens the element at the given xpath, as well as each ancestor element.
    Gets the displayState of the default element
    Gets the displayState attribute of the specified element
    Gets the id of the default element.
    boolean
    Gets the isOpen attribute of the default element
    Gets the stateMap attribute of the CollapseBean object
    void
    Opens the default element
    void
    Opens the specified element
    protected final void
    Description of the Method
    void
    Sets the defaultState attribute of the CollapseBean object
    void
    Sets the displayState attribute of the default element of the CollapseBean object
    void
    Sets the displayState for a document node corresponding to the given key.
    void
    Sets the id attribute which represets the *default element* to be operated upon when a "key" is not specified.
    void
    Find the request parameters that specify displayStates for the content boxes of the metadataEditor's instance document, and update the collapseBean so it reflects the displayStates specified by the request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • OPEN

      public static String OPEN
      Description of the Field
    • CLOSED

      public static String CLOSED
      Description of the Field
    • DEFAULT_STATE

      public static String DEFAULT_STATE
      Description of the Field
  • Constructor Details

    • CollapseBean

      public CollapseBean()
      Constructor for the CollapseBean object
  • Method Details

    • clear

      public void clear()
      Removes all state information from the CollapseBean.
    • closeElement

      public void closeElement()
      Set the state of the current element (the value returned by getId) to CLOSED.
    • closeElement

      public void closeElement(String key)
      Set the state of the specified element to CLOSED.
      Parameters:
      key - String designating an element in the instance document
    • setId

      public void setId(String id)
      Sets the id attribute which represets the *default element* to be operated upon when a "key" is not specified. Used by jsp pages to designate a particular element that will be queried, and then subsequent calls to the CollapseBean need not pass a parameter to specify the element.

      For example:

      • <jsp:setProperty name="collapseBean" property="id" value="${id}"/>
      • <c:when test="${sef.collapseBean.isOpen}">
      Parameters:
      id - The new id value
    • getId

      public String getId()
      Gets the id of the default element.
      Returns:
      The id value
    • setDefaultState

      public void setDefaultState(String state)
      Sets the defaultState attribute of the CollapseBean object
      Parameters:
      state - The new defaultState value
    • exposeElement

      public void exposeElement(String xpath)
      Opens the element at the given xpath, as well as each ancestor element.
      Parameters:
      xpath - NOT YET DOCUMENTED
    • getStateMap

      public Map getStateMap()
      Gets the stateMap attribute of the CollapseBean object
      Returns:
      The stateMap value
    • setDisplayState

      public void setDisplayState(String key, String state)
      Sets the displayState for a document node corresponding to the given key. A key is an xpath encoded to be acceptable as a javascript var (see
      invalid reference
      org.dlese.dpc.schemedit.SchemEditUtils#pathToId(String)
      )
      Parameters:
      key - An encoded xpath
      state - The new displayState value
    • setDisplayState

      public void setDisplayState(String state)
      Sets the displayState attribute of the default element of the CollapseBean object
      Parameters:
      state - The new displayState value
    • getIsOpen

      public boolean getIsOpen()
      Gets the isOpen attribute of the default element
      Returns:
      The isOpen value
    • getDisplayState

      public String getDisplayState()
      Gets the displayState of the default element
      Returns:
      The displayState value
    • getDisplayState

      public String getDisplayState(String key)
      Gets the displayState attribute of the specified element
      Parameters:
      key - Description of the Parameter
      Returns:
      The displayState value
    • openElement

      public void openElement()
      Opens the default element
    • openElement

      public void openElement(String key)
      Opens the specified element
      Parameters:
      key - an identifier for the element to open
    • displayStateMap

      public void displayStateMap()
      Debugging utility
    • update

      public void update(HttpServletRequest request)
      Find the request parameters that specify displayStates for the content boxes of the metadataEditor's instance document, and update the collapseBean so it reflects the displayStates specified by the request.
      Parameters:
      request - Description of the Parameter
    • prtln

      protected final void prtln(String s)
      Description of the Method
      Parameters:
      s - Description of the Parameter