com.arsdigita.cms.dispatcher
Interface TemplateResolver

All Known Subinterfaces:
ItemTemplateResolver
All Known Implementing Classes:
AbstractTemplateResolver, CategoryItemResolverImpl, DefaultTemplateResolver

public interface TemplateResolver

Reimplementation, based on ItemTemplateResolver

Many sites offer alternative views of the same content item depending on device or browser, or on user preference. For example, a site may have "plain" and "fancy" versions of its pages. The fancy versions would be the defaults, while the plain versions would be appropriate for users with low-bandwidth connections, older browsers, or a distaste for flashy appurtenances. In this the case the selection might be made based on a cookie.

Another common example is the "printable" version of a page. In this case a query variable might be more appropriate.

Version:
$Revision: #9 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Karl Goldstein (karlg@arsdigita.com)

Field Summary
static String versionId
           
 
Method Summary
 String getTemplate(ContentSection section, ContentItem item, javax.servlet.http.HttpServletRequest request)
          Returns the JSP template filename relative to the webapp root.
 String getTemplateContext(javax.servlet.http.HttpServletRequest request)
          Gets the template context from the request.
 String getTemplatePath(Template template)
          Returns the JSP template filename relative to the webapp root for a given Template reference.
 String getTemplateXSLPath(Template template)
          Returns the XSL template filename relative to the webapp root for a given Template reference.
 void setTemplateContext(String sTemplateContext, javax.servlet.http.HttpServletRequest request)
          Sets the TemplateContext parameter in the request
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Method Detail

getTemplate

public String getTemplate(ContentSection section,
                          ContentItem item,
                          javax.servlet.http.HttpServletRequest request)
Returns the JSP template filename relative to the webapp root.

Parameters:
section - The ContentSection for the request
item - The ContentItem for the request
request - The current HttpServletRequest
Returns:
The path to the jsp template.

getTemplatePath

public String getTemplatePath(Template template)
Returns the JSP template filename relative to the webapp root for a given Template reference.

Parameters:
template - The Template to resolve the URL for.
Returns:
The path to the jsp template.

getTemplateXSLPath

public String getTemplateXSLPath(Template template)
Returns the XSL template filename relative to the webapp root for a given Template reference.

Parameters:
template - The Template to resolve the URL for.
Returns:
The path to the xsl template.

setTemplateContext

public void setTemplateContext(String sTemplateContext,
                               javax.servlet.http.HttpServletRequest request)
Sets the TemplateContext parameter in the request

Parameters:
sTemplateContext - the template context to set
request - the request in which to set the template context

getTemplateContext

public String getTemplateContext(javax.servlet.http.HttpServletRequest request)
Gets the template context from the request.

Parameters:
request - the request from which to get the template context
Returns:
the template context


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC