Class WeblinkHandler

    • Constructor Detail

      • WeblinkHandler

        public WeblinkHandler()
    • Method Detail

      • from

        public static WithBuilder from​(java.lang.String archive)
        Static Weblink constructor.
        Parameters:
        archive - the archive / DDC of document
        Returns:
        the with builder
      • with

        public static ElementBuilder with​(ResultProperties document)
                                   throws com.saperion.util.LinkCreationException
        Static Weblink constructor. Uses the given ResultProperties to set the parameters filename, archive, id and field. Field is set to SYSROWID.
        Parameters:
        document - the document properties see ResultProperties.
        Returns:
        the element builder to add options see ElementBuilder
        Throws:
        com.saperion.util.LinkCreationException - the link creation exception if link creation fails
      • with

        public static ElementBuilder with​(DocumentId documentId,
                                          javax.servlet.http.HttpServletRequest request)
                                   throws com.saperion.util.LinkCreationException
        Static Weblink constructor used by SAP Viewer. Field is set to SYSROWID.
        Parameters:
        documentId - the id of the document to send
        request - current request to get session
        Returns:
        the element builder to add options see ElementBuilder
        Throws:
        com.saperion.util.LinkCreationException - the link creation exception if link creation fails
      • only

        public OptionsBuilder only​(int element)
        Only. Option to add if only one specific element of document should be downloaded.
        Specified by:
        only in interface ElementBuilder
        Parameters:
        element - the element
        Returns:
        the named builder
        See Also:
        ElementBuilder.only(int)
      • mandant

        public OptionsBuilder mandant​(java.lang.String mandant)
        Mandant.
        Specified by:
        mandant in interface OptionsBuilder
        Parameters:
        mandant - the mandant
        Returns:
        the options builder
      • timeout

        public OptionsBuilder timeout​(long timeout)
        Timeout. Option to add if link should have a timeout. After timeout milliseconds the link is no more valid.
        Specified by:
        timeout in interface OptionsBuilder
        Parameters:
        timeout - the timeout in milliseconds after the link is invalid
        Returns:
        the options builder
        See Also:
        OptionsBuilder.timeout(long)
      • toLink

        public java.lang.String toLink​(java.lang.String baseURL)
                                throws com.saperion.util.LinkCreationException
        To link. Builds the weblink url with given baseURL.
        Specified by:
        toLink in interface LinkBuilder
        Parameters:
        baseURL - the base url
        Returns:
        the string
        Throws:
        com.saperion.util.LinkCreationException - the link creation exception
        See Also:
        LinkBuilder.toLink(java.lang.String)
      • main

        public static void main​(java.lang.String[] args)
                         throws com.saperion.util.LinkCreationException
        The main method.
        Parameters:
        args - the arguments
        Throws:
        com.saperion.util.LinkCreationException - the link creation exception