Class WatermarkHandler
java.lang.Object
io.goobi.viewer.controller.imaging.WatermarkHandler
- All Implemented Interfaces:
Serializable
WatermarkHandler class.
- Author:
- Florian Alpers
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWatermarkHandler
(Configuration configuration, String servletPath) Constructor for WatermarkHandler. -
Method Summary
Modifier and TypeMethodDescriptiongetFooterIdIfExists
(StructElement topDocument) Return the watermark id for the givenStructElement
.Optionally returns the watermark text for the given page.Optionally returns the watermark text for the given pi.getWatermarkUrl
(de.unigoettingen.sub.commons.contentlib.imagelib.transform.Scale scale, Optional<PageType> pageType, Optional<de.unigoettingen.sub.commons.contentlib.imagelib.ImageType> imageType, Optional<String> watermarkId, Optional<String> watermarkText) Creates the watermark url for the given pageType, adding watermarkId for the currentActiveDocumentBean.getTopDocument()
and watermarkText for the currentPhysicalElement
page.getWatermarkUrl
(Optional<PhysicalElement> page, Optional<StructElement> doc, Optional<PageType> pageType) Creates the watermark url for the given pageType, adding watermarkId for the givenStructElement
andPhysicalElement
page.
-
Field Details
-
WATERMARK_TEXT_TYPE_URN
ConstantWATERMARK_TEXT_TYPE_URN="URN"
.- See Also:
-
WATERMARK_TEXT_TYPE_PURL
ConstantWATERMARK_TEXT_TYPE_PURL="PURL"
.- See Also:
-
WATERMARK_TEXT_TYPE_SOLR
ConstantWATERMARK_TEXT_TYPE_SOLR="SOLR:"
.- See Also:
-
REQUIRED_SOLR_FIELDS
ConstantREQUIRED_SOLR_FIELDS
.
-
-
Constructor Details
-
WatermarkHandler
Constructor for WatermarkHandler.
- Parameters:
configuration
- aConfiguration
object.servletPath
- aString
object.
-
-
Method Details
-
getWatermarkUrl
public Optional<String> getWatermarkUrl(Optional<PhysicalElement> page, Optional<StructElement> doc, Optional<PageType> pageType) throws ViewerConfigurationException, IndexUnreachableException, DAOException Creates the watermark url for the given pageType, adding watermarkId for the givenStructElement
andPhysicalElement
page. If the watermark height of the given pageType and image is 0, an empty optional is returned- Parameters:
page
- aOptional
object.doc
- aOptional
object.pageType
- The pageType of the currentView. Taken into consideration for footer height, if not null- Returns:
- a
Optional
object. - Throws:
ViewerConfigurationException
- if any.IndexUnreachableException
- if any.DAOException
- if any.
-
getWatermarkUrl
public Optional<String> getWatermarkUrl(de.unigoettingen.sub.commons.contentlib.imagelib.transform.Scale scale, Optional<PageType> pageType, Optional<de.unigoettingen.sub.commons.contentlib.imagelib.ImageType> imageType, Optional<String> watermarkId, Optional<String> watermarkText) throws IndexUnreachableException, DAOException, ViewerConfigurationException Creates the watermark url for the given pageType, adding watermarkId for the currentActiveDocumentBean.getTopDocument()
and watermarkText for the currentPhysicalElement
page. If the watermark height of the given pageType and image is 0, an empty optional is returned.- Parameters:
pageType
- The pageType of the currentView. Taken into consideration for footer height, if not nullscale
- aScale
object.imageType
- aOptional
object.watermarkId
- aOptional
object.watermarkText
- aOptional
object.- Returns:
- a
Optional
object. - Throws:
IndexUnreachableException
- if any.DAOException
- if any.ViewerConfigurationException
- if any.
-
getWatermarkTextIfExists
Optionally returns the watermark text for the given page. If the text is empty or none is configures, an empty optional is returned- Parameters:
page
- aPhysicalElement
object.- Returns:
- a
Optional
object.
-
getWatermarkTextIfExists
Optionally returns the watermark text for the given pi. If the text is empty or none is configures, an empty optional is returned- Parameters:
doc
- aStructElement
object.- Returns:
- a
Optional
object.
-