com.cc.framework.taglib.template
Class TemplateHelp

java.lang.Object
  extended bycom.cc.framework.taglib.template.TemplateHelp

public abstract class TemplateHelp
extends java.lang.Object

Helper Class for the Template Library

Version:
$Revision: 1.16 $
Author:
Harald Schulz

Constructor Summary
private TemplateHelp()
          Constructor
 
Method Summary
static java.lang.String expandResourceName(java.lang.String baseDir, java.lang.String resourceName)
          Method expandResourceName
static PageParameter getPageParameter(javax.servlet.jsp.PageContext pageContext, java.lang.String name)
          This method returns the Template Definition with the given name.
static java.util.Stack getPageStack(javax.servlet.jsp.PageContext pageContext, boolean create)
          Returns the template stack
static java.lang.String getTemplate(javax.servlet.jsp.PageContext pageContext, java.lang.String name)
          returns the Content of the specified Template
static PageDef getTopPage(javax.servlet.jsp.PageContext pageContext)
          Rtrieves the topmost page definition from the page stack
static boolean isContentPresent(javax.servlet.jsp.PageContext pageContext, java.lang.String name)
          Checks if the specified template is deklared/present
static java.lang.String resolve(javax.servlet.jsp.PageContext pageContext, java.lang.String templateList)
          This method selects the JSP-Resource for the active painter factory The template definition list is of the following format: {[factoryId:JSP-Resource;]}JSP-Resource This allows to specify a different JSP resource for each painter factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateHelp

private TemplateHelp()
Constructor

Method Detail

getPageStack

public static java.util.Stack getPageStack(javax.servlet.jsp.PageContext pageContext,
                                           boolean create)
Returns the template stack

Parameters:
pageContext - PageContext
create - if this parameter is set to true the method will create a new Stack if it is not already existing
Returns:
Stack

getTopPage

public static PageDef getTopPage(javax.servlet.jsp.PageContext pageContext)
                          throws javax.servlet.jsp.JspException
Rtrieves the topmost page definition from the page stack

Parameters:
pageContext - PageContext
Returns:
Page Definition
Throws:
javax.servlet.jsp.JspException - Is thrown when when the template stack is not propperly initialized

getPageParameter

public static PageParameter getPageParameter(javax.servlet.jsp.PageContext pageContext,
                                             java.lang.String name)
                                      throws javax.servlet.jsp.JspException
This method returns the Template Definition with the given name. The Tamplate was declared on the JSP page with the <template:put> tag.

Parameters:
pageContext - PageContext
name - Template Name
Returns:
PageParameter
Throws:
javax.servlet.jsp.JspException - Is thrown when when the template stack is not propperly initialized

isContentPresent

public static boolean isContentPresent(javax.servlet.jsp.PageContext pageContext,
                                       java.lang.String name)
                                throws javax.servlet.jsp.JspException
Checks if the specified template is deklared/present

Parameters:
pageContext - PageContext
name - Template Name
Returns:
boolean
Throws:
javax.servlet.jsp.JspException - Is thrown when when the template stack is not propperly initialized

getTemplate

public static java.lang.String getTemplate(javax.servlet.jsp.PageContext pageContext,
                                           java.lang.String name)
                                    throws javax.servlet.jsp.JspException
returns the Content of the specified Template

Parameters:
pageContext - PageContext
name - Template Name
Returns:
String
Throws:
javax.servlet.jsp.JspException - Is thrown when when the template stack is not propperly initialized

resolve

public static java.lang.String resolve(javax.servlet.jsp.PageContext pageContext,
                                       java.lang.String templateList)
This method selects the JSP-Resource for the active painter factory The template definition list is of the following format: {[factoryId:JSP-Resource;]}JSP-Resource This allows to specify a different JSP resource for each painter factory. Example:
  def:/jspDef;myPainter:/jspCustom;/jspOther
 
The example uses

Parameters:
pageContext - PageContext
templateList - template definition list
Returns:
The Template for the active painter factory

expandResourceName

public static java.lang.String expandResourceName(java.lang.String baseDir,
                                                  java.lang.String resourceName)
Method expandResourceName

Parameters:
baseDir - base directory
resourceName - Resource Name
Returns:
String


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.