|
|||||||||
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
org.alfresco.web.app.servlet.BaseTemplateContentServlet
org.alfresco.web.app.servlet.GuestTemplateContentServlet
public class GuestTemplateContentServlet
Servlet responsible for streaming content from a template processed against a node directly to the response stream.
The URL to the servlet should be generated thus:
/alfresco/template/workspace/SpacesStore/0000-0000-0000-0000or
/alfresco/template/workspace/SpacesStore/0000-0000-0000-0000/workspace/SpacesStore/0000-0000-0000-0000or
/alfresco/template?templatePath=/Company%20Home/Data%20Dictionary/Presentation%20Templates/doc_info.ftl&contextPath=/Company%20Home/mydoc.txt
The store protocol, followed by the store ID, followed by the content Node Id used to identify the node to execute the default template for. The second set of elements encode the store and node Id of the template to used if a default is not set or not requested. Instead of using NodeRef references to the template and context, path arguments can be used. The URL args of 'templatePath' and 'contextPath' can be used instead to specify name based encoded Paths to the template and its context.
The URL may be followed by a 'mimetype' argument specifying the mimetype to return the result as on the stream. Otherwise it is assumed that HTML is the default response mimetype.
Like most Alfresco servlets, the URL may be followed by a valid 'ticket' argument for authentication: ?ticket=1234567890
And/or also followed by the "?guest=true" argument to force guest access login for the URL. If the guest=true parameter is used the current session will be logged out and the guest user logged in. Therefore upon completion of this request the current user will be "guest".
This servlet only accesses content available to the guest user. If the guest user does not have access to the requested a 401 Forbidden response is returned to the caller.
This servlet does not effect the current session, therefore if guest access is required to a resource this servlet can be used without logging out the current user.
Nested Class Summary | |
---|---|
class |
GuestTemplateContentServlet.TemplateContentWork
Class to wrap the call to processTemplateRequest. |
Nested classes/interfaces inherited from class org.alfresco.web.app.servlet.BaseTemplateContentServlet |
---|
BaseTemplateContentServlet.URLHelper |
Nested classes/interfaces inherited from class org.alfresco.web.app.servlet.BaseServlet |
---|
BaseServlet.PathRefInfo |
Field Summary |
---|
Fields inherited from class org.alfresco.web.app.servlet.BaseTemplateContentServlet |
---|
imageResolver |
Fields inherited from class org.alfresco.web.app.servlet.BaseServlet |
---|
FACES_SERVLET, KEY_ROOT_PATH, KEY_STORE |
Constructor Summary | |
---|---|
GuestTemplateContentServlet()
|
Method Summary | |
---|---|
protected java.util.Map |
buildModel(org.alfresco.service.ServiceRegistry services,
javax.servlet.http.HttpServletRequest req,
org.alfresco.service.cmr.repository.NodeRef templateRef)
Builds the FreeMarker model |
static java.lang.String |
generateURL(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef templateRef)
Helper to generate a URL to process a template against a node. |
protected org.apache.commons.logging.Log |
getLogger()
Gets the logger to use for this request. |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
Methods inherited from class org.alfresco.web.app.servlet.BaseTemplateContentServlet |
---|
processTemplateRequest |
Methods inherited from class org.alfresco.web.app.servlet.BaseServlet |
---|
checkAccess, getServiceRegistry, redirectToLoginPage, resolveNamePath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, servletAuthenticate, servletAuthenticate, setNoCacheHeaders, validRedirectJSP |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, 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 |
Constructor Detail |
---|
public GuestTemplateContentServlet()
Method Detail |
---|
protected org.apache.commons.logging.Log getLogger()
BaseTemplateContentServlet
This will show all debug entries from this class as though they came from the subclass.
getLogger
in class BaseTemplateContentServlet
protected java.util.Map buildModel(org.alfresco.service.ServiceRegistry services, javax.servlet.http.HttpServletRequest req, org.alfresco.service.cmr.repository.NodeRef templateRef)
BaseTemplateContentServlet
buildModel
in class BaseTemplateContentServlet
services
- Service Registry instancereq
- Http requesttemplateRef
- The node ref of the template to process
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public static final java.lang.String generateURL(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef templateRef)
The result of the template is supplied returned as the response.
nodeRef
- NodeRef of the content node to generate URL for (cannot be null)templateRef
- NodeRef of the template to process against, or null to use default
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |