de.laures.cewolf.taglib.tags
Class ChartImgTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by de.laures.cewolf.taglib.tags.CewolfBodyTag
              extended by de.laures.cewolf.taglib.html.AbstractHTMLBaseTag
                  extended by de.laures.cewolf.taglib.html.HTMLImgTag
                      extended by de.laures.cewolf.taglib.tags.ChartImgTag
All Implemented Interfaces:
TaglibConstants, CewolfRootTag, Mapped, WebConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
ChartImgURLTag

public class ChartImgTag
extends HTMLImgTag
implements CewolfRootTag, Mapped, TaglibConstants, WebConstants

This is the tag implementation of the <img> tag. This tag inputs the proper <img> tag into the HTML page delivered to the client. It therefor determines the chart ID which will be used by the rendering servlet to retrieve the chart.

Author:
glaures
See Also:
ChartImage, Serialized Form

Field Summary
protected  String sessionKey
           
 
Fields inherited from class de.laures.cewolf.taglib.html.HTMLImgTag
align, alt, border, forceSessionId, height, hSpace, ismap, longDesc, removeAfterRender, src, useMap, vSpace, width
 
Fields inherited from class de.laures.cewolf.taglib.html.AbstractHTMLBaseTag
clazz, dir, id, lang, onclick, ondbclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, style, title, UNDEFINED_FLOAT, UNDEFINED_INT, UNDEFINED_STR
 
Fields inherited from class de.laures.cewolf.taglib.tags.CewolfBodyTag
log
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface de.laures.cewolf.taglib.TaglibConstants
ANCHOR_EAST, ANCHOR_NORTH, ANCHOR_SOUTH, ANCHOR_WEST, TOOLTIPS_ENABLED_KEY
 
Fields inherited from interface de.laures.cewolf.WebConstants
AMPERSAND, HEIGHT_PARAM, IMG_PARAM, MIME_JPEG, MIME_PNG, MIME_SVG, REMOVE_AFTER_RENDERING, SESSIONID_KEY, WIDTH_PARAM
 
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
ChartImgTag()
           
 
Method Summary
static String buildImgURL(String renderer, javax.servlet.jsp.PageContext pageContext, String sessionKey, int width, int height, String mimeType, boolean forceSessionId, boolean removeAfterRender)
          Build the image url
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
 void enableMapping()
          Method setUsemap.
static String fixAbsolutURL(String url, javax.servlet.http.HttpServletRequest request)
          Fix an absolute url given as attribute by adding the full application url path to it.
static String fixAbsolutURL(String url, javax.servlet.jsp.PageContext pageContext)
          Same as the other fixAbsolutURL, convinience only.
 String getChartid()
           
 String getChartId()
          Method getChartId.
 int getHeight()
           
protected  String getImgURL()
          To enable further server side scriptings on JSP output the session ID is always encoded into the image URL even if cookies are enabled on the client side.
protected  String getMimeType()
           
protected  String getRenderer()
           
 Object getRenderingInfo()
          Method getImageKey.
protected  String getTagName()
           
 int getTimeout()
           
 int getWidth()
           
protected  void reset()
           
 void setChartid(String id)
           
 void setMime(String mimeType)
          Sets the mimeType.
 void setRenderer(String renderer)
           
 void setTimeout(int timeout)
           
 void writeAttributes(Writer wr)
           
 
Methods inherited from class de.laures.cewolf.taglib.html.HTMLImgTag
hasBody, isForceSessionId, isRemoveAfterRender, setAlign, setAlt, setBorder, setForceSessionId, setHeight, setHspace, setIsmap, setLongdesc, setRemoveAfterRender, setSrc, setUsemap, setVspace, setWidth, wellFormed
 
Methods inherited from class de.laures.cewolf.taglib.html.AbstractHTMLBaseTag
appendAttributeDeclaration, appendAttributeDeclaration, appendAttributeDeclaration, setClass, setDir, setHtmltitle, setLang, setOnclick, setOndbclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setStyle
 
Methods inherited from class de.laures.cewolf.taglib.tags.CewolfBodyTag
doAfterEndTag
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, 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, setPageContext, setParent
 

Field Detail

sessionKey

protected String sessionKey
Constructor Detail

ChartImgTag

public ChartImgTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class AbstractHTMLBaseTag
Throws:
javax.servlet.jsp.JspException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class AbstractHTMLBaseTag
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doEndTag()

fixAbsolutURL

public static String fixAbsolutURL(String url,
                                   javax.servlet.http.HttpServletRequest request)
Fix an absolute url given as attribute by adding the full application url path to it. It is considered absolute url (not relative) when it starts with "/"

Parameters:
url - The url to fix
request - The http request
Returns:
Fixed url contains the full path

fixAbsolutURL

public static String fixAbsolutURL(String url,
                                   javax.servlet.jsp.PageContext pageContext)
Same as the other fixAbsolutURL, convinience only.

Parameters:
url - The url to fix
pageContext - The page context
Returns:
Fixed url contains the full path

buildImgURL

public static String buildImgURL(String renderer,
                                 javax.servlet.jsp.PageContext pageContext,
                                 String sessionKey,
                                 int width,
                                 int height,
                                 String mimeType,
                                 boolean forceSessionId,
                                 boolean removeAfterRender)
Build the image url

Parameters:
renderer - the url of the renderer
pageContext - Page context
sessionKey - The session key for the image stored.
width - The width
height - The height
mimeType - the mime-type (for example png) of it
Returns:
The full url

getImgURL

protected String getImgURL()
To enable further server side scriptings on JSP output the session ID is always encoded into the image URL even if cookies are enabled on the client side.


getRenderingInfo

public Object getRenderingInfo()
                        throws CewolfException
Description copied from interface: Mapped
Method getImageKey.

Specified by:
getRenderingInfo in interface Mapped
Returns:
int
Throws:
CewolfException

getMimeType

protected String getMimeType()

reset

protected void reset()
Overrides:
reset in class HTMLImgTag

enableMapping

public void enableMapping()
Description copied from interface: Mapped
Method setUsemap.

Specified by:
enableMapping in interface Mapped

getChartId

public String getChartId()
Description copied from interface: CewolfRootTag
Method getChartId.

Specified by:
getChartId in interface CewolfRootTag
Returns:
String

setChartid

public void setChartid(String id)

getChartid

public String getChartid()

setRenderer

public void setRenderer(String renderer)

getRenderer

protected String getRenderer()

getWidth

public int getWidth()

getHeight

public int getHeight()

setMime

public void setMime(String mimeType)
Sets the mimeType.

Parameters:
mimeType - The mimeType to set

getTagName

protected String getTagName()
Overrides:
getTagName in class HTMLImgTag
See Also:
AbstractHTMLBaseTag.getTagName()

writeAttributes

public void writeAttributes(Writer wr)
Overrides:
writeAttributes in class HTMLImgTag
See Also:
AbstractHTMLBaseTag.writeAttributes(Writer)

getTimeout

public int getTimeout()
Returns:
Returns the timeout.

setTimeout

public void setTimeout(int timeout)
Parameters:
timeout - The timeout to set.


Copyright © 2012. All Rights Reserved.