|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.SimpleTagSupport
info.magnolia.cms.taglibs.util.BaseImageTag
info.magnolia.cms.taglibs.util.ScaleImageTag
public class ScaleImageTag
Creates a scaled copy of an image. The maximum width and height of the images can be specified via the
attributes.
If the scaled image with the specified name does not exist in the repository, then this tag will create it and save
it. If the scaled image already exists, then it will not be recreated.
The name of the node that contains the original image is set by the attribute 'parentContentNode', and the name of
the nodeData for the image is set by the attribute 'parentNodeDataName'. If 'parentContentNode' is null, the local
content node is used.
The name of the content node that contains the new scaled image is set by the attribute 'imageContentNodeName'. This
node is created under the original image node. This ensures that, if the original images is deleted, so are all the
scaled versions.
This tag writes out the handle of the content node that contains the image.
Field Summary |
---|
Fields inherited from class info.magnolia.cms.taglibs.util.BaseImageTag |
---|
parentContentNodeName, PROPERTIES_CONTENTTYPE_VALUE |
Constructor Summary | |
---|---|
ScaleImageTag()
|
Method Summary | |
---|---|
void |
cleanUp()
Set objects to null. |
void |
doTag()
|
protected String |
getFilename()
|
protected boolean |
rescale(Content parentContentNode,
Content imageContentNode)
Checks to see if the previously scaled image needs to be rescaled. |
void |
setAllowOversize(boolean allowOversize)
Allow resizing images beyond their original dimensions? |
void |
setImageContentNodeName(String imageContentNodeName)
The name of the new contentNode that will contain the scaled version of the image. |
void |
setMaxHeight(int maxHeight)
The maximum height of the image in pixels. |
void |
setMaxWidth(int maxWidth)
The maximum width of the image in pixels. |
void |
setParentContentNodeName(String parentContentNodeName)
The name of the content node that contains the image to be copied and scaled. |
void |
setParentNodeDataName(String parentNodeDataName)
The name of the data node that contains the image data to be copied and scaled. |
Methods inherited from class info.magnolia.cms.taglibs.util.BaseImageTag |
---|
convertHexToColor, convertHexToRGB, convertToSimpleString, createImageNode, getImageContentNode, getRequest |
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport |
---|
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScaleImageTag()
Method Detail |
---|
public void setMaxHeight(int maxHeight)
public void setMaxWidth(int maxWidth)
public void setAllowOversize(boolean allowOversize)
public void setParentContentNodeName(String parentContentNodeName)
setParentContentNodeName
in class BaseImageTag
public void setParentNodeDataName(String parentNodeDataName)
public void setImageContentNodeName(String imageContentNodeName)
setImageContentNodeName
in class BaseImageTag
public void doTag() throws javax.servlet.jsp.JspException
doTag
in interface javax.servlet.jsp.tagext.SimpleTag
doTag
in class javax.servlet.jsp.tagext.SimpleTagSupport
javax.servlet.jsp.JspException
protected boolean rescale(Content parentContentNode, Content imageContentNode)
parentContentNode
- The node containing the scaled image nodeimageContentNode
- The scaled image node
public void cleanUp()
protected String getFilename()
getFilename
in class BaseImageTag
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |