Class WatermarkHandler
java.lang.Object
io.goobi.viewer.controller.imaging.WatermarkHandler
- All Implemented Interfaces:
Serializable
WatermarkHandler class.
- Author:
- Florian Alpers
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWatermarkHandler(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 currentPhysicalElementpage.getWatermarkUrl(Optional<PhysicalElement> page, Optional<StructElement> doc, Optional<PageType> pageType) Creates the watermark url for the given pageType, adding watermarkId for the givenStructElementandPhysicalElementpage.
-
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- aConfigurationobject.servletPath- aStringobject.
-
-
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 givenStructElementandPhysicalElementpage. If the watermark height of the given pageType and image is 0, an empty optional is returned- Parameters:
page- aOptionalobject.doc- aOptionalobject.pageType- The pageType of the currentView. Taken into consideration for footer height, if not null- Returns:
- a
Optionalobject. - 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 currentPhysicalElementpage. If the watermark height of the given pageType and image is 0, an empty optional is returned.- Parameters:
scale- aScaleobject.pageType- The pageType of the currentView. Taken into consideration for footer height, if not nullimageType- aOptionalobject.watermarkId- aOptionalobject.watermarkText- aOptionalobject.- Returns:
- a
Optionalobject. - 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- aPhysicalElementobject.- Returns:
- a
Optionalobject.
-
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- aStructElementobject.- Returns:
- a
Optionalobject.
-