public class TemplateContentServlet 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".
If the user attempting the request is not authorised to access the requested node the login page will be redirected to.
BaseTemplateContentServlet.URLHelper
BaseServlet.PathRefInfo
imageResolver
FACES_SERVLET, KEY_ROOT_PATH, KEY_STORE
Constructor and Description |
---|
TemplateContentServlet()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
buildModel(ServiceRegistry services,
HttpServletRequest req,
org.alfresco.service.cmr.repository.NodeRef templateRef)
Deprecated.
Builds the FreeMarker model
|
static String |
generateURL(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef templateRef)
Deprecated.
Helper to generate a URL to process a template against a node.
|
protected org.apache.commons.logging.Log |
getLogger()
Deprecated.
Gets the logger to use for this request.
|
protected void |
service(HttpServletRequest req,
HttpServletResponse res)
Deprecated.
|
processTemplateRequest
checkAccess, getServiceRegistry, redirectToLoginPage, redirectToLoginPage, resolveNamePath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, resolveWebDAVPath, servletAuthenticate, servletAuthenticate, setNoCacheHeaders, validRedirectJSP
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
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 Map<String,Object> buildModel(ServiceRegistry services, 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 processprotected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
service
in class HttpServlet
ServletException
IOException
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public static final 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–2017 Alfresco Software. All rights reserved.