Package com.microstrategy.web.app.tasks
Class UploadImageTask
- java.lang.Object
-
- com.microstrategy.web.tasks.AbstractBaseTask
-
- com.microstrategy.web.app.tasks.UploadImageTask
-
- All Implemented Interfaces:
Task
public class UploadImageTask extends AbstractBaseTask
This Task processes the file uploaded from an HTML form
-
-
Field Summary
-
Fields inherited from class com.microstrategy.web.tasks.AbstractBaseTask
compressOutput, CONTENT_TYPE_BINARY, CONTENT_TYPE_HTML, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_ALL, CONTENT_TYPE_JSON_D, CONTENT_TYPE_JSON_P, CONTENT_TYPE_XML, CONTENT_TYPE_XML_ANF, DEFAULT_MAX_WAIT, DEFAULT_POLLING_FREQ, execFlagsParam, INDEFINITE_MAX_WAIT, maxWaitParam, metadata, mPrivileges, msgIDParam, objectIDParam, OTHER_CONTENT_KEY_LAYOUTS, PARAM_NAME_EXEC_FLAGS, PARAM_NAME_MAX_WAIT, PARAM_NAME_MESSAGE_ID, PARAM_NAME_OBJECT_ID, PARAM_NAME_POLLING_FREQ, PARAM_NAME_RESULT_FLAGS, PARAM_NAME_SESSION_ID, PARAM_NAME_SESSION_STATE, PARAM_NAME_STATE_ID, pollingFreqParam, PREFERENCE_DEFAULT_MAX_WAIT_IN_TASK, resultFlagsParam, sessionIDParam, sessionStateParam, stateIDParam
-
-
Constructor Summary
Constructors Constructor Description UploadImageTask()
Creates a new ImportFileTask object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
processRequest(TaskRequestContext context, MarkupOutput markupOutput)
The default implementation of this version of processRequest is empty.protected PostedFile
retrieveUploadedFile(TaskRequestContext context, RequestKeys requestKeys)
Retrieves the uploaded file as an instance of a PostedFile.protected java.lang.String
saveFile(PostedFile origFile, java.lang.String filePath)
-
Methods inherited from class com.microstrategy.web.tasks.AbstractBaseTask
addExecFlagsParam, addJuilLayouts, addMaxWaitParam, addMaxWaitParam, addMessageIDParam, addObjectIDParam, addParameterMetadata, addParameterMetadata, addParameterMetadata, addPollingFrequencyParam, addPollingFrequencyParam, addResultFlagsParam, addSessionIDParam, addSessionStateParam, addStateIDParam, checkForRequiredParameters, destroy, getCompressOutput, getID, getMetadata, getPrivileges, getSysDefaultPreferenceValue, init, newRequestContext, processRequest, retrieveUploadedFile, setCompressOutput, setDescription, setID, setMetadata, setPrivileges, validateContentType
-
-
-
-
Method Detail
-
processRequest
public void processRequest(TaskRequestContext context, MarkupOutput markupOutput) throws TaskException
Description copied from class:AbstractBaseTask
The default implementation of this version of processRequest is empty. Task implementators may override either version of processRequest.- Specified by:
processRequest
in interfaceTask
- Overrides:
processRequest
in classAbstractBaseTask
- Parameters:
context
- TheTaskRequestContext
object that maintains the state of the request.markupOutput
- TheMarkupOutput
that records the contents of the Task response.- Throws:
TaskException
- If the Task was unable to satisfy the request.- See Also:
Task.processRequest(TaskRequestContext, MarkupOutput)
-
retrieveUploadedFile
protected PostedFile retrieveUploadedFile(TaskRequestContext context, RequestKeys requestKeys) throws TaskException
Retrieves the uploaded file as an instance of a PostedFile.- Parameters:
context
- TheTaskRequestContext
that contains all information about the incoming Task request.requestKeys
- TheRequestKeys
that contains all Task parameter values.- Returns:
- A
PostedFile
that contains the contents of the uploaded file. - Throws:
TaskException
- If there is no file uploaded.
-
saveFile
protected java.lang.String saveFile(PostedFile origFile, java.lang.String filePath) throws TaskException
- Throws:
TaskException
-
-