public class

ImportFileTask

extends AbstractBaseTask
java.lang.Object
   ↳ com.microstrategy.web.tasks.AbstractBaseTask
     ↳ com.microstrategy.web.tasks.ImportFileTask

Class Overview

This Task processes the file uploaded from an HTML form and returns the content of the file to client. Client side JavaScript can not read the contents of local files for security reasons.

Summary

[Expand]
Inherited Constants
From class com.microstrategy.web.tasks.AbstractBaseTask
Fields
protected TaskParameterMetadata behaviorFlagsParam
protected TaskParameterMetadata chunkSizeParam
protected TaskParameterMetadata dataParam
protected TaskParameterMetadata fileSizeParam
protected TaskParameterMetadata indexParam
protected TaskParameterMetadata numOfChunksParam
protected TaskParameterMetadata tableIDParam
[Expand]
Inherited Fields
From class com.microstrategy.web.tasks.AbstractBaseTask
Public Constructors
ImportFileTask()
Creates a new ImportFileTask object.
Public Methods
void processRequest(TaskRequestContext context, TaskOutput markupOutput)
This method uploads the contents of a file and submits it to IServer for cube creation.
Protected Methods
void checkForRequiredParameters(RequestKeys requestKeys)
Checks whether all required parameters are present or not.
void constructTaskOutput(TaskRequestContext context, TaskOutput markupOutput)
Construct the Task output given the upload file text.
PostedFile retrieveUploadedFile(TaskRequestContext context, RequestKeys requestKeys)
Retrieves the uploaded file as an instance of a PostedFile.
[Expand]
Inherited Methods
From class com.microstrategy.web.tasks.AbstractBaseTask
From class java.lang.Object
From interface com.microstrategy.web.tasks.Task

Fields

protected TaskParameterMetadata behaviorFlagsParam

protected TaskParameterMetadata chunkSizeParam

protected TaskParameterMetadata dataParam

protected TaskParameterMetadata fileSizeParam

protected TaskParameterMetadata indexParam

protected TaskParameterMetadata numOfChunksParam

protected TaskParameterMetadata tableIDParam

Public Constructors

public ImportFileTask ()

Creates a new ImportFileTask object.

Public Methods

public void processRequest (TaskRequestContext context, TaskOutput markupOutput)

This method uploads the contents of a file and submits it to IServer for cube creation.

  1. Check for required parameters.
  2. Try to retrieve the uploaded file. See retrieveUploadedFile(TaskRequestContext, RequestKeys).
  3. Generate and submit XML command
  4. Validate result

Parameters
context The TaskRequestContext that contains all information about this Task invocation.
markupOutput The TaskOutput that contains the output generated by the Task.
Throws
TaskException If anything fails along the way. See the individual methods invoked by this method.

Protected Methods

protected void checkForRequiredParameters (RequestKeys requestKeys)

Checks whether all required parameters are present or not.

Parameters
requestKeys The RequestKeys object that contains all parameters.

protected void constructTaskOutput (TaskRequestContext context, TaskOutput markupOutput)

Construct the Task output given the upload file text.

Parameters
markupOutput The TaskOutput instance to populate into.
Throws
TaskException If there was any problem serializing the results to the TaskOutput.

protected PostedFile retrieveUploadedFile (TaskRequestContext context, RequestKeys requestKeys)

Retrieves the uploaded file as an instance of a PostedFile.

Parameters
context The TaskRequestContext that contains all information about the incoming Task request.
requestKeys The RequestKeys 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.