Package org.opencms.jsp
Class CmsJspTagImage
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspImageScalerTagSupport
org.opencms.jsp.CmsJspTagImage
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag,I_CmsJspTagParamParent
Creates HTML code for <img src> tags that use the OpenCms image scaling capabilities.
- Since:
- 6.2.0
- See Also:
-
Field Summary
Fields inherited from class org.opencms.jsp.CmsJspImageScalerTagSupport
m_scaler, m_src, SCALE_ATTR_HEIGHT, SCALE_ATTR_MAXHEIGHT, SCALE_ATTR_MAXWIDTH, SCALE_ATTR_POSITION, SCALE_ATTR_QUALITY, SCALE_ATTR_RENDERMODE, SCALE_ATTR_TYPE, SCALE_ATTR_WIDTHFields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, String value) Add a parameter to this tag.intdoEndTag()intReturns.BodyTag.EVAL_BODY_BUFFEREDgetAlign()Returns the value of the HTML "align" attribute.getAlt()Returns the value of the HTML "alt" attribute.Returns the value of the HTML "border" attribute.Returns the value of the HTML "class" attribute.Returns the value of the HTML "hspace" attribute.getId()Returns the value of the HTML "id" attribute.Returns the value of the HTML "longdesc" attribute.getName()Returns the value of the HTML "name" attribute.getNoDim()Returns"true"if the created HTML image tag does not contain height and width attributes.static CmsImageScalergetScaler(CmsImageScaler scaler, CmsImageScaler original, String scaleParam) Creates the images scaler used by this image tag.getStyle()Returns the value of the HTML "style" attribute.getTitle()Returns the value of the HTML "title" attribute.Returns the value of the HTML "usemap" attribute.Returns the value of the HTML "vspace" attribute.static StringimageTagAction(String src, CmsImageScaler scaler, Map<String, String> attributes, boolean partialTag, boolean noDim, javax.servlet.ServletRequest req) Internal action method to create the tag content.static StringimageTagAction(String src, CmsImageScaler scaler, Map<String, String> attributes, boolean partialTag, javax.servlet.ServletRequest req) Internal action method to create the tag content.Returns"true"if the HTML tag should only be created as partial tag.voidrelease()Does some cleanup and creates a new ImageScaler before the tag is released to the tag pool.voidSets the value of the HTML "align" attribute.voidSets the value of the HTML "alt" attribute.voidSets the value of the HTML "border" attribute.voidsetCssclass(String value) Sets the value of the HTML "class" attribute.voidSets the value of the HTML "hspace" attribute.voidSets the value of the HTML "id" attribute.voidsetLongdesc(String value) Sets the value of the HTML "longdesc" attribute.voidSets the value of the HTML "name" attribute.voidControls if the created HTML image tag contains height and width attributes.voidsetPartialTag(String partialTag) Controls if the created HTML image tag is a full or partial tag.voidSets the value of the HTML "style" attribute.voidSets the value of the HTML "title" attribute.voidSets the value of the HTML "usemap" attribute.voidSets the value of the HTML "vspace" attribute.Methods inherited from class org.opencms.jsp.CmsJspImageScalerTagSupport
getHeight, getMaxHeight, getMaxWidth, getScaleColor, getScaleFilter, getScalePosition, getScaleQuality, getScaleRendermode, getScaleType, getSrc, getWidth, setHeight, setMaxHeight, setMaxWidth, setScaleColor, setScaleFilter, setScalePosition, setScaleQuality, setScaleRendermode, setScaleType, setSrc, setWidthMethods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
CmsJspTagImage
public CmsJspTagImage()Creates a new image scaling tag instance.
-
-
Method Details
-
getScaler
public static CmsImageScaler getScaler(CmsImageScaler scaler, CmsImageScaler original, String scaleParam) Creates the images scaler used by this image tag.- Parameters:
scaler- the scaler created from this tags parametersoriginal- a scaler that contains the original image dimensionsscaleParam- optional scaler parameters for cropping- Returns:
- the images scaler used by this image tag
-
imageTagAction
public static String imageTagAction(String src, CmsImageScaler scaler, Map<String, String> attributes, boolean partialTag, boolean noDim, javax.servlet.ServletRequest req) throws CmsExceptionInternal action method to create the tag content.- Parameters:
src- the image sourcescaler- the image scaleing parametersattributes- the additional image HTML attributespartialTag- iftrue, the opening<imgand closing/>is omittednoDim- iftrue, theheightandwidthattributes are omittedreq- the current request- Returns:
- the created <img src> tag content
- Throws:
CmsException- in case something goes wrong
-
imageTagAction
public static String imageTagAction(String src, CmsImageScaler scaler, Map<String, String> attributes, boolean partialTag, javax.servlet.ServletRequest req) throws CmsExceptionInternal action method to create the tag content.- Parameters:
src- the image sourcescaler- the image scaleing parametersattributes- the additional image HTML attributespartialTag- iftrue, the opening<imgand closing/>is omittedreq- the current request- Returns:
- the created <img src> tag content
- Throws:
CmsException- in case something goes wrong
-
addParameter
Description copied from interface:I_CmsJspTagParamParentAdd a parameter to this tag. The intent is that the <param> subtag will call this to register parameters. Assumes that 'name' and 'value' are appropriately encoded and do not contain any meaningful metacharacters; in order words, escaping is the responsibility of the caller.- Specified by:
addParameterin interfaceI_CmsJspTagParamParent- Parameters:
name- the name of the parametervalue- the value of the parameter- See Also:
-
doEndTag
- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException- See Also:
-
doStartTag
Returns.BodyTag.EVAL_BODY_BUFFERED- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Returns:
BodyTag.EVAL_BODY_BUFFERED- See Also:
-
getAlign
Returns the value of the HTML "align" attribute.- Returns:
- the value of the HTML "align" attribute
-
getAlt
Returns the value of the HTML "alt" attribute.- Returns:
- the value of the HTML "alt" attribute
-
getBorder
Returns the value of the HTML "border" attribute.- Returns:
- the value of the HTML "border" attribute
-
getCssclass
Returns the value of the HTML "class" attribute.- Returns:
- the value of the HTML "class" attribute
-
getHspace
Returns the value of the HTML "hspace" attribute.- Returns:
- the value of the HTML "hspace" attribute
-
getId
Returns the value of the HTML "id" attribute.- Overrides:
getIdin classjavax.servlet.jsp.tagext.TagSupport- Returns:
- the value of the HTML "id" attribute
-
getLongdesc
Returns the value of the HTML "longdesc" attribute.- Returns:
- the value of the HTML "longdesc" attribute
-
getName
Returns the value of the HTML "name" attribute.- Returns:
- the value of the HTML "name" attribute
-
getNoDim
Returns"true"if the created HTML image tag does not contain height and width attributes.- Returns:
"true"if the created HTML image tag does not contain height and width attributes
-
getStyle
Returns the value of the HTML "style" attribute.- Returns:
- the value of the HTML "style" attribute
-
getTitle
Returns the value of the HTML "title" attribute.- Returns:
- the value of the HTML "title" attribute
-
getUsemap
Returns the value of the HTML "usemap" attribute.- Returns:
- the value of the HTML "usemap" attribute
-
getVspace
Returns the value of the HTML "vspace" attribute.- Returns:
- the value of the HTML "vspace" attribute
-
isPartialTag
Returns"true"if the HTML tag should only be created as partial tag.- Returns:
"true"if the HTML tag should only be created as partial tag
-
release
Description copied from class:CmsJspImageScalerTagSupportDoes some cleanup and creates a new ImageScaler before the tag is released to the tag pool.- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein classCmsJspImageScalerTagSupport- See Also:
-
setAlign
Sets the value of the HTML "align" attribute.- Parameters:
value- the value of the HTML "align" attribute to set
-
setAlt
Sets the value of the HTML "alt" attribute.- Parameters:
value- the value of the HTML "alt" attribute to set
-
setBorder
Sets the value of the HTML "border" attribute.- Parameters:
value- the value of the HTML "border" attribute to set
-
setCssclass
Sets the value of the HTML "class" attribute.- Parameters:
value- the value of the HTML "class" attribute to set
-
setHspace
Sets the value of the HTML "hspace" attribute.- Parameters:
value- the value of the HTML "hspace" attribute to set
-
setId
Sets the value of the HTML "id" attribute.- Overrides:
setIdin classjavax.servlet.jsp.tagext.TagSupport- Parameters:
value- the value of the HTML "id" attribute to set
-
setLongdesc
Sets the value of the HTML "longdesc" attribute.- Parameters:
value- the value of the HTML "longdesc" attribute to set
-
setName
Sets the value of the HTML "name" attribute.- Parameters:
value- the value of the HTML "name" attribute to set
-
setNoDim
Controls if the created HTML image tag contains height and width attributes.- Parameters:
noDim- the value to set
-
setPartialTag
Controls if the created HTML image tag is a full or partial tag.- Parameters:
partialTag- the value to set
-
setStyle
Sets the value of the HTML "style" attribute.- Parameters:
value- the value of the HTML "style" attribute to set
-
setTitle
Sets the value of the HTML "title" attribute.- Parameters:
value- the value of the HTML "title" attribute to set
-
setUsemap
Sets the value of the HTML "usemap" attribute.- Parameters:
value- the value of the HTML "usemap" attribute to set
-
setVspace
Sets the value of the HTML "vspace" attribute.- Parameters:
value- the value of the HTML "vspace" attribute to set
-