java.lang.Object | |||
↳ | com.microstrategy.web.tasks.AbstractBaseTask | ||
↳ | com.microstrategy.web.app.tasks.AbstractAppTask | ||
↳ | com.microstrategy.web.app.tasks.WebComponentTask |
![]() |
This class implements the Task
interface using a WebComponent
to handle data collection. The definition of the task is provided through
a single XML file.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | FP_NAME_CONTENT_TYPE | The name of the formal parameter that defines the desired content type. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected String | initializationErrorMessage | If an error occurred at initialization time, then this field contains the message. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
WebComponentTask()
No args constructor for a WebComponentTask.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
destroy()
Destroy any data structures created by the 'init' method.
| ||||||||||
void |
init(ContainerServices containerSvcs)
Handles the initialization of the task.
| ||||||||||
TaskRequestContext |
newRequestContext()
Returns a BeanTaskRequestContext object to use for the duration
of this request.
| ||||||||||
void |
processRequest(TaskRequestContext context, TaskOutput taskOutput)
Process the incoming request.
| ||||||||||
void |
setTaskID(String taskID)
Sets the Task ID.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TransformInstance |
addTransform(BeanTaskRequestContext btrContext)
Adds the specified Transform to the WebBean.
| ||||||||||
void |
collectData(BeanTaskRequestContext btrContext)
This method calls the 'collectData' method on the WebBean
instance.
| ||||||||||
WebComponent |
createUntypedWebComponent(BeanTaskRequestContext btrContext)
This method creates an instance of an "untyped" Web Component.
| ||||||||||
WebComponent |
createWebBean(BeanTaskRequestContext btrContext)
This method creates the WebComponent or WebBean from the specified bean type.
| ||||||||||
boolean |
generatesContent(BeanTaskRequestContext btrContext)
This method determines whether the Task is going to generate any content.
| ||||||||||
BeanInfo |
getBeanInfo()
Returns the BeanInfo object associated with this BeanTask.
| ||||||||||
String | getStyleName(BeanTaskRequestContext btrContext) | ||||||||||
void |
handleEvent(BeanTaskRequestContext btrContext)
This method instructs the WebBean to handle the event.
| ||||||||||
boolean |
isSuccessfullyInitialized()
Returns whether the BeanTask was successfully initialized or
not.
| ||||||||||
void |
overrideActualParameters(BeanTaskRequestContext btrContext, TransformInstance instance)
Overrides any actual parameters specified in the Bean Task XML.
| ||||||||||
void |
prepareArgumentRequestKeys(RequestKeys requestKeys)
This method prepares the RequestKeys by adding the necessary
"event argument" parameters.
| ||||||||||
void | prepareArgumentRequestKeys(RequestKeys requestKeys, EventInfo[] events) | ||||||||||
void |
prepareBean(BeanTaskRequestContext btrContext)
This method prepares the WebBean for execution.
| ||||||||||
void |
prepareEventOrderRequestKeys(RequestKeys requestKeys)
The method sets the request keys necessary for multiple events.
| ||||||||||
void | prepareEventOrderRequestKeys(RequestKeys requestKeys, EventInfo[] events) | ||||||||||
void |
prepareEventRequestKeys(RequestKeys requestKeys)
This method prepares the RequestKeys by adding the necessary
keys for events.
| ||||||||||
void | prepareEventRequestKeys(RequestKeys requestKeys, EventInfo[] events) | ||||||||||
void |
prepareParameterRequestKeys(RequestKeys requestKeys)
This method prepares the RequestKeys by adding any default
values for parameters.
| ||||||||||
void |
prepareRequestKeys(BeanTaskRequestContext btrContext)
Prepares the RequestKeys for handling the event.
| ||||||||||
void |
registerParameterMetadata(TaskParameterMetadata parameterMetadata)
Registers a specific Task parameter metadata.
| ||||||||||
void |
registerTaskMetadata(TaskMetadata sourceMetadata)
This method is used to register the task metadata.
| ||||||||||
boolean |
requiresIServerSession()
Returns whether this Task requires an Intelligence Server session.
| ||||||||||
void |
restoreBeanState(BeanTaskRequestContext btrContext)
Restores the state of a previously serialized WebBean.
| ||||||||||
void |
serializeResult(BeanTaskRequestContext btrContext, TaskOutput taskOutput)
This method attempts to serialize the results to the supplied
TaskOutput object.
| ||||||||||
void |
setBeanContext(BeanTaskRequestContext btrContext)
Set the BeanContext associated with the Bean.
| ||||||||||
void |
setBeanInfo(BeanInfo beanInfo)
Sets the BeanInfo object associated with this BeanTask.
| ||||||||||
void |
setBeanName(BeanTaskRequestContext btrContext)
Sets the Bean's name.
| ||||||||||
void |
setBeanProperties(BeanTaskRequestContext btrContext)
Set any properties on the Bean.
| ||||||||||
void |
setBeanSession(BeanTaskRequestContext btrContext)
Set the WebIServerSession object to use with the WebBean.
| ||||||||||
void |
setSuccessfullyInitialized(boolean successfullyInitialized)
Sets whether the BeanTask was successfully initialized or not.
| ||||||||||
void |
transformBean(BeanTaskRequestContext btrContext, TaskOutput taskOutput)
This method wraps a call to
transform() . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
The name of the formal parameter that defines the desired content type. If found, the Task infrastructure will assign the value of the Task Content Type parameter to it. This allows transforms to be written that generate Block trees and the Task caller can decide how they are rendered.
If an error occurred at initialization time, then this field contains the message.
No args constructor for a WebComponentTask.
Destroy any data structures created by the 'init' method.
Handles the initialization of the task. This involves parsing
the XML file and retrieving all of the contents. This method calls
registerTaskMetadata(TaskMetadata)
.
containerSvcs | The ContainerServices object that can be
used to find more initialization parameters.
|
---|
Returns a BeanTaskRequestContext object to use for the duration of this request.
BeanTaskRequestContext
object to use for the
duration of this request.
Process the incoming request. This method proceeds through the following sequence:
checkForRequiredParameters(RequestKeys)
)RequestKeys
for use. (calls
prepareRequestKeys(BeanTaskRequestContext)
)WebBean
for use. (calls prepareBean(BeanTaskRequestContext)
)handleEvent(BeanTaskRequestContext)
)collectData(BeanTaskRequestContext)
)TaskOutput
. (calls serializeResult(BeanTaskRequestContext, TaskOutput)
)context | The TaskRequestContext object that contains
information specific to this request. |
---|---|
taskOutput | The TaskOutput object to serialize the
results into. |
TaskException | If anything fails in the process of servicing the request. |
---|---|
TaskConfigurationException | If the task is not properly configured. |
Sets the Task ID.
taskID | The Task ID. |
---|
Adds the specified Transform to the WebBean. This method is
called by serializeResult(BeanTaskRequestContext, TaskOutput)
and performs the following actions:
btrContext | The BeanTaskRequestContext to use. |
---|
TransformInstance
that was created, if any.TaskConfigurationException | If the static style name does not exist in the StyleCatalog. |
---|---|
TaskRequestMalformedException | If the dynamic style name does not exist in the Style Catalog. |
This method calls the 'collectData' method on the WebBean
instance. This method is called by processRequest(TaskRequestContext, TaskOutput)
.
btrContext | The BeanTaskRequestContext object. |
---|
TaskException | If there is a failure while trying to collect data for the Web Bean. |
---|
This method creates an instance of an "untyped" Web Component. This component implements the Transformable interface and can be used with any Transform. It provides no specialized data access methods.
btrContext | The BeanTaskRequestContext object. |
---|
WebComponent
to use when no bean type
has been specified.TaskConfigurationException | If we are unable to create an instance. |
---|
This method creates the WebComponent or WebBean from the specified bean type.
If no type is specified, then an "untyped" WebComponent is created using the
createUntypedWebComponent(BeanTaskRequestContext)
method.
btrContext | The BeanTaskRequestContext object. |
---|
WebComponent
instance created of the specified type.TaskConfigurationException | If we are unable to create a WebBean or WebComponent of the specified type |
---|
This method determines whether the Task is going to generate any content. Some tasks are "write only" in nature: they send data to the backend, but return nothing (other than a status).
btrContext | The BeanTaskRequestContext object. |
---|
TaskException | if the style parameter is not correctly specified. |
---|
Returns the BeanInfo object associated with this BeanTask.
BeanInfo
object associated with this BeanTask.
This method instructs the WebBean to handle the event. It is
called from processRequest(TaskRequestContext, TaskOutput)
.
btrContext | The BeanTaskRequestContext that contains the WebBean instance. |
---|
TaskException | If something fails in the process of handling the event. |
---|---|
TaskRequestMalformedException | If there was an exception raised while handling the event. |
Returns whether the BeanTask was successfully initialized or not.
Overrides any actual parameters specified in the Bean Task XML.
This method is called by the serializeResult(BeanTaskRequestContext, TaskOutput)
method.
btrContext | The BeanTaskRequestContext to use. |
---|---|
instance | The TransformInstance to operate on. |
This method prepares the RequestKeys by adding the necessary
"event argument" parameters. This method is called in the prepareEventRequestKeys(RequestKeys)
method.
requestKeys | The RequestKeys object to add keys to. |
---|
This method prepares the WebBean for execution. It is called by
the processRequest(TaskRequestContext, TaskOutput)
method.
It performs the following actions:
createWebBean(BeanTaskRequestContext)
)setBeanProperties(BeanTaskRequestContext)
)restoreBeanState(BeanTaskRequestContext)
)btrContext | The BeanTaskRequestContext to use. |
---|
TaskException | If anything fails along the way. |
---|
The method sets the request keys necessary for multiple events.
This method is called in the prepareEventRequestKeys(RequestKeys)
method.
requestKeys | The RequestKeys instance to add keys to. |
---|
This method prepares the RequestKeys by adding the necessary
keys for events. If there is only one event, then the URL_EVENT_NAME
key is added. Otherwise, the prepareEventOrderRequestKeys(RequestKeys)
method is called. Next, it
calls the prepareArgumentRequestKeys(RequestKeys)
method to
add any keys defined for Event Arguments in the Bean Task XML.
requestKeys | The RequestKeys object to add keys to. |
---|
This method prepares the RequestKeys by adding any default values for parameters.
requestKeys | The RequestKeys instance to add the default values to. |
---|
Prepares the RequestKeys for handling the event. This method is
called inside processRequest(TaskRequestContext, TaskOutput)
. This method, in turn, calls:
btrContext | The BeanTaskRequestContext object. |
---|
Registers a specific Task parameter metadata. This method is
called by registerTaskMetadata(TaskMetadata)
. It is helpful to
override in a Task so that a specific TaskParameterMetadata may be
saved for later use.
parameterMetadata | The TaskParameterMetadata object being saved. |
---|
This method is used to register the task metadata. It is a
method invoked by the init(ContainerServices)
method. This
method in turn calls registerParameterMetadata(TaskParameterMetadata)
for each task
parameter.
sourceMetadata | The TaskMetadata object being registered.
|
---|
Returns whether this Task requires an Intelligence Server session.
Restores the state of a previously serialized WebBean. This
method is called by prepareBean(BeanTaskRequestContext)
and
calls the restoreStateFromRequest(RequestKeys)
method on the WebBean.
btrContext | The BeanTaskRequestContext object to use. |
---|
This method attempts to serialize the results to the supplied
TaskOutput object. This method is called by processRequest(TaskRequestContext, TaskOutput)
and in turn does the
following:
addTransform(BeanTaskRequestContext)
)overrideActualParameters(BeanTaskRequestContext, TransformInstance)
)transformBean(BeanTaskRequestContext, TaskOutput)
)btrContext | The BeanTaskRequestContext object. |
---|---|
taskOutput | The TaskOutput object to populate. |
TaskException | If something fails along the way. |
---|
Set the BeanContext associated with the Bean. This method is
called by the setBeanProperties(BeanTaskRequestContext)
method.
btrContext | The BeanTaskRequestContext object to use. |
---|
Sets the BeanInfo object associated with this BeanTask.
beanInfo | The BeanInfo object associated with this
BeanTask.
|
---|
Sets the Bean's name. This method is called by setBeanProperties(BeanTaskRequestContext)
.
btrContext | The BeanTaskRequestContext object to use. |
---|
Set any properties on the Bean. This method is called by the
prepareBean(BeanTaskRequestContext)
method and performs the
following actions:
setBeanName(BeanTaskRequestContext)
)setBeanSession(BeanTaskRequestContext)
)setBeanContext(BeanTaskRequestContext)
)btrContext | The BeanTaskRequestContext object to use. |
---|
TaskException | If any of the subordinate methods raise an exception while setting a specific property of the Bean. |
---|
Set the WebIServerSession object to use with the WebBean. This
method is called by the setBeanProperties(BeanTaskRequestContext)
method.
btrContext | The BeanTaskRequestContext object to use. |
---|
TaskException | If there is not enough information to create a WebIServerSession instance. |
---|
Sets whether the BeanTask was successfully initialized or not.
successfullyInitialized | Whether the BeanTask was successfully initialized or not. |
---|
This method wraps a call to transform()
. It is called by
the serializeResult(BeanTaskRequestContext, TaskOutput)
method and simply calls the 'transform' method.
btrContext | The BeanTaskRequestContext object. |
---|---|
taskOutput | The TaskOutput instance to generate into. |
TaskConfigurationException | If the Transform does not exist. |
---|