Class ArchiveTree

java.lang.Object
io.goobi.viewer.model.archives.ArchiveTree
All Implemented Interfaces:
Serializable

public class ArchiveTree extends Object implements Serializable
Table of contents and associated functionality for a record. Instances can be either the default archive or a session-local copy.
See Also:
  • Field Details

  • Constructor Details

    • ArchiveTree

      public ArchiveTree()
      Creates a new TOC instance.
    • ArchiveTree

      public ArchiveTree(ArchiveTree orig)
  • Method Details

    • update

      public void update(ArchiveEntry rootElement)
      Parameters:
      rootElement - root archive entry to update the tree from
    • generate

      public void generate(ArchiveEntry root)
      Sets the given root entry, generates a new flat list and adds it to entryMap.
      Parameters:
      root - The root entry to set
    • getViewForGroup

      public List<ArchiveEntry> getViewForGroup(String group)
      getViewForGroup.
      Parameters:
      group - entry map group key to retrieve the flat view for
      Returns:
      a list of archive entries for the given group, or null if none found
    • getTreeViewForGroup

      public List<ArchiveEntry> getTreeViewForGroup(String group)
      getTreeViewForGroup.
      Parameters:
      group - entry map group key to build the tree view for
      Returns:
      a list of archive entries for the given group with tree nesting applied
    • getFlatView

      public List<ArchiveEntry> getFlatView()
      getFlatView.
      Returns:
      a flat list of all archive entries in the default group
    • getTreeView

      public List<ArchiveEntry> getTreeView()
      getTreeView.
      Returns:
      a list of archive entries for the default group with tree nesting applied
    • getVisibleTree

      public List<ArchiveEntry> getVisibleTree(boolean searchActive)
      Parameters:
      searchActive - true if a search filter is currently active
      Returns:
      List
    • resetCollapseLevel

      public void resetCollapseLevel(ArchiveEntry entry, int maxDepth)
      Recursively expands and sets visible entries at or below maxDepth; hides and collapses any below.
      Parameters:
      entry - archive entry to start recursion from
      maxDepth - maximum hierarchy level to keep expanded and visible
    • getSelectedEntry

      public ArchiveEntry getSelectedEntry()
    • setSelectedEntry

      public void setSelectedEntry(ArchiveEntry selectedEntry)
    • isExpandEntryOnSelection

      public boolean isExpandEntryOnSelection()
    • toggleSelectedEntry

      public void toggleSelectedEntry(ArchiveEntry selectedEntry)
      Parameters:
      selectedEntry - archive entry to toggle selection for
    • getTrueRootElement

      public ArchiveEntry getTrueRootElement()
    • setTrueRootElement

      public void setTrueRootElement(ArchiveEntry trueRootElement)
    • getRootElement

      public ArchiveEntry getRootElement()
      Returns:
      Root element for the default group
    • getRootElement

      public ArchiveEntry getRootElement(String group)
      Parameters:
      group - entry map group key to retrieve the root entry for
      Returns:
      Root element for the given group
    • expandAll

      public void expandAll()
      expandAll.
    • collapseAll

      public void collapseAll()
      collapseAll.
    • collapseAll

      public void collapseAll(boolean collapseAllEntries)
      Parameters:
      collapseAllEntries - If true, all invisible child children will also be collapsed
    • getTocElements

      public List<ArchiveEntry> getTocElements()
      getTocElements.
      Returns:
      a list of all archive entries in the default group
    • getFlatEntryList

      public List<ArchiveEntry> getFlatEntryList()
      Gets the hierarchical tree as a flat list.
      Returns:
      List
    • getEntryById

      public ArchiveEntry getEntryById(String identifier)
      Parameters:
      identifier - node identifier to search for in the tree
      Returns:
      the ArchiveEntry with the given identifier if it exists in the tree; null otherwise
    • search

      public void search(String searchValue)
      Parameters:
      searchValue - search string to match against node labels and IDs
    • resetSearch

      public void resetSearch()
    • isTreeFullyLoaded

      public boolean isTreeFullyLoaded()
    • isEntryVisible

      public boolean isEntryVisible(ArchiveEntry entry)
      Parameters:
      entry - archive entry to check visibility for
      Returns:
      true if given entry is currently visible; false otherwise
    • isEntryExpanded

      public boolean isEntryExpanded(ArchiveEntry entry)
      Parameters:
      entry - archive entry to check expansion state for
      Returns:
      true if given entry is currently expanded; false otherwise
    • expandEntry

      public void expandEntry(ArchiveEntry entry)
      Expands this entry and sets all sub-entries visible if their immediate parent is expanded.
      Parameters:
      entry - archive entry to expand
    • collapseEntry

      public void collapseEntry(ArchiveEntry entry)
      Collapses this entry and hides all sub-entries.
      Parameters:
      entry - archive entry to collapse
    • expandUpEntry

      public void expandUpEntry(ArchiveEntry entry)
      Expands and sets visible all ancestors of this node and expands siblings of this node.
      Parameters:
      entry - archive entry whose ancestors are to be expanded