Inside the API - Using Business Analyst API in UI Controls and Widgets

Since version 2.2, the support for UI controls and widgets has been added to the Business Analyst Online and Business Analyst Server API for Flex libraries. These two libraries are now merged into one Business Analyst API library (balib.swc) to allow developers to leverage both Business Analyst Online and Business Analyst Server web services in one application. These UI controls and widgets can be downloaded separately.

Business Analyst API library now provides core support for UI controls and widgets with new packages introduced in version 2.2:

The purpose of task adapters is to adapt interfaces of Business Analyst Online and Business Analyst Server tasks so that UI controls and widgets can work with both Business Analyst Online and Business Analyst Server APIs. For example, com.esri.bacore.adapters.BaseThematicQueryTaskAdapter class provides an abstract adapter of the thematic query task used in the Smart Map Search control. When an application is configured, a specific ThematicQueryTaskAdapter class from com.esri.bao.adapters or com.esri.baserver.adapters packages could be used with this control.

Every adapter implements the IConfigurableTaskAdapter interface specifying the adapter configuration method

configure(client:AbstractClient, settings:TaskAdapterConfiguration = null):void;

Here client is an instance of the BAOnlineClient or BAServerClient class and the optional settings parameter pass additional task-specific properties, namely, requestTimeout, activeDatasetID and disableClientCaching. The adapter is ready for use after applying this method with an appropriate instance of the client.

The new com.esri.bacore.client.ITokenService interface provides the authorization to a token-secured web service. Its login method asynchronously executes the authorization and creates a token provider if authorization was successful. The updateTokenProvider method just creates a token provider without immediate authorization.

These two methods can be used in different situations. When application requires authorization before start, use the login method to be sure that user credentials are correct. In other cases, use the updateTokenProvider method. In both cases, a new token provider will be associated with the token service, and then you can configure your instance of AbstractClient with this token provider.

Two implementations of ITokenService are available in version 2.2: