About
Delivers give the possibilities to pass the content of an answer using its advanced option (custom script/program) to a program written in :
- or Javascript
The Oracle BI Publisher Java API can then be use with all this functionnality.
For instance, you can push the content to a file server (FTP, WebDav, …)
Articles Related
With Java and the BIP API
SchedulerJavaExtension Interface
Note the following class of the SchedulerJavaExtension interface:
package com.siebel.analytics.scheduler.javahostrpccalls;
public interface SchedulerJavaExtension {
public void run(SchedulerJobInfo jobInfo) throws SchedulerJobException;
public void cancel();
}
This interface has two methods: run and cancel. You can implement the interface and plug the compiled class file into the Java Host instance as part of iBot execution. The following table describes the methods:
Method | Description |
---|---|
run | This method is invoked by the Java Host. It takes one SchedulerJobInfo object (described below), which contains instance related properties like user ID, Job ID, and Instance ID and parameters. In addition, the method is declared to throw SchedulerJobException, which is also described below. |
cancel | This method is invoked if the Job instance is still running while Scheduler wants to cancel it. User can imbed the resources that clean up the routine. |
With BIP API
You can find an lot of java example on how to use the Oracle BI Publisher Java API at the bottom of this page
Configuration / Enable custom java actions
Open the Config.xml file under {OracleBI}\web\javahost\config in a text editor. Search for the Scheduler tag and change it as shown below.
<Scheduler>
<Enabled>True</Enabled>
<DefaultUserJarFilePath>D:\Oracle\OracleBI\web\javahost\lib</DefaultUserJarFilePath>
</Scheduler>
+++ ThreadID: 6ec : 2009-05-28 05:47:47.265 Scheduler jobs for ibot custom java actions disabled in javahost config file.
Librairie schedulerrpccalls.jar
In this file, you have also all the class path for the applications.
Example Java Script
This example write an excel file from Delivers in the temp directory of OBIEE.
Don't forget to use the manifest file (see the next section) where you will find all the library path that you need
/**
*
*/
package sawsched;
/**
* @author Nicolas
*
*/
import java.io.FileInputStream;
import oracle.apps.xdo.delivery.DeliveryManager;
import oracle.apps.xdo.delivery.DeliveryRequest;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaExtension;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobException;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobInfo;
import oracle.apps.xdo.delivery.local.LocalPropertyDefinitions;
public class ObieePublication implements SchedulerJavaExtension{
public ObieePublication() {
}
public void run(SchedulerJobInfo jobInfo) throws SchedulerJobException {
try
{
String env = "SATEMPDIR";
String obiee_backupdir = System.getenv(env);
if (obiee_backupdir != null) {
System.out.format("%s=%s%n", env, obiee_backupdir);
} else {
System.out.format("%s is not assigned.%n", env);
}
String OutputFileName;
OutputFileName = obiee_backupdir + "\\DeliverIbotFile_Job" + jobInfo.jobID() + jobInfo.instanceID() + ".xls";
FileInputStream fis = new FileInputStream(jobInfo.getResultSetFile());
DeliveryManager dm = new DeliveryManager();
DeliveryRequest req = dm.createRequest(DeliveryManager.TYPE_LOCAL);
req.addProperty(LocalPropertyDefinitions.LOCAL_DESTINATION, OutputFileName);
req.setDocument(fis);
req.submit();
req.close();
}
catch(Exception ex)
{
throw new SchedulerJobException(1, 1, ex.getMessage());
}
}
public void cancel() {
}
}
Manifest Files
Manifest-Version: 1.0
Class-Path: sawrpccalls/sawrpccalls.jar sawrpccalls/xmlp5.6.1/aolj.jar sawrpccalls/xmlp5.6.1/xdo.jar sawrpccalls/xmlp5.6.1/xmlparserv2.jar sawrpccalls/xmlp5.6.1/bicmn.jar sawrpccalls/xmlp5.6.1/bipres.jar sawrpccalls/xmlp5.6.1/i18nAPI_v3.jar sawrpccalls/xmlp5.6.1/jewt4.jar sawrpccalls/xmlp5.6.1/xdoparser.zip
With JavaScript For IbotChaining
For all scripts from chained iBots, the full path name to the temporary file is specified in Parameter(0).
/////////////////////////////////////////////////////////////
//
// createResultFile.js
//
// Copies the results in the temporary file to a new file name
//
// Parameter(0) = iBot Result File Path
// Parameter(1) = Last Part of Output File Name (no path)
//
/////////////////////////////////////////////////////////////
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var fileName = GetConfigurationValue("Log Dir", "iBots") +
"\\" + JobID + "-" + InstanceID + "-" + UserID + "-" +
Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
See the Oracle® Business Intelligence Scheduler Guide - page 52
Support
Log
on Ibot | OracleBI_Home\server\Log\iBots | See configuration tab of the scheduler to modify it |
on javahost | OracleBIData_Home\web\log\javahost |
Weblogic - File permission
The weblogic process change the file permission with the uname command in the admin script:
- FMW_HOME\user_projects/domains/bifoundation_domain/bin/startWebLogic.sh
umask 037