Package com.saperion.ngc.util
Class WatermarkUtil
java.lang.Object
com.saperion.ngc.util.WatermarkUtil
Utility methods for watermark handling.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
adaptFilename
(String filename, com.saperion.intf.SaPropertyValue[] metaData) Changes the extension of the document's filename to .pdf when the document will be exported with a watermark.static String
adaptFilename
(String filename, DocumentDatabaseMetaInfo metaInfo) Changes the extension of the document's filename to .pdf when the document will be exported with a watermark.static String
getWatermarkFile
(String hDoc, boolean currentRevision, DocumentService docService) Gets the watermark file property of a document which is set in the WATERMARKFILE field in the document's metadata.static boolean
-
Method Details
-
isEnabled
public static boolean isEnabled()- Returns:
- true if watermark feature is enabled
-
adaptFilename
Changes the extension of the document's filename to .pdf when the document will be exported with a watermark.- Parameters:
filename
- Original filenamemetaInfo
- database metadata of the document to check if watermark is enabled- Returns:
- Adapted filename with pdf extension if watermark feature is enabled. If not, the original filename is returned.
-
adaptFilename
Changes the extension of the document's filename to .pdf when the document will be exported with a watermark.- Parameters:
filename
- Original filenamemetaData
- metadata of the document to check if watermark is enabled- Returns:
- Adapted filename with pdf extension if watermark feature is enabled. If not, the original filename is returned.
-
getWatermarkFile
public static String getWatermarkFile(String hDoc, boolean currentRevision, DocumentService docService) throws DocumentIdentificationException, SystemException, AuthenticationException, DatabaseException Gets the watermark file property of a document which is set in the WATERMARKFILE field in the document's metadata.- Parameters:
hDoc
- hdoc of the documentcurrentRevision
- whether to resolve the current revision or notdocService
- document service needed to load metadata- Returns:
- filename or null if not set for specified document
- Throws:
DocumentIdentificationException
- missing information in document's IDSystemException
- system error when loading metadataAuthenticationException
- authentication error when loading metadataDatabaseException
- database error when loading metadata
-