Fish & Chips Club 4.10.0.0

hirondelle.fish.exercise.fileupload
Class ImageUploadAction

Object
  extended by ActionImpl
      extended by ActionTemplateShowAndApply
          extended by hirondelle.fish.exercise.fileupload.ImageUploadAction
All Implemented Interfaces:
Action

public final class ImageUploadAction
extends ActionTemplateShowAndApply

Overwrite the image used on the home page.

This is an example of uploading a file, validating it, and saving it to the file system.

See Image for details regarding validation.


Field Summary
static SqlId ADD_IMAGE
           
static RequestParameter DESCRIPTION
          This 'regular' param will have its value checked by ApplicationFirewallImpl in the usual way.
static RequestParameter IMAGE_FILE
          This file upload param will not have its value checked as would a regular param.
static SqlId LIST_IMAGES
           
 
Fields inherited from class ActionTemplateShowAndApply
SUPPORTED_OPERATION
 
Fields inherited from class ActionImpl
DATA, ERRORS, ITEM_FOR_EDIT, ITEMS_FOR_LISTING, MESSAGES, USER_ID
 
Constructor Summary
ImageUploadAction(RequestParser aRequestParser)
          Constructor
 
Method Summary
protected  void apply()
          If user input is valid, overwrite the image file used on the home page; save it to the database as well.
protected  void show()
          Show a blank form.
protected  void validateUserInput()
          Ensure user input can create an Image object.
 
Methods inherited from class ActionTemplateShowAndApply
execute
 
Methods inherited from class ActionImpl
addError, addError, addError, addMessage, addMessage, addToRequest, addToSession, copyFromSessionToRequest, createSessionAndCsrfToken, endSession, getErrors, getExistingSession, getFromSession, getIdParam, getIdParams, getLocale, getLoggedInUserName, getMessages, getOperation, getOrderBy, getParam, getParamUnsafe, getRequestParser, getResponsePage, getTimeZone, getUserId, hasErrors, removeFromSession, setResponsePage
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTION

public static final RequestParameter DESCRIPTION
This 'regular' param will have its value checked by ApplicationFirewallImpl in the usual way.


IMAGE_FILE

public static final RequestParameter IMAGE_FILE
This file upload param will not have its value checked as would a regular param.


ADD_IMAGE

public static final SqlId ADD_IMAGE

LIST_IMAGES

public static final SqlId LIST_IMAGES
Constructor Detail

ImageUploadAction

public ImageUploadAction(RequestParser aRequestParser)
Constructor

Method Detail

show

protected void show()
             throws AppException
Show a blank form.

Specified by:
show in class ActionTemplateShowAndApply
Throws:
AppException

validateUserInput

protected void validateUserInput()
                          throws AppException
Ensure user input can create an Image object.

Specified by:
validateUserInput in class ActionTemplateShowAndApply
Throws:
AppException

apply

protected void apply()
              throws AppException
If user input is valid, overwrite the image file used on the home page; save it to the database as well.

Specified by:
apply in class ActionTemplateShowAndApply
Throws:
AppException

Fish & Chips Club 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26