Class TaskProcessorController
- java.lang.Object
-
- com.microstrategy.web.controller.AppControllerImpl
-
- com.microstrategy.web.controller.TaskProcessorController
-
- All Implemented Interfaces:
AppController
public class TaskProcessorController extends AppControllerImpl
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
TaskProcessor.PARAM_NAME_TASK_ID
), the task envelope (known through the constantPARAM_NAME_TASK_ENVELOPE
) and the task Content Type (know through the constantPARAM_NAME_TASK_CONTENT_TYPE
). The task ID identifies the registeredTask
, 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.- Since:
- MicroStrategy Web 8.1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TaskProcessorController.TaskEnvelope
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAM_NAME_TASK_CONTENT_ENCODING
The HTTP Parameter that specifies the desired transfer encoding for the content generated by the Task.static java.lang.String
PARAM_NAME_TASK_CONTENT_TYPE
The HTTP Parameter that specifies the desired content type for the Task.static java.lang.String
PARAM_NAME_TASK_ENVELOPE
The HTTP Parameter that specifies the type of envelope to use to containing the response.static java.lang.String
REQ_ATTR_TASK_RESPONSE_CONTEXT
The name of the HTTP Request Attribute that contains the TaskProcessorResponseContext object.
-
Constructor Summary
Constructors Constructor Description TaskProcessorController()
Creates a new TaskProcessorController object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
errorAfterRedirect(RequestState reqState, java.lang.Exception e)
What to do if there is an error after we have redirected to the target page.com.microstrategy.web.controller.TaskProcessorController.InterfacePages
getAdminPages()
java.lang.String
getBaseURL(ContainerServices cs)
The Base URL for this application.java.lang.String
getDefaultEnvelopeID()
java.lang.String
getPage(RequestState reqState)
Get the relative path to the Page that should be displayed.java.util.Set<java.lang.String>
getPrivateTaskIDs()
TaskProcessorController.TaskEnvelope
getTaskEnvelope(TaskProcessorRequestState tprState)
java.util.List<java.lang.String>
getTaskEnvelopeNames(boolean sorted)
TaskFactory
getTaskFactory()
Returns task factory singletonTaskProcessor
getTaskProcessor()
com.microstrategy.web.controller.TaskProcessorController.InterfacePages
getViewerPages()
void
initializeApp(ContainerServices cs)
Initialize the application.protected void
initializeEnvelopeTypes(ContainerServices cs)
ExternalSecurity
newExternalSecurity()
Creates a newExternalSecurity
object.RequestState
newRequestState()
Get a newRequestState
object to handle the incoming request.boolean
processRequest(RequestState reqState)
Process the incoming request.boolean
showPrivateTaskIDs()
void
terminateApp()
Terminate the application.
-
-
-
Field Detail
-
PARAM_NAME_TASK_ENVELOPE
public static final java.lang.String PARAM_NAME_TASK_ENVELOPE
The HTTP Parameter that specifies the type of envelope to use to containing the response.- See Also:
- Constant Field Values
-
PARAM_NAME_TASK_CONTENT_TYPE
public static final java.lang.String PARAM_NAME_TASK_CONTENT_TYPE
The HTTP Parameter that specifies the desired content type for the Task.- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
PARAM_NAME_TASK_CONTENT_ENCODING
public static final java.lang.String PARAM_NAME_TASK_CONTENT_ENCODING
The HTTP Parameter that specifies the desired transfer encoding for the content generated by the Task.- See Also:
- Constant Field Values
-
REQ_ATTR_TASK_RESPONSE_CONTEXT
public static final java.lang.String REQ_ATTR_TASK_RESPONSE_CONTEXT
The name of the HTTP Request Attribute that contains the TaskProcessorResponseContext object.- See Also:
- Constant Field Values
-
-
Method Detail
-
initializeApp
public void initializeApp(ContainerServices cs)
Initialize the application.- Parameters:
cs
- TheContainerServices
object to use to complete the initialization.
-
newRequestState
public RequestState newRequestState()
Get a newRequestState
object to handle the incoming request.- Returns:
- A new
RequestState
object to handle the incoming request.
-
processRequest
public boolean processRequest(RequestState reqState)
Process the incoming request.- Parameters:
reqState
- TheRequestState
object that holds per-request data.- Returns:
- True, if the request was handled; otherwise, false.
-
getPage
public java.lang.String getPage(RequestState reqState)
Get the relative path to the Page that should be displayed.- Parameters:
reqState
- TheRequestState
object that contains per-request data structures.- Returns:
- The path to the Page to internally redirect to.
-
errorAfterRedirect
public void errorAfterRedirect(RequestState reqState, java.lang.Exception e)
What to do if there is an error after we have redirected to the target page.- Parameters:
reqState
- TheRequestState
object that holds per-request data.e
- TheException
was raised.
-
getBaseURL
public java.lang.String getBaseURL(ContainerServices cs)
The Base URL for this application.- Parameters:
cs
- TheContainerServices
object that exposes a variety of services.- Returns:
- The base URL for this application.
-
newExternalSecurity
public ExternalSecurity newExternalSecurity()
Creates a newExternalSecurity
object.- Returns:
- A new
ExternalSecurity
object.
-
terminateApp
public void terminateApp()
Terminate the application.- Specified by:
terminateApp
in interfaceAppController
- Overrides:
terminateApp
in classAppControllerImpl
-
getTaskProcessor
public TaskProcessor getTaskProcessor()
-
getTaskFactory
public TaskFactory getTaskFactory()
Returns task factory singleton- Returns:
TaskFactory
instance
-
initializeEnvelopeTypes
protected void initializeEnvelopeTypes(ContainerServices cs)
-
getTaskEnvelopeNames
public java.util.List<java.lang.String> getTaskEnvelopeNames(boolean sorted)
-
getTaskEnvelope
public TaskProcessorController.TaskEnvelope getTaskEnvelope(TaskProcessorRequestState tprState)
-
getDefaultEnvelopeID
public java.lang.String getDefaultEnvelopeID()
-
getAdminPages
public com.microstrategy.web.controller.TaskProcessorController.InterfacePages getAdminPages()
-
getViewerPages
public com.microstrategy.web.controller.TaskProcessorController.InterfacePages getViewerPages()
-
getPrivateTaskIDs
public java.util.Set<java.lang.String> getPrivateTaskIDs()
-
showPrivateTaskIDs
public boolean showPrivateTaskIDs()
-
-