@WebServlet(name="ImageUploadController",
urlPatterns="/uploadImages")
public class ImageUploadController
extends FreemarkerHttpServlet
FreemarkerHttpServlet.TemplateVitroHttpServlet.PickListSorter| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_DELETE
A request to delete the file and return to the referring page.
|
static String |
ACTION_DELETE_EDIT
A request to delete the file and return to the "new image" screen.
|
static String |
ACTION_SAVE
Here is the cropping info; we're ready to save the image.
|
static String |
ACTION_UPLOAD
Here is the main image file.
|
static String |
BODY_CANCEL_URL |
static String |
BODY_DELETE_URL |
static String |
BODY_ENTITY_NAME |
static String |
BODY_ERROR_MESSAGE |
static String |
BODY_FORM_ACTION |
static String |
BODY_MAIN_IMAGE_HEIGHT |
static String |
BODY_MAIN_IMAGE_URL |
static String |
BODY_MAIN_IMAGE_WIDTH |
static String |
BODY_MAX_FILE_SIZE |
static String |
BODY_THUMBNAIL_HEIGHT |
static String |
BODY_THUMBNAIL_URL |
static String |
BODY_THUMBNAIL_WIDTH |
static String |
BODY_TITLE |
static int |
MAXIMUM_FILE_SIZE
Limit file size to 6 megabytes.
|
static String |
PARAMETER_ACTION
The form field that tells what we are doing: uploading? deleting?
|
static String |
PARAMETER_ENTITY_URI
The form field that identifies the Individual.
|
static String |
PARAMETER_UPLOADED_FILE
The form field of the uploaded file; use as a key to the FileItem map.
|
static String |
TEMPLATE_CROP |
static String |
TEMPLATE_ERROR |
static String |
TEMPLATE_NEW |
static String |
TEMPLATE_REPLACE |
static int |
THUMBNAIL_HEIGHT
Generated thumbnails will be this big.
|
static int |
THUMBNAIL_WIDTH |
BODY_TEMPLATE_TYPE, PAGE_TEMPLATE_TYPEHTML_MIMETYPE, JSON_LD_MIMETYPE, JSON_MIMETYPE, N3_MIMETYPE, publicDateFormat, RDFXML_MIMETYPE, TTL_MIMETYPE, XHTML_MIMETYPE| Constructor and Description |
|---|
ImageUploadController() |
| Modifier and Type | Method and Description |
|---|---|
void |
init()
When initialized, get a reference to the File Storage system.
|
long |
maximumMultipartFileSize()
How large an image file will we accept?
|
protected ResponseValues |
processRequest(VitroRequest vreq)
Handle the different actions.
|
protected AuthorizationRequest |
requiredActions(VitroRequest vreq)
The required action depends on what we are trying to do.
|
boolean |
stashFileSizeException()
What will we do if there is a problem parsing the request?
|
doException, doForward, doGet, doPost, doRdf, doRedirect, doResponse, doTemplate, getBeansWrapper, getDisplayModelMenu, getFreemarkerComponentsForJsp, getPageTemplateName, getPageTemplateValues, getThemeDir, getTitle, handleException, processTemplate, processTemplateToString, wrap, wrap, write, writePage, writeTemplate, writeTemplatedumpRequestParameters, isAuthorizedToDisplayPage, redirectToInsufficientAuthorizationPage, redirectToLoginPage, redirectUnauthorizedRequest, service, sortForPickListdoDelete, doHead, doOptions, doPut, doTrace, getLastModified, servicepublic static final int MAXIMUM_FILE_SIZE
public static final int THUMBNAIL_HEIGHT
public static final int THUMBNAIL_WIDTH
public static final String PARAMETER_ACTION
public static final String PARAMETER_ENTITY_URI
public static final String PARAMETER_UPLOADED_FILE
public static final String ACTION_UPLOAD
public static final String ACTION_SAVE
public static final String ACTION_DELETE
public static final String ACTION_DELETE_EDIT
public static final String BODY_TITLE
public static final String BODY_ENTITY_NAME
public static final String BODY_MAIN_IMAGE_URL
public static final String BODY_MAIN_IMAGE_HEIGHT
public static final String BODY_MAIN_IMAGE_WIDTH
public static final String BODY_THUMBNAIL_URL
public static final String BODY_CANCEL_URL
public static final String BODY_DELETE_URL
public static final String BODY_FORM_ACTION
public static final String BODY_ERROR_MESSAGE
public static final String BODY_MAX_FILE_SIZE
public static final String BODY_THUMBNAIL_WIDTH
public static final String BODY_THUMBNAIL_HEIGHT
public static final String TEMPLATE_NEW
public static final String TEMPLATE_REPLACE
public static final String TEMPLATE_CROP
public static final String TEMPLATE_ERROR
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic long maximumMultipartFileSize()
maximumMultipartFileSize in interface MultipartRequestWrapper.ParsingStrategymaximumMultipartFileSize in class VitroHttpServletpublic boolean stashFileSizeException()
stashFileSizeException in interface MultipartRequestWrapper.ParsingStrategystashFileSizeException in class VitroHttpServletprotected AuthorizationRequest requiredActions(VitroRequest vreq)
requiredActions in class FreemarkerHttpServletprotected ResponseValues processRequest(VitroRequest vreq)
processRequest in class FreemarkerHttpServletCopyright © 2021. All rights reserved.