Class ServletUrl

java.lang.Object
com.saperion.ngc.servlet.ServletUrl

public final class ServletUrl extends Object
Utility class to construct the URLs required to access the servlets.
  • Field Details

  • Method Details

    • constructDocumentUrl

      @Deprecated public static String constructDocumentUrl(String revisionId, boolean currentRevision, int element, String filename, boolean download, jakarta.servlet.http.HttpServletRequest request) throws UnsupportedEncodingException
      Deprecated.
      download parameter will be removed and set to true in version 8.1. Use constructDocumentUrl(String, boolean, int, String, HttpServletRequest) instead.
      Constructs the url to retrieve the document with the specified document id.
      Parameters:
      revisionId - the id of the document to retrieve
      currentRevision - currentRevision
      element - document element
      filename - filename of the element
      download - set to true to force the browser to open a download box
      overwritten if NgClientConstants.WEBCONFIG_ALWAYS_ATTACH_DOCUMENT_DOWNLOAD is true
      request - request
      Returns:
      url as string
      Throws:
      UnsupportedEncodingException - unsupported encoding
    • constructDocumentUrl

      public static String constructDocumentUrl(String revisionId, boolean currentRevision, int element, String filename, jakarta.servlet.http.HttpServletRequest request) throws UnsupportedEncodingException
      Constructs the url to retrieve the document with the specified document id.

      Download the document as attachment. Force the browser to open a download box

      Parameters:
      revisionId - the id of the document to retrieve
      currentRevision - currentRevision
      element - document element
      filename - filename of the element
      request - request
      Returns:
      url as string
      Throws:
      UnsupportedEncodingException - unsupported encoding
    • constructMashupUrl

      public static String constructMashupUrl(String filename, jakarta.servlet.http.HttpServletRequest request)
      Constructs the url that is required to access the mashup-servlet.
      Parameters:
      filename - Filename
      request - current servlet request
      Returns:
      Mashup URL
    • constructZipUrl

      public static String constructZipUrl(jakarta.servlet.http.HttpServletRequest request)
      Constructs the url to retrieve document content as zip file. The ZIP servlet requires the list of content to be set as session attribute CONTENT_LIST. (The attribute is removed by the servlet after the ZIP was constructed).
      Parameters:
      request - request
      Returns:
      url
    • constructTimelineUrl

      public static String constructTimelineUrl(DocumentId documentId, jakarta.servlet.http.HttpServletRequest request)
      Constructs the url to retrieve revision infos for timeline components.
      Parameters:
      documentId - document id
      request - request
      Returns:
      url
    • getBaseUrl

      public static String getBaseUrl(jakarta.servlet.http.HttpServletRequest request, String servletUrlPart)
      Returns the base url of the current request. The session id will be contained if the session-tracking-mode is set to URL.
      Parameters:
      request - request
      servletUrlPart - the part of the url that identifies the servlet (with leading /)
      Returns:
      base url
    • getBaseUrl

      public static String getBaseUrl(jakarta.servlet.http.HttpServletRequest request)
      Returns the base url of the current request without the session id.
      Parameters:
      request - request
      Returns:
      base url
    • constructViewerControlUrl

      public static String constructViewerControlUrl(jakarta.servlet.http.HttpServletRequest request)
      Constructs the URL that can be used to contact the ViewerControlServlet.
      Parameters:
      request - servlet request
      Returns:
      URL as string
    • constructViewerControlUrl

      public static String constructViewerControlUrl(jakarta.servlet.http.HttpServletRequest request, String viewerId)
      Constructs the URL that can be used to contact the ViewerControlServlet.
      Parameters:
      request - servlet request
      viewerId - ID of the viewer
      Returns:
      URL as string
    • constructSapNotesUrl

      public static String constructSapNotesUrl(jakarta.servlet.http.HttpServletRequest request)
      Constructs the URL that can be used to get or post sap notes from or to the SAPViewerNotesServlet.
      Parameters:
      request - servlet request
      Returns:
      URL as string
    • constructViewDocumentUrl

      public static String constructViewDocumentUrl(jakarta.servlet.http.HttpServletRequest request, String viewerId)
      Constructs the URL needed to view a document.
      Parameters:
      request - servlet request
      viewerId - viewer ID
      Returns:
      URL as string
    • constructViewTemporaryDocumentUrl

      public static String constructViewTemporaryDocumentUrl(jakarta.servlet.http.HttpServletRequest request, String viewerId)
      Constructs the URL needed to view a temporary document.
      Parameters:
      request - servlet request
      viewerId - viewer ID
      Returns:
      URL as string
    • constructViewAnnotationsUrl

      public static String constructViewAnnotationsUrl(jakarta.servlet.http.HttpServletRequest request, String viewerId)
      Constructs the URL needed to view annotations.
      Parameters:
      request - servlet request
      viewerId - viewer ID
      Returns:
      URL as string
    • constructViewJadiceAnnoUrl

      public static String constructViewJadiceAnnoUrl(jakarta.servlet.http.HttpServletRequest request, String viewerId)
      Constructs the URL needed to view annotations.
      Parameters:
      request - servlet request
      viewerId - viewer ID
      Returns:
      URL as string
    • constructGetPdfUrl

      @Deprecated public static String constructGetPdfUrl(jakarta.servlet.http.HttpServletRequest request, String objectId, String revisionId, String ddcName, String filename, boolean currentRevision, boolean download)
      Deprecated.
      download parameter will be removed and set to true in version 8.1. Use constructGetPdfUrl(HttpServletRequest, String, String, String, String, boolean) instead.
      Constructs the url for a PDF document.
      Parameters:
      request - the http request to set the given parameters
      objectId - the sysrowid attribute
      revisionId - name for revision id (hdoc) attribute
      ddcName - the ddc name
      filename - attribute
      currentRevision - if true, current revision is used
      download - if true, the references PDF will get downloaded and not displayed inline
      Returns:
      the URL string
    • constructGetPdfUrl

      public static String constructGetPdfUrl(jakarta.servlet.http.HttpServletRequest request, String objectId, String revisionId, String ddcName, String filename, boolean currentRevision)
      Constructs the URL for a PDF document.

      Download the document as attachment. Force the browser to open a download box.

      Parameters:
      request - the http request to set the given parameters
      objectId - the sysrowid attribute
      revisionId - name for revision id (hdoc) attribute
      ddcName - the ddc name
      filename - attribute
      currentRevision - if true, current revision is used
      Returns:
      the request URL as string
    • constructSearchJadiceUrl

      public static String constructSearchJadiceUrl(jakarta.servlet.http.HttpServletRequest request, String viewerId)
      Constructs the URL needed to fulltext search.
      Parameters:
      request - servlet request
      viewerId - viewer ID
      Returns:
      URL as string
    • urlSessionTrackingUsed

      public static boolean urlSessionTrackingUsed(jakarta.servlet.http.HttpSession session)
      Checks if sessions are tracked by URL-rewriting (adding ;jsessionid). This can be configured in web.xml.
      Parameters:
      session - current session
      Returns:
      true if sessions are tracked by URL
    • getBaseUrl

      public static String getBaseUrl(jakarta.servlet.ServletContext servletContext)
      Returns the base URL of the webclient. If it is configured in webclient.properties, the configured value will be returned. If not, the servlet context is used to auto-determine the URL.
      Parameters:
      servletContext - the context of the current servlet
      Returns:
      the base URL of the webclient