In this lesson, you will learn how to incorporate BI Beans objects, which were defined in lessons from the Develop Business Intelligence Objects focus area, into a BI Beans JSP application and run the application from within JDeveloper.
![]() |
Overview | |
![]() |
Prerequisites | |
This lesson will discuss the following (please complete these topics in sequence):
![]() |
Download, Extract, and Open the BI Beans OBE Project (optional) | |
![]() |
||
![]() |
View the JDeveloper Application Development Environment | |
![]() |
Run the Application | |
![]() |
Exit the Application | |
![]() |
Summary | |
45 minutes
Move your mouse over this icon to show all screenshots. You can also move your
mouse over each individual icon to see only the screenshot associated with it.
BI Beans objects, such as presentations, calculations, and saved selections, are the building blocks of BI Beans analytic applications. The definitions of these objects are stored in the local BI Beans catalog on the developer's machine. These objects can also be copied to a remote BI Beans Catalog. The remote catalog is defined in an Oracle database, which allows analyses to be shared within a user community.
The BI Beans object definitions only need to be created once. They can then be referenced in BI Beans Java-Client applications or HTML client applications alike.
Lesson Objectives
The goal of this lesson is to generate a fully functional BI Beans JSP application that incorporates the Stoplight Report that was created previously. The application enables an end user to perform typical OLAP analyses, including the following:
![]() |
Open and save crosstabs and graphs | |
![]() |
Modify queries | |
![]() |
Create calculations | |
![]() |
Format data presentations | |
![]() |
Export data to a spreadsheet | |
![]() |
||
Menus and a toolbar provide access to these features.
As part of this lesson, you will run the application and learn how to use a subset of the features that are provided.
Data Model
For information on the data model used in the BI Beans OBE lessons, please see the Data Model page.
High Level Objectives
The general business requirements of the BI Beans OBE lessons are described in the Business Requirements page.
In order for this lesson to work successfully, you will need to have performed the following:
| 1. | Business Intelligence Beans provides a set of samples to help you learn how to use the product. These samples use the Oracle Common Schema analytic workspace as the sample data set. The BI Beans OBE lessons also use the Common Schema analytic workspace as the sample data set. Therefore, if the BI Beans samples have been installed, you should have access to the analytic workspace for the BI Beans OBE lessons. If the BI Beans samples have not been installed, refer to Installing the Common Schema for detailed instructions on how to install the Common Schema sample data set.
|
| 2. | Complete the first three lessons in the Develop Business Intelligence Objects focus area. Or, You can use a BI Beans Project that contains all of the files that would result from the completion of the tutorials in the first focus area. To use this project, follow the instructions in Download, Extract, and Open the BI Beans OBE Project. Note: If you have completed any other lesson in this focus area, then you already have the BI Beans OBE project that is required for this lesson. |
To create a BI Beans application, you must first develop the BI Beans objects that will be used by the application.
If you have not completed the first three lessons in the Develop Business Intelligence Objects focus area, or if you have not already downloaded and extracted the BI Beans OBE Project as part of another lesson in this focus area, use this optional topic. Otherwise, skip this topic and move directly to the Generate a BI Beans JSP Application topic.
This topic contains instructions for downloading and opening the JDeveloper Project that contains all of the files and objects that you need for this lesson.
To download and open the BI Beans OBE Project, follow these steps:
| 1. | First create a new Workspace. From the File menu, select New. The New Gallery dialog box opens.
|
|||||||||||||||
| 2. | In the New Gallery dialog box, under Categories, select General; under Items, select Workspace and click OK. The Create Workspace dialog box opens.
|
|||||||||||||||
| 3. | In the Create Workspace dialog box, accept the default name and directory for the workspace. Note: Make note of the path for your workspace Directory Name. Ensure that the Add a New Empty Project box is not checked, as shown in the screen shot below: Click OK to create the Workspace. Click the Save All tool to save the Workspace.
|
|||||||||||||||
| 4. | Save the following self-extracting archive, Project1.exe, to your local machine. For example, use your browser's right-mouse menu to perform a Save As. Note: Due to virus protection rules, the self-extracting archive may copy to your machine with the name Project1, rather than Project1.exe. If this is the case, you will need to rename the file on your local machine by adding the .exe extension before extracting its contents. Once you have downloaded the archive, and renamed it if necessary, extract the contents of the archive using the following steps:
The BI Beans OBE project is unzipped into your workspace directory. Close the WinZip Self- Extractor dialog.
|
|||||||||||||||
| 5. | In the JDeveloper Applications-Navigator, select the new Workspace that you just created in Steps 1. - 3. Then, from the main menu select File > Open.
|
|||||||||||||||
| 6. | In the Open dialog, navigate to the Project1 directory below your workspace directory. This directory was created when you extracted the archive in Step 4. Select Project1.jpr Click Open. The Workspace and associated Project are displayed in the Navigator.
|
|||||||||||||||
| 7. | Expand all of the nodes in the Workspace, and you should see the following project files in the Applications-Navigator:
|
|||||||||||||||
| 8. | Now, you must specify your database connection to the Oracle Common Schema analytic workspace in the BIDesigner. To do this, perform the following:
|
|||||||||||||||
| 9. | From the File menu, choose Save All. |
|||||||||||||||
The BI Beans JSP Application Wizard may be used to generate a JSP application that uses the BI Beans objects that you select.
You can generate the application files in the same project as your BI Beans objects, or you can create a new project to hold your application files. Here, you will create a new project and then generate the BI Java-Client application in that new project.
![]() |
Create a New Project | |
![]() |
Generating a BI Beans JSP Application | |
To create the new project for your application, follow these steps:
| 1. | In the Navigator, right mouse click on Project1 and select New from the pop-up menu.
|
| 2. | In the New Gallery dialog box, select General from Categories panel and select Empty Project from the Items panel Then click OK.
|
| 3. | Accept the default values provided in the Create Project dialog and click OK.
|
| 4. | From the main menu, choose File > Save All.
|
Generate a BI Beans JSP Application
You can generate a fully-functional BI Beans JSP application without having to write any code.
In the BI JSP Application Wizard, you are asked to select or identify optional components that can be added to the application. Once you have selected the components that you want, simply click OK to generate the application.
Follow these steps to generate a BI Beans JSP application:
| 1. | In the Navigator, right-click on the Project that you just created in the previous topic. Select New from the pop-up menu.
|
|||||||||
| 2. | In the New Gallery dialog box, perform the following:
The Complete BI JSP Application wizard is opened. This wizard, which is comprised of one dialog box, contains options for JSP application functions, or components. Here, you select the options that you want added to your application.
|
|||||||||
| 3. | First, select the BI Runtime Configuration file that the application will use. This file contains the connection information for your OLAP data connection and the location of your BI Beans objects. By default, the Project1OLAPConfig1.xml - [Project1] file should be selected in the Runtime Configuration file list. If not, select this file from the drop-down list.
|
|||||||||
| 4. | Next, specify the presentation that is to be displayed when the application starts. To do this, Select the Show a Default Presentation option, and then click the Browse button. The Open dialog box is displayed.
|
|||||||||
| 5. | In the Open dialog box, select Sales Analysis Crosstab and click OK. The Sales Analysis Crosstab is displayed in the Location box of the Complete BI JSP Application wizard.
|
|||||||||
| 6. | Now, select all of the other JSP application function options, as shown here: Click OK to generate the application. A set of project files are created for your BI JSP application. Note: When you first create a JSP application using this wizard, a Readme page is displayed. Review the Readme page, which describes all of the project files that are created as part of a JSP applications.
|
|||||||||
| 7. | When you are finished reviewing the Readme file, close it by clicking the 'X' next to it's name, as shown below:
|
|||||||||
| 8. |
From the main menu, choose File > Save All.
|
|||||||||
When your BI JSP application is generated, a set of application files are created that include:
![]() |
A Java application source file (BIJSPApp1.java) | |
![]() |
Image files | |
![]() |
XML files | |
![]() |
JSP files | |
These application source code and support files are added to the Applications-Navigator window under the project.
The number of image files and JSP files that are created depend on the number of JSP application functions that you selected in the Complete BI JSP Application wizard.
The primary JSP file for the application is named Analyze1.jsp.
Follow these steps to examine the application develoment environment:
| 1. | In the Applications - Navigator, right-click on Analyze1.jsp and select Open to load the primary JSP application page.
|
|||||||||||||||
| 2. | Once the application loads, the JDeveloper window layout should be divided into five areas as descibed below.
|
|||||||||||||||
This BI Beans JSP application is complete and ready to run. Go to the next topic for instructions on running the application.
In this topic, you will compile and run the application from within JDeveloper. You will also use some of the built-in features of the generated BI JSP application to work with the Stoplight Report crosstab and the Sales Analysis graph.
Complete the following subtopics in sequence:
![]() |
Compile and Run the Application | |
![]() |
Use the Presentation Toolbar | |
![]() |
Save Crosstab Modifications as a New Catalog Object | |
![]() |
Create a Ranking Condition for the New Crosstab | |
![]() |
Open and Modify a Graph | |
JDeveloper allows you to launch the application directly from the Applications-Navigator pane to view the application as an end user.
To compile and launch the application, follow these steps:
| 1. | To check the structure of the application, it is recommended to compile (Make) the application code. In the Navigator, right-click Analyze1.jsp and choose Make from the popup menu. The status bar at the bottom of the JDeveloper window should report that the compile process is successful.
|
|||||||||
| 2. | Right-click Analyze1.jsp and choose Run from the popup menu. JDeveloper's embedded OC4J server is started, and the application is loaded into memory.
|
|||||||||
| 3. | The running application is displayed in a new window and starts by showing the Stoplight Report crosstab that was selected as the default presentation. The page is divided into three main sections:
|
|||||||||
In this subtopic, you will use some of the features of the Presentation toolbar by performing the following:
![]() |
Change the view of the Stoplight report from a crosstab to a graph and back | |
![]() |
Modify the layout of the report | |
![]() |
Use a Saved Selection to change the member selection for the Geography dimension | |
![]() |
Modify the Stoplight format thresholds | |
Follow these steps:
| 1. | Click the View tool. In the View menu, select the Graph option. Then, change the graph type to Pie. Click Go to update the report. The graph shows the contribution of Sales for each of the selected Geography dimension members. Reset the view back to a crosstab by selecting the Crosstab option and clicking Go. |
|||||||||
| 2. | To change the member selection in Page Items dimensions, simply select the new dimension member from the drop-down list, and then click Go. You can also scroll horizontally in the crosstab by clicking the appropriate link next to the Columns drop-down list. For example, click the Right link to view the measure data for the remaining selected products. Scroll back to the left by clicking the Left link.
|
|||||||||
| 3. | Change the orientation of the crosstab by using the Layout tool. Click the Layout tool to display the Layout menu options. Select the following:
Click Go to update the crosstab. In the year 2000, the Electronics product division contributed the most in terms of sales growth in the Americas. Now, drill on the Electronics division to view the data for its product groups. The Game Consoles and Home Audio product groups are peforming the best based on sales growth. Collapse the Electronics division by clicking the minus ("-") sign. Finally, use the Layout tool to Swap the Product and Geography dimension again. This will re-establish the original orientation of the crosstab.
|
|||||||||
| 4. | Modify the Geography member selection by using a Saved Selection. Click the Saved Selections tool. In the Saved Selections menu, select the following:
Click Go to update the crosstab. The dimension members that were saved as European Areas are added to the Geography dimension selection in the report.
|
|||||||||
| 5. | Modify the upper threshold of the stoplight format to 70%. Click the Stoplight tool to display the stoplight options. In the Stoplight menu, specify the following:
Then, click Go. The crosstab stoplight formatting updates to meet the new criteria.
|
|||||||||
| 6. | Finally, change the layout of the crosstab once more before saving your changes to the crosstab as a new object. Click the Layout tool to display the Layout menu options. Select the following:
Click Go to update the crosstab. The new layout should look like this:
|
|||||||||
In this subtopic, you will save the modified crosstab to the Catalog using a different name.
Perform the following steps:
| 1. | Click the Save As button at the top right section of the application page.
|
| 2. | In the Save As screen, enter the name Country Ranking Stoplight, and then click Save. The name of the report is updated, and a new object has been added to the Catalog.
|
In this subtopic, you will learn how to use the HTML Query Editor to modify the query for the Country Ranking Stoplight crosstab.
You will change the dimension selection for Geography by creating a ranking condition that returns the top 10 countries based on Sales Revenue, and then save the changes to the report.
Perform the following steps to edit the query:
| 1. | Click the Edit button in the top right corner of the report window. The Edit: screen is displayed. Click the Refine Selections link. The Refine Selections tab displays the current selections for the measures and each dimension in the query.
|
||||||||||||||||
| 2. | In the Geography dimension, click the Delete (trash can) icon for both of the selection steps to remove the entire selection. After deleting both steps, the Geography selection is empty:
|
||||||||||||||||
| 3. | Now, in the Geography dimension, click the Create Step button. The Step Type screen is displayed. In the Step Type screen, select the Top / Bottom condition type that contains the following description: Top or bottom members based on a Measure, as shown here: Click the Continue button to refine the condition.
|
||||||||||||||||
| 4. | In the top portion of the Top/Bottom Step screen, select the following options:
|
||||||||||||||||
| 5. | An OLAP ranking condition returns the appropriate dimension members for the condition by using a specific combination of values for the remaining,or qualifying, dimensions in the query. The values for these dimensions are displayed in the Qualify Measure region, in the bottom portion of the Top/Bottom Step screen For example, our ranking condition as currently defined would return the top 10 products for Channel total, Product total , Promotion total and 1999, as shown here: In an OLAP ranking condition, you can use the Qualify Measure region to select a different dimension member for each of the qualifying dimensions in the query. Even more, you can specify that the ranking condition should be re-executed each time you select a new member from a qualifying dimension that is in the Page Items region of the crosstab. To do this, choose the Selected <Dimension> page item option in the dimension value drop-down list. Use the dimension value drop-down lists to select the following:
Click Finish to add the new Geography dimension Step to the Query. At the top of the Step Type screen, Click Apply to execute the new query and update the crosstab
|
||||||||||||||||
| 6. | With the inclusion of the new ranking condition, when you select members from one of the Page Item dimensions, the Top 10 Country list is refreshed for the current combination of selected dimension members. For example, select the following dimension members from the Page Item dimensions: Electronics, Channel total, and 2000. Then click Go. The report shows the following top 10 Countries based on Sales Revenue: Now, select these dimension members from the Page Item dimensions: Photo, Direct, and 2000. Then click Go. The report shows a new list of top 10 Countries with the appropriate ranking and stoplight formatting: Feel free to experiment with the crosstab selections. Note: As currently defined, the Geography ranking condition is designed to re-execute every time a new Product, Time, and Channel dimension member is selected. Therefore, while using this ranking condition, these three qualifying dimensions must be located in the Page Items region of the crosstab layout.
|
||||||||||||||||
| 7. |
When you are done experimenting with the crosstab, save the Country Ranking Stoplight report by clicking the Save button.
|
||||||||||||||||
In this subtopic, you will open the Sales Analysis Graph. You will modify the graph format and the query for the graph. Finally, you will save the modified graph to the Catalog using a different name.
Perform the following steps:
To exit the application and close the Java source code file, perform the following:
| 1. |
To exit the application, simply exit the Browser.
|
| 2. | Then, shut down the embedded OC4J engine by selecting Run > Terminate > Embedded OC4J Server from JDeveloper's main menu.
|
In this lesson, you learned how to generate an ad hoc query and analysis application using the Complete BI JSP wizard.
You also learned how to use many of the features that integrated into a generated BI Beans JSP application for analyzing and modifying crosstabs and graphs.
Finally, you learned how to save modified reports as new objects in the Catalog, and how to open objects from the Catalog.