MicroStrategy ONE
WebBean Interface
The WebBean interface represents an object related to the backend. Each Web Bean is supplied a WebSessionInfo object which defines how the Web Bean interacts with backend servers. All Web Beans are both Transformable and RequestPersistable. Referring to the diagram below, also notice that the top-level error from a Web Bean request is stored in the WebBeanError object that is accessible from the getErrorInfo method of a Web Bean.
The WebBean interface provides methods that help in rendering the data using Transforms and managing or persisting the state for a Web Bean. The Web Bean usage model consists of a caller initializing the Web Bean with some data and then asking the Web Bean to transform itself. This is accomplished by methods on the Web Bean triggering a request to be executed.
An object that is a Web Bean has three fundamental characteristics:
-
It is a WebComponent and therefore inherits the characteristics of WebComponents
-
It and its underlying data can be rendered by a Transform object
-
It can persist its state into and restore its state from a string that can, in turn, be passed across multiple requests
Each of these characteristics comes from each of three interfaces that WebBean extends: WebComponent, Transformable, and Persistable. Thus, a WebBean object is a Web Component that is Transformable and Persistable.
Recall that the MicroStrategy Web application uses two types of Beans: Web Beans and Application Beans. While different Application Beans provide varying degrees of flexible functionality like that of Web Beans, Application Beans are generally not Web Beans. While some Application Beans may be rendered by transforms, many others (such as GridFormatEditorBean and ObjectBrowserBean) are self-rendering. Additionally, Application Beans are not necessarily WebComponents and not necessarily Persistable.
Usage Model
The Web Bean usage model consists of a caller initializing the Web Bean with some data and then asking the Web Bean to transform itself. This is accomplished by certain methods on the Web Bean triggering a request to be executed. The only two methods that cause this on the Web Bean interface are the transform and getDocument methods.
-
transform(){all variants}— XML construction is required before a transform can be invoked. If XML content is not stale, then no other backend server request is made.
-
getDocument()— XML construction is required before giving out the XML content. If XML content is “fresh” (not stale), then no other backend server request is made.
The execution of a transform causes a MarkupOutput object to be created. This contains the results of the transform in a format that can be easily sent to the JSP response object, the ASP response object, or the Server’s HttpServletResponse object. This object is produced and held by the TransformInstance object. Subsequent attempts to transform the same Web Bean when no data has changed causes the previously generated MarkupOutput object to be returned.