Class ServletUrl


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

      Fields 
      Modifier and Type Field Description
      static java.lang.String ANNOTATIONS
      Annotations servlet url part.
      static java.lang.String BASE_URL
      Init parameter for Viewer baseURL.
      static java.lang.String CLIENT_LOCALE
      Client locale attribute.
      static java.lang.String CONTENT
      Content servlet url part.
      static java.lang.String CONTENT_LIST
      Content list session attribute.
      static java.lang.String DDC_NAME_ATTR
      DDC name attribute.
      static java.lang.String DOC_ELEMENT_ATTR
      Name for document element attribute used in streaming-servlet request.
      static java.lang.String DOWNLOAD_MODE
      Download attribute.
      static java.lang.String EDIT_MODE
      Edit mode attribute.
      static java.lang.String FILENAME_ATTR
      Filename attribute.
      static java.lang.String FILENAME_ENCODING
      Charset used to encode the filename.
      static java.lang.String JADICEANNO
      Annotations servlet url part.
      static java.lang.String JADICESEARCH
      Search servlet url part.
      static java.lang.String MASHUP
      Mashup-servlet.
      static java.lang.String OBJ_ID_ATTR
      Name for object id (sysrowid) attribute used in streaming-servlet request.
      static java.lang.String PDFCONTENT
      PDF content Servlet URL part.
      static java.lang.String REV_CURRENT_REVISION
      currentRevision.
      static java.lang.String REV_ID_ATTR
      Name for revision id (hdoc) attribute used in streaming-servlet request.
      static java.lang.String SAP_NOTES
      SAP-Notes retrieval- and storage-servlet.
      static java.lang.String UPLOAD_ANNOTATIONS
      Upload-Annotations servlet url part.
      static java.lang.String VIEW_CONTENT
      View-content servlet url part.
      static java.lang.String VIEW_TEMPORARY_CONTENT
      View-temporary-content servlet url part.
      static java.lang.String VIEWER_CONTROL
      Viewer-Control-Servlet URL part.
      static java.lang.String VIEWER_ID
      Popup-id parameter.
      static java.lang.String ZIP
      ZIP servlet url part.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.String constructDocumentUrl​(java.lang.String revisionId, boolean currentRevision, int element, java.lang.String filename, boolean download, javax.servlet.http.HttpServletRequest request)
      Deprecated.
      download parameter will be removed and set to true in version 8.1.
      static java.lang.String constructDocumentUrl​(java.lang.String revisionId, boolean currentRevision, int element, java.lang.String filename, javax.servlet.http.HttpServletRequest request)
      Constructs the url to retrieve the document with the specified document id.
      static java.lang.String constructGetPdfUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String objectId, java.lang.String revisionId, java.lang.String ddcName, java.lang.String filename, boolean currentRevision)
      Constructs the URL for a PDF document.
      static java.lang.String constructGetPdfUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String objectId, java.lang.String revisionId, java.lang.String ddcName, java.lang.String filename, boolean currentRevision, boolean download)
      Deprecated.
      download parameter will be removed and set to true in version 8.1.
      static java.lang.String constructMashupUrl​(java.lang.String filename, javax.servlet.http.HttpServletRequest request)
      Constructs the url that is required to access the mashup-servlet.
      static java.lang.String constructSapNotesUrl​(javax.servlet.http.HttpServletRequest request)
      Constructs the URL that can be used to get or post sap notes from or to the SAPViewerNotesServlet.
      static java.lang.String constructSearchJadiceUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)
      Constructs the URL needed to fulltext search.
      static java.lang.String constructTimelineUrl​(DocumentId documentId, javax.servlet.http.HttpServletRequest request)
      Constructs the url to retrieve revision infos for timeline components.
      static java.lang.String constructViewAnnotationsUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)
      Constructs the URL needed to view annotations.
      static java.lang.String constructViewDocumentUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)
      Constructs the URL needed to view a document.
      static java.lang.String constructViewerControlUrl​(javax.servlet.http.HttpServletRequest request)
      Constructs the URL that can be used to contact the ViewerControlServlet.
      static java.lang.String constructViewerControlUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)
      Constructs the URL that can be used to contact the ViewerControlServlet.
      static java.lang.String constructViewJadiceAnnoUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)
      Constructs the URL needed to view annotations.
      static java.lang.String constructViewTemporaryDocumentUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)
      Constructs the URL needed to view a temporary document.
      static java.lang.String constructZipUrl​(javax.servlet.http.HttpServletRequest request)
      Constructs the url to retrieve document content as zip file.
      static java.lang.String getBaseUrl​(javax.servlet.http.HttpServletRequest request)
      Returns the base url of the current request without the session id.
      static java.lang.String getBaseUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String servletUrlPart)
      Returns the base url of the current request.
      static java.lang.String getBaseUrl​(javax.servlet.ServletContext servletContext)
      Returns the base URL of the webclient.
      static boolean urlSessionTrackingUsed​(javax.servlet.http.HttpSession session)
      Checks if sessions are tracked by URL-rewriting (adding ;jsessionid).
      • Methods inherited from class java.lang.Object

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

      • FILENAME_ENCODING

        public static final java.lang.String FILENAME_ENCODING
        Charset used to encode the filename.
        See Also:
        Constant Field Values
      • ANNOTATIONS

        public static final java.lang.String ANNOTATIONS
        Annotations servlet url part.
        See Also:
        Constant Field Values
      • JADICEANNO

        public static final java.lang.String JADICEANNO
        Annotations servlet url part.
        See Also:
        Constant Field Values
      • JADICESEARCH

        public static final java.lang.String JADICESEARCH
        Search servlet url part.
        See Also:
        Constant Field Values
      • UPLOAD_ANNOTATIONS

        public static final java.lang.String UPLOAD_ANNOTATIONS
        Upload-Annotations servlet url part.
        See Also:
        Constant Field Values
      • CONTENT

        public static final java.lang.String CONTENT
        Content servlet url part.
        See Also:
        Constant Field Values
      • VIEW_CONTENT

        public static final java.lang.String VIEW_CONTENT
        View-content servlet url part.
        See Also:
        Constant Field Values
      • VIEW_TEMPORARY_CONTENT

        public static final java.lang.String VIEW_TEMPORARY_CONTENT
        View-temporary-content servlet url part.
        See Also:
        Constant Field Values
      • VIEWER_CONTROL

        public static final java.lang.String VIEWER_CONTROL
        Viewer-Control-Servlet URL part.
        See Also:
        Constant Field Values
      • PDFCONTENT

        public static final java.lang.String PDFCONTENT
        PDF content Servlet URL part.
        See Also:
        Constant Field Values
      • SAP_NOTES

        public static final java.lang.String SAP_NOTES
        SAP-Notes retrieval- and storage-servlet.
        See Also:
        Constant Field Values
      • OBJ_ID_ATTR

        public static final java.lang.String OBJ_ID_ATTR
        Name for object id (sysrowid) attribute used in streaming-servlet request.
        See Also:
        Constant Field Values
      • REV_ID_ATTR

        public static final java.lang.String REV_ID_ATTR
        Name for revision id (hdoc) attribute used in streaming-servlet request.
        See Also:
        Constant Field Values
      • REV_CURRENT_REVISION

        public static final java.lang.String REV_CURRENT_REVISION
        currentRevision.
        See Also:
        Constant Field Values
      • DOC_ELEMENT_ATTR

        public static final java.lang.String DOC_ELEMENT_ATTR
        Name for document element attribute used in streaming-servlet request.
        See Also:
        Constant Field Values
      • FILENAME_ATTR

        public static final java.lang.String FILENAME_ATTR
        Filename attribute.
        See Also:
        Constant Field Values
      • DDC_NAME_ATTR

        public static final java.lang.String DDC_NAME_ATTR
        DDC name attribute.
        See Also:
        Constant Field Values
      • EDIT_MODE

        public static final java.lang.String EDIT_MODE
        Edit mode attribute.
        See Also:
        Constant Field Values
      • CLIENT_LOCALE

        public static final java.lang.String CLIENT_LOCALE
        Client locale attribute.
        See Also:
        Constant Field Values
      • DOWNLOAD_MODE

        public static final java.lang.String DOWNLOAD_MODE
        Download attribute.
        See Also:
        Constant Field Values
      • CONTENT_LIST

        public static final java.lang.String CONTENT_LIST
        Content list session attribute.
        See Also:
        Constant Field Values
      • BASE_URL

        public static final java.lang.String BASE_URL
        Init parameter for Viewer baseURL.
        See Also:
        Constant Field Values
      • VIEWER_ID

        public static final java.lang.String VIEWER_ID
        Popup-id parameter.
        See Also:
        Constant Field Values
    • Method Detail

      • constructDocumentUrl

        @Deprecated
        public static java.lang.String constructDocumentUrl​(java.lang.String revisionId,
                                                            boolean currentRevision,
                                                            int element,
                                                            java.lang.String filename,
                                                            boolean download,
                                                            javax.servlet.http.HttpServletRequest request)
                                                     throws java.io.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:
        java.io.UnsupportedEncodingException - unsupported encoding
      • constructDocumentUrl

        public static java.lang.String constructDocumentUrl​(java.lang.String revisionId,
                                                            boolean currentRevision,
                                                            int element,
                                                            java.lang.String filename,
                                                            javax.servlet.http.HttpServletRequest request)
                                                     throws java.io.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:
        java.io.UnsupportedEncodingException - unsupported encoding
      • constructMashupUrl

        public static java.lang.String constructMashupUrl​(java.lang.String filename,
                                                          javax.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 java.lang.String constructZipUrl​(javax.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 java.lang.String constructTimelineUrl​(DocumentId documentId,
                                                            javax.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 java.lang.String getBaseUrl​(javax.servlet.http.HttpServletRequest request,
                                                  java.lang.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 java.lang.String getBaseUrl​(javax.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 java.lang.String constructViewerControlUrl​(javax.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 java.lang.String constructViewerControlUrl​(javax.servlet.http.HttpServletRequest request,
                                                                 java.lang.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 java.lang.String constructSapNotesUrl​(javax.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 java.lang.String constructViewDocumentUrl​(javax.servlet.http.HttpServletRequest request,
                                                                java.lang.String viewerId)
        Constructs the URL needed to view a document.
        Parameters:
        request - servlet request
        viewerId - viewer ID
        Returns:
        URL as string
      • constructViewTemporaryDocumentUrl

        public static java.lang.String constructViewTemporaryDocumentUrl​(javax.servlet.http.HttpServletRequest request,
                                                                         java.lang.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 java.lang.String constructViewAnnotationsUrl​(javax.servlet.http.HttpServletRequest request,
                                                                   java.lang.String viewerId)
        Constructs the URL needed to view annotations.
        Parameters:
        request - servlet request
        viewerId - viewer ID
        Returns:
        URL as string
      • constructViewJadiceAnnoUrl

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

        @Deprecated
        public static java.lang.String constructGetPdfUrl​(javax.servlet.http.HttpServletRequest request,
                                                          java.lang.String objectId,
                                                          java.lang.String revisionId,
                                                          java.lang.String ddcName,
                                                          java.lang.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 java.lang.String constructGetPdfUrl​(javax.servlet.http.HttpServletRequest request,
                                                          java.lang.String objectId,
                                                          java.lang.String revisionId,
                                                          java.lang.String ddcName,
                                                          java.lang.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 java.lang.String constructSearchJadiceUrl​(javax.servlet.http.HttpServletRequest request,
                                                                java.lang.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​(javax.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 java.lang.String getBaseUrl​(javax.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