Package com.saperion.ngc.util
Class WatermarkUtil
- java.lang.Object
-
- com.saperion.ngc.util.WatermarkUtil
-
public final class WatermarkUtil extends java.lang.Object
Utility methods for watermark handling.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
adaptFilename(java.lang.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 java.lang.String
adaptFilename(java.lang.String filename, DocumentDatabaseMetaInfo metaInfo)
Changes the extension of the document's filename to .pdf when the document will be exported with a watermark.static java.lang.String
getWatermarkFile(java.lang.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
isEnabled()
-
-
-
Method Detail
-
isEnabled
public static boolean isEnabled()
- Returns:
- true if watermark feature is enabled
-
adaptFilename
public static java.lang.String adaptFilename(java.lang.String filename, DocumentDatabaseMetaInfo metaInfo)
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
public static java.lang.String adaptFilename(java.lang.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.- 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 java.lang.String getWatermarkFile(java.lang.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
-
-