In This Section:
The sample programs provided with Provider Services help you test the software and get you started on developing client programs for Provider Services.
Note: | The sample programs are available for use with Essbase only. |
In order to run the sample programs, you must configure your environment with the following components:
A Provider Server
A supported Essbase server with users and sample applications
Unless otherwise noted in this document, the sample programs assume that all necessary software components (Provider Services, Essbase, and the sample programs themselves) are running on the same computer.
The sample programs demonstrate areas of functionality provided through the Essbase JAPI. The sample programs are located in the directory, EPM_ORACLE_HOME/common/EssbaseJavaAPI/11.1.2.0/samples/japi. The areas covered by each sample program are summarized in the following list:
Allocation.java shows how to perform allocation on an Essbase ASO cube.
BackupAndRestoreDatabase.java signs onto an Essbase domain, creates an application and database, backs up and then restores the database.
BuildDimension.java adds and removes members from the outline in the active database.
CdfCdm.java shows the usage of CDF and CDM.
CellAttributes.java signs on to Essbase domain, opens a cube view, performs a retrieval, gets the cell attributes, and signs off.
Connect.java demonstrates a simple connection to an Essbase Server.
CopyOlapAppAndCube.java copies an Essbase application and cube within the same Essbase Server; can be extended to perform copying across Essbase Servers.
CreateCluster.java creates a cluster.
CreateOlapApp.java creates OLAP applications.
CreateOutline.java demonstrates creating a cube outline: creates dimensions, members, and other outline elements; verifies the outline; and restructures the database.
CubeDataLoad.java signs onto the Essbase domain, loads data into a cube, and signs off.
CubeLocks.java signs onto the Essbase domain, gets the list of locks held on a cube, and signs off.
CustomCalc.java demonstrates how to perform custom calculation on an Essbase Aggregate Storage(ASO) cube.
CustomMessageHandler.java demonstates how to use the custom message handler.
DataQuery.java demonstrates basic retrieval of data from an Essbase database.
DataSource.java demonstrates the retrieval of Essbase Server information and execution of reports.
Domain.java demonstrates adding, fetching and removing Essbase Servers from the domain of Provider Services.
EditOutline.java signs onto the Essbase domain, connects to an application and database, and performs almost all edit operations on the database outline.
ExecuteMaxL.java logs on to the Analytic Server, executes MaxL statements, then logs off.
GetLoginIDRequest.java signs onto the Essbase domain and retrieves the login ID of the user signing in; and retrieves the list of executing requests from Essbase Server.
GetMembers.java signs on to Essbase domain, performs various metadata operations and signs off.
GetOlapUser, demonstrates fetching of native and external Essbase users.
GridDataUpdate.java demonstrates the retrieving and updating of data in a grid format.
GridLockUnlock.java signs on to an Essbase domain, opens a cube view, performs a lock, retrieval, unlock, and signs off.
GridWithUnknownMembers.java demonstrates how to detect unknown members in data query.
HisDrillThrough.java signs on to an Essbase domain, opens a cube view, performs Oracle Essbase Integration Services drill-through, lists reports, executes reports, and signs off.
HisDrillThroughOnRange.java signs on to an Essbase domain, opens a cube view, performs Oracle Essbase Integration Services drill-through, lists reports, executes reports, and signs off.
HybridAnalysis.java demonstrates how to use the Hybrid Analysis option for data query and metadata operations.
KillOwnRequest.java kills a running request issued to an Essbase application server from the same user session.
LinkedObjects.java signs on to an Essbase domain, opens a cube view, performs a retrieval, performs LRO operations, and signs off.
LinkedPartition.java signs on to an Essbase domain, opens a cube view, performs a retrieval, looks for a linked partition in a cell and signs off.
ListAndKillOlapRequests.java signs on to an Essbase domain, connects to an Essbase Server, lists the requests, kills requests, and signs off.
LoadData.java loads data to a cube.
MdxQuery.java signs on to an Essbase domain, opens a cube view, performs an MDX query execution, retrieves the results, and signs off.
MetaData.java demonstrates retrieval of metadata information from an Essbase database, including member selection.
NonUniqueOutline.java tests an existing Sample Basic outline to verify that it allows unique members only, creates a new outline enabled for duplicate (non-unique) member names, and uses the duplicate member name JAPIs.
NonUniqueQueryOutline.java, queries a outline enabled for duplicate (non-unique) member names. This sample file is intended to test the duplicate member names outline created using the NonUniqueOutline.java sample.
PropertyViewer.java gets an application/database object, enumerates its properties, and prints the values.
QueryHints.java signs on to the Essbase domain, performs various query hints-related operations, and signs off.
QueryVaryingAttributes.java signs onto the Essbase and opens a database; performs a member selection; queries for varying attributes; and signs off.
ReadOutline.java signs on to the Essbase domain, reads various items in an outline and signs off.
RunReport.java demonstrates the running of a report from an Essbase database.
RunXmlReport.java signs on to the Essbase domain, runs a report, and signs off.
SecurityFilter.java tests the security filters.
SmartListOutline.java signs onto the Essbase domain, creates a database with MemberType Enabled outline, verifies Smart List outline editing APIs, performs the grid operations, and deletes the outline.
SmartListReport.java signs onto the Essbase demonstrates grid API report specification usages with respect to querying on smart list, date, and formatted string data cell types.
SyncCubeReplicas.java demonstrates the replication of data between two Essbase databases.
TimeDimIntelligence.java shows the time intelligence APIs related to a "date time" dimension.
ViewOutlineTree.java demonstrates the listing of all outline members from an Essbase database outline.
The sample programs require an Essbase server with the Demo Basic sample application loaded. You must also create the user “system” on theEssbase server.
If you plan to use several Essbase servers in a cluster with the sample programs, you must perform the following procedure for all servers in the cluster.
To configure one or more instances of Essbase server for use with the sample programs:
On the Essbase server, verify that the sample applications Demo Basic and Sample Basic are installed and that the databases have been loaded with data.
For information about copying Essbase applications, see the Essbase Database Administrator's Guide.
Optional: If you are using more than one server in a cluster, repeat step 1.
After you have configured the required servers, you can compile and run the sample programs.
Two script files are provided for compiling the sample programs:
runsamplesAPS: for use in a three-tier Java API deployment
runsamplesEmbedded: for use in an embedded Java API deployment
Depending on the deployment option you choose, these scripts must be configured to work with your computer environment. Once the scripts are working in your environment, you can use them as templates for creating compile and run scripts for the other sample programs.
To configure the runsamplesAPS and runsamplesEmbedded script files to work in your computer environment, you must verify that the path and other environment variables in the scripts are set correctly.
Note: | The procedure in this section applies to both a three-tier or embedded Java API deployment. |
To configure the script files to work with your computer environment:
In the EPM_ORACLE_HOME/common/EssbaseJavaAPI/11.1.2.0/samples/japi directory, locate the appropriate script.
If you are deploying the Java API in three-tier mode:
runsamplesAPS.cmd on Windows
runsamplesAPS.sh on UNIX
If you are deploying the Java API in embedded mode:
runsamplesEmbedded.cmd on Windows
runsamplesEmbedded.sh on UNIX
Using a text editor, open the script file you chose in step 1.
Verify that the APS_HOME variable is set to the location of your Provider Services installation; for example:
set APS_HOME=C:Oracle\Middleware\EPMSystem11R1\common\EssbaseJavaAPI\11.1.2.0\
Verify that the JAVA_HOME variable points to a supported version of the Java Runtime Environment.
If you did not install the Java Runtime Environment with Provider Services, you must update this variable with a full path to the Java installation; for example,
set JAVA_HOME="C:\Oracle\Middleware\jdk160_11" or C:\Oracle\Middleware\EPMSystem11R1\common\JRE\Sun\1.6.0
Replace the variable values for SAMPLE_PROG, USER, PASSWORD, OLAP_SERVER, and PROVIDER_URL as necessary.
These variables are set at the beginning of the script file.
Tip: | To make running the example programs easier, set up Oracle Essbase Provider Services and Oracle Essbase on your local computer. Then, in Oracle Essbase Administration Services, create a user “system” with a password of “password” and full access to the Sample Basic, Demo Basic, and Demo2 Basic databases. If you set up your computer system in this configuration, you do not need to modify the default settings for the sample client programs. |
The scripts, runsamplesAPS or runsamplesEmbedded, compile all the sample programs but runs only one of them. To run the other sample programs, you must create your own scripts or modify the runsamplesAPS or runsamplesEmbedded script.
You can use the either of the runsamples scripts as a template for new scripts.
The following procedure shows you how to create a version of the runsamplesAPS script to run a different sample program.
To create a version of the runsamples script to run another sample program:
In the EPM_ORACLE_HOME\common\EssbaseJavaAPI\11.1.2.0\samples\japi directory, locate the runsamples script (.cmd on Windows systems, .sh on UNIX systems).
In the script file, find the line that begins with echo Step-2 and replace %SAMPLE_PROG% with the name of a sample program (listed in The Sample Programs) :
echo Step-2: Ready to run "%SAMPLE_PROG%" example ... pause "%JAVA_HOME%\bin\java" com.essbase.samples.japi.%SAMPLE_PROG% %USER% %PASSWORD% %OLAP_SERVER% %PROVIDER_URL%
To use the script to run another sample program, substitute the name of the sample program class for MetaData, as shown in the preceding sample.
Save the script file in the EPM_ORACLE_HOME\common\EssbaseJavaAPI\11.1.2.0\samples\japi directory.
Save the file with a .cmd extension on Windows or a .sh extension on UNIX.
Optional: Repeat this procedure to create a separate script for each sample program that you want to run.