Class WatermarkHandler
java.lang.Object
io.goobi.viewer.controller.imaging.WatermarkHandler
- All Implemented Interfaces:
- Serializable
WatermarkHandler class.
- Author:
- Florian Alpers
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionWatermarkHandler(Configuration configuration, String servletPath) Constructor for WatermarkHandler.
- 
Method SummaryModifier 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_URNConstantWATERMARK_TEXT_TYPE_URN="URN".- See Also:
 
- 
WATERMARK_TEXT_TYPE_PURLConstantWATERMARK_TEXT_TYPE_PURL="PURL".- See Also:
 
- 
WATERMARK_TEXT_TYPE_SOLRConstantWATERMARK_TEXT_TYPE_SOLR="SOLR:".- See Also:
 
- 
REQUIRED_SOLR_FIELDSConstantREQUIRED_SOLR_FIELDS.
 
- 
- 
Constructor Details- 
WatermarkHandlerConstructor for WatermarkHandler. - Parameters:
- configuration- a- Configurationobject.
- servletPath- a- Stringobject.
 
 
- 
- 
Method Details- 
getWatermarkUrlpublic 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- a- Optionalobject.
- doc- a- Optionalobject.
- 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.
 
- 
getWatermarkUrlpublic 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- a- Scaleobject.
- pageType- The pageType of the currentView. Taken into consideration for footer height, if not null
- imageType- a- Optionalobject.
- watermarkId- a- Optionalobject.
- watermarkText- a- Optionalobject.
- Returns:
- a Optionalobject.
- Throws:
- IndexUnreachableException- if any.
- DAOException- if any.
- ViewerConfigurationException- if any.
 
- 
getWatermarkTextIfExistsOptionally returns the watermark text for the given page. If the text is empty or none is configures, an empty optional is returned- Parameters:
- page- a- PhysicalElementobject.
- Returns:
- a Optionalobject.
 
- 
getWatermarkTextIfExistsOptionally returns the watermark text for the given pi. If the text is empty or none is configures, an empty optional is returned- Parameters:
- doc- a- StructElementobject.
- Returns:
- a Optionalobject.
 
 
-