Creating a multisource Web ADF application


The Simple ArcGIS Server Web ADF Java platform application and Simple ArcIMS Web ADF Java platform application sample applications show how to create an application that uses one data source (either an ArcGIS Server or an ArcIMS resource). You can extend these applications to consume multiple resources. While this topic uses ArcGIS Server and an ArcIMS server in the sample applications, you can use other data sources by changing the appropriate resource and functionality declaration in faces-config.xml by replacing one of the resources with a resource available to you. For example, if you have an ArcGIS server, you can expose another server object as a Web service and use that as another resource. You can also point to one of the Web Map Servers (WMSs) on the Geography Network.
To extend your original application to consume multiple data sources, the following tasks are required:
  • Add a new managed bean for the resource you want to consume.
  • Expose the functionalities you want to use with the resource in your application.
  • Add the name of the resource to the list of resources associated with the context.
Because the Web ADF is built to handle multiples resources, when you plug in additional resources and expose the appropriate functionality, the Web ADF uses them correctly.
To create a multisource application, go to your ArcGIS installation /java/web/web_map_application and use arcgisant to build a map viewing application. When you create the application, a new directory will be created called build that will contain a Java Web application and the same application in a Web ARchive (WAR) file. When you examine the contents of faces-config.xml in the application, you'll notice the multiple resources entries. All that is required to make a multisource Web application is to associate the multiple resources with the context, add the appropriate functionalities, and add any other auxiliary classes you may need, such as users and connection properties.
The following are some tips to consider when working with multiple resources.
  • In multisource applications, the map sets its extent from the first resource declared for the context. Therefore, if you have one resource, such as an ArcGIS Server map that focuses on a small area, and you are using it with a global dataset, such as ArcGIS Online Services, then you should list your ArcGIS Server resource first.
  • You do not have to expose all the functionality that a resource supports. For example, if you have an application with both an ArcIMS and an ArcGIS Server resource in it, you can declare only the AIMSMapFunctionality for the ArcIMS resource. Without an AGSMapfunctionality declaration, the ArcGIS Server map image will not draw on the map. Instead, you can include the AGSNAFunctionality to provide network analysis functions. You can write code to render these results using WebGraphics.
  • To fuse images from multiple sources, the ADF uses the Java Advanced Imaging (JAI) API version 1.1. By default, this uses a Java implementation for the fusing; however, Sun Microsystems provides native binaries that can increase the performance of imaging operations on Linux, Solaris, and Windows operating systems.


See Also:

Configuring Web controls
Writing a JSP page
How to add a command or tool