Exocortex

January 27, 2009

About resources and proxies to ArcObjects

Filed under: ESRI, GIS — Tags: , , — Soumya @ 12:49 pm
The com.esri.adf.web.data.GISResource interface provides access to a proxy preconfigured with the connection details of a service on the SOM. The interface also provides access to the functionalities that are applicable for that resource.

GISResource instances are defined as managed beans in the faces-config.xml. The resources are then tied up with the WebContext of the application.

One example of a GISResource implementation is the AGSMapResource.This resource provides a proxy called MapServerPort that proxies the mapping service on the SOM. Behind the scenes the service on the SOM interacts with the MapServer ArcObject on the SOC. Hence, using the MapServerPort one can send specific commands to the ArcObjects back-end (through the service on the SOM), commands that are applicable to a map. Some examples are querying map data, manipulation of map image etc.

Another example of a GISResource implementation is the AGSGeocodeResource. This resource provides a proxy called GeocodeServerPort that proxies the GeocodeServer ArcObject on the SOC.

Example of a GISResource instance declared as a managed bean:
<managed-bean> <managed-bean-name>agsws0</managed-bean-name> <managed-bean-class> com.esri.adf.web.ags.data.AGSMapResource </managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>endPointURL</property-name> <value> http:/ip:port/arcgis/services/serviceGroup/serviceName/MapServer </value> </managed-property> <managed-property> <property-name>user</property-name> <value>#{agswsUser1}</value> </managed-property> <managed-property> <property-name>alias</property-name> <value>Some Alias</value> </managed-property> <managed-property> <property-name>functionalities</property-name> <map-entries> <map-entry> <key>map</key> <value>#{agsMap}</value> </map-entry> <map-entry> <key>tile</key> <value>#{agsTile}</value> </map-entry> <map-entry> <key>toc</key> <value>#{agsToc}</value> </map-entry> <map-entry> <key>query</key> <value>#{agsQuery}</value> </map-entry> </map-entries> </managed-property> </managed-bean>
(Anything above in #{} are defined elsewhere and is not shown here.)
Example of the above map resource being tied up to the WebContext:

<managed-bean>
<managed-bean-name>mapContext</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.data.WebContext
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>webSession</property-name>
<value>#{esriWebSession}</value>
</managed-property>
<managed-property>
<property-name>attributes</property-name>
<map-entries>
<map-entry>
<key>map</key>
<value>#{map}</value>
</map-entry>
<map-entry>
<key>overview</key>
<value>#{overview}</value>
</map-entry>
<map-entry>
<key>toc</key>
<value>#{toc}</value>
</map-entry>
<map-entry>
<key>graphics</key>
<value>#{graphics}</value>
</map-entry>
<map-entry>
<key>query</key>
<value>#{query}</value>
</map-entry>
<map-entry>
<key>history</key>
<value>#{extentHistory}</value>
</map-entry>
<map-entry>
<key>geocode</key>
<value>#{geocode}</value>
</map-entry>
<map-entry>
<key>results</key>
<value>#{results}</value>
</map-entry>
<map-entry>
<key>scaleBar</key>
<value>#{scaleBar}</value>
</map-entry>
</map-entries>
</managed-property>
<managed-property>
<property-name>resources</property-name>
<map-entries>
<map-entry>
<key>agsws0</key>
<value>#{agsws0}</value>
</map-entry>
</map-entries>
</managed-property>
</managed-bean>

(Again, anything above in #{} are defined elsewhere and is not shown here.)

Example Java code that retrieves the resource:
WebContext webContext = webMap.getWebContext();

Map resources = webContext.getResources();
AGSMapResource agsMapResource = (AGSMapResource) resources.get(”agswso”);
Example Java code that sends a query to the back-end ArcObject:
URL url = agsMapResource.getEndPointURL();
MapServerBindingStub mapserver = new MapServerBindingStub(new URL(url), null);
MapServerInfo mapinfo = mapserver.getServerInfo(mapserver.getDefaultMapName());
MapDescription mapdesc = mapinfo.getDefaultMapDescription();
RecordSet recordSet = mapserver.queryFeatureData(mapdesc.getName(), layerId, query);
In the above the layerId variable is an int that specifies which specific layer needs to be queried and query is an instance of a QueryFilter that specifies the details of the query that is to be run.

January 23, 2009

General description of ESRI’s Java Web ADF

Filed under: ESRI, GIS — Tags: , — Soumya @ 10:06 pm

The Java Web ADF, part of the ArcGIS Server ADF, is a library of objects that assist in the development of GIS web applications. The library consists of a bunch of objects which are organized in a MVC framework. The web controls define standard interactions with maps and also provide hook ups to backend ArcObjects. ESRI decided to build the Web ADF based on JSF and hence a knowledge of JSF is necessary for developing applications using the Java Web ADF. The Java Web ADF is made up primarily of 3 groups of objects:

  • View: Objects in this layer consist of preprogrammed visual controls. These are JSF components that can be plugged into a JSP using JSF tags. The backing beans behind these controls serve as controllers too.
  • Model 1: Objects in this layer are beans that provide the data layer for the objects in the view layer. The data objects provide support for the data on the web. These objects also act as a business logic layer for certain standard GIS functionality. Such functionality is provided by interacting with the server (ArcGIS server) objects.
  • Model 2: Objects in this layer complement the objects in the Model 1 layer by providing purely GIS data and functionality. The objects in this layer are provided with intelligence of how to pull data from appropriate resources.

The view objects deal with presentation and user interaction. To deal with user interactions, the Java Web ADF contains the following categories of objects:

  • Commands: These require a 1-step interaction from users. On the web page, once the user clicks on a button or some other control something happens on the server side. The server acts on information available at the time of the clicking. Examples can be “Zoom to full extent”, “Information at current point” etc. Implementation-wise, such constructs are implemented as JSF actions or action listeners depending on whether the interaction results in a navigation change or not.
  • Tools: These require at least a 2-step interaction from users. This means that the interaction is initiated by the user clicking a control and then continues the interaction by performing some more actions. An example can be “Zoom to rectangle” which is initiated by the user clicking on a Zoom In or Zoom Out button and then continuing by setting a rectangle. After the user interaction is completed a request is sent back to the server side where a server side component handles the request.
  • Tasks: While commands and tools handle the more traditional and more visual of the map controls, tasks (and the associated task framework) are supposed to handle the more non-traditional interactions with geospatial data. The result of running these tasks are generally result sets but these results can impact the visual aspects also. Examples can be customized queries that result in the highlighting of features (from the result) in the map.

General description of ESRI’s ArcGIS Server

Filed under: ESRI, GIS — Tags: , , — Soumya @ 10:03 pm

Briefly, ArcGIS Server is a collection of server-side components (ArcObjects) providing GIS functionality and a mechanism to interact with these ArcObjects. ArcGIS Server is organized in a system of servers.

The system of servers hosting the ArcObjects consist of a Server Object Manager (SOM) and one or more Server Object Containers (SOC). The SOCs contain the actual ArcObjects and perform the computations while the SOM acts as a gateway to the SOCs and performs most of the component management tasks. A client application interacts only with the SOM. In most cases, therefore, the SOM and ArcObjects can be used interchangeably.

ESRI provides APIs, called ArcGIS Server ADF, written in various languages that allows developers to interact with the SOM. These APIs contain web controls and proxies to the back-end ArcObjects. The proxies abstract out all the communication between the client application (the developers write) and the SOM. In the 9.2 version of the software, the communication between the client application and the SOM is through SOAP over HTTP.

Important URLs:
http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/manager/administration/how_gis_svr_works.htm

http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ArcGIS/SOAP/overview.htm

Motivations for writing about ArcGIS Server software

Filed under: ESRI, GIS — Soumya @ 9:49 pm

I am currently working with ESRI’s ArcGIS Server 9.2/9.3 (Java edition). This software is fairly new to me and so I decided to collect bits and pieces of information about the software itself and how to program with it. As other people working with this software will verify, documentation on this software is, in short, “lacking”. I am not trying to override the official documentation that ESRI provides, I am merely trying to organize my thoughts about this software. This might come in handy for my current team members, other people working with this software or even to myself a few years down the road!

Specifically, I am trying to target the following topics for now:

  1. General architecture of the ArcGIS Server (primarily 9.2, currently evaluating the new REST style architecture of 9.3 so that might be covered also).
  2. Java Web ADF (9.2).
  3. Flex API (9.3).
  4. JavaScript API (this is optional for me right now).

Code samples may or may not be present. I will try to provide some.

Comments are welcome. I understand that I am fairly new to this and so I may not be “getting it correct” all the time. Part of the reason for writing this blog is to make sure that my understanding is consistent with others experienced with this software.

Powered by WordPress