For run time, the BIRT ODA run-time consumer passes its resource location information in the org.eclipse.datatools.connectivity.oda.util.ResourceIdentifiers instance in the appContext map. ODA run-time drivers can get the instance in any one of the setAppContext methods, such as IDriver.setAppContext:
To get the instance from the appContext map, pass the map key ResourceIdentifiers.ODA_APP_CONTEXT_KEY_CONSUMER_RESOURCE_IDS, defined by the class as a method argument.
To get the URI of the associated report design file folder call getDesignResourceBaseURI( ) method. The URI is application-dependent and it can be absolute or relative. If your application maintains relative URLs, call the getDesignResourceURILocator.resolve( ) method to get the absolute URI.The code snippet on Listing 27-7 shows how to access the resource identifiers through the application context.
Listing 27-7 Object obj = this.appContext.get( ResourceIdentifiers.ODA_APP_CONTEXT_KEY_CONSUMER_RESOURCE_IDS );
|
|
Copyright Actuate Corporation 2012 |