Generating a BI Beans JSP Application

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 Topics

Overview
Prerequisites

Topics

This lesson will discuss the following (please complete these topics in sequence):

Download, Extract, and Open the BI Beans OBE Project (optional)

Generate a BI Beans JSP Application

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.

Overview

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.

Back to Topic List

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
Print

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.

Prerequisites

In order for this lesson to work successfully, you will need to have performed the following:

Back to Topic List

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.

 

Download, Extract, and Open the BI Beans OBE Project (optional)

To create a BI Beans application, you must first develop the BI Beans objects that will be used by the application.

Back to Topic List

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.

Move your mouse over this icon to see the image

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:

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

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:

A. Double-click on the self-extracting archive, Project1.exe.
B.

In the WinZip Self- Extractor dialog box, use the Browse button to navigate to the directory that was just established by the creation of your new JDeveloper Workspace. For example, <JDeveloper_home>\jdev\mywork\Workspace1.

C. Click the Unzip button.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

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

Move your mouse over this icon to see the image

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:

Move your mouse over this icon to see the image

 

8.

Now, you must specify your database connection to the Oracle Common Schema analytic workspace in the BIDesigner. To do this, perform the following:

A.

Right-mouse click on Project1BIDesigner and select Settings from the pop-up menu.

Move your mouse over this icon to see the image

 

B.

In the BI Designer Settings dialog box, click the Edit button just beneath the Connection drop-down box.

Move your mouse over this icon to see the image

The OLAP Connection Editor is displayed.

 

C.

Select the Connection tab in the OLAP Connection Editor. Modify the connection details for your Oracle OLAP data source.

Move your mouse over this icon to see the image

 

D.

Select the Test tab. Then, click Test Connection to verify that your connection is valid.

Move your mouse over this icon to see the image

Click OK to close the OLAP Connection Editor.

Notes:

If the connection fails, return to the Connection tab and re-enter the connection information for your Oracle Common Schema analytic workspace data source.

If you have not installed the Common Schema sample data set, follow the instructions in Installing the Oracle Common Schema, which is described in the Prerequistes section.

 

E.

Click OK to close the BI Beans Settings dialog box.

 

9.

From the File menu, choose Save All.

 

Generate a BI Beans JSP Application

The BI Beans JSP Application Wizard may be used to generate a JSP application that uses the BI Beans objects that you select.

Back to Topic List

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

 

Create a New Project

Back to Subtopic List

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.

Move your mouse over this icon to see the image

 

2.

In the New Gallery dialog box, select General from Categories panel and select Empty Project from the Items panel

Move your mouse over this icon to see the image

Then click OK.


3.

Accept the default values provided in the Create Project dialog and click OK.

Move your mouse over this icon to see the image


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.

Back to Subtopic List

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.

Move your mouse over this icon to see the image


2.

In the New Gallery dialog box, perform the following:

A. In the Categories box, expand the Business Intelligence Beans node and then expand the Web Tier node. Select JavaServer Pages.
B.

In the Items box, select Complete BI JSP Application.

Move your mouse over this icon to see the image

 

C. Click OK.

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.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

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:

Move your mouse over this icon to see the image

Click OK to generate the application.

A set of project files are created for your BI JSP application.

Move your mouse over this icon to see the image

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:

Move your mouse over this icon to see the image

 

8.

From the main menu, choose File > Save All.

 

View the JDeveloper JSP Application Development Environment

Back to Topic List

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.

Move your mouse over this icon to see the image

 

2.

Once the application loads, the JDeveloper window layout should be divided into five areas as descibed below.

Move your mouse over this icon to see the image

Area 1: Applications-Navigator – Shows a list of project components, such as Designers, Java files, XML files, HTML FILES, etc.

Area 2: Design/Source Window – Consists of two tabs:

- The Design tab – Displays the UI view of the application and allows a developer to edit the design visually.
- The Source tab – Displays the the JSP tags and allows a developer to edit the application code directly.

Area 3: Structure Window – Displays a view of application objects in a hierarchical drillable tree mode. This display is dependent on the tab that is selected in Area 2, and it refreshes automatically when you select a different tab.

Area 4: Component Palette – Displays a list of JSP and HTML components that can be used within an application.
Area 5: Property Inspector – Displays a window that is linked to the Structure window. Selecting a component in the Structure window updates the Property Inspector.

This BI Beans JSP application is complete and ready to run. Go to the next topic for instructions on running the application.

 

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 JSP application to work with the Stoplight Report crosstab and the Sales Analysis graph.

Back to Topic List

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

Compile and Run the Application

JDeveloper allows you to launch the application directly from the Applications-Navigator pane to view the application as an end user.

Back to Subtopic List

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.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

The page is divided into three main sections:

Main toolbuttons

Move your mouse over this icon to see the image

The toolbuttons allow users to update the current report, save the report to a new name, print the current report, export the current report, create a new calculation, or edit the query for the report.

The toolbuttons are also displayed at the bottom of the application window.

Note: For the Export feature, supported formats include: MS Excel HTML (*.htm), Tabbed Text (*.txt), and Comma Separated Values (*.csv).

 

Presentation toolbar

Move your mouse over this icon to see the image

The toobar allows users to change the view from crosstab to graph and vice versa, change the layout of the current report, modify the format and stoplight formatting, sort dimension members, and access previously saved dimension selections.

Select any one of the toolbar links to display the toobar menu that is associated with the selected tool. For example, the Format menu is expanded to show its options here:

Move your mouse over this icon to see the image

 

Presentation area, which contains the Crosstab or Graph.

Use the Presentation Toolbar

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

Back to Subtopic List

Follow these steps:

1.

Click the View tool.

In the View menu, select the Graph option. Then, change the graph type to Pie.

Move your mouse over this icon to see the image

Click Go to update the report. The graph shows the contribution of Sales for each of the selected Geography dimension members.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

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:

option 1:

Swap

option 2:

Product

option 3:

With Geography

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

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:

Dimension:

Geography

Action:

Add

Saved Selection:

European Areas

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

 

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:

Format:

Sales Revenue Growth %

Unacceptable

0

Acceptable:

0.70

Move your mouse over this icon to see the image

Then, click Go.

The crosstab stoplight formatting updates to meet the new criteria.

Move your mouse over this icon to see the image

 

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:

option 1:

Move

option 2:

Product

option 3:

To Page Items

Click Go to update the crosstab. The new layout should look like this:

Move your mouse over this icon to see the image

 

Save Crosstab Modifications as a New Catalog Object

In this subtopic, you will save the modified crosstab to the Catalog using a different name.

Back to Subtopic List

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.


Create a Ranking Condition for the New Crosstab

In this subtopic, you will learn how to use the HTML Query Editor to modify the query for the Country Ranking Stoplight crosstab.

Back to Subtopic List

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.

Move your mouse over this icon to see the image

 

2.

In the Geography dimension, click the Delete (trash can) icon for both of the selection steps to remove the entire selection.

Move your mouse over this icon to see the image

After deleting both steps, the Geography selection is empty:

Move your mouse over this icon to see the image

 

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:

Move your mouse over this icon to see the image

Click the Continue button to refine the condition.

 

4.

In the top portion of the Top/Bottom Step screen, select the following options:

Level:

 

Country
Condition:

Operator

Top
 

Rank

10
  Based On Sales Revenue

Move your mouse over this icon to see the image

 

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:

Move your mouse over this icon to see the image

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:

Channel:

Selected Channel page item

Product

Selected Product page item

Promotion:

Promotion total

Time: Selected Time page item

Move your mouse over this icon to see the image

Click Finish to add the new Geography dimension Step to the Query.

Move your mouse over this icon to see the image

At the top of the Step Type screen, Click Apply to execute the new query and update the crosstab

Move your mouse over this icon to see the image

 

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:

Move your mouse over this icon to see the image

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:

Move your mouse over this icon to see the image

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.

 

Open and Modify a Graph

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.

Back to Subtopic List

Perform the following steps:

1.

Click the Catalog link at the top left section of the application page.

Move your mouse over this icon to see the image

The Catalog browser is opened.

 

2.

Click the link for the Sales Analysis Graph.

Move your mouse over this icon to see the image

The graph is displayed in the application, replacing the crosstab.

Move your mouse over this icon to see the image


3.

First, use Query Editor to change the measures that are displayed in the graph.

Click the Edit button at the top right corner of the application page.

Then, in the Edit screen, click the Start With tab, which is shown below:

Move your mouse over this icon to see the image

Using the Start With tab, follow these steps to add the Sales Costs measure to the graph:

A.

In the Available Items panel, click the Available link as shown in the following image:

Move your mouse over this icon to see the image

All available measure folders are displayed in the list

 

B.

In the Available list, click the drill symbol next to the Electronics - KPIs measure folder. Then, in the Electronics - KPIs measure folder, click the drill symbol next to Measures. The following list is displayed:

Move your mouse over this icon to see the image

Select Sales Cost by checking the box to the left.

Move your mouse over this icon to see the image

 

C.

Click on the Add icon ('>') to add Sales Costs to the list of Selected Items.

Move your mouse over this icon to see the image

 

D. Click the Apply button at the top right corner of the Edit screen to add the measure to the graph.

Sales Cost is added to the list of measures in the graph.

Move your mouse over this icon to see the image

 

4.

Next, use the Layout tool to modify the layout of the presentation.

Click the Layout tool to display the Layout menu options and select the following:

option 1:

Swap

option 2:

Channel

option 3:

With Measure

Click Go to update the graph, which should now look like the following:

Move your mouse over this icon to see the image

 

5.

Select other members from the Page Items dimensions and see how the Top 5 Products list is re-evaluated based on the qualifying dimension members.

For example, the selection of Channel total, United States of America, and 2000 should create the following graph result:

Move your mouse over this icon to see the image

 

6.

Save the modified graph as a new object. First click the Save As button in the application page.

Enter Sales and Costs for Top 5 Photo Products as the name of the new graph, and then click Save.

The name of the report is updated, and a new object has been added to the Catalog.

 

Exit the Application

Back to Topic List

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.