org.mmbase.bridge.jsp.taglib
Class ContentTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended by org.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended by org.mmbase.bridge.jsp.taglib.LocaleTag
                      extended by org.mmbase.bridge.jsp.taglib.ContentTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally

public class ContentTag
extends LocaleTag

Provided environmental information to its body's tags.

Since:
MMBase-1.7
Version:
$Id: ContentTag.java 42361 2010-06-01 12:44:40Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
(package private) static CharTransformer COPY
           
(package private) static ContentTag DEFAULT
           
static String ENCODEURLS_KEY
           
static String ESCAPER_KEY
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.LocaleTag
cloud, KEY, locale, prevCloudLocale, prevJstlLocale, SCOPE, TZ_KEY, varyHeaders
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
cloudId
 
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 setDisposition(String d)
           
 void setEncodeurls(String u)
           
 void setEncoding(String e)
           
 void setEscaper(String e)
           
 void setExpires(String e)
           
 void setPostprocessor(String e)
           
 void setType(String ct)
           
 void setUnacceptable(String u)
           
(package private)  void setUser(UserContext newUser)
          Sets a user.
 void setVaries(String v)
           
protected  void setWriteEscaper()
           
protected  void unsetWriteEscaper()
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.LocaleTag
addVary, determineFromCloudProvider, determineLocaleFromAttributes, doFinally, getLocale, 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
appendMoreParameters, doCatch, findLoopOrQuery, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getCurrentBlock, getDefaultLocale, getEscapedValue, getFormTag, getId, getLocaleFromContext, getObject, getObjectConditional, getPageContext, getPageContextTag, getQuery, getReferid, getString, getTaglibVersion, getThreadPageContext, getTimeZone, getWriterValue, haveBody, release, setContext, setEscape, setId, setListdelimiter, setPageContext, setPageContextOnly, 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

COPY

static final CharTransformer COPY

ESCAPER_KEY

public static final String ESCAPER_KEY
See Also:
Constant Field Values

ENCODEURLS_KEY

public static final String ENCODEURLS_KEY
See Also:
Constant Field Values

DEFAULT

static final ContentTag DEFAULT
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

setDisposition

public void setDisposition(String d)
                    throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8.5

setVaries

public void setVaries(String v)
               throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.9.1

getType

public String getType()
               throws JspTagException
Throws:
JspTagException

setUnacceptable

public void setUnacceptable(String u)
                     throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8.5

setEncodeurls

public void setEncodeurls(String u)
                   throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.9.4

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
Since:
MMBase 1.8.1

doEndTag

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

setUser

void setUser(UserContext newUser)
       throws JspTagException
Sets a user. This is used by cloud-tag.

Throws:
JspTagException

doAfterBody

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


MMBase 2.0-SNAPSHOT - null