Package com.saperion.ngc.servlet
Class ServletUrl
java.lang.Object
com.saperion.ngc.servlet.ServletUrl
Utility class to construct the URLs required to access the servlets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Annotations servlet url part.static final String
Init parameter for Viewer baseURL.static final String
Client locale attribute.static final String
Content servlet url part.static final String
Content list session attribute.static final String
DDC name attribute.static final String
Name for document element attribute used in streaming-servlet request.static final String
Download attribute.static final String
Edit mode attribute.static final String
Filename attribute.static final String
Charset used to encode the filename.static final String
Annotations servlet url part.static final String
Search servlet url part.static final String
Mashup-servlet.static final String
Name for object id (sysrowid) attribute used in streaming-servlet request.static final String
PDF content Servlet URL part.static final String
currentRevision.static final String
Name for revision id (hdoc) attribute used in streaming-servlet request.static final String
SAP-Notes retrieval- and storage-servlet.static final String
Upload-Annotations servlet url part.static final String
View-content servlet url part.static final String
View-temporary-content servlet url part.static final String
Viewer-Control-Servlet URL part.static final String
Popup-id parameter.static final String
ZIP servlet url part. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
constructDocumentUrl
(String revisionId, boolean currentRevision, int element, String filename, boolean download, jakarta.servlet.http.HttpServletRequest request) Deprecated.download parameter will be removed and set to true in version 8.1.static String
constructDocumentUrl
(String revisionId, boolean currentRevision, int element, String filename, jakarta.servlet.http.HttpServletRequest request) Constructs the url to retrieve the document with the specified document id.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.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.static String
constructMashupUrl
(String filename, jakarta.servlet.http.HttpServletRequest request) Constructs the url that is required to access the mashup-servlet.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.static String
constructSearchJadiceUrl
(jakarta.servlet.http.HttpServletRequest request, String viewerId) Constructs the URL needed to fulltext search.static String
constructTimelineUrl
(DocumentId documentId, jakarta.servlet.http.HttpServletRequest request) Constructs the url to retrieve revision infos for timeline components.static String
constructViewAnnotationsUrl
(jakarta.servlet.http.HttpServletRequest request, String viewerId) Constructs the URL needed to view annotations.static String
constructViewDocumentUrl
(jakarta.servlet.http.HttpServletRequest request, String viewerId) Constructs the URL needed to view a document.static String
constructViewerControlUrl
(jakarta.servlet.http.HttpServletRequest request) Constructs the URL that can be used to contact the ViewerControlServlet.static String
constructViewerControlUrl
(jakarta.servlet.http.HttpServletRequest request, String viewerId) Constructs the URL that can be used to contact the ViewerControlServlet.static String
constructViewJadiceAnnoUrl
(jakarta.servlet.http.HttpServletRequest request, String viewerId) Constructs the URL needed to view annotations.static String
constructViewTemporaryDocumentUrl
(jakarta.servlet.http.HttpServletRequest request, String viewerId) Constructs the URL needed to view a temporary document.static String
constructZipUrl
(jakarta.servlet.http.HttpServletRequest request) Constructs the url to retrieve document content as zip file.static String
getBaseUrl
(jakarta.servlet.http.HttpServletRequest request) Returns the base url of the current request without the session id.static String
getBaseUrl
(jakarta.servlet.http.HttpServletRequest request, String servletUrlPart) Returns the base url of the current request.static String
getBaseUrl
(jakarta.servlet.ServletContext servletContext) Returns the base URL of the webclient.static boolean
urlSessionTrackingUsed
(jakarta.servlet.http.HttpSession session) Checks if sessions are tracked by URL-rewriting (adding ;jsessionid).
-
Field Details
-
FILENAME_ENCODING
Charset used to encode the filename.- See Also:
-
ANNOTATIONS
Annotations servlet url part.- See Also:
-
JADICEANNO
Annotations servlet url part.- See Also:
-
JADICESEARCH
Search servlet url part.- See Also:
-
UPLOAD_ANNOTATIONS
Upload-Annotations servlet url part.- See Also:
-
ZIP
ZIP servlet url part.- See Also:
-
CONTENT
Content servlet url part.- See Also:
-
VIEW_CONTENT
View-content servlet url part.- See Also:
-
VIEW_TEMPORARY_CONTENT
View-temporary-content servlet url part.- See Also:
-
VIEWER_CONTROL
Viewer-Control-Servlet URL part.- See Also:
-
PDFCONTENT
PDF content Servlet URL part.- See Also:
-
SAP_NOTES
SAP-Notes retrieval- and storage-servlet.- See Also:
-
MASHUP
Mashup-servlet.- See Also:
-
OBJ_ID_ATTR
Name for object id (sysrowid) attribute used in streaming-servlet request.- See Also:
-
REV_ID_ATTR
Name for revision id (hdoc) attribute used in streaming-servlet request.- See Also:
-
REV_CURRENT_REVISION
currentRevision.- See Also:
-
DOC_ELEMENT_ATTR
Name for document element attribute used in streaming-servlet request.- See Also:
-
FILENAME_ATTR
Filename attribute.- See Also:
-
DDC_NAME_ATTR
DDC name attribute.- See Also:
-
EDIT_MODE
Edit mode attribute.- See Also:
-
CLIENT_LOCALE
Client locale attribute.- See Also:
-
DOWNLOAD_MODE
Download attribute.- See Also:
-
CONTENT_LIST
Content list session attribute.- See Also:
-
BASE_URL
Init parameter for Viewer baseURL.- See Also:
-
VIEWER_ID
Popup-id parameter.- See Also:
-
-
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. UseconstructDocumentUrl(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 retrievecurrentRevision
- currentRevisionelement
- document elementfilename
- filename of the elementdownload
- set to true to force the browser to open a download box
overwritten if NgClientConstants.WEBCONFIG_ALWAYS_ATTACH_DOCUMENT_DOWNLOAD is truerequest
- 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 retrievecurrentRevision
- currentRevisionelement
- document elementfilename
- filename of the elementrequest
- 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
- Filenamerequest
- current servlet request- Returns:
- Mashup URL
-
constructZipUrl
Constructs the url to retrieve document content as zip file. The ZIP servlet requires the list of content to be set as session attributeCONTENT_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 idrequest
- 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
- requestservletUrlPart
- the part of the url that identifies the servlet (with leading /)- Returns:
- base url
-
getBaseUrl
Returns the base url of the current request without the session id.- Parameters:
request
- request- Returns:
- base url
-
constructViewerControlUrl
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 requestviewerId
- ID of the viewer- Returns:
- URL as string
-
constructSapNotesUrl
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 requestviewerId
- 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 requestviewerId
- 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 requestviewerId
- 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 requestviewerId
- 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. UseconstructGetPdfUrl(HttpServletRequest, String, String, String, String, boolean)
instead.Constructs the url for a PDF document.- Parameters:
request
- the http request to set the given parametersobjectId
- the sysrowid attributerevisionId
- name for revision id (hdoc) attributeddcName
- the ddc namefilename
- attributecurrentRevision
- if true, current revision is useddownload
- 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 parametersobjectId
- the sysrowid attributerevisionId
- name for revision id (hdoc) attributeddcName
- the ddc namefilename
- attributecurrentRevision
- 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 requestviewerId
- 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
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
-