public class

TaskProcessorController

extends AppControllerImpl
java.lang.Object
   ↳ com.microstrategy.web.controller.AppControllerImpl
     ↳ com.microstrategy.web.controller.TaskProcessorController

Class Overview

This class is the AppController implementation for the TaskProcessor servlet. It contains the majority of the logic for handling incoming task requests, dispatching them to the appropriate tasks and formatting their results for the desired consumer.

This controller is responsible for generating the entire task response. There are two parts to this response: the envelope and the payload. The "payload" is easiest to understand: it is the result generated by the underlying task. The "envelope" is the markup that encapsulates the "payload". The envelope is often structured for the caller's consumption.

For example, the IFRAME envelope consists of a full HTML document with the BODY element specifying a JavaScript function to invoke for the 'onload' handler. An XMLHttpRequest envelope will contain less "wiring" to indicate when the request is complete.

Three HTTP parameters are relevant at this stage of task processing: the task ID (known through the constant PARAM_NAME_TASK_ID), the task envelope (known through the constant PARAM_NAME_TASK_ENVELOPE) and the task Content Type (know through the constant PARAM_NAME_TASK_CONTENT_TYPE). The task ID identifies the registered Task, the envelope specifies a set of pages that are used to contain the payload and the content type specifies the desired output format. If omitted, it defaults to whatever is specified by the envelope.

Summary

Nested Classes
class TaskProcessorController.TaskEnvelope  
Constants
String PARAM_NAME_TASK_CONTENT_ENCODING The HTTP Parameter that specifies the desired transfer encoding for the content generated by the Task.
String PARAM_NAME_TASK_CONTENT_TYPE The HTTP Parameter that specifies the desired content type for the Task.
String PARAM_NAME_TASK_ENVELOPE The HTTP Parameter that specifies the type of envelope to use to containing the response.
String REQ_ATTR_TASK_RESPONSE_CONTEXT The name of the HTTP Request Attribute that contains the TaskProcessorResponseContext object.
Public Constructors
TaskProcessorController()
Creates a new TaskProcessorController object.
Public Methods
void errorAfterRedirect(RequestState reqState, Exception e)
What to do if there is an error after we have redirected to the target page.
TaskProcessorController.InterfacePages getAdminPages()
String getBaseURL(ContainerServices cs)
The Base URL for this application.
String getDefaultEnvelopeID()
String getPage(RequestState reqState)
Get the relative path to the Page that should be displayed.
Set<String> getPrivateTaskIDs()
TaskProcessorController.TaskEnvelope getTaskEnvelope(TaskProcessorRequestState tprState)
List<String> getTaskEnvelopeNames(boolean sorted)
TaskFactory getTaskFactory()
Returns task factory singleton
TaskProcessor getTaskProcessor()
TaskProcessorController.InterfacePages getViewerPages()
void initializeApp(ContainerServices cs)
Initialize the application.
ExternalSecurity newExternalSecurity()
Creates a new ExternalSecurity object.
RequestState newRequestState()
Get a new RequestState object to handle the incoming request.
boolean processRequest(RequestState reqState)
Process the incoming request.
boolean showPrivateTaskIDs()
void terminateApp()
Terminate the application.
Protected Methods
void initializeEnvelopeTypes(ContainerServices cs)
[Expand]
Inherited Methods
From class com.microstrategy.web.controller.AppControllerImpl
From class java.lang.Object
From interface com.microstrategy.web.controller.AppController

Constants

public static final String PARAM_NAME_TASK_CONTENT_ENCODING

The HTTP Parameter that specifies the desired transfer encoding for the content generated by the Task.

Constant Value: "taskContentEncoding"

public static final String PARAM_NAME_TASK_CONTENT_TYPE

The HTTP Parameter that specifies the desired content type for the Task.

Constant Value: "taskContentType"

public static final String PARAM_NAME_TASK_ENVELOPE

The HTTP Parameter that specifies the type of envelope to use to containing the response.

Constant Value: "taskEnv"

public static final String REQ_ATTR_TASK_RESPONSE_CONTEXT

The name of the HTTP Request Attribute that contains the TaskProcessorResponseContext object.

Constant Value: "com.microstrategy.web.tasks.ResponseContext"

Public Constructors

public TaskProcessorController ()

Creates a new TaskProcessorController object.

Public Methods

public void errorAfterRedirect (RequestState reqState, Exception e)

What to do if there is an error after we have redirected to the target page.

Parameters
reqState The RequestState object that holds per-request data.
e The Exception was raised.

public TaskProcessorController.InterfacePages getAdminPages ()

public String getBaseURL (ContainerServices cs)

The Base URL for this application.

Parameters
cs The ContainerServices object that exposes a variety of services.
Returns
  • The base URL for this application.

public String getDefaultEnvelopeID ()

public String getPage (RequestState reqState)

Get the relative path to the Page that should be displayed.

Parameters
reqState The RequestState object that contains per-request data structures.
Returns
  • The path to the Page to internally redirect to.

public Set<String> getPrivateTaskIDs ()

public List<String> getTaskEnvelopeNames (boolean sorted)

public TaskFactory getTaskFactory ()

Returns task factory singleton

Returns

public TaskProcessor getTaskProcessor ()

public TaskProcessorController.InterfacePages getViewerPages ()

public void initializeApp (ContainerServices cs)

Initialize the application.

Parameters
cs The ContainerServices object to use to complete the initialization.

public ExternalSecurity newExternalSecurity ()

Creates a new ExternalSecurity object.

Returns

public RequestState newRequestState ()

Get a new RequestState object to handle the incoming request.

Returns

public boolean processRequest (RequestState reqState)

Process the incoming request.

Parameters
reqState The RequestState object that holds per-request data.
Returns
  • True, if the request was handled; otherwise, false.

public boolean showPrivateTaskIDs ()

public void terminateApp ()

Terminate the application.

Protected Methods

protected void initializeEnvelopeTypes (ContainerServices cs)