public class ThumbnailTag extends javax.servlet.jsp.tagext.BodyTagSupport implements JcmsConstants
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)
which use same internal cache.Modifier and Type | Field and Description |
---|---|
static int |
MAX_THUMB_SIZE |
static int |
MIN_THUMB_SIZE |
static java.lang.String |
REVISION |
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
ThumbnailTag() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
buildThumbnail(java.io.File srcFile,
int width,
int height,
java.io.File defaultFile,
java.lang.String background)
Returns a Thumbnail for the given path.
|
static java.lang.String |
buildThumbnail(java.lang.String path,
int width,
int height,
java.lang.String defaultPath) |
static java.lang.String |
buildThumbnail(java.lang.String path,
int width,
int height,
java.lang.String defaultPath,
java.lang.String background)
Returns a Thumbnail for the given path.
|
protected void |
clean() |
static boolean |
createImageThumbnail(java.io.File imageFile,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight) |
static boolean |
createImageThumbnail(java.io.File imageFile,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background)
This method creates a thumbnail of the given image source file.
|
static boolean |
createOpenOfficeThumbnail(java.io.File docFile,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background)
This method creates a thumbnail of the given Open Office file.
|
static boolean |
createOpenXmlThumbnail(java.io.File docFile,
java.io.File dest,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background)
This method creates a thumbnail of the given OpenXml file.
|
static java.io.File |
createThumbnail(FileDocument fileDoc,
java.io.File srcFile,
java.net.URL url,
ImageFormat format,
int maxWidth,
int maxHeight) |
static java.io.File |
createThumbnail(FileDocument fileDoc,
java.io.File srcFile,
java.net.URL url,
ImageFormat format,
int maxWidth,
int maxHeight,
java.lang.String background)
Create a thumbnail using the first valid source from FileDocument, File or URL using given dimensions.
|
static java.lang.String |
createThumbnailFromSessionAttribute(java.lang.String sessionAttrName) |
static boolean |
createThumbnailNow(FileDocument fileDoc,
java.io.File srcFile,
java.net.URL url,
ImageFormat format,
int maxWidth,
int maxHeight,
java.io.File destFile) |
static boolean |
createThumbnailNow(FileDocument fileDoc,
java.io.File srcFile,
java.net.URL url,
ImageFormat format,
int maxWidth,
int maxHeight,
java.io.File destFile,
java.lang.String background)
This method create a thumbnail of one of the three source given using the
options passed as parameters ("now" as opposed to generation when going through ajax}.
|
int |
doAfterBody() |
int |
doEndTag() |
int |
doStartTag() |
static java.io.File |
getThumbnailFile(FileDocument fileDoc,
java.io.File srcFile,
java.net.URL url,
int maxWidth,
int maxHeight)
Gets the File to use for a thumbnail of the given FileDocument, File or URL using given dimensions.
|
static void |
invalidateCacheAttemptThumbnail(FileDocument fileDoc,
java.io.File srcFile,
java.net.URL url)
Invalidates the cache of failure while attempt to create a thumbnail for the given
parameter.
|
void |
setAddChannelBaseUrl(boolean addChannelBaseUrl) |
void |
setAjaxLoadingImage(java.lang.String ajaxLoadingImage) |
void |
setAlt(java.lang.String alt) |
void |
setBackground(java.lang.String background) |
void |
setCss(java.lang.String css) |
void |
setData(Data data) |
void |
setDestination(java.lang.String path) |
void |
setFile(java.io.File file) |
void |
setFileDoc(FileDocument fd) |
void |
setForceUpdate(boolean forceUpdate) |
void |
setFormat(java.lang.String format) |
void |
setHeight(int height) |
void |
setHtmlAttributes(java.lang.String htmlAttributes) |
void |
setPath(java.lang.String path) |
void |
setUrl(java.lang.String purl) |
void |
setUseAjaxLoading(boolean useAjaxLoading) |
void |
setWidth(int width) |
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
public static final java.lang.String REVISION
public static final int MAX_THUMB_SIZE
public static final int MIN_THUMB_SIZE
protected void clean()
public void setData(Data data)
public void setFileDoc(FileDocument fd)
public void setFile(java.io.File file)
public void setPath(java.lang.String path)
public void setUrl(java.lang.String purl)
public void setFormat(java.lang.String format)
public void setWidth(int width)
public void setHeight(int height)
public void setDestination(java.lang.String path)
public void setBackground(java.lang.String background)
public void setForceUpdate(boolean forceUpdate)
public void setAlt(java.lang.String alt)
public void setCss(java.lang.String css)
public void setHtmlAttributes(java.lang.String htmlAttributes)
public void setUseAjaxLoading(boolean useAjaxLoading)
public void setAjaxLoadingImage(java.lang.String ajaxLoadingImage)
public void setAddChannelBaseUrl(boolean addChannelBaseUrl)
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public int doAfterBody() throws javax.servlet.jsp.JspException
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public static java.lang.String createThumbnailFromSessionAttribute(java.lang.String sessionAttrName) throws java.lang.Exception
sessionAttrName
- the name of session attribute Map object in which all options were storedjava.lang.Exception
- if option 'urlStr' (from option map) could not be converted to URLpublic static void invalidateCacheAttemptThumbnail(FileDocument fileDoc, java.io.File srcFile, java.net.URL url)
fileDoc
- the FileDocument to invalidate cache thumbnail generation failuresrcFile
- the file to invalidate the cacheurl
- the URL of the file to invalidate the cachepublic static java.io.File buildThumbnail(java.io.File srcFile, int width, int height, java.io.File defaultFile, java.lang.String background)
Warning : This method does not use any cache for failed attemps and may not
meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)
instead.
srcFile
- the original filewidth
- target max widthheight
- target max widthdefaultFile
- the default file to use if thumbnail do not existsbackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightpublic static java.lang.String buildThumbnail(java.lang.String path, int width, int height, java.lang.String defaultPath)
path
- Relative path to the original filewidth
- target max widthheight
- target max widthdefaultPath
- the default image to use if thumbnail do not existsbuildThumbnail(String, int, int, String, String)
public static java.lang.String buildThumbnail(java.lang.String path, int width, int height, java.lang.String defaultPath, java.lang.String background)
Warning : This method does not use any cache for failed attemps and may not
meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)
instead.
path
- Relative path to the original filewidth
- target max widthheight
- target max widthdefaultPath
- the default image to use if thumbnail do not existsbackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightpublic static java.io.File createThumbnail(FileDocument fileDoc, java.io.File srcFile, java.net.URL url, ImageFormat format, int maxWidth, int maxHeight)
fileDoc
- a FileDocument
of which to create thumbnailsrcFile
- a File
of which to create thumbnailurl
- an URL
of which to create thumbnailformat
- the ImageFormat
of the file to generate (default to JPEG if null)maxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatecreateThumbnail(FileDocument, File, URL, ImageFormat, int, int, String)
public static java.io.File createThumbnail(FileDocument fileDoc, java.io.File srcFile, java.net.URL url, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background)
For performance reason, if a previous thumbnail creation attempt failed
for the specified source, this method will not perform any creation until
the delay specified by property "tag.thumbnail.failed-attempt-check-delay"
has been reached (or if site is restarted).
Be careful though that this method is not asynchronous and thus may take some time to process
if thumbnail creation processing is long.
fileDoc
- a FileDocument
of which to create thumbnailsrcFile
- a File
of which to create thumbnailurl
- an URL
of which to create thumbnailformat
- the ImageFormat
of the file to generate (default to JPEG if null)maxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightpublic static java.io.File getThumbnailFile(FileDocument fileDoc, java.io.File srcFile, java.net.URL url, int maxWidth, int maxHeight)
fileDoc
- a FileDocument
of which to create thumbnailsrcFile
- a File
of which to create thumbnailurl
- an URL
of which to create thumbnailmaxWidth
- the maximum width of the thumbnail, a positive integer.maxHeight
- the maximum height of the thumbnail, a positive integer.public static boolean createThumbnailNow(FileDocument fileDoc, java.io.File srcFile, java.net.URL url, ImageFormat format, int maxWidth, int maxHeight, java.io.File destFile)
fileDoc
- a FileDocument
of which to create thumbnailsrcFile
- a File
of which to create thumbnailurl
- an URL
of which to create thumbnailformat
- the ImageFormat
of the file to generate (default to JPEG if null)maxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatedestFile
- destination file (of the thumbnail to generate)createThumbnailNow(FileDocument, File, URL, ImageFormat, int, int, File, String)
,
PolicyManager.createThumbnail(FileDocument, File, ImageFormat, int, int, String)
,
PolicyManager.createThumbnail(File, File, ImageFormat, int, int, String)
,
PolicyManager.createThumbnail(URL, File, ImageFormat, int, int, String)
public static boolean createThumbnailNow(FileDocument fileDoc, java.io.File srcFile, java.net.URL url, ImageFormat format, int maxWidth, int maxHeight, java.io.File destFile, java.lang.String background)
Warning : This method does not use any cache for failed attemps and may not
meet performance requirements of frequent use. Use method
createThumbnail(FileDocument, File, URL, ImageFormat, int, int)
instead.
Possible sources are (only of must be passed, other must be null) :
fileDoc
- a FileDocument
of which to create thumbnailsrcFile
- a File
of which to create thumbnailurl
- an URL
of which to create thumbnailformat
- the ImageFormat
of the file to generate (default to JPEG if null)maxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatedestFile
- destination file (of the thumbnail to generate)background
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightPolicyManager.createThumbnail(FileDocument, File, ImageFormat, int, int, String)
,
PolicyManager.createThumbnail(File, File, ImageFormat, int, int, String)
,
PolicyManager.createThumbnail(URL, File, ImageFormat, int, int, String)
public static boolean createImageThumbnail(java.io.File imageFile, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight)
imageFile
- image file of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatecreateImageThumbnail(File, File, ImageFormat, int, int, String)
public static boolean createImageThumbnail(java.io.File imageFile, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background)
imageFile
- image file of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightImageUtil.createThumbnail(File, ImageFormat, int, int)
public static boolean createOpenOfficeThumbnail(java.io.File docFile, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background)
docFile
- Open Office file of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightImageUtil.createThumbnail(File, ImageFormat, int, int)
public static boolean createOpenXmlThumbnail(java.io.File docFile, java.io.File dest, ImageFormat format, int maxWidth, int maxHeight, java.lang.String background)
docFile
- Open Office file of which to create a thumbnaildest
- destination file (the thumbnail to generate)format
- the format of the file to generate as requested by the ThumbnailTagmaxWidth
- the maximum width of the thumbnail to generatemaxHeight
- the maximum height of the thumbnail to generatebackground
- the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeightImageUtil.createThumbnail(File, ImageFormat, int, int)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.