org.mmbase.bridge.jsp.taglib
Class ImageTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.mmbase.bridge.jsp.taglib.ContextReferrerTag
org.mmbase.bridge.jsp.taglib.CloudReferrerTag
org.mmbase.bridge.jsp.taglib.NodeReferrerTag
org.mmbase.bridge.jsp.taglib.FieldReferrerTag
org.mmbase.bridge.jsp.taglib.FieldTag
org.mmbase.bridge.jsp.taglib.ImageTag
- All Implemented Interfaces:
- Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, FieldProvider, TagIdentifier, Writer
- Direct Known Subclasses:
- AttachmentTag
public class ImageTag
- extends FieldTag
Produces an url to the image servlet mapping. Using this tag makes
your pages more portable to other system, and hopefully less
sensitive for future changes in how the image servlet works.
- Version:
- $Id: ImageTag.java 42414 2010-06-07 12:30:58Z michiel $
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
|
Method Summary |
int |
doEndTag()
write the value of the field. |
int |
doStartTag()
|
protected String |
encodeURL(Node node,
String servletPath)
|
protected String |
getAltAttribute(Node node)
|
protected String |
getBaseAttributes(String url,
Dimension dim)
|
protected String |
getCropTemplate(Node node,
int width,
int height,
String cropTemplate)
Returns the crop template string to be used by img servlet |
Dimension |
getDimension(Node node,
String template)
|
protected String |
getOtherAttributes()
|
protected String |
getOutputValue(int mode,
Node node,
String servletPath,
Dimension dim)
|
protected String |
getResizeTemplate(Node node,
int width,
int height)
Returns the resize template string to be used by img servlet without cropping |
String |
getServletArgument(Node node,
String t)
|
Parameters |
getServletArguments(String servletArgument,
Function servletPathFunction)
|
Function |
getServletFunction(Node node)
|
protected Node |
getServletNode(Node node,
String template)
|
protected String |
getServletPath(Node node,
String servletArgument)
|
protected String |
getSrcAttribute(String url)
|
String |
getTemplate(Node node,
String t,
int widthTemplate,
int heightTemplate,
String cropTemplate)
Get template to manipulate image |
void |
setAbsolute(String a)
|
void |
setAlign(String align)
|
void |
setAlt(String a)
|
void |
setBorder(String border)
|
void |
setCrop(String crop)
|
void |
setDisposition(String d)
|
void |
setHeight(String height)
|
void |
setHspace(String hspace)
|
void |
setMode(String m)
|
void |
setStyle(String style)
|
void |
setStyleClass(String styleClass)
|
void |
setTemplate(String t)
The transformation template |
void |
setVspace(String vspace)
|
void |
setWidth(String width)
|
void |
setXmlnamespace(String x)
|
| Methods inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag |
fillStandardParameters, findNode, findNodeProvider, findNodeProvider, getCloudVar, getLocale, getNode, getNode, getNodeFromPageContext, initTag, setElement, setNode |
| 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, setJspvar, setListdelimiter, setPageContext, setPageContextOnly, setReferid, setVartype, setWrite, setWriter |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MODE_URL
public static final int MODE_URL
- See Also:
- Constant Field Values
MODE_HTML_ATTRIBUTES
public static final int MODE_HTML_ATTRIBUTES
- See Also:
- Constant Field Values
MODE_HTML_IMG
public static final int MODE_HTML_IMG
- See Also:
- Constant Field Values
CROP_BEGIN
public static final String CROP_BEGIN
- See Also:
- Constant Field Values
CROP_MIDDLE
public static final String CROP_MIDDLE
- See Also:
- Constant Field Values
CROP_END
public static final String CROP_END
- See Also:
- Constant Field Values
URLESCAPER
public static final UrlEscaper URLESCAPER
ImageTag
public ImageTag()
setTemplate
public void setTemplate(String t)
throws JspTagException
- The transformation template
- Throws:
JspTagException
setMode
public void setMode(String m)
throws JspTagException
- Throws:
JspTagException
setAlign
public void setAlign(String align)
throws JspTagException
- Throws:
JspTagException
setBorder
public void setBorder(String border)
throws JspTagException
- Throws:
JspTagException
setStyleClass
public void setStyleClass(String styleClass)
throws JspTagException
- Throws:
JspTagException
setCrop
public void setCrop(String crop)
throws JspTagException
- Throws:
JspTagException
setHeight
public void setHeight(String height)
throws JspTagException
- Throws:
JspTagException
setHspace
public void setHspace(String hspace)
throws JspTagException
- Throws:
JspTagException
setStyle
public void setStyle(String style)
throws JspTagException
- Throws:
JspTagException
setVspace
public void setVspace(String vspace)
throws JspTagException
- Throws:
JspTagException
setWidth
public void setWidth(String width)
throws JspTagException
- Throws:
JspTagException
setAlt
public void setAlt(String a)
throws JspTagException
- Throws:
JspTagException
setAbsolute
public void setAbsolute(String a)
throws JspTagException
- Throws:
JspTagException- Since:
- MMBase-1.9.1
setDisposition
public void setDisposition(String d)
throws JspTagException
- Throws:
JspTagException- Since:
- MMBase-1.9.1
setXmlnamespace
public void setXmlnamespace(String x)
throws JspTagException
- Throws:
JspTagException- Since:
- MMBase-1.9.2
getServletNode
protected Node getServletNode(Node node,
String template)
doStartTag
public int doStartTag()
throws JspException
- Specified by:
doStartTag in interface Tag- Overrides:
doStartTag in class FieldTag
- Throws:
JspException
doEndTag
public int doEndTag()
throws JspTagException
- Description copied from class:
FieldTag
- write the value of the field.
- Specified by:
doEndTag in interface Tag- Overrides:
doEndTag in class FieldTag
- Throws:
JspTagException
getServletArgument
public String getServletArgument(Node node,
String t)
getServletPath
protected String getServletPath(Node node,
String servletArgument)
throws JspTagException
- Throws:
JspTagException
getServletFunction
public Function getServletFunction(Node node)
getServletArguments
public Parameters getServletArguments(String servletArgument,
Function servletPathFunction)
throws JspTagException
- Throws:
JspTagException
encodeURL
protected String encodeURL(Node node,
String servletPath)
- Since:
- MMBase-1.9.4
getOutputValue
protected String getOutputValue(int mode,
Node node,
String servletPath,
Dimension dim)
throws JspTagException
- Throws:
JspTagException
getSrcAttribute
protected String getSrcAttribute(String url)
throws JspTagException
- Throws:
JspTagException
getBaseAttributes
protected String getBaseAttributes(String url,
Dimension dim)
throws JspTagException
- Throws:
JspTagException
getAltAttribute
protected String getAltAttribute(Node node)
throws JspTagException
- Throws:
JspTagException
getOtherAttributes
protected String getOtherAttributes()
throws JspTagException
- Throws:
JspTagException
getDimension
public Dimension getDimension(Node node,
String template)
getTemplate
public String getTemplate(Node node,
String t,
int widthTemplate,
int heightTemplate,
String cropTemplate)
- Get template to manipulate image
- Parameters:
node - - image nodet - - custom template stringwidthTemplate - - width of image, which is used when custom is not providedheightTemplate - - height of image, which is used when custom is not providedcropTemplate - - crop the image. values are 'begin', 'middle' and 'end'.
- Returns:
- template for image
getCropTemplate
protected String getCropTemplate(Node node,
int width,
int height,
String cropTemplate)
- Returns the crop template string to be used by img servlet
- Parameters:
node - - get template for this nodewidth - - template widthheight - - template height
- Returns:
- the crop template
getResizeTemplate
protected String getResizeTemplate(Node node,
int width,
int height)
- Returns the resize template string to be used by img servlet without cropping
- Parameters:
node - - get template for this nodewidth - - template widthheight - - template height
- Returns:
- the resize template
MMBase 2.0-SNAPSHOT - null