« Addition Not Applicable Main | Excel Datasources »

Getting started with BIP APIs

Had a request today asking how to get started with the BIP API layer. I think the use of the APIs is straightforward enough, there are lots of examples to get you started in the developer sections of the user guide. The tough bit is, what libraries and jars need to be in the class path to be able to work with the APIs without annoying compile errors? So heres the list:


  • xdocore.jar  - the core BIP/XMLP library
  • aolj.jar - this is an Oracle EBS library, we need it whether you're developing in EBS or not
  • i18nAPI_v3.jar - this is the i18n library used for localization functions
  • xdoparser.jar  - this is the scalable XML parser and XSLT 2.0 engine
  • xmlparserv2-904.jar  - the main XML parser/XSLT engine - these will come together again in a coming version.
  • bipres.jar - charting library
  • bicmn.jar - charting library
  • jewt.jar - charting support library
  • share.jar - charting support library
  • collections.jar - you only need this if you are working with the delivery APIs or bursting engine.

Now if you're using JDeveloper then the charting and XML Parser libraries will already be available to you. I'd recommend creating a directory with all of the above thou and using them as custom libraries in your project. That way you'll know when it comes to deployment you're not going to get any unexpected surprises at runtime.

Where to get the libraries:
1. EBS - you can point your java project to the JAVA_TOP directory  - not the simplest solution
2. Download the BIP Server and open the EAR file and find the jars
3. Download the Template Builder for Word, install and check the jlib library under the install directory.


So now you know what you need and where to get it.


Need a quick start ... how about applying an RTF template to some XML and generating PDF output ...

package xdotestbed;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import oracle.apps.xdo.XDOException;
import oracle.apps.xdo.template.FOProcessor;
import oracle.apps.xdo.template.RTFProcessor;

public class XDOTest
{
  public XDOTest()
  {
  // Need to use a try-catch block
  try
  {
    // Set the RTF template
    FileInputStream fiS = new FileInputStream("c:\\temp\\check.rtf");
    //Instntiate the RTFProcessor
    RTFProcessor rtfP = new RTFProcessor(fiS);
    // Set the output XSL
    rtfP.setOutput("c:\\temp\\check.xsl");
    // Process
    rtfP.process();
  }
  catch (FileNotFoundException ex)
  {
    ex.printStackTrace();
   }
  catch (IOException ex)
  {
    ex.printStackTrace();
   }
  catch (XDOException ex)
  {
  ex.printStackTrace(); 
   }
  
   //Now process the XSLFO template against the XML data
      // Instantiate the FOprocessor
      FOProcessor processor = new FOProcessor();
      // set XML input file
      processor.setData("c:\\temp\\check_data.xml");
      // set XSL input file
      processor.setTemplate("c:\\temp\\check.xsl");
      // set the output format
      processor.setOutputFormat(FOProcessor.FORMAT_PDF);
      //set output file
      processor.setOutput("c:\\temp\\check.pdf");
    // Now we process, have to surround with a try-catch block thou
    try
    {
      // Process !
      processor.generate();
    }
    catch (XDOException e)
    {
      e.printStackTrace();
    }

  }

   // Heres the main method to run the class.
// You could of course add arguments for the RTF, XML

// and output PDF and avoid hard coding them in the class.
// Sorry, Im being lazeeee ...

public static void main(String[] args) {
        XDOTest xDOTest = new XDOTest();
    }
}



Not too tough right ? With a little effort you can get the whole thing streaming rather than writing to disc, bolt on a call to the Data Template engine to fetch the data, use the FormProcessor to stick multiple outputs together ... the list goes on.

Post a comment