com.esri.adf.web.data
Interface GISFunctionality

All Known Subinterfaces:
ExportFunctionality, ExportFunctionality2, GeocodeFunctionality, MapFunctionality, MapFunctionality2, OverviewFunctionality, ScaleBarFunctionality, TileFunctionality, TocFunctionality
All Known Implementing Classes:
AGSGeocodeFunctionality, AGSGPFunctionality, AGSImageMapFunctionality, AGSImageOverviewFunctionality, AGSImageQueryFunctionality, AGSImageTocFunctionality, AGSMapFunctionality, AGSNAFunctionality, AGSOverviewFunctionality, AGSQueryFunctionality, AGSScaleBarFunctionality, AGSTileFunctionality, AGSTocFunctionality, AIMSGeocodeFunctionality, AIMSMapFunctionality, AIMSOverviewFunctionality, AIMSQueryFunctionality, AIMSTocFunctionality, GraphicsMapFunctionality, GraphicsOverviewFunctionality, GraphicsQueryFunctionality, GraphicsTocFunctionality, QueryFunctionality, VEGeocodeFunctionality, VEImageryFunctionality, VEOverviewFunctionality, VETileFunctionality, VETocFunctionality, WMSMapFunctionality, WMSOverviewFunctionality, WMSQueryFunctionality, WMSTocFunctionality

public interface GISFunctionality

The GISFunctionality interface must be implemented by all functionalities of GISResources. It declares basic methods to initialize and cleanup functionalities and another method to return a reference to the resource that it provides functions for.

It is a common practice to declare sub-interfaces which extend GISFunctionality to declare methods specific to a certain GIS task. For example, the MapFunctionality extends GISFunctionality and declares methods required to do basic mapping. Then resources that support basic mapping provide a class (for example AGSMapFunctionality, AIMSMapFunctionality, etc.) which implements MapFunctionality to do mapping.

Once resources have provided classes that implement the various functionalities that the resource supports, users can then select from this laundry list of functionalities to use for a given instance of the resource. Users can add the functionalities to use with a resource instance programmatically as such:

 WebContext ctx = ...;
 AGSMapResource ags1 = new AGSMapResource();
 ags1.setEndPointURL("http://myserver/mywebservice");
 <b>ags1.addFunctionality("map", new AGSMapFunctionality());</b>
 ctx.addResource("ags1", ags1, 0);
 

They can also add functionalities declaratively using JSF managed bean configuration files:

 <managed-bean>
   <managed-bean-name>agsMap</managed-bean-name>
   <managed-bean-class>com.esri.adf.web.ags.data.AGSMapFunctionality</managed-bean-class>
   <managed-bean-scope>none</managed-bean-scope>
 </managed-bean>
  
 <managed-bean>
   <managed-bean-name>ags1</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>functionalities</property-name>
     ...
     <map-entries>
       <map-entry>
         <key>map</key>
         <value>#{agsMap}</value>
       </map-entry>
     </map-entries>
   </managed-property>
 </managed-bean>
  
 <managed-bean>
   <managed-bean-name>myContext</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>resources</property-name>
     ...
     <map-entries>
       <map-entry>
         <key>ags1</key>
         <value>#{ags1}</value>
       </map-entry>
       ...
     </map-entries>
   </managed-property>
 </managed-bean>
 


Method Summary
 void destroyFunctionality()
           The cleanup chores (such as releasing held resources) for the functionality must be performed in this method.
 GISResource getResource()
           Returns the GISResource associated with this functionality.
 void initFunctionality(GISResource resource)
           The initialization chores for the functionality must be performed in this method.
 

Method Detail

initFunctionality

void initFunctionality(GISResource resource)

The initialization chores for the functionality must be performed in this method. This method is called by the resource when the functionality needs to be initialized. This happens either when the resource itself is being initialized or if users add this functionality to the resource using the GISResource.addFunctionality(String, GISFunctionality) method after the resource has already been initialized.

Classes which implement this method should maintain the resource as a class instance variable and return the same in the getResource() method. The functionality is ready for use only after this method has been called.

Parameters:
resource - the GISResource that this functionality supports
See Also:
GISResource.init(WebContext)

destroyFunctionality

void destroyFunctionality()

The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. This method is called by the GISResource when the resource itself is being destroyed.

The functionality is no longer usable after this method has been called.

See Also:
GISResource.destroy()

getResource

GISResource getResource()

Returns the GISResource associated with this functionality.

The resource passed to initFunctionality(GISResource) is maintained as a class variable and is accessible through this method.

Returns:
the GISResource associated with this functionality