|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.domutil.NodeGeneratorImpl
uk.co.weft.htform.Widget
uk.co.weft.htform.FileMaybeUploadWidget
uk.co.weft.htform.ImageFileMaybeUploadWidget
A file upload widget for a hypertext form, which assumes the file uploaded is an image which may reasonably be displayed. The widget will attempt to create a thumbnail of the file which has been uploaded; the name of the thumbnail will be the name of the file prepended by the prefix thumbPrefix, by default thumbnail_. If thumbnailing succeeds, it will leave in the context tokens composed of the name of the widget and the suffixes:
| Field Summary | |
static java.lang.String |
DEFAULTTHUMBPREFIX
what my thumbnail prefix should default to if not over-ridden |
static java.lang.String |
IMAGEHEIGHTSUFFIX
the suffix I will append to a name to create a token to store the image height on |
static java.lang.String |
IMAGEWIDTHSUFFIX
the suffix I will append to a name to create a token to store the image width on |
static java.lang.String |
THUMBHEIGHTSUFFIX
the suffix I will append to a name to create a token to store the thumbnail height on |
protected int |
thumbMaxHeight
The maximum height for thumbnails |
protected int |
thumbMaxWidth
The maximum width for thumbnails |
protected uk.co.weft.htform.ImageFileMaybeUploadWidget.ThumbnailPainter |
thumbPainter
Something to create thumbnails |
java.lang.String |
thumbPrefix
the prefix I will tag onto filename to create the name for the thumbnail |
static java.lang.String |
THUMBWIDTHSUFFIX
the suffix I will append to a name to create a token to store the thumbnail width on |
| Fields inherited from class uk.co.weft.htform.FileMaybeUploadWidget |
previousValueMagicToken, VALUE_IS_FILE, VALUE_IS_PATH, VALUE_IS_URL, valueType |
| Fields inherited from class uk.co.weft.htform.Widget |
ACTIONCSSCLASS, akprompt, attrs, CONTEXTATTRIBUTESSUFFIX, cssClass, DANGEROUSCSSCLASS, debug, DEFAULTTOKEN, dflt, form, generateAs, GENERATEASHTML, GENERATEASXFORM, GENERATEASXML, help, HELPTOKEN, immutable, ISIMMUTABLETOKEN, ISMANDATORYTOKEN, mandatory, MANDATORYCSSCLASS, maxVisibleSize, name, NAMETOKEN, OPTIONALCSSCLASS, PREVIOUSVALUESUFFIX, prompt, PROMPTTOKEN, size, SIZETOKEN, type, TYPETOKEN |
| Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl |
namespaceURI |
| Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl |
resourceBundleName |
| Fields inherited from interface uk.co.weft.domutil.NodeGenerator |
NAMESPACEURIMAGICTOKEN |
| Fields inherited from interface uk.co.weft.htform.ResourceConsumer |
RESOURCEBUNDLEMAGICTOKEN |
| Constructor Summary | |
ImageFileMaybeUploadWidget()
Creates a new ImageFileMaybeUploadWidget object. |
|
ImageFileMaybeUploadWidget(java.lang.String name,
java.lang.String prompt,
java.lang.String help)
name, prompt and helptext is best |
|
ImageFileMaybeUploadWidget(java.lang.String name,
java.lang.String prompt,
java.lang.String help,
java.lang.String thumbPrefix,
int thumbWidth,
int thumbHeight)
Construct me with explicit values for my thumbnailing parameters |
|
| Method Summary | |
protected void |
layoutValue(Context context)
show the image which is the current value of this widget, if there is a value and it is accessible |
protected void |
preProcess(Context context)
If a file was uploaded, maybe generate a thumbnail. |
| Methods inherited from class uk.co.weft.htform.FileMaybeUploadWidget |
layout |
| Methods inherited from class uk.co.weft.htform.Widget |
clone, generate, generateAttributes, generateAttributes, generateHTML, generateHTMLPrompt, generateInnerHTML, generateValue, generateXML, getContextAttribute, getCssClass, getHeight, getHelp, getName, getPrompt, getTabPlaces, getType, getWidth, init, layout, layout, layout, layoutAttribute, layoutAttributes, makeReady, maybeLayout, maybeLayout, onloadRequest, onloadRequest, postProcess, scriptRequest, scriptRequest, setAttribute, setContextAttribute, setCssClass, setDebug, setDefault, setHelp, setImmutable, setMandatory, setMandatory, setName, setPrompt, setSize, setType |
| Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl |
getNamespaceURI, setNamespaceURI |
| Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl |
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String IMAGEHEIGHTSUFFIX
public static final java.lang.String IMAGEWIDTHSUFFIX
public static final java.lang.String THUMBHEIGHTSUFFIX
public static final java.lang.String THUMBWIDTHSUFFIX
public static final java.lang.String DEFAULTTHUMBPREFIX
public java.lang.String thumbPrefix
protected uk.co.weft.htform.ImageFileMaybeUploadWidget.ThumbnailPainter thumbPainter
protected int thumbMaxHeight
protected int thumbMaxWidth
| Constructor Detail |
public ImageFileMaybeUploadWidget()
public ImageFileMaybeUploadWidget(java.lang.String name,
java.lang.String prompt,
java.lang.String help)
public ImageFileMaybeUploadWidget(java.lang.String name,
java.lang.String prompt,
java.lang.String help,
java.lang.String thumbPrefix,
int thumbWidth,
int thumbHeight)
name - name of this widgetprompt - prompt for this widgethelp - helptext for this widgetthumbPrefix - prefix to be prepended to image file names to make
the name of the associated thumbnailthumbWidth - maximum width of thumbnailsthumbHeight - maximum height of thumbnails| Method Detail |
protected void layoutValue(Context context)
throws DataFormatException,
javax.servlet.ServletException,
java.io.IOException
layoutValue in class FileMaybeUploadWidgetcontext - the service context
java.io.IOException - if can't write to the output stream
javax.servlet.ServletException - I don't, but things which specialise me may
DataFormatException
protected void preProcess(Context context)
throws DataStoreException,
javax.servlet.ServletException
preProcess in class FileMaybeUploadWidgetcontext - the Context of the service in which I'm called
DataFormatException - if data fails validation test
javax.servlet.ServletException - if the thing itself breaks
DataStoreException
|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||