| java.lang.Object com.flexive.war.servlet.ThumbnailServlet
ThumbnailServlet | public class ThumbnailServlet implements Servlet(Code) | | Thumbnail servlet.
Usage: /thumbnail/[options][/filename.extension]
Options are optional but must at least contain a way to identify the thumbnail to display.
There can be multiple options seperated by a "/".
Options may not contain spaces and values have to be properly URL encoded!
Valid options are:
pk{n.m} - id and version of the content, if no version is given the live version is used
xp{path} - URL encoded XPath of the property containing the image (optional, else default will be used)
lang{lang} - 2-digit ISO language code
lfb{0,1} - language fallback: 0=generate error if language not found, 1=fall back to default language
e{3 digit error number}u{error url} - URL encoded error url to redirect for http errors specified in {error number}, if no number is given then the url is a fallback for unclassified errors
s{0,1,2,3} - use a predefined image/thumbnail size
w{n} - scale to width
h{n} - scale to height
rot{90,180,270} - rotate 90, 180 or 270 degrees (rotate is always executed before flip operations)
flip{h,v} - flip horizontal or vertical (rotate is always executed before flip operations)
cropx{x}y{y}w{w}h{h} - crop a box from image defined by x,y,w(idth),h(eight), scaling applies to cropped image!
Sizes for the s parameters:
0 ... original image
1 ... image scaled to fit a 42x42 box
2 ... image scaled to fit a 85x85 box
3 ... image scaled to fit a 232x232 box
Selecting a predefined image or thumbnail disables all image manipultion parameters: the image will be served exactly how it
exists in the database/storage.
Examples:
/thumbnail/pk27.1/s21/test.jpg
/thumbnail/s0/w100/h300/pk4711.MAX/vermax/rot90/test.jpg
TODO:
rotate, flip, scale and crop are not implemented yet and have no effect!
author: Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) author: Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) version: $Rev: 103 $ |
Method Summary | |
public void | destroy() | public static String | getLink(FxPK pk, BinaryDescriptor.PreviewSizes size) Return a thumbnail link for the given object. | public static String | getLink(FxPK pk, BinaryDescriptor.PreviewSizes size, String xpath) Return a thumbnail link for the given object. | public static String | getLink(FxPK pk, BinaryDescriptor.PreviewSizes size, String xpath, long timestamp) Return a thumbnail link for the given object. | public static String | getLink(FxPK pk, BinaryDescriptor.PreviewSizes size, String xpath, long timestamp, FxLanguage language) Return a thumbnail link for the given object. | public ServletConfig | getServletConfig() | public String | getServletInfo() | public void | init(ServletConfig servletConfig) | public void | service(ServletRequest servletRequest, ServletResponse servletResponse) |
destroy | public void destroy()(Code) | | |
getLink | public static String getLink(FxPK pk, BinaryDescriptor.PreviewSizes size)(Code) | | Return a thumbnail link for the given object.
Parameters: pk - the object id Parameters: size - the preview size (if null, the default size is used by the servlet) a thumbnail link for the given object. |
getLink | public static String getLink(FxPK pk, BinaryDescriptor.PreviewSizes size, String xpath)(Code) | | Return a thumbnail link for the given object.
Parameters: pk - the object id Parameters: size - the preview size (if null, the default size is used by the servlet) Parameters: xpath - the binary xpath (if null, the default preview for the object will be used) a thumbnail link for the given object. |
getLink | public static String getLink(FxPK pk, BinaryDescriptor.PreviewSizes size, String xpath, long timestamp)(Code) | | Return a thumbnail link for the given object.
Parameters: pk - the object id Parameters: size - the preview size (if null, the default size is used by the servlet) Parameters: xpath - the binary xpath (if null, the default preview for the object will be used) Parameters: timestamp - the binary timestamp, to be added to the URL for fine-grained cache control a thumbnail link for the given object. |
getLink | public static String getLink(FxPK pk, BinaryDescriptor.PreviewSizes size, String xpath, long timestamp, FxLanguage language)(Code) | | Return a thumbnail link for the given object.
Parameters: pk - the object id Parameters: size - the preview size (if null, the default size is used by the servlet) Parameters: xpath - the binary xpath (if null, the default preview for the object will be used) Parameters: timestamp - the binary timestamp, to be added to the URL for fine-grained cache control Parameters: language - the language (for multi-lingual objects, otherwise the default language will be used) a thumbnail link for the given object. |
|
|