Class CitationLink

java.lang.Object
io.goobi.viewer.model.citation.CitationLink

public class CitationLink extends Object
Represents a configurable citation link for a digitized record.

Each link has a CitationLink.CitationLinkType (internal viewer URL or external URL), a CitationLink.CitationLinkLevel (record, docstruct, or image page), and a CitationLink.CitationLinkAction (copy to clipboard, open, or download) that determines how the link is presented to the user.

  • Constructor Details

    • CitationLink

      public CitationLink(String type, String level, String action, String label)
      Parameters:
      type - link type name (URL or INTERNAL)
      level - link level name (RECORD, DOCSTRUCT, or IMAGE)
      action - link action name (CLIPBOARD, OPEN, or DOWNLOAD)
      label - display label shown to the user
  • Method Details

    • getAction

      public CitationLink.CitationLinkAction getAction()
    • getUrl

      Parameters:
      viewManager - the ViewManager providing the current record context
      Returns:
      Appropriate URL
      Throws:
      IndexUnreachableException
      PresentationException
      DAOException
    • getType

    • getLevel

      public CitationLink.CitationLinkLevel getLevel()
    • getLabel

      public String getLabel()
    • getField

      public String getField()
    • getValue

      public String getValue()
    • setValue

      public void setValue(String value)
    • setField

      public CitationLink setField(String field)
      Parameters:
      field - the Solr field name from which the citation value is retrieved
      Returns:
      this
    • getPattern

      public String getPattern()
    • setPattern

      public CitationLink setPattern(String pattern)
      Parameters:
      pattern - the URL pattern template used to build the citation link, with placeholders for field values
      Returns:
      this
    • isTopstructValueFallback

      public boolean isTopstructValueFallback()
    • setTopstructValueFallback

      public CitationLink setTopstructValueFallback(boolean topstructValueFallback)
      Parameters:
      topstructValueFallback - true to fall back to the top-level structure element's field value when the current element has none
      Returns:
      this
    • isDefaultLink

      public boolean isDefaultLink()
    • setDefaultLink

      public CitationLink setDefaultLink(boolean defaultLink)
      Parameters:
      defaultLink - true if this is the default citation link used for the copy-link action
      Returns:
      this
    • isEmpty

      public boolean isEmpty()