Class TOCElement

java.lang.Object
io.goobi.viewer.model.toc.TOCElement
All Implemented Interfaces:
IAccessDeniedThumbnailOutput, Serializable

public class TOCElement extends Object implements IAccessDeniedThumbnailOutput, Serializable
Single TOC entry.
See Also:
  • Constructor Details

    • TOCElement

      public TOCElement(de.intranda.metadata.multilanguage.IMetadataValue label, String pageNo, String pageNoLabel, String iddoc, String logId, int level, String topStructPi, String thumbnailUrl, boolean accessPermissionPdf, boolean anchorOrGroup, boolean hasImages, String recordMimeType, String docStructType, String footerId)
      Creates a new TOCElement instance.
      Parameters:
      label - multilingual display label for this element
      pageNo - physical page number as string
      pageNoLabel - human-readable page label
      iddoc - Solr IDDOC identifier of this element
      logId - logical structure ID from METS
      level - nesting depth in the TOC hierarchy
      topStructPi - persistent identifier of the top-level record
      thumbnailUrl - URL of the representative thumbnail image
      accessPermissionPdf - true if PDF download is permitted
      anchorOrGroup - true if this element is an anchor or group record
      hasImages - true if the structure element has image pages
      recordMimeType - MIME type of the associated record
      docStructType - document structure type string from METS
      footerId - identifier for the associated footer configuration
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getContentServerPdfUrl

      public String getContentServerPdfUrl() throws ViewerConfigurationException
      getContentServerPdfUrl.
      Returns:
      String
      Throws:
      ViewerConfigurationException - if any.
    • isAccessPermissionPdf

      public boolean isAccessPermissionPdf()
      Checks whether the current user has permissions to download a PDFs for this element.
      Returns:
      true if the current user has PDF download permission for this TOC element, false otherwise
    • getAccessPermissionThumbnail

      public AccessPermission getAccessPermissionThumbnail()
    • setAccessPermissionThumbnail

      public void setAccessPermissionThumbnail(AccessPermission accessPermissionThumbnail)
    • getThumbnailUrl

      public String getThumbnailUrl()
      Getter for the field thumbnailUrl.
      Returns:
      the thumbnail URL for this TOC element
    • getThumbnailUrl

      public String getThumbnailUrl(int width, int height)
      Getter for the field thumbnailUrl.
      Parameters:
      width - desired thumbnail width in pixels
      height - desired thumbnail height in pixels
      Returns:
      the thumbnail URL for this TOC element scaled to the given dimensions
    • getAccessDeniedThumbnailUrl

      public String getAccessDeniedThumbnailUrl(Locale locale) throws IndexUnreachableException, DAOException
      Specified by:
      getAccessDeniedThumbnailUrl in interface IAccessDeniedThumbnailOutput
      Parameters:
      locale - locale for selecting the appropriate image
      Returns:
      Configured image URI for the given language; null if none found
      Throws:
      IndexUnreachableException
      DAOException
    • getLabel

      public String getLabel()
      Getter for the field label.
      Returns:
      the label value for the current locale, or the default value if no locale is available
    • getLabel

      public String getLabel(Locale locale)
      Getter for the field label.
      Parameters:
      locale - locale used to select the label value
      Returns:
      the label value for the given locale, or the default value if none is set for that locale
    • getLabel

      public String getLabel(String locale)
      Getter for the field label.
      Parameters:
      locale - BCP 47 language tag for label selection
      Returns:
      the label value for the given language tag, or the default value if none is set for that language
    • getMetadata

      public Map<String,String> getMetadata()
      Getter for the field metadata.
      Returns:
      the metadata map containing additional field values for this TOC element
    • getMetadataValue

      public String getMetadataValue(String key)
      getMetadataValue.
      Parameters:
      key - metadata field name to look up
      Returns:
      the metadata value for the given field name, or null if not present
    • getPageNo

      public String getPageNo()
      Getter for the field pageNo.
      Returns:
      the page number associated with this TOC element
    • getIddoc

      public String getIddoc()
      Getter for the field iddoc.
      Returns:
      the internal Solr document identifier for this TOC element
    • getPageNoLabel

      public String getPageNoLabel()
      Getter for the field pageNoLabel.
      Returns:
      the human-readable page number label for this TOC element
    • getTopStructPi

      public String getTopStructPi()
      Getter for the field topStructPi.
      Returns:
      the persistent identifier of the top-level structure this element belongs to
    • getLogId

      public String getLogId()
      Gibt die logID aus der Mets Datei zurück.
      Returns:
      the logical identifier from the METS file for this TOC element
    • getLevel

      public int getLevel()
      Getter for the field level.
      Returns:
      a int.
    • getUrl

      public String getUrl()
      getUrl.
      Returns:
      the URL for this TOC element
    • getUrl

      public String getUrl(String viewType)
      Returns the URL for this element that links to the requested view type.
      Parameters:
      viewType - name of the requested page view type
      Returns:
      the URL for this TOC element pointing to the given view type
    • getFullscreenUrl

      public String getFullscreenUrl()
      getFullscreenUrl.
      Returns:
      the URL for displaying this TOC element in fullscreen view
    • isVisible

      public boolean isVisible()
      isVisible.
      Returns:
      true if this TOC element is currently visible, false otherwise
    • setVisible

      public void setVisible(boolean visible)
      Setter for the field visible.
      Parameters:
      visible - true to show this element, false to hide it
    • getParentId

      public int getParentId()
      Getter for the field parentId.
      Returns:
      a int.
    • setParentId

      public void setParentId(int parentId)
      Setter for the field parentId.
      Parameters:
      parentId - ID of the parent TOC element
    • getID

      public int getID()
      getID.
      Returns:
      a int.
    • setID

      public void setID(int iD)
      setID.
      Parameters:
      iD - numeric ID to assign to this element
    • isExpanded

      public boolean isExpanded()
      isExpanded.
      Returns:
      true if this TOC element is currently shown expanded, false otherwise
    • setExpanded

      public void setExpanded(boolean expanded)
      Setter for the field expanded.
      Parameters:
      expanded - true if this element should be shown expanded
    • isHasChild

      public boolean isHasChild()
      isHasChild.
      Returns:
      true if this TOC element has at least one child element, false otherwise
    • setHasChild

      public void setHasChild(boolean hasChild)
      Setter for the field hasChild.
      Parameters:
      hasChild - true if this element has child elements
    • getGroupIds

      public List<String> getGroupIds()
      Getter for the field groupIds.
      Returns:
      the list of group identifier strings associated with this TOC element
    • setGroupIds

      public void setGroupIds(List<String> groupIds)
      Setter for the field groupIds.
      Parameters:
      groupIds - list of group identifier strings to assign
    • getRecordMimeType

      public String getRecordMimeType()
      Getter for the field recordMimeType.
      Returns:
      the MIME type of the record associated with this TOC element
    • isEmpty

      public boolean isEmpty()
      isEmpty.
      Returns:
      true if label is null, empty or blank