Class MailUtil


  • public final class MailUtil
    extends java.lang.Object
    Utility for sending mails.
    Since:
    7.5
    Author:
    art
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String createDocumentLink​(ResultProperties item, int element, java.lang.String filename, java.lang.String baseUrl, java.lang.String tenant)
      Creates a weblink to given file of the given document.
      static java.lang.String createDocumentZipLink​(DocumentId documentId, javax.servlet.http.HttpServletRequest request, java.lang.String filename, java.lang.String baseUrl, long timeout, java.lang.String tenant)
      Creates a weblink to all files of the given document as ZIP.
      static java.lang.String createDocumentZipLink​(ResultProperties item, java.lang.String filename, java.lang.String baseUrl, java.lang.String tenant)
      Creates a weblink to all files of the given document as ZIP.
      static java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> getElementInfos​(DocumentId documentId)
      Gets a list of information for the elements of the given document.
      static com.saperion.connector.formats.SourceFormat getSourceFormat​(java.lang.String filename)
      Returns the SourceFormat that matches the specified filename.
      static java.util.Map<com.saperion.connector.formats.SourceFormat,​java.lang.Integer> getSourceFormats​(DocumentId documentId)
      Returns a map with the SourceFormats of the elements of the document identified by the specified ID.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createDocumentZipLink

        public static java.lang.String createDocumentZipLink​(ResultProperties item,
                                                             java.lang.String filename,
                                                             java.lang.String baseUrl,
                                                             java.lang.String tenant)
                                                      throws com.saperion.util.LinkCreationException
        Creates a weblink to all files of the given document as ZIP.
        Parameters:
        item - document for which the weblink should be created
        filename - name of the resulting ZIP file
        baseUrl - URL to the REST webservices
        tenant - name of the tenant. This would be used for authentication later (webservices)
        Returns:
        weblink to ZIP of all files of the given document
        Throws:
        com.saperion.util.LinkCreationException - if creation of link failes
      • createDocumentZipLink

        public static java.lang.String createDocumentZipLink​(DocumentId documentId,
                                                             javax.servlet.http.HttpServletRequest request,
                                                             java.lang.String filename,
                                                             java.lang.String baseUrl,
                                                             long timeout,
                                                             java.lang.String tenant)
                                                      throws com.saperion.util.LinkCreationException
        Creates a weblink to all files of the given document as ZIP.
        Parameters:
        documentId - document for which the weblink should be created
        request - the current request
        filename - name of the resulting ZIP file
        baseUrl - URL to the REST webservices
        timeout - timeout for the link in milliseconds
        tenant - the tenant of the current user
        Returns:
        weblink to ZIP of all files of the given document
        Throws:
        com.saperion.util.LinkCreationException - if creation of link failes
      • createDocumentLink

        public static java.lang.String createDocumentLink​(ResultProperties item,
                                                          int element,
                                                          java.lang.String filename,
                                                          java.lang.String baseUrl,
                                                          java.lang.String tenant)
                                                   throws com.saperion.util.LinkCreationException
        Creates a weblink to given file of the given document.
        Parameters:
        item - document for which the weblink should be created
        element - number of the file for which the weblink should be created
        filename - name of the file for which the weblink should be created
        baseUrl - URL to the REST webservices
        tenant - name of the tenant. This would be used for authentication later (webservices)
        Returns:
        weblink to given file of the given document
        Throws:
        com.saperion.util.LinkCreationException - if creation of link failes
      • getSourceFormats

        public static java.util.Map<com.saperion.connector.formats.SourceFormat,​java.lang.Integer> getSourceFormats​(DocumentId documentId)
                                                                                                                   throws DocumentIdentificationException,
                                                                                                                          AuthenticationException,
                                                                                                                          SystemException
        Returns a map with the SourceFormats of the elements of the document identified by the specified ID. SourceFormats are mapped to a counter that shows how many elements with the same format were found.
        Parameters:
        documentId - the ID of the document
        Returns:
        map with all source-formats mapped to a counter
        Throws:
        DocumentIdentificationException - when the ID did not contain the required information
        AuthenticationException - when the user was not logged in or has insufficient privileges to read the document
        SystemException - when the document could not be read due to a system-error
      • getSourceFormat

        public static com.saperion.connector.formats.SourceFormat getSourceFormat​(java.lang.String filename)
        Returns the SourceFormat that matches the specified filename.
        Parameters:
        filename - filename to get a SourceFormat for
        Returns:
        the SourceFormat