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

java.lang.Object
  extended by com.esri.adf.web.data.GISResource
      extended by com.esri.adf.web.aims.data.AIMSMapResource
All Implemented Interfaces:
WebContextInitialize, WebLifecycle, Serializable

public class AIMSMapResource
extends GISResource

This class maintains the ArcIMS Resource information. For example the ArcIMS Server Machine name, Port number, Service name etc. It makes TCP or HTTP connection to the specified ArcIMS Server based on the machine name. If the Machine name start with "http" it makes HTTP connection otherwise TCP. In case of TCP Connection the application port number is required. The user name and the password are required properties if the given service name is authenticated.

Resource can be added using JSF managed bean configuration as shown below,

 <managed-bean>
  <managed-bean-name>aimsResource</managed-bean-name>
  <managed-bean-class>com.esri.adf.web.aims.data.AIMSMapResource</managed-bean-class>
  <managed-bean-scope>none</managed-bean-scope>
  <managed-property>
    <property-name>hostName</property-name>
    <value>http://machinename</value>
  </managed-property>
  <managed-property>
    <property-name>serviceName</property-name>
    <value>ServiceName</value>
  </managed-property>
  <managed-property>
    <property-name>functionalities</property-name>
    <map-entries>
      <map-entry>
        <key>map</key>
        <value>#{aimsMap}</value>
      </map-entry>
      <map-entry>
        <key>overview</key>
        <value>#{aimsOverview}</value>
      </map-entry>
      <map-entry>
        <key>toc</key>
        <value>#{aimsToc}</value>
      </map-entry>
      <map-entry>
        <key>query</key>
        <value>#{aimsQuery}</value>
      </map-entry>
      <map-entry>
        <key>geocode</key>
        <value>#{aimsGeocode}</value>
      </map-entry>
    </map-entries>
  </managed-property>
 lt;/managed-bean>
 
 
 

See Also:
Serialized Form

Field Summary
static String ARCMAP_RESOURCE_TYPE
          The ArcIMS service indicating the type Image Server ArcMap.
protected  com.esri.aims.mtier.io.ConnectionProxy connection
          The ConnectionProxy object associated with this resource.
protected  String hostName
          The machine name or the URL string to connect ArcIMS Server.
static String IMAGE_RESOURCE_TYPE
          The ArcIMS service indicating the type Image Server.
protected  String password
          The password to connect the authenticated service.
protected  boolean passwordEncrypted
          Indicating whether the password is encrpyted or not.
protected  int port
          The Application server port to connect ArcIMS Server.
protected  String resourceType
          The type of ArcIMS Service.
protected  String serviceName
          The ArcIMS Service name.
protected  String userName
          The user name to connect the authenticated service.
 
Fields inherited from class com.esri.adf.web.data.GISResource
alias, context, defaultSpatialReference, functionalities, hasFailedFunctionalities, init
 
Constructor Summary
AIMSMapResource()
           
 
Method Summary
 String getAlias()
           Returns a reader friendly name for this resource.
protected  com.esri.aims.mtier.io.ConnectionProxy getConnectionProxy()
          Returns the ConnectionProxy object associated with this resource.
 String getHostName()
          Returns the Machine name or URL string of the ArcIMS Server.
 String getImageFormat(String format)
          Convenient method to return the ArcIMS Service specific map image format from the available list of the Service supported formats.
 String getPassword()
          Returns the password to connect authenticated service.
 int getPort()
          Returns the ArcIMS Application Server port number associated with this resource.
 String getResourceType()
          Returns the type of service based on the service name set.
 String getServiceName()
          Return the ArcIMS Service that associated with this resource.
 String getUserName()
          Returns the user name to connect authenticated service.
 void init(WebContext webContext)
           This method is called by the WebContext to initialize the resource.
 boolean isPasswordEncrypted()
          Tests whether the given password is encrypted or not.
 void setHostName(String hostName)
          Set the machine name or URL string of the ArcIMS Server.
 void setPassword(String password)
          Sets the password to connect the authenticate service.
 void setPasswordEncrypted(boolean passwordEncrypted)
          Sets to true if the given password is encrpted.
 void setPort(int port)
          Sets the ArcIMS Application Server port number associated with this resource.
 void setServiceName(String serviceName)
          Sets the ArcIMS Service for this resource.
 void setUserName(String userName)
          Sets the user name to connect the authenticate service.
 
Methods inherited from class com.esri.adf.web.data.GISResource
activate, addFunctionality, destroy, getDefaultSpatialReference, getFunctionalities, getFunctionality, getWebContext, passivate, setAlias, setFunctionalities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_RESOURCE_TYPE

public static final String IMAGE_RESOURCE_TYPE
The ArcIMS service indicating the type Image Server.

See Also:
Constant Field Values

ARCMAP_RESOURCE_TYPE

public static final String ARCMAP_RESOURCE_TYPE
The ArcIMS service indicating the type Image Server ArcMap.

See Also:
Constant Field Values

connection

protected com.esri.aims.mtier.io.ConnectionProxy connection
The ConnectionProxy object associated with this resource.


hostName

protected String hostName
The machine name or the URL string to connect ArcIMS Server.


port

protected int port
The Application server port to connect ArcIMS Server. By default the port number is 5300.


serviceName

protected String serviceName
The ArcIMS Service name.


resourceType

protected String resourceType
The type of ArcIMS Service.


userName

protected String userName
The user name to connect the authenticated service.


password

protected String password
The password to connect the authenticated service.


passwordEncrypted

protected boolean passwordEncrypted
Indicating whether the password is encrpyted or not.

Constructor Detail

AIMSMapResource

public AIMSMapResource()
Method Detail

init

public void init(WebContext webContext)
Description copied from class: GISResource

This method is called by the WebContext to initialize the resource. This is typically called when the context itself is initialized or when users add a new resource to the context by using the WebContext.addResource(String, GISResource) method. A GISResource is usable only after this method has been called.

This method iterates through all its supported GISFunctionalitys and calls the GISFunctionality.initFunctionality(GISResource) on them all.

Sub-classes that want to do custom initialization should override this method and make the super call first before doing the custom stuff:

 public void init(WebContext context) {
   super.init(context);
   myInit();
 }
 

Specified by:
init in interface WebContextInitialize
Overrides:
init in class GISResource
Parameters:
webContext - the WebContext that maintains a reference to this resource
See Also:
WebContextInitialize.init(com.esri.adf.web.data.WebContext), GISFunctionality.initFunctionality(GISResource), WebContext.init(WebContext), WebContext.addResource(String, GISResource)

getAlias

public String getAlias()
Description copied from class: GISResource

Returns a reader friendly name for this resource.

It is a good practice for users to explicitly set an alias when the resource is created programmatically or declaratively. Resource providers should provide an auto-generated alias anyway in case users don't explicitly set an alias themselves.

Overrides:
getAlias in class GISResource
Returns:
a reader friendly name for this resource

getConnectionProxy

protected com.esri.aims.mtier.io.ConnectionProxy getConnectionProxy()
Returns the ConnectionProxy object associated with this resource.

Returns:
the ConnectionProxy object

getHostName

public String getHostName()
Returns the Machine name or URL string of the ArcIMS Server.

Returns:
the host name

getPort

public int getPort()
Returns the ArcIMS Application Server port number associated with this resource. By default the port number is 5300.

Returns:
the port number

getServiceName

public String getServiceName()
Return the ArcIMS Service that associated with this resource.

Returns:
the service name associated with this resource

getResourceType

public String getResourceType()
Returns the type of service based on the service name set. By default it is IMAGE_RESOURCE_TYPE

Returns:
the service type

getUserName

public String getUserName()
Returns the user name to connect authenticated service.

Returns:
the user name

getPassword

public String getPassword()
Returns the password to connect authenticated service.

Returns:
the password

isPasswordEncrypted

public boolean isPasswordEncrypted()
Tests whether the given password is encrypted or not. By default the password is not encrypted "false".

Returns:
true if password is encrypted; false otherwise

setHostName

public void setHostName(String hostName)
Set the machine name or URL string of the ArcIMS Server. For eg, in case of TCP connection "MACHINENAME", for HTTP connection "http://www.geographynetwork.com"

Parameters:
hostName - the host name

setPort

public void setPort(int port)
Sets the ArcIMS Application Server port number associated with this resource. By default the port number is 5300. This is required if connection is of type TCP.

Parameters:
port - the port number

setServiceName

public void setServiceName(String serviceName)
Sets the ArcIMS Service for this resource. The specified service should be of type ImageServer or ImageServerArcMap

Parameters:
serviceName - the ArcIMS service for this resource

setUserName

public void setUserName(String userName)
Sets the user name to connect the authenticate service.

Parameters:
userName - the user name

setPassword

public void setPassword(String password)
Sets the password to connect the authenticate service.

Parameters:
password - the password to connect the authenticate service

setPasswordEncrypted

public void setPasswordEncrypted(boolean passwordEncrypted)
Sets to true if the given password is encrpted.

Parameters:
passwordEncrypted - true if password is encrpted; false otherwise

getImageFormat

public String getImageFormat(String format)
Convenient method to return the ArcIMS Service specific map image format from the available list of the Service supported formats. The ArcMap Image Service supports image type "bmp", "gif", "jpg", "png", "png8", "tif" and by default it is "jpg" The Image Services supports image type "gif", "jpg", "png", "png8" and by default it is "jpg". For format "PNG", you can specify "png" and "png8", otherwise, the format will be set as "png";

Parameters:
format - the user defined format
Returns:
the WMS service specific map image format