Oracle OLAP Java API Reference
10g Release 1 (10.1)

B10994-01

oracle.olapi.data.source
Interface SourceGenerator


public abstract interface SourceGenerator

An interface for an object that produces a Source for a Template. A SourceGenerator must produce only one type of Source, such as a BooleanSource, a NumberSource, or a StringSource.

In producing the Source, a SourceGenerator uses the current state of the data stored in the MetadataState for the Template. An application creates a DynamicDefinition by passing the SourceGenerator to the createDynamicDefinition method on the Template. The application then gets the Source by calling the getSource method on the DynamicDefinition.

A Template can have more than one DynamicDefinition, each with a different SourceGenerator. Such a Template can produce different Source objects based on the same data, as defined by the current state of the MetadataState.

See Also:
DynamicDefinition, MetadataState, Template

Method Summary
 Source generateSource(MetadataState state)
          Produces a Source for a Template using the current state of the MetadataState.

 

Method Detail

generateSource

public Source generateSource(MetadataState state)
Produces a Source for a Template using the current state of the MetadataState. To get the Source produced by this method, an application calls the getSource method on a DynamicDefinition that was created using this SourceGenerator. An implementation of the generateSource method performs the operations needed to build the Source.

For example, suppose a Template, called TopBottomTemplate, produces a Source that defines a number of data values from the top or bottom of the elements of a measure for one of the dimensions of the measure. The other dimensions of the measure are limited to single values. An application lets the end user do the following:

The data that the user has specified is the ten products that have the highest total sales amount values of those sold through the direct channel to customers from San Francisco in the first quarter of the calendar year 2000 during a televised promotion.

The application calls methods on the Template to get the current state of the MetadataState, specify the values, and set the current state of the MetadataState. To get the Source produced by the Template, the application calls getSource on the DynamicDefinition.

The generateSource method performs the OLAP API operations that create a Source based on the current state of the MetadataState. In the example above, the generateSource method does the following:

That Source represents the data selection that the user defined.
Parameters:
state - The MetadataState whose fields contain the values of the current state of the Template.
Returns:
A Source representing a request for data from a data store.

Oracle OLAP Java API Reference
10g Release 1 (10.1)

B10994-01

Copyright © 2002, 2003, Oracle. All Rights Reserved.