Package com.sap.ecm.api
Class AbstractCmisProxyServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.sap.ecm.api.AbstractCmisProxyServlet
- All Implemented Interfaces:
Servlet,ServletConfig,Serializable
Abstract CMIS Proxy Servlet.
This servlet forwards CMIS requests to the SAP Cloud Platform document service.
Usage:
- Create a servlet that extends this class.
- Implement at least the methods
getRepositoryUniqueName()andgetRepositoryKey(). - If you override the
init(ServletConfig)method, make sure you callsuper.init(ServletConfig). However make sure to NOT modify the servlet's paths/uris/context, otherwise the AbstractCmisProxyServlet won't work correctly. - Add your servlet to the web.xml.
For samples, check https://help.sap.com/viewer/b0cc1109d03c4dc299c215871eed8c42/Cloud/en-US/ed1c6732d4214c68846ab9813b9df943.html
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringauthenticate(HttpServletRequest request, HttpServletResponse response) Checks the user or the credentials that are included in the request.protected intReturns the connect timeout in milliseconds.protected StringReturns the destination name.protected intReturns the read timeout in milliseconds.protected abstract StringReturns the repository key.protected abstract StringReturns the repository unique name.voidinit(ServletConfig config) protected booleanIndicates if the proxy should only forward read-only Browser binding requests.protected booleanIndicates if the request must be authenticated.protected voidservice(HttpServletRequest request, HttpServletResponse response) protected booleanIndicates if the CMIS AtomPub Binding should be exposed.protected booleanIndicates if the CMIS Browser Binding should be exposed.protected booleanIndicates if the CMIS 1.0 endpoints should be exposed.protected booleanIndicates if the CMIS 1.1 endpoints should be exposed.protected booleanIndicates if the CMIS Web Services Binding should be exposed.Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
AbstractCmisProxyServlet
public AbstractCmisProxyServlet()
-
-
Method Details
-
init
- Specified by:
initin interfaceServlet- Overrides:
initin classHttpServlet- Throws:
ServletException
-
service
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - Overrides:
servicein classHttpServlet- Throws:
ServletExceptionIOException
-
getDestinationName
Returns the destination name. Default:null- Returns:
- the destination name or
nullfor the default destination.
-
getRepositoryUniqueName
Returns the repository unique name.- Returns:
- the repository unique name
-
getRepositoryKey
Returns the repository key. If a repository unique name is provided, then this method must not returnnull.- Returns:
- the repository key
-
supportWebServicesBinding
protected boolean supportWebServicesBinding()Indicates if the CMIS Web Services Binding should be exposed. Default:true- Returns:
trueif the CMIS Web Services Binding should be exposed,falseotherwise
-
supportAtomPubBinding
protected boolean supportAtomPubBinding()Indicates if the CMIS AtomPub Binding should be exposed. Default:true- Returns:
trueif the CMIS AtomPub Binding should be exposed,falseotherwise
-
supportBrowserBinding
protected boolean supportBrowserBinding()Indicates if the CMIS Browser Binding should be exposed. Default:true- Returns:
trueif the CMIS Browser Binding should be exposed,falseotherwise
-
supportCMIS_1_0
protected boolean supportCMIS_1_0()Indicates if the CMIS 1.0 endpoints should be exposed. Default:true- Returns:
trueif CMIS 1.0 endpoints should be exposed,falseotherwise
-
supportCMIS_1_1
protected boolean supportCMIS_1_1()Indicates if the CMIS 1.1 endpoints should be exposed. Default:true- Returns:
trueif CMIS 1.1 endpoints should be exposed,falseotherwise
-
requireAuthentication
protected boolean requireAuthentication()Indicates if the request must be authenticated. If this method returnstrue, the methodauthenticate(HttpServletRequest, HttpServletResponse)is called to handle the authentication of the user. Default:true- Returns:
trueif user authentication is required,falseif anonymous access should be granted
-
authenticate
protected String authenticate(HttpServletRequest request, HttpServletResponse response) throws LoginException Checks the user or the credentials that are included in the request. If this method throws an exception, the request processing is stopped. The default implementation checks if the platform delivered a remote user. If not, it asks for credentials via basic authentication.- Parameters:
request- the HTTP request objectresponse- the HTTP response object- Returns:
- the user id or
nullfor anonymous login - Throws:
LoginException- if the authentication failed
-
readOnlyMode
protected boolean readOnlyMode()Indicates if the proxy should only forward read-only Browser binding requests. Default:false- Returns:
trueif only read-only request should be forwarded,falsefor full access
-
getConnectTimeout
protected int getConnectTimeout()Returns the connect timeout in milliseconds. Default: 30,000 milliseconds -
getReadTimeout
protected int getReadTimeout()Returns the read timeout in milliseconds. Default: 300,000 milliseconds
-