Considering which Actuate API to use
Actuate provides software development tools as a collection of APIs that support designing new Actuate applications or extending or customizing existing applications. Each API offers the developer different methods to access and control data, visualizations and iHub server functionality. The API that you use depends on what you need to do.
Actuate APIs libraries extend functionality in applications that provide API integration points. Actuate provides:
*Representational state transfer API (REST API). The REST API accesses and manages data and files built with Actuate BIRT technology. Use this API to manage and generate new documents, and to request data in the JSON format.
*JavaScript API (JSAPI). The JSAPI provides libraries for web and client-side visualizations using the JavaScript programming language. Use this API to render BIRT content in a web page.
About the representational state transfer API
The Actuate REST API is an HTTP service that runs on a Node.js platform. This service interacts with BIRT content and files on an iHub server using URI requests such as:
http://<web server>:5000/ihub/v1/login
This API is installed with iHub and responds to RESTful web requests that uses HTTP methods such as GET, PUT, and DELETE. The REST API is a strategy for developing web and mobile components that are platform and language independent, require very little time to implement, and that use minimal client and server resources.
RESTful requests use a specific command set to access REST API resources, which simplifies implementations by providing access to essential functions and raw data. Actuate offers many APIs that provide broader functionality but they are implemented using specific tools or access resources in a wide array of formats and interfaces. The REST API provides maximum freedom for developers to create their own implementations.
The REST API employs uniform resource identifiers (URIs) references to convey user requests to the iHub system. URIs access iHub functionality, including generating and storing reports, browsing volume contents, extracting data from files and data sources, and managing users and credentials.
Mobile applications request RESTful content by sending URI requests to the REST service. The REST server module interprets REST requests and forwards them as SOAP requests to iHub. For example, iOS applications can use NSURLConnection object to request RESTful content, Android applications can use the ApacheHTTPClient for Java, and JavaScript can use XMLHttpRequest or the jQuery AJAX library.
To view interactive visualizations such as filtering, drill down, and dashboards, use the Actuate JSAPI. For more information about using the REST API, see Integrating Applications into BIRT iHub.
About the JavaScript API
The Actuate JavaScript API enables the creation of custom web pages that display Actuate BIRT report elements. The Actuate JSAPI handles connections, security, and interactive content. The Actuate JSAPI classes embed BIRT reports or BIRT report elements into web pages, handle scripted events within BIRT content, package report data for use in web applications, and operate BIRT Interactive Viewer and Crosstabs.
The Actuate JavaScript API uses the Prototype JavaScript Framework. The following URI to an iHub server contains the Actuate JavaScript API library:
http://<web server>:8700/iportal/jsapi
The base class in the Actuate JavaScript API is actuate. The Actuate class is the entry point for all of the Actuate JavaScript API classes and establishes connections to the Actuate web application services. The Actuate JavaScript API uses HTTP requests to retrieve reports and report data from an Actuate web service. The subclasses provide functionality that determines the usage of the reports and report data.
Many functions in the Actuate JavaScript API use a callback function. A callback function is a custom function written into the web page that is called immediately after the function that calls it is finished. A callback function does not execute before the required data or connection has been retrieved from the server.
Mobile applications integrate BIRT visualizations using JSAPI in a web view. A web view is a class or object that displays an HTML content such as a web page within a native application. The iHub server receives the JSAPI requests and sends HTML content for display in a selected HTML DIV element. For example, iOS applications can use UIWebView object to display JSAPI, Android applications can use the WebView class and JSAPI can display in HTML files using most web browsers.
For more information about using the JSAPI, see Integrating Applications into BIRT iHub.