MicroStrategy ONE

XML Structure of a Bean-based Task File

A bean-based task is simply an XML file in a specified format. This XML file is saved in the MicroStrategy installation directory, in the location specified by the beanTaskDir initialization parameter in microstrategy.xml. The default location is the \WEB-INF\xml\beanTasks folder. You can view the current location on the Configuration page of the Task Administrator application.

There is no need to understand the underlying structure of the bean XML file in order to create a new bean-based task with the Web Customization Editor. However, if you want to know exactly how the XML is constructed, this topic provides that information.

The first two lines of every bean-based task XML file are shown below.

Copy
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE beanTask SYSTEM "beanTask.dtd">

The table below describes the remaining structure of a bean-based task XML file. The four columns in the table include the following descriptive information:

Parent Element

- Child Element 1

- Child Element 2

Indicates the name of the element described in the next three columns. If this is a parent element, the names of all possible child elements are listed below the parent element.

Number of Nodes

Specifies the number of nodes that are required or allowed for the corresponding element in the Parent Element column. For example, if the value is "1", there must be only one node - no more, no less. If the value is "0 or more", the node is not required ("0"), but there is no restriction on the number of nodes that can be added ("or more").

Parent Element Attributes

Lists the separate attributes that can be used with the corresponding element in the Parent Element column. Included in parentheses beneath each attribute name are the attribute type and an indication of whether the attribute is required or implied.

Description

Describes either a parent element in the Parent Element column or an attribute in the Parent Element Attributescolumn.

Parent Element

- Child Element 1

- Child Element 2

Number of Nodes Parent Element Attributes Description

<beanTask>

- <basicInfo>

- <eventInfo>

- <beanInfo>

 

1

 

The <beanTask> root element defines a single task based on a web bean.

registerAs

(NMTOKEN / optional)

The registerAs attribute defines the identifier for the task. If it is omitted, the name of the XML file that defines this task is used as the identifier.

class

(NMTOKEN / optional)

The class attribute defines the base class for this implementation. If no base class is specified, BeanTask is used by default. If a base class is specified, it must be a subclass of BeanTask and expressed as a fully-qualified name.

<basicInfo>

- <parameter>

 

1

 

 

The <basicInfo> element defines the metadata for the task.

desc

(CDATA / optional)

The desc attribute provides the textual description of the task.

<parameter>

0 or more

 

The <parameter> element defines the metadata for a single task parameter.

name

(NMTOKEN / required)

The name attribute specifies the name for the task parameter. The value should be a URL-friendly identifier.

desc

(CDATA / optional)

The desc attribute provides the textual description of the task parameter.

required

(false | true / optional)

The required attribute indicates whether the task parameter is needed in order for the task to work properly. If this attribute is omitted, it is assumed that this task parameter is not required.

defvalue

(CDATA / optional)

The defvalue attribute specifies the default value for the task parameter. If the parameter is not included in the task invocation, the default value is supplied.

This is not the same as a parameter which has an empty value. In this case, the default value is not applied. This allows a distinction to be made between non-existent and empty parameters.

<eventInfo>

- <argument>

0 or more

 

The <eventInfo> element defines the event or events that implement the data collection portion of the task.

If no <eventInfo> element is specified, it is assumed that the event is selected dynamically. In this case, a base class must be specified to programmatically select an event (or events) to process.

eventID

(NMTOKEN / required)

The eventID attribute provides the numeric identifier for the event. For example, if the event is "report execution", the event ID would be "4001".

<argument>

0 or more

 

The <argument> element specifies the assignment or handling of a single event argument. This is provided as a way to override the value of this argument. Not all event arguments need to be declared here, especially if they are optional or are not overridden.

name

(NMTOKEN / required)

The name attribute specifies the name for the event argument.

 

value

(CDATA / required)

The value attribute is used to compute a value for the event argument. How it is interpreted is controlled by the source attribute (described below).

 

source

(const | parameter / optional)

The source attribute defines how the value attribute (described above) should be interpreted. If source is "const", then the value is a constant value. If source is "parameter", then the value is a parameter name, whose value should be used instead. If source is omitted, "const" is assumed.

<beanInfo>

- <style>

1

 

The <beanInfo> element defines the properties of the web bean that handles this task.

name

(NMTOKEN / required)

The name attribute specifies the name to apply to the bean instance (via setName).

bean-type

(NMTOKEN / required)

The bean-type attribute identifies the kind of bean to instantiate. Examples include "ReportBean", "FolderBean", and others. See EnumSysBeanNames for a list of valid values.

output-format

(508 | HTMLOnly | DHTML / optional for non-widgets, required for widgets)

The output-format attribute defines the output mode to set on the bean. Values include "508", "HTMLOnly", and "DHTML". It is used largely to specify the mode for block creation. If blocks are not used, it may be omitted.

This attribute is used primarily to select the widgets initialized for a particular mode. If widgets are not used, it may be omitted.

<style>

- <actualParameter>

0 or 1

 

The <style> element defines a style in the Style Catalog Configuration file and, through the actualParameter element, how transform parameters are overridden.

name

(NMTOKEN / required)

The name attribute specifies the name of the style in the Style Catalog Configuration file. How this name is interpreted is controlled by the source attribute (described below).

source

(const | parameter / optional)

The source attribute specifies how the name attribute (described above) should be interpreted. If source is "const", then name is the actual name of the style in the Style Catalog. If source is "parameter", then name is simply the name of a task parameter. If source is omitted, "const" is assumed.

<actualParameter>

0 or more

 

The <actualParameter> element represents the assignment of a single transform parameter when the style (and associated transform) is instantiated.

name

(NMTOKEN / required)

The name attribute specifies the name for the transform parameter.

 

value

(CDATA / required)

The value attribute specifies the value of the transform parameter. How this value is interpreted is controlled by the source attribute (described below).

source

(const | parameter / optional)

The source attribute defines how the value attribute (described above) should be interpreted. If source is "const", then the value is a constant value assigned directly. If source is "parameter", then the value is the name of a task parameter, whose value should be used instead. If source is omitted, "const" is assumed.