Package io.goobi.viewer.model.citation
Class CitationLink
java.lang.Object
io.goobi.viewer.model.citation.CitationLink
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the user-facing action triggered when aCitationLinkis activated.static enumDefines the structural level of a digitized object to which aCitationLinkrefers.static enumDefines whether aCitationLinkpoints to an internal viewer URL or an external URL built from a Solr field value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetField()getLabel()getLevel()getType()getUrl(ViewManager viewManager) getValue()booleanisEmpty()booleansetPattern(String pattern) setTopstructValueFallback(boolean topstructValueFallback) void
-
Constructor Details
-
CitationLink
- 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
-
getUrl
public String getUrl(ViewManager viewManager) throws PresentationException, IndexUnreachableException, DAOException - Parameters:
viewManager- the ViewManager providing the current record context- Returns:
- Appropriate URL
- Throws:
IndexUnreachableExceptionPresentationExceptionDAOException
-
getType
-
getLevel
-
getLabel
-
getField
-
getValue
-
setValue
-
setField
- Parameters:
field- the Solr field name from which the citation value is retrieved- Returns:
- this
-
getPattern
-
setPattern
- Parameters:
pattern- the URL pattern template used to build the citation link, with placeholders for field values- Returns:
- this
-
isTopstructValueFallback
public boolean isTopstructValueFallback() -
setTopstructValueFallback
- Parameters:
topstructValueFallback- true to fall back to the top-level structure element's field value when the current element has none- Returns:
- this
-
isEmpty
public boolean isEmpty()
-