Package com.saperion.ngc.servlet
Class ServletUrl
- java.lang.Object
- 
- com.saperion.ngc.servlet.ServletUrl
 
- 
 public final class ServletUrl extends java.lang.ObjectUtility class to construct the URLs required to access the servlets.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringANNOTATIONSAnnotations servlet url part.static java.lang.StringBASE_URLInit parameter for Viewer baseURL.static java.lang.StringCLIENT_LOCALEClient locale attribute.static java.lang.StringCONTENTContent servlet url part.static java.lang.StringCONTENT_LISTContent list session attribute.static java.lang.StringDDC_NAME_ATTRDDC name attribute.static java.lang.StringDOC_ELEMENT_ATTRName for document element attribute used in streaming-servlet request.static java.lang.StringDOWNLOAD_MODEDownload attribute.static java.lang.StringEDIT_MODEEdit mode attribute.static java.lang.StringFILENAME_ATTRFilename attribute.static java.lang.StringFILENAME_ENCODINGCharset used to encode the filename.static java.lang.StringJADICEANNOAnnotations servlet url part.static java.lang.StringJADICESEARCHSearch servlet url part.static java.lang.StringMASHUPMashup-servlet.static java.lang.StringOBJ_ID_ATTRName for object id (sysrowid) attribute used in streaming-servlet request.static java.lang.StringPDFCONTENTPDF content Servlet URL part.static java.lang.StringREV_CURRENT_REVISIONcurrentRevision.static java.lang.StringREV_ID_ATTRName for revision id (hdoc) attribute used in streaming-servlet request.static java.lang.StringSAP_NOTESSAP-Notes retrieval- and storage-servlet.static java.lang.StringUPLOAD_ANNOTATIONSUpload-Annotations servlet url part.static java.lang.StringVIEW_CONTENTView-content servlet url part.static java.lang.StringVIEW_TEMPORARY_CONTENTView-temporary-content servlet url part.static java.lang.StringVIEWER_CONTROLViewer-Control-Servlet URL part.static java.lang.StringVIEWER_IDPopup-id parameter.static java.lang.StringZIPZIP servlet url part.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.StringconstructDocumentUrl(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.StringconstructDocumentUrl(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.StringconstructGetPdfUrl(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.StringconstructGetPdfUrl(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.StringconstructMashupUrl(java.lang.String filename, javax.servlet.http.HttpServletRequest request)Constructs the url that is required to access the mashup-servlet.static java.lang.StringconstructSapNotesUrl(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.StringconstructSearchJadiceUrl(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)Constructs the URL needed to fulltext search.static java.lang.StringconstructTimelineUrl(DocumentId documentId, javax.servlet.http.HttpServletRequest request)Constructs the url to retrieve revision infos for timeline components.static java.lang.StringconstructViewAnnotationsUrl(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)Constructs the URL needed to view annotations.static java.lang.StringconstructViewDocumentUrl(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)Constructs the URL needed to view a document.static java.lang.StringconstructViewerControlUrl(javax.servlet.http.HttpServletRequest request)Constructs the URL that can be used to contact the ViewerControlServlet.static java.lang.StringconstructViewerControlUrl(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)Constructs the URL that can be used to contact the ViewerControlServlet.static java.lang.StringconstructViewJadiceAnnoUrl(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)Constructs the URL needed to view annotations.static java.lang.StringconstructViewTemporaryDocumentUrl(javax.servlet.http.HttpServletRequest request, java.lang.String viewerId)Constructs the URL needed to view a temporary document.static java.lang.StringconstructZipUrl(javax.servlet.http.HttpServletRequest request)Constructs the url to retrieve document content as zip file.static java.lang.StringgetBaseUrl(javax.servlet.http.HttpServletRequest request)Returns the base url of the current request without the session id.static java.lang.StringgetBaseUrl(javax.servlet.http.HttpServletRequest request, java.lang.String servletUrlPart)Returns the base url of the current request.static java.lang.StringgetBaseUrl(javax.servlet.ServletContext servletContext)Returns the base URL of the webclient.static booleanurlSessionTrackingUsed(javax.servlet.http.HttpSession session)Checks if sessions are tracked by URL-rewriting (adding ;jsessionid).
 
- 
- 
- 
Field Detail- 
FILENAME_ENCODINGpublic static final java.lang.String FILENAME_ENCODING Charset used to encode the filename.- See Also:
- Constant Field Values
 
 - 
ANNOTATIONSpublic static final java.lang.String ANNOTATIONS Annotations servlet url part.- See Also:
- Constant Field Values
 
 - 
JADICEANNOpublic static final java.lang.String JADICEANNO Annotations servlet url part.- See Also:
- Constant Field Values
 
 - 
JADICESEARCHpublic static final java.lang.String JADICESEARCH Search servlet url part.- See Also:
- Constant Field Values
 
 - 
UPLOAD_ANNOTATIONSpublic static final java.lang.String UPLOAD_ANNOTATIONS Upload-Annotations servlet url part.- See Also:
- Constant Field Values
 
 - 
ZIPpublic static final java.lang.String ZIP ZIP servlet url part.- See Also:
- Constant Field Values
 
 - 
CONTENTpublic static final java.lang.String CONTENT Content servlet url part.- See Also:
- Constant Field Values
 
 - 
VIEW_CONTENTpublic static final java.lang.String VIEW_CONTENT View-content servlet url part.- See Also:
- Constant Field Values
 
 - 
VIEW_TEMPORARY_CONTENTpublic static final java.lang.String VIEW_TEMPORARY_CONTENT View-temporary-content servlet url part.- See Also:
- Constant Field Values
 
 - 
VIEWER_CONTROLpublic static final java.lang.String VIEWER_CONTROL Viewer-Control-Servlet URL part.- See Also:
- Constant Field Values
 
 - 
PDFCONTENTpublic static final java.lang.String PDFCONTENT PDF content Servlet URL part.- See Also:
- Constant Field Values
 
 - 
SAP_NOTESpublic static final java.lang.String SAP_NOTES SAP-Notes retrieval- and storage-servlet.- See Also:
- Constant Field Values
 
 - 
MASHUPpublic static final java.lang.String MASHUP Mashup-servlet.- See Also:
- Constant Field Values
 
 - 
OBJ_ID_ATTRpublic 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_ATTRpublic 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_REVISIONpublic static final java.lang.String REV_CURRENT_REVISION currentRevision.- See Also:
- Constant Field Values
 
 - 
DOC_ELEMENT_ATTRpublic static final java.lang.String DOC_ELEMENT_ATTR Name for document element attribute used in streaming-servlet request.- See Also:
- Constant Field Values
 
 - 
FILENAME_ATTRpublic static final java.lang.String FILENAME_ATTR Filename attribute.- See Also:
- Constant Field Values
 
 - 
DDC_NAME_ATTRpublic static final java.lang.String DDC_NAME_ATTR DDC name attribute.- See Also:
- Constant Field Values
 
 - 
EDIT_MODEpublic static final java.lang.String EDIT_MODE Edit mode attribute.- See Also:
- Constant Field Values
 
 - 
CLIENT_LOCALEpublic static final java.lang.String CLIENT_LOCALE Client locale attribute.- See Also:
- Constant Field Values
 
 - 
DOWNLOAD_MODEpublic static final java.lang.String DOWNLOAD_MODE Download attribute.- See Also:
- Constant Field Values
 
 - 
CONTENT_LISTpublic static final java.lang.String CONTENT_LIST Content list session attribute.- See Also:
- Constant Field Values
 
 - 
BASE_URLpublic static final java.lang.String BASE_URL Init parameter for Viewer baseURL.- See Also:
- Constant Field Values
 
 - 
VIEWER_IDpublic 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.UnsupportedEncodingExceptionDeprecated.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 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
 
 - 
constructDocumentUrlpublic 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.UnsupportedEncodingExceptionConstructs 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
 
 - 
constructMashupUrlpublic 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
 
 - 
constructZipUrlpublic 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 attributeCONTENT_LIST. (The attribute is removed by the servlet after the ZIP was constructed).- Parameters:
- request- request
- Returns:
- url
 
 - 
constructTimelineUrlpublic 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
 
 - 
getBaseUrlpublic 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
 
 - 
getBaseUrlpublic 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
 
 - 
constructViewerControlUrlpublic 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
 
 - 
constructViewerControlUrlpublic 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
 
 - 
constructSapNotesUrlpublic 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
 
 - 
constructViewDocumentUrlpublic 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
 
 - 
constructViewTemporaryDocumentUrlpublic 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
 
 - 
constructViewAnnotationsUrlpublic 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
 
 - 
constructViewJadiceAnnoUrlpublic 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. UseconstructGetPdfUrl(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
 
 - 
constructGetPdfUrlpublic 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
 
 - 
constructSearchJadiceUrlpublic 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
 
 - 
urlSessionTrackingUsedpublic 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
 
 - 
getBaseUrlpublic 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
 
 
- 
 
-