|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.adf.web.aims.data.AIMSGeocodeFunctionality
public class AIMSGeocodeFunctionality
This class is responsible for sending GET_GEOCODE AXL request to ArcIMS Server based on the AIMSMapResource
information.
When initFunctionality(com.esri.adf.web.data.GISResource)
method is called, the GET_SERVICE_INFO request is sent to the ArcIMS Server if there
is no ArcIMS Map Functionality associated with the resource.
ArcIMS Geocode Functionality can be added using JSF managed bean configuration as shown below,
<managed-bean> <managed-bean-name>aimsGeocodeResource</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>geocode</key> <value>#{aimsGeocode}</value> </map-entry> </map-entries> </managed-property> </managed-bean>
<managed-bean> <managed-bean-name>aimsGeocode</managed-bean-name> <managed-bean-class>com.esri.adf.web.aims.data.AIMSGeocodeFunctionality</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>maxCandidates</property-name> <value>10</value> </managed-property> <managed-property> <property-name>aliases</property-name> <map-entries> <map-entry> <key>STREET</key> <value>Street</value> </map-entry> <map-entry> <key>ZONE</key> <value>ZIP</value> </map-entry> </map-entries> </managed-property>
Field Summary |
---|
Fields inherited from interface com.esri.adf.web.data.GeocodeFunctionality |
---|
FUNCTIONALITY_NAME |
Constructor Summary | |
---|---|
AIMSGeocodeFunctionality()
|
Method Summary | |
---|---|
void |
destroyFunctionality()
The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. |
List<AddressCandidate> |
findAddressCandidates()
Returns a List of AddressCandidate s based on the current set of address field values . |
AddressCandidate |
geocodeAddress()
Geocodes a single address based on the current set of address field values . |
String |
getAddressFieldAlias(String fieldName)
Returns an alias for the given address field . |
String[] |
getAddressFields()
Returns an array of address fields for this geocoder. |
String |
getAddressFieldValue(String fieldName)
Returns the value for a given address field . |
HashMap<String,String> |
getAliases()
Returns the aliases for the geocoding style ids. |
String |
getDefaultDataFrame()
Returns the default dataframe name. |
HashMap<String,String> |
getDefaultValue()
Return the default values for the geocoding style ids. |
String |
getGeocodeLayerId()
Returns the geocode layer id. |
com.esri.aims.mtier.model.map.Map |
getMap()
Returns the Map object. |
int |
getMaxCandidates()
Returns the maximum number of geocoding result candidates value. |
int |
getMinScore()
Returns the minimum geocode scoring value. |
AIMSMapResource |
getResource()
Returns the GISResource associated with this functionality. |
int |
getSpellingSensitivity()
Returns the spelling sensitivity for geocoding. |
void |
initFunctionality(GISResource resource)
The initialization chores for the functionality must be performed in this method. |
void |
setAddressFieldValue(String fieldName,
String value)
Sets the value for a given address field . |
void |
setAliases(HashMap<String,String> aliases)
Sets the aliases for the geocoding style ids. |
void |
setDefaultDataFrame(String defaultDataFrame)
Sets the default data frame in which the geocode functionality should work with. |
void |
setDefaultValue(HashMap<String,String> defaultValue)
Sets the default values for the geocoding style ids. |
void |
setGeocodeLayerId(String geocodeLayerId)
Sets the geocode layer id in which the geocoding should be performed. |
void |
setMaxCandidates(int maxCandidates)
Sets the maximum number of candidates to return from the geocoding result. |
void |
setMinScore(int minScore)
Sets the minimum geocode scoring value. |
void |
setSpellingSensitivity(int spellingSensitivity)
Sets the spelling sensitivity for geocoding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AIMSGeocodeFunctionality()
Method Detail |
---|
public void initFunctionality(GISResource resource)
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.
initFunctionality
in interface GISFunctionality
resource
- the GISResource
that this functionality supportsGISResource.init(WebContext)
public void destroyFunctionality()
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.
destroyFunctionality
in interface GISFunctionality
GISResource.destroy()
public AIMSMapResource getResource()
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.
getResource
in interface GISFunctionality
GISResource
associated with this functionalitypublic String[] getAddressFields()
GeocodeFunctionality
Returns an array of address fields for this geocoder. Every implementation of GeocodeFunctionality
defines the address fields that are available.
The GeocodeTask
dynamically generates input text box for each address field.
getAddressFields
in interface GeocodeFunctionality
String
array of address fields for this geocoderpublic void setAddressFieldValue(String fieldName, String value)
GeocodeFunctionality
Sets the value for a given address field
.
setAddressFieldValue
in interface GeocodeFunctionality
fieldName
- the address field for which the value is to be setvalue
- the value for the given address fieldpublic String getAddressFieldValue(String fieldName)
GeocodeFunctionality
Returns the value for a given address field
.
getAddressFieldValue
in interface GeocodeFunctionality
fieldName
- the address field for which the value is to be returned
public String getAddressFieldAlias(String fieldName)
GeocodeFunctionality
Returns an alias for the given address field
.
The GeocodeTask
labels the input text box for the address field with this alias.
getAddressFieldAlias
in interface GeocodeFunctionality
fieldName
- the address field for which the alias is to be returned
public List<AddressCandidate> findAddressCandidates()
GeocodeFunctionality
Returns a List
of AddressCandidate
s based on the current set of address field values
.
findAddressCandidates
in interface GeocodeFunctionality
List
of AddressCandidate
s matching the current set of address field valuespublic AddressCandidate geocodeAddress()
GeocodeFunctionality
Geocodes a single address based on the current set of address field values
.
geocodeAddress
in interface GeocodeFunctionality
public com.esri.aims.mtier.model.map.Map getMap()
Map
object.
public void setGeocodeLayerId(String geocodeLayerId)
If the geocode layer id is not set then the first available geocode layer id is set automatically from the associated resource.
geocodeLayerId
- the geocode layer idpublic String getGeocodeLayerId()
public void setAliases(HashMap<String,String> aliases)
Sets the aliases for the geocoding style ids.
For example, if the geocoding style is
<EXTENSION type="geocode"> <GCSTYLE name="USAddressZ"> <GCINPUT id="STREET" description="street number, street name and type" label="Street" type="text" width="10"/> <GCINPUT id="ZONE" description="zone information" label="Zone" type="text" width="5"/> <GCINPUT id="CROSSSTREET" description="cross street name and type" label="Cross street" type="text" width="10"/> </GCSTYLE> </EXTENSION>
then
AIMSGeocodeFunctionality gFunc = ...; HashMap aliases = new HashMap(); aliases.put("STREET", "Street"); aliases.put("ZONE", "ZIP"); gFunc.setAliases(aliases);
aliases
- the aliases for the geocoding style idspublic HashMap<String,String> getAliases()
HashMap
the aliases for the geocoding style ids.public void setDefaultValue(HashMap<String,String> defaultValue)
Sets the default values for the geocoding style ids.
AIMSGeocodeFunctionality gFunc = ...; HashMap defaultValues = new HashMap(); aliases.put("STREET", "380 New York St"); aliases.put("ZONE", "92373"); gFunc.setAliases(defaultValues);
defaultValue
- the default valuespublic HashMap<String,String> getDefaultValue()
HashMap
the default values for the geocoding style ids.public void setSpellingSensitivity(int spellingSensitivity)
spellingSensitivity
- the spelling sensitivity for geocoding servicepublic int getSpellingSensitivity()
public void setMinScore(int minScore)
minScore
- the minimum scoring valuepublic int getMinScore()
public void setMaxCandidates(int maxCandidates)
maxCandidates
- the maximum number of candidates to returnpublic int getMaxCandidates()
public void setDefaultDataFrame(String defaultDataFrame)
defaultDataFrame
- the default dataframe namepublic String getDefaultDataFrame()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |