public abstract class BaseServlet
extends javax.servlet.http.HttpServlet
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseServlet.PathRefInfo
Simple structure class for returning both a NodeRef and Filename String
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FACES_SERVLET |
static java.lang.String |
KEY_ROOT_PATH |
static java.lang.String |
KEY_STORE |
| Constructor and Description |
|---|
BaseServlet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAccess(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.lang.String permission,
boolean allowLogIn)
Check the user has the given permission on the given node.
|
static org.alfresco.service.ServiceRegistry |
getServiceRegistry(javax.servlet.ServletContext sc)
Return the ServiceRegistry helper instance
|
static void |
redirectToLoginPage(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
javax.servlet.ServletContext sc)
Redirect to the Login page - saving the current URL which can be redirected back later
once the user has successfully completed the authentication process.
|
static void |
redirectToLoginPage(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
javax.servlet.ServletContext sc,
boolean sendRedirect)
Redirect to the Login page - saving the current URL which can be redirected back later
once the user has successfully completed the authentication process.
|
static BaseServlet.PathRefInfo |
resolveNamePath(javax.servlet.ServletContext sc,
java.lang.String path)
Resolve a name based into a NodeRef and Filename string
|
static org.alfresco.service.cmr.repository.NodeRef |
resolveWebDAVPath(javax.faces.context.FacesContext context,
java.lang.String[] args)
Resolves the given path elements to a NodeRef in the current repository
|
static org.alfresco.service.cmr.repository.NodeRef |
resolveWebDAVPath(javax.faces.context.FacesContext context,
java.lang.String[] args,
boolean decode)
Resolves the given path elements to a NodeRef in the current repository
|
static org.alfresco.service.cmr.repository.NodeRef |
resolveWebDAVPath(javax.servlet.ServletContext context,
java.lang.String[] args)
Resolves the given path elements to a NodeRef in the current repository
|
static org.alfresco.service.cmr.repository.NodeRef |
resolveWebDAVPath(javax.servlet.ServletContext context,
java.lang.String[] args,
boolean decode)
Resolves the given path elements to a NodeRef in the current repository
|
AuthenticationStatus |
servletAuthenticate(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Perform an authentication for the servlet request URI.
|
AuthenticationStatus |
servletAuthenticate(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
boolean redirectToLoginPage)
Perform an authentication for the servlet request URI.
|
static void |
setNoCacheHeaders(javax.servlet.http.HttpServletResponse res)
Apply the headers required to disallow caching of the response in the browser
|
static boolean |
validRedirectJSP(java.lang.String jsp)
Returns true if the specified JSP file is valid for a redirect after login.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic static final java.lang.String FACES_SERVLET
public static final java.lang.String KEY_STORE
public static final java.lang.String KEY_ROOT_PATH
public static org.alfresco.service.ServiceRegistry getServiceRegistry(javax.servlet.ServletContext sc)
sc - ServletContextpublic AuthenticationStatus servletAuthenticate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException
java.io.IOExceptionpublic AuthenticationStatus servletAuthenticate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, boolean redirectToLoginPage) throws java.io.IOException
java.io.IOExceptionpublic boolean checkAccess(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.lang.String permission,
boolean allowLogIn)
throws java.io.IOException,
javax.servlet.ServletException
req - the requestres - the responsenodeRef - the node in questionallowLogIn - Indicates whether guest users without access to the node should be redirected to the log in page. If
false, a status 403 forbidden page is displayed instead.true, if the user has accessjava.io.IOException - Signals that an I/O exception has occurred.javax.servlet.ServletException - On other errorspublic static void redirectToLoginPage(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
javax.servlet.ServletContext sc)
throws java.io.IOException
java.io.IOExceptionpublic static void redirectToLoginPage(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
javax.servlet.ServletContext sc,
boolean sendRedirect)
throws java.io.IOException
sendRedirect - allow a redirect status code to be set? If false redirect
will be via markup rather than status code (to allow the status code to be used for handshake
responses etc.java.io.IOExceptionpublic static void setNoCacheHeaders(javax.servlet.http.HttpServletResponse res)
public static boolean validRedirectJSP(java.lang.String jsp)
jsp - Filename of JSP to check, for example "/jsp/browse/browse.jsp"public static org.alfresco.service.cmr.repository.NodeRef resolveWebDAVPath(javax.faces.context.FacesContext context,
java.lang.String[] args)
context - Faces contextargs - The elements of the path to lookuppublic static org.alfresco.service.cmr.repository.NodeRef resolveWebDAVPath(javax.faces.context.FacesContext context,
java.lang.String[] args,
boolean decode)
context - Faces contextargs - The elements of the path to lookupdecode - True to decode the arg from UTF-8 format, false for no decodingpublic static org.alfresco.service.cmr.repository.NodeRef resolveWebDAVPath(javax.servlet.ServletContext context,
java.lang.String[] args)
context - ServletContext contextargs - The elements of the path to lookuppublic static org.alfresco.service.cmr.repository.NodeRef resolveWebDAVPath(javax.servlet.ServletContext context,
java.lang.String[] args,
boolean decode)
context - ServletContext contextargs - The elements of the path to lookupdecode - True to decode the arg from UTF-8 format, false for no decodingpublic static final BaseServlet.PathRefInfo resolveNamePath(javax.servlet.ServletContext sc, java.lang.String path)
sc - ServletContextpath - 'cm:name' based path using the '/' character as a separatorjava.lang.IllegalArgumentExceptionCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.