Class CmsJspTagImage

    • Constructor Summary

      Constructors 
      Constructor Description
      CmsJspTagImage()
      Creates a new image scaling tag instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addParameter​(java.lang.String name, java.lang.String value)
      Add a parameter to this tag.
      int doEndTag()  
      int doStartTag()
      Returns BodyTag.EVAL_BODY_BUFFERED.
      java.lang.String getAlign()
      Returns the value of the HTML "align" attribute.
      java.lang.String getAlt()
      Returns the value of the HTML "alt" attribute.
      java.lang.String getBorder()
      Returns the value of the HTML "border" attribute.
      java.lang.String getCssclass()
      Returns the value of the HTML "class" attribute.
      java.lang.String getHspace()
      Returns the value of the HTML "hspace" attribute.
      java.lang.String getId()
      Returns the value of the HTML "id" attribute.
      java.lang.String getLongdesc()
      Returns the value of the HTML "longdesc" attribute.
      java.lang.String getName()
      Returns the value of the HTML "name" attribute.
      java.lang.String getNoDim()
      Returns "true" if the created HTML image tag does not contain height and width attributes.
      static CmsImageScaler getScaler​(CmsImageScaler scaler, CmsImageScaler original, java.lang.String scaleParam)
      Creates the images scaler used by this image tag.
      java.lang.String getStyle()
      Returns the value of the HTML "style" attribute.
      java.lang.String getTitle()
      Returns the value of the HTML "title" attribute.
      java.lang.String getUsemap()
      Returns the value of the HTML "usemap" attribute.
      java.lang.String getVspace()
      Returns the value of the HTML "vspace" attribute.
      static java.lang.String imageTagAction​(java.lang.String src, CmsImageScaler scaler, java.util.Map<java.lang.String,​java.lang.String> attributes, boolean partialTag, boolean noDim, javax.servlet.ServletRequest req)
      Internal action method to create the tag content.
      static java.lang.String imageTagAction​(java.lang.String src, CmsImageScaler scaler, java.util.Map<java.lang.String,​java.lang.String> attributes, boolean partialTag, javax.servlet.ServletRequest req)
      Internal action method to create the tag content.
      java.lang.String isPartialTag()
      Returns "true" if the HTML tag should only be created as partial tag.
      void release()
      Does some cleanup and creates a new ImageScaler before the tag is released to the tag pool.
      void setAlign​(java.lang.String value)
      Sets the value of the HTML "align" attribute.
      void setAlt​(java.lang.String value)
      Sets the value of the HTML "alt" attribute.
      void setBorder​(java.lang.String value)
      Sets the value of the HTML "border" attribute.
      void setCssclass​(java.lang.String value)
      Sets the value of the HTML "class" attribute.
      void setHspace​(java.lang.String value)
      Sets the value of the HTML "hspace" attribute.
      void setId​(java.lang.String value)
      Sets the value of the HTML "id" attribute.
      void setLongdesc​(java.lang.String value)
      Sets the value of the HTML "longdesc" attribute.
      void setName​(java.lang.String value)
      Sets the value of the HTML "name" attribute.
      void setNoDim​(java.lang.String noDim)
      Controls if the created HTML image tag contains height and width attributes.
      void setPartialTag​(java.lang.String partialTag)
      Controls if the created HTML image tag is a full or partial tag.
      void setStyle​(java.lang.String value)
      Sets the value of the HTML "style" attribute.
      void setTitle​(java.lang.String value)
      Sets the value of the HTML "title" attribute.
      void setUsemap​(java.lang.String value)
      Sets the value of the HTML "usemap" attribute.
      void setVspace​(java.lang.String value)
      Sets the value of the HTML "vspace" attribute.
      • Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport

        doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
      • Methods inherited from class javax.servlet.jsp.tagext.TagSupport

        findAncestorWithClass, getParent, getValue, getValues, removeValue, 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
    • Constructor Detail

      • CmsJspTagImage

        public CmsJspTagImage()
        Creates a new image scaling tag instance.

    • Method Detail

      • getScaler

        public static CmsImageScaler getScaler​(CmsImageScaler scaler,
                                               CmsImageScaler original,
                                               java.lang.String scaleParam)
        Creates the images scaler used by this image tag.

        Parameters:
        scaler - the scaler created from this tags parameters
        original - a scaler that contains the original image dimensions
        scaleParam - optional scaler parameters for cropping
        Returns:
        the images scaler used by this image tag
      • imageTagAction

        public static java.lang.String imageTagAction​(java.lang.String src,
                                                      CmsImageScaler scaler,
                                                      java.util.Map<java.lang.String,​java.lang.String> attributes,
                                                      boolean partialTag,
                                                      boolean noDim,
                                                      javax.servlet.ServletRequest req)
                                               throws CmsException
        Internal action method to create the tag content.

        Parameters:
        src - the image source
        scaler - the image scaleing parameters
        attributes - the additional image HTML attributes
        partialTag - if true, the opening <img and closing /> is omitted
        noDim - if true, the height and width attributes are omitted
        req - the current request
        Returns:
        the created <img src> tag content
        Throws:
        CmsException - in case something goes wrong
      • imageTagAction

        public static java.lang.String imageTagAction​(java.lang.String src,
                                                      CmsImageScaler scaler,
                                                      java.util.Map<java.lang.String,​java.lang.String> attributes,
                                                      boolean partialTag,
                                                      javax.servlet.ServletRequest req)
                                               throws CmsException
        Internal action method to create the tag content.

        Parameters:
        src - the image source
        scaler - the image scaleing parameters
        attributes - the additional image HTML attributes
        partialTag - if true, the opening <img and closing /> is omitted
        req - the current request
        Returns:
        the created <img src> tag content
        Throws:
        CmsException - in case something goes wrong
      • doEndTag

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

        public int doStartTag()
        Returns BodyTag.EVAL_BODY_BUFFERED.

        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
        Returns:
        BodyTag.EVAL_BODY_BUFFERED
        See Also:
        Tag.doStartTag()
      • getAlign

        public java.lang.String getAlign()
        Returns the value of the HTML "align" attribute.

        Returns:
        the value of the HTML "align" attribute
      • getAlt

        public java.lang.String getAlt()
        Returns the value of the HTML "alt" attribute.

        Returns:
        the value of the HTML "alt" attribute
      • getBorder

        public java.lang.String getBorder()
        Returns the value of the HTML "border" attribute.

        Returns:
        the value of the HTML "border" attribute
      • getCssclass

        public java.lang.String getCssclass()
        Returns the value of the HTML "class" attribute.

        Returns:
        the value of the HTML "class" attribute
      • getHspace

        public java.lang.String getHspace()
        Returns the value of the HTML "hspace" attribute.

        Returns:
        the value of the HTML "hspace" attribute
      • getId

        public java.lang.String getId()
        Returns the value of the HTML "id" attribute.

        Overrides:
        getId in class javax.servlet.jsp.tagext.TagSupport
        Returns:
        the value of the HTML "id" attribute
      • getLongdesc

        public java.lang.String getLongdesc()
        Returns the value of the HTML "longdesc" attribute.

        Returns:
        the value of the HTML "longdesc" attribute
      • getName

        public java.lang.String getName()
        Returns the value of the HTML "name" attribute.

        Returns:
        the value of the HTML "name" attribute
      • getNoDim

        public java.lang.String 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

        public java.lang.String getStyle()
        Returns the value of the HTML "style" attribute.

        Returns:
        the value of the HTML "style" attribute
      • getTitle

        public java.lang.String getTitle()
        Returns the value of the HTML "title" attribute.

        Returns:
        the value of the HTML "title" attribute
      • getUsemap

        public java.lang.String getUsemap()
        Returns the value of the HTML "usemap" attribute.

        Returns:
        the value of the HTML "usemap" attribute
      • getVspace

        public java.lang.String getVspace()
        Returns the value of the HTML "vspace" attribute.

        Returns:
        the value of the HTML "vspace" attribute
      • isPartialTag

        public java.lang.String 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
      • setAlign

        public void setAlign​(java.lang.String value)
        Sets the value of the HTML "align" attribute.

        Parameters:
        value - the value of the HTML "align" attribute to set
      • setAlt

        public void setAlt​(java.lang.String value)
        Sets the value of the HTML "alt" attribute.

        Parameters:
        value - the value of the HTML "alt" attribute to set
      • setBorder

        public void setBorder​(java.lang.String value)
        Sets the value of the HTML "border" attribute.

        Parameters:
        value - the value of the HTML "border" attribute to set
      • setCssclass

        public void setCssclass​(java.lang.String value)
        Sets the value of the HTML "class" attribute.

        Parameters:
        value - the value of the HTML "class" attribute to set
      • setHspace

        public void setHspace​(java.lang.String value)
        Sets the value of the HTML "hspace" attribute.

        Parameters:
        value - the value of the HTML "hspace" attribute to set
      • setId

        public void setId​(java.lang.String value)
        Sets the value of the HTML "id" attribute.

        Overrides:
        setId in class javax.servlet.jsp.tagext.TagSupport
        Parameters:
        value - the value of the HTML "id" attribute to set
      • setLongdesc

        public void setLongdesc​(java.lang.String value)
        Sets the value of the HTML "longdesc" attribute.

        Parameters:
        value - the value of the HTML "longdesc" attribute to set
      • setName

        public void setName​(java.lang.String value)
        Sets the value of the HTML "name" attribute.

        Parameters:
        value - the value of the HTML "name" attribute to set
      • setNoDim

        public void setNoDim​(java.lang.String noDim)
        Controls if the created HTML image tag contains height and width attributes.

        Parameters:
        noDim - the value to set
      • setPartialTag

        public void setPartialTag​(java.lang.String partialTag)
        Controls if the created HTML image tag is a full or partial tag.

        Parameters:
        partialTag - the value to set
      • setStyle

        public void setStyle​(java.lang.String value)
        Sets the value of the HTML "style" attribute.

        Parameters:
        value - the value of the HTML "style" attribute to set
      • setTitle

        public void setTitle​(java.lang.String value)
        Sets the value of the HTML "title" attribute.

        Parameters:
        value - the value of the HTML "title" attribute to set
      • setUsemap

        public void setUsemap​(java.lang.String value)
        Sets the value of the HTML "usemap" attribute.

        Parameters:
        value - the value of the HTML "usemap" attribute to set
      • setVspace

        public void setVspace​(java.lang.String value)
        Sets the value of the HTML "vspace" attribute.

        Parameters:
        value - the value of the HTML "vspace" attribute to set