Introducing the BIRT Gazetteer example application
This example illustrates how to integrate BIRT iHub resources into a native mobile application using iOS Objective-C. Two BIRT APIs—the REST API and the JavaScript API (JSAPI)—retrieve data and visualizations from a demonstration BIRT iHub 3.1 server. The iHub server resources used by this example are included with the source code.
This example application demonstrates the following functionality:
*User authentication to a user account residing on a BIRT iHub server
*Requesting and setting values of parameters in BIRT reports
*Building the following interactive content:
*Hierarchical list of parameter values
*Global map containing location data and links to additional reports
*Extracting data for display as text
*Extracting data for display in third‑party visualizations
*Sending values to an Objective-C UIWebView
*Displaying a report item from a BIRT design file in an Objective-C UIWebView
*Displaying a full BIRT report in an Objective-C UIWebView
*Display the appropriate report design for current device orientation
After using REST API to extract location names from a BIRT file, this application builds touch‑enabled navigation links. When a user selects a link, Objective-C code passes the information to the embedded web view for display using JSAPI. The appropriate BIRT content is displayed for the current device orientation, portrait or landscape.
Figure 1‑1 shows the application’s list interface.
Figure 1‑1 User interface displaying a list, chart, and link to BIRT reports
An application can extract data from iHub using the REST API and send the values to third‑party data visualizations, such as a chart or map. BIRT visualizations, such as a chart, table or a full page BIRT report display in interactive web views using JSAPI.
This example enables the JavaScript visualization to act as a tool to select a BIRT report for display. As a result, both the reports and third-party JavaScript visualizations use the same web view. When a full page BIRT report is displayed, the other JavaScript content is hidden using CSS.
Figure 1‑2 contains the following HTML DIV elements:
*Mapdiv, which displays the JavaScript map
*Sidebar, which displays a BIRT bookmark
*Report, which displays a selected BIRT report
Figure 1‑2 Map and BIRT bookmark in web view
This web view also contains an image button that runs the loadReport JavaScript function. This function displays a report in the report DIV and hides the container div element that contains the JavaScript map and BIRT bookmark.