com.esri.adf.web.tasks
Class SearchAttributesTask

java.lang.Object
  extended by com.esri.adf.web.tasks.SearchAttributesTask
All Implemented Interfaces:
TaskInfoBean, WebContextInitialize, WebContextObserver, Serializable

public class SearchAttributesTask
extends Object
implements WebContextInitialize, WebContextObserver, TaskInfoBean, Serializable

See Also:
Serialized Form

Constructor Summary
SearchAttributesTask()
           
 
Method Summary
 void clearGraphics()
           
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 String getButtonText()
          Returns the search button text
 String getDisplayFieldName()
          Deprecated. As of ArcGIS Java Server 9.3, instead use getLayerDefinitions()
 String getDisplayName()
          Returns the task window title name.
 String getHelpURL()
          Returns the task help URL.
 String getLabelText()
          Returns the label text for the search field.
 List<? extends LayerDefinition> getLayerDefinitions()
          Returns the list of LayerDefinition.
 int getLayerId()
          Deprecated. As of ArcGIS Java Server 9.3, instead use getSearchableLayers()
 int getLayerIndex()
          Returns the layer index.
 Map<Integer,String> getLayers()
          Returns the key value pair with layer index and layer name of all the resource(s).
 int getMaxRecordCount()
          Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getMaxRecordCount()
 GISResource getResource()
          Deprecated. As of ArcGIS Java Server 9.3, instead get the resource from WebContext.getResourceById(String) based on the resource id.
 List<String> getReturnFields()
          Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getReturnFields()
 Map<String,String> getSearchableLayers()
          Returns the map entry of searchable layers.
 List<String> getSearchFields()
          Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getSearchFields()
 String getSearchText()
          Returns the default search text value.
 SearchAttributesTaskConfig getTaskConfig()
          Deprecated. As of ArcGIS Java Server 9.3, instead use this class to get all properties
 TaskInfo getTaskInfo()
           
 String getToolTip()
          Returns the tool tip of search button.
 WebContext getWebContext()
           
 void init(WebContext webContext)
           The initialization chores of attributes of a WebContext should be performed in this method.
 boolean isShowInfoWindow()
          Returns true if the task result(s) to be shown in the info window.
 void search(TaskEvent event)
           
 List<QueryResult> search(WebContext webContext)
          Search features on the map based on the specified context and text value set using setSearchText(String).
 void searchByExtent(MapEvent event)
           
 List<QueryResult> searchByExtent(WebContext webContext, WebGeometry webGeometry)
          Search features by extent on the map based on the specified context and geometry.
 List<QueryResult> searchByExtent(WebGeometry webGeometry)
          Search features by extent on the map based on the specified geometry.
 void setButtonText(String text)
          Sets the search button text
 void setDisplayFieldName(String displayFieldName)
          Deprecated. As of ArcGIS Java Server 9.3, instead use setLayerDefinitions(java.util.List)
 void setDisplayName(String displayName)
          Sets the task window title name.
 void setHelpURL(String helpURL)
          Sets the task help URL.
 void setLabelText(String labelText)
          Sets the label text for the search field.
 void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
          Sets the list of LayerDefinition objects.
 void setLayerId(int layerId)
          Deprecated. As of ArcGIS Java Server 9.3, instead use setSearchableLayers(java.util.Map)
 void setLayerIndex(int layerIndex)
          Sets the layer index.
 void setMaxRecordCount(int count)
          Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getMaxRecordCount()
 void setResource(GISResource resource)
          Deprecated. As of ArcGIS Java Server 9.3, instead use setSearchableLayers(java.util.Map)
 void setReturnFields(List<String> returnFields)
          Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.setReturnFields(List)
 void setSearchableLayers(Map<String,String> searchableLayers)
          Sets the map entry of searchable layers.
 void setSearchFields(List<String> searchFields)
          Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.setSearchFields(List)
 void setSearchText(String defaultSearchTextValue)
          Sets the default search text value.
 void setShowInfoWindow(boolean showInfoWindow)
          Sets whether the task result(s) to be shown in the info window or not.
 void setTaskConfig(SearchAttributesTaskConfig searchConfig)
          Deprecated. As of ArcGIS Java Server 9.3, instead use this class to set all properties
 void setTaskInfo(TaskInfo taskInfo)
           
 void setToolTip(String toolTip)
          Sets the tool tip of search button.
 void setWebContext(WebContext webContext)
          Deprecated. As of ArcGIS Java Server 9.3, no replacement
 void update(WebContext webContext, Object arg)
           This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchAttributesTask

public SearchAttributesTask()
Method Detail

init

public void init(WebContext webContext)
Description copied from interface: WebContextInitialize

The initialization chores of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is initialized. It is important to note that this method is again called by the context when a GISResource is dynamically added to or removed from the context. Classes that implement this method should keep this in mind and adapt the method to react to the callbacks in these circumstances as well.

A WebContext attribute is usable only after this method has been called.

Specified by:
init in interface WebContextInitialize
Parameters:
webContext - WebContext- the WebContext
See Also:
WebContext.init(WebContext), WebContext.addResource(String, GISResource, int), WebContext.removeResource(GISResource)

destroy

public void destroy()
Description copied from interface: WebContextInitialize

The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is destroyed.

The WebContext attribute is unusable after this method has been called.

Specified by:
destroy in interface WebContextInitialize
See Also:
WebContext.destroy()

update

public void update(WebContext webContext,
                   Object arg)
Description copied from interface: WebContextObserver

This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.

To setup an object to be updated by the context, one needs to use the WebContext.addObserver(WebContextObserver) to register itself with the context. All context attributes are wired up to the WebContext. When users change state on any of the attributes and need to intimate other attributes of the context to react to the change they call either the WebContext.refresh() or WebContext.refresh(Object) methods. The context in turns calls the WebContextObserver.update(WebContext, Object) methods on all its registered observers.

Specified by:
update in interface WebContextObserver
Parameters:
webContext - the WebContext that has been refreshed
arg - the argument passed to the WebContext's refresh(arg) method
See Also:
WebContext.refresh(Object), WebContext.addObserver(WebContextObserver), WebContext.removeObserver(WebContextObserver)

getWebContext

public WebContext getWebContext()

setTaskInfo

public void setTaskInfo(TaskInfo taskInfo)
Specified by:
setTaskInfo in interface TaskInfoBean

getTaskInfo

public TaskInfo getTaskInfo()
Specified by:
getTaskInfo in interface TaskInfoBean

searchByExtent

public void searchByExtent(MapEvent event)

searchByExtent

public List<QueryResult> searchByExtent(WebGeometry webGeometry)
Search features by extent on the map based on the specified geometry.

Parameters:
webGeometry - the geometry in map coordinates

searchByExtent

public List<QueryResult> searchByExtent(WebContext webContext,
                                        WebGeometry webGeometry)
Search features by extent on the map based on the specified context and geometry.

Parameters:
webContext - the context object, passing null will use the context from this object
webGeometry - the geometry in map coordinates
Returns:
the list of search result(s)

search

public void search(TaskEvent event)

search

public List<QueryResult> search(WebContext webContext)
Search features on the map based on the specified context and text value set using setSearchText(String).

Parameters:
webContext - the context object, passing null will use the context from this object
Returns:
the list of search result(s)

clearGraphics

public void clearGraphics()

setLayerIndex

public void setLayerIndex(int layerIndex)
Sets the layer index.

Parameters:
layerIndex - the layer index

getLayerIndex

public int getLayerIndex()
Returns the layer index.

Returns:
the layer index

getLayers

public Map<Integer,String> getLayers()
Returns the key value pair with layer index and layer name of all the resource(s).

Returns:
Map the key value pair with layer index and layer name of all the resource(s).

setDisplayName

public void setDisplayName(String displayName)
Sets the task window title name.

Parameters:
displayName - the task window title name

getDisplayName

public String getDisplayName()
Returns the task window title name.

Returns:
the task window title name

setHelpURL

public void setHelpURL(String helpURL)
Sets the task help URL.

Parameters:
helpURL - the task help URL

getHelpURL

public String getHelpURL()
Returns the task help URL.

Returns:
the task help URL

setLabelText

public void setLabelText(String labelText)
Sets the label text for the search field.

Parameters:
labelText - the label text for the search field

getLabelText

public String getLabelText()
Returns the label text for the search field.

Returns:
the label text for the search field

setSearchText

public void setSearchText(String defaultSearchTextValue)
Sets the default search text value.

Parameters:
defaultSearchTextValue - the default search text

getSearchText

public String getSearchText()
Returns the default search text value.

Returns:
the default search text value

setButtonText

public void setButtonText(String text)
Sets the search button text

Parameters:
text - a String

getButtonText

public String getButtonText()
Returns the search button text

Returns:
a String

setToolTip

public void setToolTip(String toolTip)
Sets the tool tip of search button.

Parameters:
toolTip - the tool tip of search button

getToolTip

public String getToolTip()
Returns the tool tip of search button.

Returns:
the tool tip of search button

setLayerDefinitions

public void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
Sets the list of LayerDefinition objects.

Parameters:
layerDefinitions - the list of layer definition objects

getLayerDefinitions

public List<? extends LayerDefinition> getLayerDefinitions()
Returns the list of LayerDefinition.

Returns:
the list of layer definition objects

setShowInfoWindow

public void setShowInfoWindow(boolean showInfoWindow)
Sets whether the task result(s) to be shown in the info window or not. By default the value is true

Parameters:
showInfoWindow - if true, info window is shown

isShowInfoWindow

public boolean isShowInfoWindow()
Returns true if the task result(s) to be shown in the info window.

Returns:
true if info window to be shown

setSearchableLayers

public void setSearchableLayers(Map<String,String> searchableLayers)
Sets the map entry of searchable layers. Here key is the resource id and value is the comma separated layer ids.
 For Example,
   java.util.Map<String, Integer> searchableLayers = new java.util.LinkedHashMap<String, Integer>(1);
   searchableLayers.put("ags1", "2,3");
   searchableLayers.put("aws1", "0");
   searchableLayers.put("aims1", "0,5");
 

Parameters:
searchableLayers - the map entry of searchable layers

getSearchableLayers

public Map<String,String> getSearchableLayers()
Returns the map entry of searchable layers.

Returns:
the map entry of searchable layers

setTaskConfig

@Deprecated
public void setTaskConfig(SearchAttributesTaskConfig searchConfig)
Deprecated. As of ArcGIS Java Server 9.3, instead use this class to set all properties

Sets the search attributes task config object.

Parameters:
searchConfig - the search attributes task config object

getTaskConfig

@Deprecated
public SearchAttributesTaskConfig getTaskConfig()
Deprecated. As of ArcGIS Java Server 9.3, instead use this class to get all properties

Return the search attributes task config object.

Returns:
the search attributes task config object

setWebContext

@Deprecated
public void setWebContext(WebContext webContext)
Deprecated. As of ArcGIS Java Server 9.3, no replacement


setDisplayFieldName

@Deprecated
public void setDisplayFieldName(String displayFieldName)
Deprecated. As of ArcGIS Java Server 9.3, instead use setLayerDefinitions(java.util.List)

Sets the display field name, the string used to represent the root node name of the results tree.

Parameters:
displayFieldName - a String

getDisplayFieldName

@Deprecated
public String getDisplayFieldName()
Deprecated. As of ArcGIS Java Server 9.3, instead use getLayerDefinitions()

Returns the display field name.

Returns:
the display field name

setLayerId

@Deprecated
public void setLayerId(int layerId)
Deprecated. As of ArcGIS Java Server 9.3, instead use setSearchableLayers(java.util.Map)

Sets the layer id in which the search is performed.

Parameters:
layerId - the layer id

getLayerId

@Deprecated
public int getLayerId()
Deprecated. As of ArcGIS Java Server 9.3, instead use getSearchableLayers()

Returns the layer id in which the search is performed.

Returns:
the layer id

setMaxRecordCount

@Deprecated
public void setMaxRecordCount(int count)
Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getMaxRecordCount()

Sets the maximum number of features to be returned while performing search operation.

Parameters:
count - the number of features to be returned

getMaxRecordCount

@Deprecated
public int getMaxRecordCount()
Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getMaxRecordCount()

Returns the maximum number of features to be returned while performing search operation.

Returns:
the number of features to be returned

setResource

@Deprecated
public void setResource(GISResource resource)
Deprecated. As of ArcGIS Java Server 9.3, instead use setSearchableLayers(java.util.Map)

Set the GISResource object in which the attributes are searched.

Parameters:
resource - the GISResource object

getResource

@Deprecated
public GISResource getResource()
Deprecated. As of ArcGIS Java Server 9.3, instead get the resource from WebContext.getResourceById(String) based on the resource id.

Returns the GISResource object.

Returns:
the GISResource object

getReturnFields

@Deprecated
public List<String> getReturnFields()
Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getReturnFields()

Returns the list of return field name.


setReturnFields

@Deprecated
public void setReturnFields(List<String> returnFields)
Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.setReturnFields(List)

Sets the list of return field name.

Parameters:
returnFields - the list of return field name

getSearchFields

@Deprecated
public List<String> getSearchFields()
Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.getSearchFields()

Returns the list of search fields.

Returns:
the list of search fields

setSearchFields

@Deprecated
public void setSearchFields(List<String> searchFields)
Deprecated. As of ArcGIS Java Server 9.3, instead use LayerDefinition.setSearchFields(List)

Sets the list of search fields.

Parameters:
searchFields - tthe list of search fields