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 String
authenticate
(HttpServletRequest request, HttpServletResponse response) Checks the user or the credentials that are included in the request.protected int
Returns the connect timeout in milliseconds.protected String
Returns the destination name.protected int
Returns the read timeout in milliseconds.protected abstract String
Returns the repository key.protected abstract String
Returns the repository unique name.void
init
(ServletConfig config) protected boolean
Indicates if the proxy should only forward read-only Browser binding requests.protected boolean
Indicates if the request must be authenticated.protected void
service
(HttpServletRequest request, HttpServletResponse response) protected boolean
Indicates if the CMIS AtomPub Binding should be exposed.protected boolean
Indicates if the CMIS Browser Binding should be exposed.protected boolean
Indicates if the CMIS 1.0 endpoints should be exposed.protected boolean
Indicates if the CMIS 1.1 endpoints should be exposed.protected boolean
Indicates 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, service
Methods 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:
init
in interfaceServlet
- Overrides:
init
in classHttpServlet
- Throws:
ServletException
-
service
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - Overrides:
service
in classHttpServlet
- Throws:
ServletException
IOException
-
getDestinationName
Returns the destination name. Default:null
- Returns:
- the destination name or
null
for 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:
true
if the CMIS Web Services Binding should be exposed,false
otherwise
-
supportAtomPubBinding
protected boolean supportAtomPubBinding()Indicates if the CMIS AtomPub Binding should be exposed. Default:true
- Returns:
true
if the CMIS AtomPub Binding should be exposed,false
otherwise
-
supportBrowserBinding
protected boolean supportBrowserBinding()Indicates if the CMIS Browser Binding should be exposed. Default:true
- Returns:
true
if the CMIS Browser Binding should be exposed,false
otherwise
-
supportCMIS_1_0
protected boolean supportCMIS_1_0()Indicates if the CMIS 1.0 endpoints should be exposed. Default:true
- Returns:
true
if CMIS 1.0 endpoints should be exposed,false
otherwise
-
supportCMIS_1_1
protected boolean supportCMIS_1_1()Indicates if the CMIS 1.1 endpoints should be exposed. Default:true
- Returns:
true
if CMIS 1.1 endpoints should be exposed,false
otherwise
-
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:
true
if user authentication is required,false
if 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
null
for 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:
true
if only read-only request should be forwarded,false
for 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
-