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 Java-Client 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 Java Application Development Environment | |
![]() |
Run and Use 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 specific goal of this lesson is to generate a fully functional BI Beans Java-Client application that incorporates the following functionality:
![]() |
Views of business data in both graphical and crosstab format, as a single view. | |
![]() |
Data-driven stoplight reporting. | |
![]() |
Access to saved crosstab, graph, calculations, and saved selections. | |
![]() |
Access to the QueryBuilder, which enables users to answer business questions like "What are my Top 3 selling products?" | |
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 Java-Client 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 Applications-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 Java-Client Class wizard may be used to generate a Java-Client Class application that uses the BI Beans objects that you specify.
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 | |
![]() |
Generate a BI Java-Client Application | |
To create the new project for your application, follow these steps:
| 1. | In the Applications-Navigator, right mouse click on Project1 and select New from the popup 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.
|
The BI Java-Client Class wizard guides you through the process of creating a fully-functional BI Beans Java-Client application without having to write any code.
In the wiizard, you are asked to select or identify the following:
![]() |
The BI Designer, which contains the OLAP data connection information and the location of the BI Beans objects that will be used by the application. | |
![]() |
Whether or not to display a default presentation (crosstab or graph) in the application. | |
![]() |
Which menus and toolbars to include in the application. | |
Follow these steps to generate a BI Java-Client application:
| 1. | In the Navigator, right-click on the Project that you just created in the previous topic. Select New from the popup menu.
|
|||||||||
| 2. | In the New Gallery dialog box, perform the following:
|
|||||||||
| 3. |
The Welcome screen, which describes the wizard steps, is displayed. Choose Next to continue.
|
|||||||||
| 4. | In Step 1, select the 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. Choose Project1OLAPConfig1.xml - [Project1] from the drop-down list. Click Next to continue.
|
|||||||||
| 5. | In Step 2, specify the presentation that is to be displayed when the application starts. Select the Yes option, and choose Browse to view the presentations that are available for selection.
|
|||||||||
| 6. | In the Open dialog box, select Sales Analysis Crosstab and click OK. In the Wizard, click Next to continue.
|
|||||||||
| 7. | In Step 3, select components such as menus and toolbars to include in the application. Select the following items as shown below: Menus, File, Tools, and Toolbar. Click Next to continue.
|
|||||||||
| 8. | On the Summary screen, review your selections and choose Finish. Select File > Save All to save your work. Notes: Application code is generated by the wizard and saved in BIApplication1.java, which is added to the Navigation window under the project. In addition, a default deployment profile, bijavaclientarchive1.deploy,
is also created. The deploy file allows the application to be run without
using JDeveloper. For the purposes of this lesson, JDeveloper will be
used to test and run the new Java-Client application. For more information
about deploying and running standalone Java-Client applications, see the
help topic: Deploying a BI Beans Java-Client Application topic in BI Beans
help within JDeveloper.
|
|||||||||
When the Java-Client application is generated, your JDeveloper layout should be divided into four areas as descibed below.
![]() |
Area 1: Source/Class/Design Window – Consists of three tabs: - The Source tab displays the application code and
allows a developer to edit the code directly. |
|
![]() |
Area 2: Applications-Navigator - Shows a list of project components, such as Designers, Java files, XML files, HTML FILES, etc. |
|
![]() |
Area 3: Structure Window – Provides the following views of the object in a hierarchical drillable tree mode: Code structure, UI structure, UI Model. Each view can be filtered by sorting, showing only methods, fields, static members or public members |
|
![]() |
Area 4: Message/Log Window – Provides feedback during compilation and execution. | |
All of these windows are linked.
For example, the Structure window can be used to find, and then navigate to functions, methods, and other elements in the Java application. Follow these steps for an illustration of this feature:
| 1. | In the Structure window, select the Code Structure tool (paper with pencil icon). Then, scroll down to and double-click the line that reads FILE_EXIT : String.
|
| 2. | When you double-click on an application element in the Structure window, the Code window is refreshed and the same java code that is referenced in the Structure window is now highlighted, as shown below: Feel free to examine the application using this Structure window / Source window navigation mechanism. However, do not modify any of the application code. The application is fully functional, and ready to be run without any modification. Proceed to the next topic for instructions on how to run 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 Java-Client 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 Crosstab | |
![]() |
Use the 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 BIApplication1.java and choose Make BIApplication1.java from the popup menu. The message log window should report that the compile process is successful.
|
| 2. | Right-click BIApplication1.java and choose Run BIApplication1.java from the popup menu. The application is loaded into memory. After the application loads, it is displayed in a new window.
|
The application starts by showing the presentation that was specified in the in the BI Java-Client wizard, in this case, the Stoplight Report crosstab.
The application also contains a menu that incorporates the main menu items that you specified in the wizard. The menu options provide access to various features.
The following steps demonstrate how an end user could interact with the crosstab in a Java-Client application. In the next subtopic, you will open and work with the Sales Analysis graph.
| 1. | The BI Java-Client Class Application runs in its own window. This is the end user view of the application.
|
|||||||||
| 2. | In the Time dimension drop-down on the paging control, select year 2001. The crosstab is updated to the specified year and the formatting rules are also applied to the new time period. Use the horizontal scroll bar to set all of the product divisions.
|
|||||||||
| 3. | Change the layout of the dimensions that are displayed in the crosstab by practicing drag-and-drop operations. For example:
The crosstab should now look similar to the following layout:
|
|||||||||
| 4. | Click the drill icon beside one of the Product division values to drill to the next level of detail. For example:
|
|||||||||
| 5. | Continue to experiment with the crosstab.
This is only an example and you will not save these changes now.
|
|||||||||
This subtopic demonstrates how to open and work with the Sales Analysis graph that you created in the Create Business Intelligence Objects focus area.
You will modify the graph format and the query that the graph is displaying. Then, you will save the modified graph to your local BI Beans Catalog using a different name.
| 1. | From the application's main menu, select File > Open and choose the presentation Sales Analysis Graph. Click OK to open the graph. If you are prompted to save the modified crosstab, click No. The graph presentation is displayed in the application replacing the stoplight report, as shown below. You can select new members from any of Page Items dimension tiles to requery the data.
|
|||||||||||||||
| 2. | Use the Query Wizard to change the Sales measure, which is displayed in the graph, to a Sales Revenue Growth % calculation, by performing the following:
The graph displays the new calculated data, showing how the top 5 products in the Photo division performed in the year 2000 in terms of Sales Growth %, as compared to the previous year.
|
|||||||||||||||
| 3. | Use the Query Wizard to change the dimension selection from America Areas to European Areas. Follow these steps:
The graph should now look similar to the following:
|
|||||||||||||||
| 4. | Select new members from the Geography dimension tile to view the updated graph.
|
|||||||||||||||
| 5. | Save the modified graph as a new object. Select File > Save As. Enter Sales Growth Analysis Graph as the name of the new graph and click OK. The new graph is saved in your local BI Beans Catalog.
|
|||||||||||||||
To exit the application and close the Java source code file, perform the following:
| 1. | From the application menu, Select File > Exit. In the Exit prompt box, click Yes. The application is closed and you are returned to JDeveloper.
|
| 2. | In the Source code tab, click the "X" to close the window. |
In this lesson, you learned how to generate an ad hoc query and analysis application using the BI Java-Client Class wizard. You also learned how to use some of the features that are integrated into a generated BI Beans Java-Client application.