Class WatermarkUtil

java.lang.Object
com.saperion.ngc.util.WatermarkUtil

public final class WatermarkUtil extends Object
Utility methods for watermark handling.
  • Method Details

    • isEnabled

      public static boolean isEnabled()
      Returns:
      true if watermark feature is enabled
    • adaptFilename

      public 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.
      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 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.
      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.
    • 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 document
      currentRevision - whether to resolve the current revision or not
      docService - document service needed to load metadata
      Returns:
      filename or null if not set for specified document
      Throws:
      DocumentIdentificationException - missing information in document's ID
      SystemException - system error when loading metadata
      AuthenticationException - authentication error when loading metadata
      DatabaseException - database error when loading metadata