com.esri.adf.web.data.query
Class LayerDefinition

java.lang.Object
  extended by com.esri.adf.web.data.query.LayerDefinition
All Implemented Interfaces:
java.io.Serializable

public class LayerDefinition
extends java.lang.Object
implements java.io.Serializable

The LayerDefinition class is used to customize the query result. The LayerDefinition can be used to set field aliases, filter return fields, set symbols, etc. These customizations are used to represent the results of queries performed using the WebQuery object. The LayerDefinition set in the WebQuery object can be overriden by the LayerDefinition set in the IdentifyCriteria, PredefinedQueryCriteria and TextCriteria objects.

See Also:
WebQuery.setLayerDefinitions(List), IdentifyCriteria.setLayerDefinitions(List), PredefinedQueryCriteria.setLayerDefinitions(List), TextCriteria.setLayerDefinitions(List), Serialized Form

Field Summary
static java.lang.String DEFAULT_TEMPLATE
           
 
Constructor Summary
LayerDefinition()
           
 
Method Summary
 java.lang.String getCalloutTemplate()
          Returns the callout template.
 java.lang.String getDisplayFieldName()
          Returns which field’s value should be used to display the query’s results.This value is used as the title in the map tip’s callout window.
 java.util.Map<java.lang.String,java.lang.String> getFieldAliases()
          Returns the field aliases.
 WebRenderer getHighlightRenderer()
          Return the highlight renderer for callout.
 int getLayerId()
          Returns the layer id.
 int getMaxRecordCount()
          Returns the number of records that will be returned for the query operation.
 WebRenderer getRenderer()
          Return the default renderer for callout.
 java.lang.String getResourceId()
          Returns the resource id.
 java.lang.String getResultTemplate()
          Returns the template used for formatting result attributes.
 java.util.List<java.lang.String> getReturnFields()
          Specifies which fields should be included in the query results.
 java.util.List<java.lang.String> getSearchFields()
          Returns which fields to perform the query on.
 boolean isFetchResultDetails()
          Specifies whether to retrieve detailed results for the query.
 boolean isReturnGeometry()
          Returns true if the Shape field should always be included in the query results.
 void setCalloutTemplate(java.lang.String calloutTemplate)
          Sets the template used for displaying the callout.
 void setDisplayFieldName(java.lang.String displayFieldName)
          Specifies which field’s value should be used to display the query’s results.
 void setFetchResultDetails(boolean fetchResultDetails)
          Specifies whether to retrieve detailed results for the query.
 void setFieldAliases(java.util.Map<java.lang.String,java.lang.String> fields)
          Sets the field aliases name for the feature attributes.
 void setHighlightRenderer(WebRenderer highlightRenderer)
          Sets the highlight renderer for callout.
 void setLayerId(int layerId)
          Sets the layer id.
 void setMaxRecordCount(int count)
          Sets the number of records to be returned for the query operation.
 void setRenderer(WebRenderer renderer)
          Sets the default renderer for callout.
 void setResourceId(java.lang.String resourceId)
          Sets the resource id of this layer definition.
 void setResultTemplate(java.lang.String resultTemplate)
          Sets the template used for formatting result attributes.
 void setReturnFields(java.util.List<java.lang.String> returnFields)
          Specifies which fields should be included in the query results.
 void setReturnGeometry(boolean returnGeometry)
          Specifies whether the Shape field should always be included in the query results.
 void setSearchFields(java.util.List<java.lang.String> searchFields)
          Specifies which fields to perform the query on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEMPLATE

public static final java.lang.String DEFAULT_TEMPLATE
See Also:
Constant Field Values
Constructor Detail

LayerDefinition

public LayerDefinition()
Method Detail

setResourceId

public void setResourceId(java.lang.String resourceId)
Sets the resource id of this layer definition. This is used to attach a layer definition to a resource. The argument resourceId is the key used to add the resource in the WebContext.

Parameters:
resourceId - the resource id of which this layer definition belongs
See Also:
WebContext.addResource(String, com.esri.adf.web.data.GISResource)

getResourceId

public java.lang.String getResourceId()
Returns the resource id.

Returns:
the resource id

setLayerId

public void setLayerId(int layerId)
Sets the layer id.

Parameters:
layerId - the layer id

getLayerId

public int getLayerId()
Returns the layer id.

Returns:
the layer id

setDisplayFieldName

public void setDisplayFieldName(java.lang.String displayFieldName)
Specifies which field’s value should be used to display the query’s results. This value is used as the title in the map tip’s callout window.

Parameters:
displayFieldName - the name of the query result

getDisplayFieldName

public java.lang.String getDisplayFieldName()
Returns which field’s value should be used to display the query’s results.This value is used as the title in the map tip’s callout window.

Returns:
the name of the query result

setFetchResultDetails

public void setFetchResultDetails(boolean fetchResultDetails)
Specifies whether to retrieve detailed results for the query. The default value is true and all fields specified in getReturnFields() are retrieved. If the getReturnFields() does not include the Shape field, it may also be retrieved depending upon the value of isReturnGeometry(). When false, only the field specified in setDisplayFieldName(String) is retrieved. The Shape field may also be retrieved depending upon the value of isReturnGeometry().

Parameters:
fetchResultDetails - if true the feature attributes will be returned in query result

isFetchResultDetails

public boolean isFetchResultDetails()
Specifies whether to retrieve detailed results for the query. The default value is true and all fields specified in getReturnFields() are retrieved. If the getReturnFields() does not include the Shape field, it may also be retrieved depending upon the value of isReturnGeometry(). When false, only the field specified in setDisplayFieldName(String) is retrieved. The Shape field may also be retrieved depending upon the value of isReturnGeometry().

Returns:
if true, the feature attributes will be returned

setReturnGeometry

public void setReturnGeometry(boolean returnGeometry)
Specifies whether the Shape field should always be included in the query results. Please refer to setFetchResultDetails(boolean) for further information. Only applicable for queries based on AGSPredefinedQueryCriteriaHandler.

Parameters:
returnGeometry - if true the feature geometry will be returned in query result

isReturnGeometry

public boolean isReturnGeometry()
Returns true if the Shape field should always be included in the query results. Please refer to setFetchResultDetails(boolean) for further information. Only applicable for queries based on AGSPredefinedQueryCriteriaHandler.

Returns:
if true, the feature geometry will be returned

setFieldAliases

public void setFieldAliases(java.util.Map<java.lang.String,java.lang.String> fields)
Sets the field aliases name for the feature attributes.

Parameters:
fields - the field aliases name for the feature attributes

getFieldAliases

public java.util.Map<java.lang.String,java.lang.String> getFieldAliases()
Returns the field aliases.

Returns:
the field aliases

setSearchFields

public void setSearchFields(java.util.List<java.lang.String> searchFields)
Specifies which fields to perform the query on. The default value is null and all fields will be queried. Only applicable for queries based on TextCriteria.

Parameters:
searchFields - the list of search field names

getSearchFields

public java.util.List<java.lang.String> getSearchFields()
Returns which fields to perform the query on. The default value is null and all fields will be queried. Only applicable for queries based on TextCriteria.

Returns:
the list of search field names

setReturnFields

public void setReturnFields(java.util.List<java.lang.String> returnFields)
Specifies which fields should be included in the query results. By default, the value is null and all fields are included. Please refer to setFetchResultDetails(boolean) for further information.

Parameters:
returnFields - the list of return field names

getReturnFields

public java.util.List<java.lang.String> getReturnFields()
Specifies which fields should be included in the query results. By default, the value is null and all fields are included. Please refer to setFetchResultDetails(boolean) for further information.

Returns:
the list of return field names

setMaxRecordCount

public void setMaxRecordCount(int count)
Sets the number of records to be returned for the query operation. PredefinedQueryCriteria.getMaxRecordCount() will take precedence over this value.

Parameters:
count - the record limit

getMaxRecordCount

public int getMaxRecordCount()
Returns the number of records that will be returned for the query operation. The default value is -1 which will return all records.

Returns:
the record limit

setRenderer

public void setRenderer(WebRenderer renderer)
Sets the default renderer for callout.

Parameters:
renderer - the default renderer for callout

getRenderer

public WebRenderer getRenderer()
Return the default renderer for callout.

Returns:
the default renderer for callout.

setHighlightRenderer

public void setHighlightRenderer(WebRenderer highlightRenderer)
Sets the highlight renderer for callout.

Parameters:
highlightRenderer - the highlight renderer for callout

getHighlightRenderer

public WebRenderer getHighlightRenderer()
Return the highlight renderer for callout.

Returns:
the highlight renderer for callout.

setCalloutTemplate

public void setCalloutTemplate(java.lang.String calloutTemplate)
Sets the template used for displaying the callout. Setting null does not show the callout. Use DEFAULT_TEMPLATE for default formatting.

Parameters:
calloutTemplate - the template used for displaying callout

getCalloutTemplate

public java.lang.String getCalloutTemplate()
Returns the callout template.

Returns:
the callout template

setResultTemplate

public void setResultTemplate(java.lang.String resultTemplate)
Sets the template used for formatting result attributes. Use DEFAULT_TEMPLATE for default formatting.

Parameters:
resultTemplate - the template for formatting result attributes

getResultTemplate

public java.lang.String getResultTemplate()
Returns the template used for formatting result attributes.

Returns:
the template for formatting result attributes