com.esri.adf.web.aims.data
Class AIMSMapFunctionality

java.lang.Object
  extended by com.esri.adf.web.aims.data.AIMSMapFunctionality
All Implemented Interfaces:
ExportFunctionality, ExportFunctionality2, GISFunctionality, MapFunctionality, MapFunctionality2, Serializable

public class AIMSMapFunctionality
extends Object
implements MapFunctionality2, ExportFunctionality2, Serializable

The AIMSMapFunctionality maintains the reference to the Map object.

When initFunctionality(com.esri.adf.web.data.GISResource) method is called, the GET_SERVICE_INFO request is sent to the ArcIMS Server.

Calling exportImage(), the GET_IMAGE AXL request is sent to the ArcIMS Server.

ArcIMS Map Functionality can be added using JSF managed bean configuration as shown below,

 <managed-bean>
  <managed-bean-name>aimsMap</managed-bean-name>
  <managed-bean-class>com.esri.adf.web.aims.data.AIMSMapFunctionality</managed-bean-class>
   <managed-bean-scope>none</managed-bean-scope>
  <managed-property>
    <property-name>loadRecordSet</property-name>
    <value>true</value>
  </managed-property>
  <managed-property>
    <property-name>loadExtensions</property-name>
    <value>true</value>
  </managed-property>
 </managed-bean>
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.adf.web.data.MapFunctionality
FUNCTIONALITY_NAME
 
Fields inherited from interface com.esri.adf.web.data.export.ExportFunctionality
EXPORT_FUNCTIONALITY_NAME
 
Constructor Summary
AIMSMapFunctionality()
           
 
Method Summary
 void destroyFunctionality()
           The cleanup chores (such as releasing held resources) for the functionality must be performed in this method.
 InputStream export(ExportProperties exportProperties)
           
 InputStream exportImage()
           Exports this map for the current extent.
 ExportImage exportMapImage()
          Returns a map image based on the current state (height, width, map extent, dpi, etc) of the WebMap.
 ExportImage exportMapImage(ExportProperties exportProperties)
          Returns a map image based parameters (height, width, map extent, dpi, etc) specified in the exportProperties argument.
 WebExtent getCurrentExtent()
           Returns the current extent of this map.
 WebExtent getCurrentExtentInContextSR()
           Returns the current extent in the Web Context's spatial reference.
 String getDefaultDataFrame()
          Returns the default dataframe name.
 int getDPI()
          Returns the DPI from the map functionality.
 WebExtent getFullExtent()
           Returns the full extent of this map.
 WebExtent getInitialExtent()
           Returns the initial extent of this map.
 com.esri.aims.mtier.model.map.layer.Layer getLayer(String layerId)
          Returns Layer object based on the specified layerId.
 com.esri.aims.mtier.model.map.Map getMap()
          Returns the Map object.
 double getMapScale()
           Returns the current scale of this map.
 AIMSMapResource getResource()
           Returns the GISResource associated with this functionality.
 double getTransparency()
           Returns the transparency factor for this map functionality.
 void initFunctionality(GISResource resource)
           The initialization chores for the functionality must be performed in this method.
 boolean isDisabled()
           Returns true if this map functionality is disabled.
 boolean isLoadEnvelope()
          Returns true, if envelope information is available for all layers.
 boolean isLoadExtensions()
          Returns true, if extensions information is available for all layers.
 boolean isLoadFields()
          Returns true, if fields information is available for all layers.
 boolean isLoadRenderer()
          Returns true, if renderer information is available for all layers.
 void setCurrentExtent(WebExtent newMapExtent)
           Sets the current extent of this map.
 void setDefaultDataFrame(String defaultDataFrame)
          Sets the default data frame in which the map functionality should work with.
 void setDisabled(boolean disabled)
           If true, this map functionality is disabled.
 void setDPI(int dpi)
          Sets the DPI(dots per square inch) for the output image.
 void setLoadEnvelope(boolean loadEnvelope)
          If true, loads the envelope information for all layers.
 void setLoadExtensions(boolean loadExtensions)
          If true, loads the extensions information for all layers.
 void setLoadFields(boolean loadFields)
          If true, loads the fields information for all layers.
 void setLoadRenderer(boolean loadRenderer)
          If true, loads the renderer information for all layers.
 void setTransparency(double transparency)
           Sets the transparency factor for this map functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AIMSMapFunctionality

public AIMSMapFunctionality()
Method Detail

initFunctionality

public void initFunctionality(GISResource resource)
Description copied from interface: GISFunctionality

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 GISFunctionality.getResource() method. The functionality is ready for use only after this method has been called.

Specified by:
initFunctionality in interface GISFunctionality
Parameters:
resource - the GISResource that this functionality supports
See Also:
GISResource.init(WebContext)

destroyFunctionality

public void destroyFunctionality()
Description copied from interface: GISFunctionality

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.

Specified by:
destroyFunctionality in interface GISFunctionality
See Also:
GISResource.destroy()

getCurrentExtent

public WebExtent getCurrentExtent()
Description copied from interface: MapFunctionality

Returns the current extent of this map.

Specified by:
getCurrentExtent in interface MapFunctionality
Returns:
the current WebExtent of this map

getCurrentExtentInContextSR

public WebExtent getCurrentExtentInContextSR()
Description copied from interface: MapFunctionality2

Returns the current extent in the Web Context's spatial reference.

Specified by:
getCurrentExtentInContextSR in interface MapFunctionality2
Returns:
the current WebExtent of this map
See Also:
WebContext.getSpatialReference()

setCurrentExtent

public void setCurrentExtent(WebExtent newMapExtent)
Description copied from interface: MapFunctionality

Sets the current extent of this map.

Specified by:
setCurrentExtent in interface MapFunctionality
Parameters:
newMapExtent - the current WebExtent of this map

isDisabled

public boolean isDisabled()
Description copied from interface: MapFunctionality

Returns true if this map functionality is disabled. If a map functionality is disabled, the WebMap will not call the MapFunctionality.exportImage() on that functionality while it is disabled.

A map functionality is typically disabled by unchecking the resource node in the Table of Contents control.

Specified by:
isDisabled in interface MapFunctionality
Returns:
true if this map functionality is disabled

setDisabled

public void setDisabled(boolean disabled)
Description copied from interface: MapFunctionality

If true, this map functionality is disabled. If a map functionality is disabled, the WebMap will not call the MapFunctionality.exportImage() on that functionality while it is disabled.

A map functionality is typically disabled by unchecking the resource node in the Table of Contents control.

Specified by:
setDisabled in interface MapFunctionality
Parameters:
disabled - true if this map functionality is disabled

getTransparency

public double getTransparency()
Description copied from interface: MapFunctionality

Returns the transparency factor for this map functionality. Valid values are from 0.0 through 1.0. A value of 1 means it is completely opaque while a value of 0 means it is completely transparent.

The WebMap uses this value after the map image has been exported and applies the transparency appropriately. Note that transparency will not be applied for the lower most service. In a single service application that service is the lower most service and hence transparency will not be applied for it.

Specified by:
getTransparency in interface MapFunctionality
Returns:
the transparency factor for this map functionality

setTransparency

public void setTransparency(double transparency)
Description copied from interface: MapFunctionality

Sets the transparency factor for this map functionality. Valid values are from 0.0 through 1.0. A value of 1 means it is completely opaque while a value of 0 means it is completely transparent.

The WebMap uses this value after the map image has been exported and applies the transparency appropriately. Note that transparency will not be applied for the lower most service. In a single service application that service is the lower most service and hence transparency will not be applied for it.

Specified by:
setTransparency in interface MapFunctionality
Parameters:
transparency - the transparency factor for this map functionality

getFullExtent

public WebExtent getFullExtent()
Description copied from interface: MapFunctionality

Returns the full extent of this map.

Typically, this extent should be determined by the functionality when it is initialized.

Specified by:
getFullExtent in interface MapFunctionality
Returns:
the full WebExtent of this map

getInitialExtent

public WebExtent getInitialExtent()
Description copied from interface: MapFunctionality

Returns the initial extent of this map.

Typically, this extent should be determined by the functionality when it is initialized.

Specified by:
getInitialExtent in interface MapFunctionality
Returns:
the initial WebExtent of this map

getMapScale

public double getMapScale()
Description copied from interface: MapFunctionality

Returns the current scale of this map.

Specified by:
getMapScale in interface MapFunctionality
Returns:
the current scale of this map

exportImage

public InputStream exportImage()
Description copied from interface: MapFunctionality

Exports this map for the current extent. Implementations should ensure the following:

The WebMap calls this method on all its map functionalities and eventually fuses all the exported maps before streaming it to the user.

Specified by:
exportImage in interface MapFunctionality
Returns:
a java.io.InputStream to the exported image

export

public InputStream export(ExportProperties exportProperties)
Specified by:
export in interface ExportFunctionality

exportMapImage

public ExportImage exportMapImage()
Description copied from interface: ExportFunctionality2
Returns a map image based on the current state (height, width, map extent, dpi, etc) of the WebMap.

Specified by:
exportMapImage in interface ExportFunctionality2

exportMapImage

public ExportImage exportMapImage(ExportProperties exportProperties)
Description copied from interface: ExportFunctionality2
Returns a map image based parameters (height, width, map extent, dpi, etc) specified in the exportProperties argument. It does not consider or alter the state of the WebMap.

Specified by:
exportMapImage in interface ExportFunctionality2

getResource

public AIMSMapResource getResource()
Description copied from interface: GISFunctionality

Returns the GISResource associated with this functionality.

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

Specified by:
getResource in interface GISFunctionality
Returns:
the GISResource associated with this functionality

getMap

public com.esri.aims.mtier.model.map.Map getMap()
Returns the Map object.

Returns:
the map object

setDPI

public void setDPI(int dpi)
Sets the DPI(dots per square inch) for the output image.

Parameters:
dpi - the DPI for the output image

getDPI

public int getDPI()
Returns the DPI from the map functionality.

Returns:
the DPI from the map functionality

setLoadEnvelope

public void setLoadEnvelope(boolean loadEnvelope)
If true, loads the envelope information for all layers.

Parameters:
loadEnvelope - if true, loads the envelope information for all layers

isLoadEnvelope

public boolean isLoadEnvelope()
Returns true, if envelope information is available for all layers.

Returns:
true if the envelope information is available

setLoadRenderer

public void setLoadRenderer(boolean loadRenderer)
If true, loads the renderer information for all layers.

Parameters:
loadRenderer - if true, loads the renderer information for all layers

isLoadRenderer

public boolean isLoadRenderer()
Returns true, if renderer information is available for all layers.

Returns:
true if the renderer information is available

setLoadFields

public void setLoadFields(boolean loadFields)
If true, loads the fields information for all layers.

If the associated resource includes the ArcIMS Query functionality, then this property should set to true in order to perform query.

Parameters:
loadFields - if true, loads the fields information for all layers

isLoadFields

public boolean isLoadFields()
Returns true, if fields information is available for all layers.

Returns:
true if the fields information is available

setLoadExtensions

public void setLoadExtensions(boolean loadExtensions)
If true, loads the extensions information for all layers.

If the associated resource includes the ArcIMS Geocode functionality, then this property should set to true in order to perform geocoding.

Parameters:
loadExtensions - if true, loads the extensions information for all layers

isLoadExtensions

public boolean isLoadExtensions()
Returns true, if extensions information is available for all layers.

Returns:
true if the extensions information is available

setDefaultDataFrame

public void setDefaultDataFrame(String defaultDataFrame)
Sets the default data frame in which the map functionality should work with.

This property is valid only if the associated resource service type is ImageServerArcMap.

Parameters:
defaultDataFrame - the default dataframe name

getDefaultDataFrame

public String getDefaultDataFrame()
Returns the default dataframe name.

Returns:
the default dataframe name

getLayer

public com.esri.aims.mtier.model.map.layer.Layer getLayer(String layerId)
Returns Layer object based on the specified layerId.

Parameters:
layerId - the layer id
Returns:
Layer object