# Oracle Business Intelligence Beans Sample

## Linking Presentations

### Overview

Linking Presentations is a sample application that demonstrates how to link queries and selections between views (for example, crosstab, table and graph). It connects to Oracle OLAP (the source of the business data for the application) and to the BI Beans Catalog (where object definitions, like crosstabs and graphs, are saved).
The Linking Presentations sample allows the user to control the following options:

- What views to link

- Crosstabs, tables, and graphs can be linked together in a variety of combinations

- Relationships

- Bidirectional

- If a view is changed, all other linked views are changed

- Master/Detail

- If a master view is changed, all detailed views are changed

- Changes to the detail view are not reflected in the master

- UI Action

- Users are allowed to perform Page, Drill, Pivot, and Selection Change operations

- Selections

- All Dimensions (i.e. by query)

- Specified dimensions (i.e. by selection)

### Code Highlights

`BILinking` provides a menu with access to a simple connection dialog that prompts a user for security credentials. It then makes the two connections described above.

#### Views Menu

After the connection is established, various combinations of linked views can be created from the Views menu option. All linked views currently default to Bidirectional/All dimensions.

- Crosstab-Table

- Crosstab-Graph

- Graph-Table

- Crosstab-Table-Graph

The Views menu also allows the ability to toggle the first selection associated with a master dataview between various types of steps (for example, AllStep or FirstLastStep). This is useful for generating 'Selection Change' UI Actions described below.

#### Linking Menus

The right mouse button can then be used to select various link options based on the dimensions chosen:

#### Identifying Linked Dimensions

To help simplify the ability to see the relationships defined between various dimension, we apply an italic font if the dimension is linked and add a bold font if the link is bidirectional or part of the master view.

Issues:

- Formatting with rule bundles is supported only in Table and Crosstab, but not in Graph

- Measures associated with the Table cannot be formatted

#### Expected Behavior

The following table shows the expected behavior of different combinations of Relationships, UI Actions and Selections:

Relationship: Bidirectional

UI Action | Selections |
--- | --- | ---
| All Dimensions [Linked by Query - Default] | Selected Dimensions [Linked by Selection(s)]
Page | Changes are automatically sent to all views by shared Query | Master page operation is performed on all detail views by simply applying the Master's current page slice to each Detail view.
Drill | Changes are automatically sent to all views by shared Query | Drill is performed on all views for linked dimensions
Pivot | Changes are automatically sent to all views by shared Query | Ignored
Selection Change | Changes are automatically sent to all views by shared Query | Selection is applied to all views for linked dimensions
| Note: Since linked by Query, any changes made to one view are automatically reapplied to (i.e. re-synced with ) others. | Note: A QueryListener must listen for events associated with each linked dimension UI Action and be able to apply them to each linked view.

Relationship: Master/Detail

UI Action | Selections |
--- | --- | ---
| All Dimensions [Linked by Query] | Selected Dimensions [Linked by Selection(s)]
Page | Master page operations are performed on all detail views for all dimensions | Master page operation is performed on all detail views for linked dimensions by attempting to find the Dimension/Dimension member chosen in each detail view.
Drill | Master drills are performed on all detail views for all dimensions | Master drill is performed on all detail views for linked dimensions by applying master selection without clearing drill steps.
Pivot | Master pivot operations are performed on all detail views for all dimensions | Ignored
Selection Change | Master selection is applied to all detail views for all dimensions. | Master selection is applied to all detail views for linked dimensions.
| Note: Detail views are disabled. A QueryListener must listen for events associated with each Master UI Action and be able to apply them to each Detail linked view. | Note: Changes to Detail views do not affect the master. A QueryListener must listen for events associated with each Master linked dimension UI Action and be able to apply them to each Detail linked view.

Relationship: Remove (None)

- Each view's query is cloned to remove any existing links

#### Query Listener Events

This table shows the QueryListener events that are fired for different combinations of Views and UI Actions

View: Crosstab

Page | Drill | Pivot | Selection
--- | --- | --- | ---
viewDataChanged (DataChangedEvent) | drillRequesting (DrillRequestingEvent) | layoutChanged (LayoutChangedEvent) | selectionChanged (SelectionChangedEvent)
DataChangedEvent.PAGE_CHANGE | drillRequested (DrillRequestedEvent) | viewDataChanged (DataChangedEvent) | viewDataChanged (DataChangedEvent)
| viewDataChanged (DataChangedEvent) | DataChangedEvent.PIVOT_CHANGE | DataChangedEvent.SEL_CHANGE
| DataChangedEvent.DRILL_CHANGE |  |

View: Table

Page | Drill | Pivot | Selection
--- | --- | --- | ---
viewDataChanged (DataChangedEvent) | N/A (not available for relational projections) | layoutChanged (LayoutChangedEvent) | selectionChanged (SelectionChangedEvent)
DataChangedEvent.PAGE_CHANGE |  | viewDataChanged (DataChangedEvent) | viewDataChanged (DataChangedEvent)
|  | DataChangedEvent.PIVOT_CHANGE | DataChangedEvent.SEL_CHANGE

View: Graph

Page | Drill | Pivot | Selection
--- | --- | --- | ---
viewDataChanged (DataChangedEvent) | drillRequesting (DrillRequestingEvent) | N/A (only available through layout panel) | selectionChanged (SelectionChangedEvent)
DataChangedEvent.PAGE_CHANGE | drillRequested (DrillRequestedEvent) |  | viewDataChanged (DataChangedEvent)
| viewDataChanged (DataChangedEvent) |  | DataChangedEvent.SEL_CHANGE
| DataChangedEvent.DRILL_CHANGE |  |

#### Known Issues and Limitations

- Graph

- No ability to add layout panels directly through graph (for example, cannot display Series and Group)

- Default 'Paging Item' controls and drilling off

- Does not support pivoting of 'Page Items'

- Formatting

- Does not support rule bundles

- Crosstab and Table

- Formatting

- Crosstab (cube) and Table (relational) measure QDRs differ

- This affects the ability to apply rule bundles (for example, bold or italic) to measure dimension members within a table

Copyright © 2004 Oracle Corporation. All Rights Reserved.