|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.alfresco.web.app.servlet.BaseServlet
public abstract class BaseServlet
Base servlet class containing useful constant values and common methods for Alfresco servlets.
Nested Class Summary | |
---|---|
static class |
BaseServlet.PathRefInfo
Simple structure class for returning both a NodeRef and Filename String |
Field Summary | |
---|---|
static java.lang.String |
FACES_SERVLET
|
static java.lang.String |
KEY_ROOT_PATH
|
static java.lang.String |
KEY_STORE
|
Constructor Summary | |
---|---|
BaseServlet()
|
Method Summary | |
---|---|
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 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. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FACES_SERVLET
public static final java.lang.String KEY_STORE
public static final java.lang.String KEY_ROOT_PATH
Constructor Detail |
---|
public BaseServlet()
Method Detail |
---|
public static org.alfresco.service.ServiceRegistry getServiceRegistry(javax.servlet.ServletContext sc)
sc
- ServletContext
public AuthenticationStatus servletAuthenticate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException
java.io.IOException
public AuthenticationStatus servletAuthenticate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, boolean redirectToLoginPage) throws java.io.IOException
java.io.IOException
public 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 access
java.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.IOException
public 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 separator
java.lang.IllegalArgumentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |