public class GuestTemplateContentServlet extends BaseTemplateContentServlet
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.
| Modifier and Type | Class and Description |
|---|---|
class |
GuestTemplateContentServlet.TemplateContentWork
Class to wrap the call to processTemplateRequest.
|
BaseTemplateContentServlet.URLHelperBaseServlet.PathRefInfoimageResolverFACES_SERVLET, KEY_ROOT_PATH, KEY_STORE| Constructor and Description |
|---|
GuestTemplateContentServlet() |
| Modifier and Type | Method and Description |
|---|---|
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) |
processTemplateRequestcheckAccess, getServiceRegistry, redirectToLoginPage, resolveNamePath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, servletAuthenticate, servletAuthenticate, setNoCacheHeaders, validRedirectJSPdoDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprotected org.apache.commons.logging.Log getLogger()
BaseTemplateContentServletThis will show all debug entries from this class as though they came from the subclass.
getLogger in class BaseTemplateContentServletprotected java.util.Map buildModel(org.alfresco.service.ServiceRegistry services,
javax.servlet.http.HttpServletRequest req,
org.alfresco.service.cmr.repository.NodeRef templateRef)
BaseTemplateContentServletbuildModel in class BaseTemplateContentServletservices - Service Registry instancereq - Http requesttemplateRef - The node ref of the template to processprotected 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.HttpServletjavax.servlet.ServletExceptionjava.io.IOExceptionHttpServlet.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 defaultCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.