|Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API
Release 1 (9.0.1)
Part Number A88756-01
Introduction to the OLAP API, 6 of 6
An application that uses the OLAP API typically performs the following tasks:
The rest of this topic briefly describes these tasks, and the rest of this guide provides detailed information.
Before an application can connect to the data store, it must obtain the CORBA stub that resides on the OLAP API client computer and represents the OLAP service to which the connection will be made. The application can use a CORBA name-space browsing procedure outside the OLAP API to get the name of the OLAP service. With this name in hand, the application can obtain the stub. The application then uses the OLAP API
Connection objects to specify the stub and establish the connection.
For more information about connecting, see Chapter 3.
Having established a connection, the application creates an
MdmMetadataProvider. This object gives access to all the metadata objects in the data store.
To discover the available metadata, an application uses the
getRootSchema method on the
MdmMetdataProvider to obtain the top-level measure folder for all of its metadata objects. The application then gets the dimensions, measures, and subfolders that are under the root. Once the application has all the dimensions and measures, it can interrogate them to get their attributes, hierarchies, levels, and other characteristics.
Having determined the metadata objects that it has to work with, the application can present relevant lists of objects to the user for data selection and manipulation.
The heart of any OLAP application lies in the construction of queries against the data store. The application user interface provides ways for the user to select data and specify what should be done with it. Then, the data manipulation code translates these instructions into queries against the data store. The queries can be as simple as a selection of dimension elements, or they can be complex, including several aggregations and calculations on measure values.
The OLAP API object that specifies a query is a
Source. Therefore, a significant portion of any OLAP API application is devoted to dealing with
You can manipulate
Source objects directly, using methods such as
appendValues to create selections. In addition, you can use methods such as
total to calculate values.
Source and its subclasses,
BooleanSource, have a rich assortment of methods for manipulating data. The most powerful method in
join, which gives you the ability to combine
Source objects in almost any way imaginable.
If you are implementing a simple user interface, you might use only the methods on the
Source classes to select and manipulate the data that users specify in the interface. However, if you want to offer your users multistep selection procedures and the ability to modify queries or undo individual steps in their selections, you should use
Template classes as described in the topic "Developing an OLAP API Application". Within the code for each
Template, you use the methods on the
Source classes, but the
Template classes themselves allow you to modify and refine even the most complex query. In addition, you can minimize your work by writing general-purpose
Template classes and reusing them in various parts of your application.
When users of an OLAP application are selecting, calculating, combining, and generally manipulating data, they also want to see the results of their work. This means that the application must retrieve the result sets of queries from the data store and display the data in multidimensional form. To retrieve a result set for a query through the OLAP API, the application creates a
Cursor based on the
Source that specifies the query.
Because the OLAP API was designed to deal with a multidimensional view of data, a
Source can have a multidimensional result set. For example, a
Source can represent an
MdmMeasure that is structured by three
MdmDimension objects. The
Cursor for this
Source has a structure that mirrors the
Source itself; that is, the
Cursor organization is based on the same three
To retrieve all the items of data through a
Cursor, the application can loop through the multidimensional
Cursor structure. This design is well adapted to the requirements of standard user interface objects for painting the computer screen. It is especially well adapted to the display of data in multidimensional format.
For more information about using
Cursor objects to retrieve data, see Chapter 9.