Class TOC

java.lang.Object
io.goobi.viewer.model.toc.TOC
All Implemented Interfaces:
Serializable

public class TOC extends Object implements Serializable
Table of contents and associated functionality for a record.
See Also:
  • Constructor Details

    • TOC

      public TOC()

      Constructor for TOC.

  • Method Details

    • generate

      public void generate(StructElement structElement, boolean addAllSiblings, String mimeType, int tocCurrentPage) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException

      generate.

      Parameters:
      structElement - a StructElement object.
      addAllSiblings - a boolean.
      mimeType - a String object.
      tocCurrentPage - a int.
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
      DAOException - if any.
      ViewerConfigurationException - if any.
    • getGroupNames

      public List<String> getGroupNames()

      getGroupNames.

      Returns:
      a List object.
    • getViewForGroup

      public List<TOCElement> getViewForGroup(String group)

      getViewForGroup.

      Parameters:
      group - a String object.
      Returns:
      a List object.
    • getTreeViewForGroup

      public List<TOCElement> getTreeViewForGroup(String group)

      getTreeViewForGroup.

      Parameters:
      group - a String object.
      Returns:
      a List object.
    • getFlatView

      public List<TOCElement> getFlatView()

      getFlatView.

      Returns:
      a List object.
    • getTreeView

      public List<TOCElement> getTreeView()

      getTreeView.

      Returns:
      a List object.
    • getTreeViewSidebar

      @Deprecated(since="24.10") public List<TOCElement> getTreeViewSidebar()
      Deprecated.

      getTreeViewSidebar.

      Returns:
      a List object.
    • buildTree

      protected void buildTree(String group, int visibleLevel, int collapseThreshold, int lowestLevelToCollapse, String currentElementIdDoc)
      Parameters:
      group -
      visibleLevel -
      collapseThreshold -
      lowestLevelToCollapse -
      currentElementIdDoc -
    • getActiveElement

      public TOCElement getActiveElement()
      Recalculates the visibility of TOC elements after a +/- button has been pressed.
      Returns:
      a TOCElement object.
    • expandAll

      public void expandAll()

      expandAll.

    • collapseAll

      public void collapseAll()

      collapseAll.

    • setChildVisible

      public void setChildVisible(int id)

      setChildVisible.

      Parameters:
      id - a int.
    • setChildInvisible

      public void setChildInvisible(int id)

      setChildInvisible.

      Parameters:
      id - a int.
    • getTocElements

      public List<TOCElement> getTocElements()

      getTocElements.

      Returns:
      a List object.
    • findTocElementIndexByIddoc

      public int findTocElementIndexByIddoc(String iddoc)
      Parameters:
      iddoc - IDDOC of the element to find
      Returns:
      Index of the element with the matching IDDOC within the list of elements; -1 if none found
    • getTocVisible

      public int getTocVisible()

      Getter for the field tocVisible.

      Returns:
      the tocVisible
    • setTocVisible

      public void setTocVisible(int tocVisible)

      Setter for the field tocVisible.

      Parameters:
      tocVisible - the tocVisible to set
    • getTocInvisible

      public int getTocInvisible()

      Getter for the field tocInvisible.

      Returns:
      the tocInvisible
    • setTocInvisible

      public void setTocInvisible(int tocInvisible)

      Setter for the field tocInvisible.

      Parameters:
      tocInvisible - the tocInvisible to set
    • getMaxTocDepth

      public int getMaxTocDepth()

      Getter for the field maxTocDepth.

      Returns:
      the maxTocDepth
    • setMaxTocDepth

      public void setMaxTocDepth(int maxTocDepth)

      Setter for the field maxTocDepth.

      Parameters:
      maxTocDepth - the maxTocDepth to set
    • getTotalTocSize

      public int getTotalTocSize()

      Getter for the field totalTocSize.

      Returns:
      the totalTocSize
    • setTotalTocSize

      public void setTotalTocSize(int totalTocSize)

      Setter for the field totalTocSize.

      Parameters:
      totalTocSize - the totalTocSize to set
    • getCurrentPage

      public int getCurrentPage()

      Getter for the field currentPage.

      Returns:
      the currentPage
    • setCurrentPage

      public void setCurrentPage(int currentPage)

      Setter for the field currentPage.

      Parameters:
      currentPage - the currentPage to set
    • getNumPages

      public int getNumPages()
      Returns the number of paginator pages for the given TOC size and elements per page.
      Returns:
      a int.
    • isHasChildren

      public boolean isHasChildren()

      hasChildren.

      Returns:
      a boolean.
    • getLabel

      public String getLabel(String pi)
      Returns the label of the first found TOCElement that has the given PI as its topStructPi.
      Parameters:
      pi - a String object.
      Returns:
      a String object.
    • getLabel

      public String getLabel(String pi, String language)
      Returns the label in the given language of the first found TOCElement that has the given PI as its topStructPi.
      Parameters:
      pi - a String object.
      language - a String object.
      Returns:
      a String object.
    • getLabel

      public String getLabel(String pi, Locale locale)
      Returns the label in the given locale of the first found TOCElement that has the given PI as its topStructPi.
      Parameters:
      pi - a String object.
      locale - a Locale object.
      Returns:
      a String object.