Package io.goobi.viewer.model.toc
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_GROUP
ConstantDEFAULT_GROUP="_DEFAULT"
-
Constructor Summary
Constructors Constructor Description TOC()
Constructor for TOC.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
buildTree(String group, int visibleLevel, int collapseThreshold, int lowestLevelToCollapse, Long currentElementIdDoc)
void
collapseAll()
collapseAll.void
expandAll()
expandAll.int
findTocElementIndexByIddoc(String iddoc)
void
generate(StructElement structElement, boolean addAllSiblings, String mimeType, int tocCurrentPage)
generate.TOCElement
getActiveElement()
Recalculates the visibility of TOC elements after a +/- button has been pressed.int
getCurrentPage()
Getter for the fieldcurrentPage
.List<TOCElement>
getFlatView()
getFlatView.List<String>
getGroupNames()
getGroupNames.String
getLabel(String pi)
Returns the label of the first found TOCElement that has the given PI as its topStructPi.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.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.int
getMaxTocDepth()
Getter for the fieldmaxTocDepth
.int
getNumPages()
Returns the number of paginator pages for the given TOC size and elements per page.List<TOCElement>
getTocElements()
getTocElements.int
getTocInvisible()
Getter for the fieldtocInvisible
.int
getTocVisible()
Getter for the fieldtocVisible
.int
getTotalTocSize()
Getter for the fieldtotalTocSize
.List<TOCElement>
getTreeView()
getTreeView.List<TOCElement>
getTreeViewForGroup(String group)
getTreeViewForGroup.List<TOCElement>
getTreeViewSidebar()
Deprecated.List<TOCElement>
getViewForGroup(String group)
getViewForGroup.boolean
isHasChildren()
hasChildren.void
setChildInvisible(int id)
setChildInvisible.void
setChildVisible(int id)
setChildVisible.void
setCurrentPage(int currentPage)
Setter for the fieldcurrentPage
.void
setMaxTocDepth(int maxTocDepth)
Setter for the fieldmaxTocDepth
.void
setTocInvisible(int tocInvisible)
Setter for the fieldtocInvisible
.void
setTocVisible(int tocVisible)
Setter for the fieldtocVisible
.void
setTotalTocSize(int totalTocSize)
Setter for the fieldtotalTocSize
.
-
-
-
Field Detail
-
DEFAULT_GROUP
public static final String DEFAULT_GROUP
ConstantDEFAULT_GROUP="_DEFAULT"
- See Also:
- Constant Field Values
-
-
Method Detail
-
generate
public void generate(StructElement structElement, boolean addAllSiblings, String mimeType, int tocCurrentPage) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException
generate.
- Parameters:
structElement
- aStructElement
object.addAllSiblings
- a boolean.mimeType
- aString
object.tocCurrentPage
- a int.- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.DAOException
- if any.ViewerConfigurationException
- if any.
-
getViewForGroup
public List<TOCElement> getViewForGroup(String group)
getViewForGroup.
-
getTreeViewForGroup
public List<TOCElement> getTreeViewForGroup(String group)
getTreeViewForGroup.
-
getFlatView
public List<TOCElement> getFlatView()
getFlatView.
- Returns:
- a
List
object.
-
getTreeView
public List<TOCElement> getTreeView()
getTreeView.
- Returns:
- a
List
object.
-
getTreeViewSidebar
@Deprecated public List<TOCElement> getTreeViewSidebar()
Deprecated.getTreeViewSidebar.
- Returns:
- a
List
object.
-
buildTree
protected void buildTree(String group, int visibleLevel, int collapseThreshold, int lowestLevelToCollapse, Long 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.
-
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.
-
-