Strategy ONE
Syntax for Web GUI Components in Page Configuration File
The following example is taken from the Shared Reports and Report Execution pages in MicroStrategy Web products and provides a thorough comparison between the differences between beans and web-components.
If beans are defined as follows:
<web-bean name="fb" persist-mode="2" sys- bean="FolderBean">...properties,styles...</web-bean><web-bean name="frame" persist-mode="2" sys-bean="ReportFrameBean">
<init-properties>...</init-properties>
<web-beans>...</web-beans>
</web-bean>
Then web-components can be defined as follows:
<web-components>
<web-component base-bean="fb" feature-id="" is-container="" name="folder_browser" style-name="folderViewMode" style-type="pref"/>
<web-component base-bean="fb" feature-id="" is-container="" name="folder_details" style-name="FolderStyleDetails" style-type="catalog"/>
<web-component base-bean="frame" feature-id="" is-container="true" name="report_area" style-name="" style-type=""/>
</web-components>
There are two beans defined in the above example— a Metadata Bean of type FolderBean and an Application Bean (Container Bean) of type ReportFrameBean. Here are the highlights:
-
Each type of bean can become the base for a web-component.
-
Each web-component includes a ‘base-bean’ that ties the web-components functionality to a bean defined on the same page.
-
When a web-component is based on a Container Bean, the ‘is-container’ attribute must be set to “true.”
-
The feature-id attribute takes the names of a feature ID. If the user does not have the corresponding privilege or permission, the component is not rendered for the user.
-
The style-name and style-type attributes can be set. When these are set, they override any defaults specified in the underlying bean definition.
-
style-name— Specifies the name of a style.
-
style-type— Specifies whether the style definition should be taken from the Style Catalog (catalog) or from preferences (pref). If pref is selected, the value specified for style-name becomes the name of a preference. The value of that preference then becomes the style to use.
-
Defining Web Components Based on Implicitly Defined Web Beans
Web Beans are occasionally instantiated automatically by the Web application rather than being explicitly defined in the Page Configuration file. The two most common cases of this occur in the Report Execution and the HTML Document Execution page.
During the report execution process, the application is intelligent enough to create its own PromptsBeans from a given ReportBean that is determined to have prompts. This is beneficial in that it saves you from having to handle the possibility of prompts existing in a report. You can observe this clearly by examining the Report Execution page. To do so, open the Page Configuration file and go to the <page> node whose name is report. In the <web-beans> node, you will find only a single metadata bean— a ReportBean by the name of rb. Similarly, there is no <web-component> corresponding to a PromptsBean. Still, the Report Execution page is capable of handling prompts. It creates the PromptsBean automatically when necessary.
Similarly, in the HTML Document Execution page (the <page> whose name is document), an HTML document can contain multiple reports, each of which is automatically instantiated as a ReportBean by the application, depending upon how many reports are present in a given HTML Document request.
In each of these cases, Web Beans are defined by the application with names assigned by the application. The naming conventions are as follows.
- For a ReportBean (whose name is rb) with prompts, rb_ep is the name of the PromptsBean automatically created.
- For a DocumentBean (whose name is db) with reports, dbrb_0 is the name of the ReportBean that represents the first report in the collection, dbrb_1 the second, and so on for as many reports are present in the HTML Document.
In each of these cases, the ReportBean or DocumentBean may be defined in the context of a container bean (as both are by default). In each of these cases, the provided default name of the Container Bean is frame. As such, the complete base-bean path for defining a Web component from these implicitly defined beans would become frame.rb.rb_ep and frame.db.dbrb_0 respectively:
- <web-component base-bean="frame.rb.rb_ep" "name="prompts_area" ... />
- <web-component base-bean="frame.db.dbrb_0" name="myFirstReport" ... />
See also
- Advanced Customization Topics: Including the Prompt Question on the Report Execution Page (for an example of using an implicitly defined web-component).
