Oracle Business Intelligence Beans Sample

Retrieving Metadata from Oracle9i OLAP and the BI Beans Catalog

Overview

BIMetadata is a sample application that demonstrates how a BI Beans application can retrieve metadata from a metadataManager that is connected to Oracle9i 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).

BIMetadata extends BIFrame that provides a menu with access to a simple connection dialog which prompts a user for security credentials. It then makes the two connections described above. After the connection is established, the "Metadata Browser" menu option can be selected to view metadata.

Setup Requirements

If you have not already done so, you must perform several installation and configuration tasks, then open the workspace javaclient\javaclient.jws under the samples directory within JDeveloper. All the necessary files for this sample can be found in the metadata_browser.jpr project under the javaclient.jws workspace.

Code Highlights

There are a few areas of interest in the code which may be particularly useful for developers. The code below is taken from the getChildren method and demonstrates how to retrieve sub-folders, measures and dimensions from an MDFolder:

MDObject[] children = folder.getFolders();
for(int i = 0; children != null && i < children.length; i++) childrenVec.addElement(children[i]);
children = folder.getMeasures(); for(int i = 0; children != null && i < children.length;
i++) childrenVec.addElement(children[i]); children = folder.getDimensions();
for(int i = 0; children != null && i < children.length; i++) childrenVec.addElement(children[i]);

The code below is taken from the showProperties method and demonstrates how to retrieve general properties from an MDObject:

text.append("Name = " + mdObject.getName() + newLine);
text.append("UniqueID = " + mdObject.getUniqueID() + newLine);
text.append("ObjectType = " + mdObject.getObjectType() + newLine);
text.append("DriverType = " + mdObject.getDriverTypes().toString() + newLine);
text.append("Path = " + mdObject.getPath() + newLine);
text.append("ShortLabel = " + mdObject.getShortLabel() + newLine);
text.append("LongLabel = " + mdObject.getLongLabel() + newLine);
text.append("Description = " + mdObject.getDescription() + newLine);

How To Run

To run the BIMetadata example within JDeveloper, simply right-click on the file BIMetadata.java and choose Run BIMetadata.java. From the File Menu in the application, choose Connect and enter the username and password of the user that owns the BI Beans Catalog (e.g. BIBCAT).

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

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.