The objective of this exercise is to learn the techniques that you need to develop a BI JSP application using predefined BI Beans objects and custom BI JSP tags.
In JDeveloper, you can create a JSP application easily using custom BI JSP
tags. From the component palette, you select tags that you can incorporate into
your JSP to build an application quickly. First, use the BIThinSession
tag to build a connection to Oracle9i OLAP based on the BI Designer object
that you created in the previous tutorial. Then, use the Presentation
tag to display a graph and the Toolbar
tag to create a toolbar
that controls the graph. You will run the application within JDeveloper to preview
it.
simpleJSP.jsp
as the name of the
JSP and accept the default directory for storing the JSP file. Choose Finish.You have created a new JSP under Project1.jpr
. Notice that the
Code Editor displays the code of the new JSP. This code includes simple HTML
and Java code that displays the current time. A default webXML file (which is
required for running the JSP) has also been created.
From the File menu, choose Save All to save the new JSP and its associated XML file.
Before you add objects to the JSP application, you must define the OLAP connections and object locations. Use the BIThinSession tag that encapsulates this information and is based on the BIDesigner object (Project1BIDesigner1) that you create previously.
In the BIThinSession tag wizard, you can define the attribute values for the BIThinSession tag.
simpleApp.
Ensure that there are no spaces
in id boxes.You can see the generated code in the Code Editor. The following code defines the location of the BI tag library, creates a synchronized session for the application, identifies the connection configuration file to use, and creates a form to hold the BI tags:
<%@ taglib uri="http://xmlns.oracle.com/bibeans" prefix="orabi"
%>
...
<%-- Start synchronization of the BI tags --%>
<% synchronized(session){ %>
<orabi:BIThinSession id="simpleApp" configuration="/Project1BIConfig1.xml"
>
</orabi:BIThinSession>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>
Hello World
</title>
</head>
<body>
<FORM name="BIForm">
<%-- Insert your Business Intelligence tags here --%>
</FORM>
...
<% } %>
<%-- End synchronization of the BI tags --%>
From the File menu, choose Save All to save the JSP application.
After you have defined the connection information, you are ready to add an object to your application.
<%--
Insert your Business Intelligence tags here --%>
comment .In the Presentation tag wizard, you can define the attribute values for the
Presentation
(Graph) tag.
simpleGraph
.In the Code Editor, you can see the following generated code:
The following code below the <orabi: BIThinSession>
tag
identifies the graph definition file to display in the JSP:
<orabi:Presentation id="simpleGraph" location="Sales Analysis Graph"/>
The following code adds hidden fields to maintain the state of the application, and displays the graph.
<orabi:Render targetId="simpleGraph" parentForm="BIForm"
/>
<%-- The InsertHiddenFields tag adds state fields to the parent
form tag --%>
<orabi:InsertHiddenFields parentForm="BIForm" biThinSessionId="simpleApp"
/>
From the File menu, choose Save All to save the JSP application.
After adding a graph to the simple application, you can add a toolbar that contains the essential tools for manipulating the graph. These tools perform tasks such as changing the view type, rotating dimensions, sorting dimension values, and retrieving favorites.
<%--
Insert your Business Intelligence tags here --%>
comment.In the Toolbar wizard, you can define the attribute values for the Toolbar tag.
simpleToolbar
.In the Code Editor, you can see the generated code. The following code defines the presentation that the toolbar controls (in this case, the referenced presentation is "simpleGraph" that you just created):
<orabi:Toolbar id="simpleToolbar" presentationId="simpleGraph" />
The following lines of code display the toolbar:
<orabi:Render targetId="simpleToolbar" parentForm="BIForm" />
From the File menu, choose Save All to save the JSP application.
You have completed the creation of a simple BI application. You can now run the application directly under JDeveloper with its built-in JSP engine.
To select a tool on the toolbar, click the tool.
You have built a simple application that allow users to view and analyze critical business information from an Oracle 9i database. Most important, you have accomplished this task easily and quickly using the custom JSP tags without writing a single line of code.
The next exercise "Handling Multiple Presentations" will build on this simple application.