Class 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 filename
        metaInfo - 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 filename
        metaData - 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.