BI Beans thin beans use UIX Components technology for rendering HTML. Your servlet application must take the following steps to incorporate BI Beans extensions to UIX Components technology:
Register the thin beans with the look and feel manager
Add the BI Beans style sheet
As you initialize your servlet, you must register an oracle.dss.thin.beans.ThinExtensionUI
object with the look and feel that is registered with the UIX Configuration.
Registering this object makes BI Beans thin beans known to the UIX rendering
code. If you do not register a ThinExtensionUI
object, then UIX
is not able to render the thin beans. The following line of code shows how to
do register the ThinExtensionUI
:
LookAndFeelManager.getDefaultLookAndFeelManager().registerUIExtension( new ThinUIExtension);
The LookAndFeelManager
is defined in the oracle.cabo.ui.laf
package. For more information about the LookAndFeel
, refer to the
UIX Help topics.
The BIQueryToolServlet
class in the Custom Query Tool sample has
initialization code that registers the thin beans with UIX.
The BI Beans thin beans use a dynamically generated cascading style sheet (CSS) to format the HTML that they render. This style sheet is generated from two XML style sheet (XSS) files. These two files are:
blaf.xss
-- The UIX default style sheet
bistyles.xss
-- The BI Beans style sheet
When you build a servlet that includes the BI Beans thin beans, you need both XSS files. You must import them into a single XSS file, in order to generate a single CSS file. BI Beans uses the UIX Styles technology to create dynamically the CSS file.
These two files and the file into which you import them must be in the same folder, in order for the import to be successful. By default this folder is the style
subfolder of the UIX installables
folder.
The following example shows a single XSS file that imports the blaf.xss
file and the bistyles.xss
file.
<?xml version="1.0"?> <styleSheetDocument xmlns="http://bali.us.oracle.com/cabo/ocelot" version="2.0"> <import href="blaf.xss"/> <import href="bistyles.xss"/> </styleSheetDocument>
Because UIX generates the single servlet CSS file dynamically, you cannot insert the import statement into the <HEAD> element of the HTML page. Instead, use the UIX StyleSheetBean
. The StyleSheetBean
is a UINode
that supports the dynamic CSS generation and renders the import statement for the HTML page.
The following code shows how to use the StyleSheetBean
to import the CSS file that is generated from the XSS file that imports the blaf.xss
file and the bistyles.xss
file.
ServletRenderingContext context = new ServletRenderingContext(this, request, response, writer); // tell UIX to load servlet.xss instead of blaf.xss if (Configuration.getConfiguration("Test")==null){ ConfigurationImpl config = new ConfigurationImpl("Test"); config.putProperty(Configuration.STYLE_SHEET_HAME, "servlet.xss"); config.register(); } // register thin beans with the LookAndFeelManager LookAndFeelManager.getDefaultLookAndFeelManager().registerUIExtension( new ThinUIExtension()); context.setConfiguration("Test"); DocumentBean document = new DocumentBean(); HTMLWebBean head = new HTMLWebBean("head"); // add the stylesheet import to the head section of the HTML page head.addIndexedChild(StyleSheetBean.sharedInstance()); document.addIndexedChild(head); BodyBean body = new BodyBean(); document.addIndexedChild(body); // -- add thin beans and other UIX components to the body // -- code not provided in this example // render the page document.render(context);