org.mmbase.bridge.jsp.taglib
Class ContentTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended byorg.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended byorg.mmbase.bridge.jsp.taglib.LocaleTag
                      extended byorg.mmbase.bridge.jsp.taglib.ContentTag
All Implemented Interfaces:
BodyTag, IterationTag, Serializable, Tag

public class ContentTag
extends LocaleTag

Provided environmental information to its body's tags.

Since:
MMBase-1.7
Version:
$Id: ContentTag.java,v 1.55 2006/07/15 11:50:47 michiel Exp $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
static String ESCAPER_KEY
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.LocaleTag
cloud, KEY, locale, prevLocale, SCOPE, TZ_KEY
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ContentTag()
           
 
Method Summary
protected  void addNoCacheHeaders(HttpServletRequest request, HttpServletResponse response, long expire)
          The code first sets the Expires header to a date in the past.
protected  void determineLocale()
           
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
static CharTransformer getCharTransformer(String id, ContextReferrerTag tag)
          Gets a CharTransformer identified by id, which possibly can also be list of id's in which case a chain of chartransformers will be returned.
 String getEncoding()
           
protected  CharTransformer getPostProcessor()
           
protected static CharTransformer getSimpleCharTransformer(String id, ContextReferrerTag tag)
          Gets a CharTransformer identified by id, withouth trying to create chains of them.
static ParameterizedTransformerFactory getTransformerFactory(String id)
          Returns transformer factory with given id or throws exception if there is none
 String getType()
           
 CharTransformer getWriteEscaper()
          Called by children
protected static void readXML(InputSource escapersSource)
           
 void setEncoding(String e)
           
 void setEscaper(String e)
           
 void setExpires(String e)
           
 void setPostprocessor(String e)
           
 void setRefresh(String r)
           
 void setStatus(String s)
           
 void setType(String ct)
           
protected  void setWriteEscaper()
           
protected  void unsetWriteEscaper()
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.LocaleTag
determineFromCloudProvider, determineLocaleFromAttributes, getLocale, release, setCountry, setJspvar, setLanguage, setTimezone, setVariant
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
fillStandardParameters, findCloudProvider, findCloudProvider, getCloudContext, getCloudVar, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
findLoopOrQuery, findParentTag, findParentTag, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getDefaultLocale, getEscapedValue, getId, getObject, getObjectConditional, getPageContext, getPageContextTag, getReferid, getString, getTaglibVersion, getTimeZone, getWriterValue, haveBody, setContext, setEscape, setId, setListdelimiter, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Field Detail

ESCAPER_KEY

public static final String ESCAPER_KEY
See Also:
Constant Field Values
Constructor Detail

ContentTag

public ContentTag()
Method Detail

readXML

protected static void readXML(InputSource escapersSource)

setType

public void setType(String ct)
             throws JspTagException
Throws:
JspTagException

setEncoding

public void setEncoding(String e)
                 throws JspTagException
Throws:
JspTagException

setEscaper

public void setEscaper(String e)
                throws JspTagException
Throws:
JspTagException

setPostprocessor

public void setPostprocessor(String e)
                      throws JspTagException
Throws:
JspTagException

setExpires

public void setExpires(String e)
                throws JspTagException
Throws:
JspTagException

getType

public String getType()
               throws JspTagException
Throws:
JspTagException

setStatus

public void setStatus(String s)
               throws JspTagException
Throws:
JspTagException

setRefresh

public void setRefresh(String r)
                throws JspTagException
Throws:
JspTagException

getPostProcessor

protected CharTransformer getPostProcessor()
                                    throws JspTagException
Returns:
A CharTransformer or null if no postprocessing needed
Throws:
JspTagException - can occur if taglibcontent.xml is misconfigured

getEncoding

public String getEncoding()
                   throws JspTagException
Throws:
JspTagException

getSimpleCharTransformer

protected static CharTransformer getSimpleCharTransformer(String id,
                                                          ContextReferrerTag tag)
                                                   throws JspTagException
Gets a CharTransformer identified by id, withouth trying to create chains of them.

Throws:
JspTagException

getCharTransformer

public static CharTransformer getCharTransformer(String id,
                                                 ContextReferrerTag tag)
                                          throws JspTagException
Gets a CharTransformer identified by id, which possibly can also be list of id's in which case a chain of chartransformers will be returned.

Returns:
A CharTransformer
Throws:
JspTagException - if not transformer with given id was configured

getTransformerFactory

public static ParameterizedTransformerFactory getTransformerFactory(String id)
                                                             throws JspTagException
Returns transformer factory with given id or throws exception if there is none

Throws:
JspTagException

getWriteEscaper

public CharTransformer getWriteEscaper()
Called by children

Returns:
A CharTransformer (not null)

setWriteEscaper

protected void setWriteEscaper()
                        throws JspTagException
Throws:
JspTagException

unsetWriteEscaper

protected void unsetWriteEscaper()

determineLocale

protected void determineLocale()
                        throws JspTagException
Overrides:
determineLocale in class LocaleTag
Throws:
JspTagException
See Also:
LocaleTag.determineLocale()

doStartTag

public int doStartTag()
               throws JspTagException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class LocaleTag
Throws:
JspTagException

addNoCacheHeaders

protected void addNoCacheHeaders(HttpServletRequest request,
                                 HttpServletResponse response,
                                 long expire)
The code first sets the Expires header to a date in the past. This indicates to the recipient that the page's content have already expired, as a hint that it's contents should not be cached. The no-cache value for the Pragma header is provided by version 1.0 of the HTTP protocol to further indicate that browsers and proxy servers should not cache a page. Version 1.1 of HTTP replaces this header with a more specific Cache-Control header, but recommends including the Pragma header as well for backward compatibility.

Parameters:
response - - http response
expire - - seconds before content should expire

doEndTag

public int doEndTag()
             throws JspTagException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class LocaleTag
Throws:
JspTagException

doAfterBody

public int doAfterBody()
                throws JspTagException
Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class LocaleTag
Throws:
JspTagException


MMBase build 1.8.1.20060716