MicroStrategy ONE
WebComponent Interface
The WebComponent interface abstracts every component of a Web application. It defines the following functionality common to all components:
-
Name information— Each WebComponent on a single page should have a unique name.
-
Parent-child relationships— WebComponents can form hierarchies with one WebComponent holding others. The methods defined in the WebComponent interface allow the application to build such hierarchies, navigate them, and propagate requests from parents to children and from children to parents.
-
Event handling— In a Web application, a user interaction can be abstracted as a WebEvent. Each individual WebComponent can have a WebEventHandler associated with it. This WebEventHandler is capable of generating and handling a set of WebEvent objects. If necessary, a WebComponent itself can be designed to handle a WebEvent.
-
State synchronization— The interface defines a set of methods for synchronizing the state of the component with MicroStrategy Intelligence Server. Even if a component itself is not related to Intelligence Server, it can contain other components that are related, which would require that state synchronization requests be propagated from the children up through the hierarchy. The state of the component in relation to Intelligence Server can be determined by calling the getXMLStatus method, which returns values contained in the EnumXMLRequestStatus interface. To make it easier to use enumeration constants, the WebBean interface implements the EnumXMLRequestStatus interface, which declares only the static constants listed below. As a result, all of these constants are visible to any abstract or concrete class that implements the WebBean interface:
-
WebBeanRequestCancelled
-
WebBeanRequestEndsInError
-
WebBeanRequestNotInitiated
-
WebBeanRequestProcessing
-
WebBeanRequestSuccessful
-
WebBeanRequestWaitingForUserInput
All WebBeans expose their content via a DOM document node. The setStale method can be used to control whether the content is still valid for the supplied parameters. When a WebBean is stale, any content that was collected is ignored.
-
-
State serialization— Each WebComponent offers the ability to save and restore its state from a string representation. The state can be stored in a URL-compatible format using the getChildrenUrlState method, or in a format suitable for storing in a hidden input field using the getChildrenInputState method.
-
Rendering— The interface defines the generateOutput method, which can be used to render components on the page.
In the MSDL, WebComponents are referred to as Web Page Components to differentiate them from <web-components>, which are referred to as Web GUI Components. See Use of the Term Web Components in the MSDL for a detailed explanation of the two terms.