|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.adf.web.data.query.LayerDefinition
public class LayerDefinition
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
for individual queries by setting a LayerDefinition on the IdentifyCriteria
, PredefinedQueryCriteria
and TextCriteria
objects.
WebQuery.setLayerDefinitions(List)
,
IdentifyCriteria.setLayerDefinitions(List)
,
PredefinedQueryCriteria.setLayerDefinitions(List)
,
TextCriteria.setLayerDefinitions(List)
,
Serialized FormField Summary | |
---|---|
static String |
DEFAULT_TEMPLATE
|
Constructor Summary | |
---|---|
LayerDefinition()
|
Method Summary | |
---|---|
String |
getCalloutTemplate()
Returns the callout template. |
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. |
Map<String,String> |
getFieldAliases()
Returns the field aliases. |
WebRenderer |
getHighlightRenderer()
Return the highlight renderer for callout. |
int |
getLayerId()
Returns the layer id. |
double |
getMaximumAllowableOffset()
This property specifies whether the geometry of features returned by the query should be generalized. |
int |
getMaxRecordCount()
Returns the number of records that will be returned for the query operation. |
double |
getPointZoomToFactor()
Returns the amount by which the map's full extent should be contracted to zoom into results returned by the query. |
WebRenderer |
getRenderer()
Return the default renderer for callout. |
String |
getResourceId()
Returns the resource id. |
String |
getResultTemplate()
Returns the template used for formatting result attributes. |
List<String> |
getReturnFields()
Specifies which fields should be included in the query results. |
List<String> |
getSearchFields()
Returns which fields to perform the query on. |
boolean |
isFetchRelatedRecords()
Returns true if the related records need to be fetched. |
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(String calloutTemplate)
Sets the template used for displaying the callout. |
void |
setDisplayFieldName(String displayFieldName)
Specifies which field's value should be used to display the query's results. |
void |
setFetchRelatedRecords(boolean fetchRelatedRecords)
Specifies whether to retrieve the related records for the query. |
void |
setFetchResultDetails(boolean fetchResultDetails)
Specifies whether to retrieve detailed results for the query. |
void |
setFieldAliases(Map<String,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 |
setMaximumAllowableOffset(double maximumAllowableOffset)
This property specifies whether the geometry of features returned by the query should be generalized. |
void |
setMaxRecordCount(int count)
Sets the number of records to be returned for the query operation. |
void |
setPointZoomToFactor(double factor)
Specifies the amount by which the map's full extent should be contracted to zoom into results returned by the query. |
void |
setRenderer(WebRenderer renderer)
Sets the default renderer for callout. |
void |
setResourceId(String resourceId)
Sets the resource id of this layer definition. |
void |
setResultTemplate(String resultTemplate)
Sets the template used for formatting result attributes. |
void |
setReturnFields(List<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(List<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 |
---|
public static final String DEFAULT_TEMPLATE
Constructor Detail |
---|
public LayerDefinition()
Method Detail |
---|
public void setResourceId(String resourceId)
WebContext
.
resourceId
- the resource id of which this layer definition belongsWebContext.addResource(String, com.esri.adf.web.data.GISResource)
public String getResourceId()
public void setLayerId(int layerId)
layerId
- the layer idpublic int getLayerId()
public void setDisplayFieldName(String displayFieldName)
displayFieldName
- the name of the query resultpublic String getDisplayFieldName()
public void setFetchResultDetails(boolean fetchResultDetails)
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()
.
fetchResultDetails
- if true the feature attributes will be returned in query resultpublic boolean isFetchResultDetails()
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()
.
public void setReturnGeometry(boolean returnGeometry)
setFetchResultDetails(boolean)
for further information. Only applicable for queries based on
AGSPredefinedQueryCriteriaHandler
.
returnGeometry
- if true the feature geometry will be returned in query resultpublic boolean isReturnGeometry()
setFetchResultDetails(boolean)
for further information. Only applicable for queries based on
AGSPredefinedQueryCriteriaHandler
.
public void setFieldAliases(Map<String,String> fields)
<managed-property> <property-name>fieldAliases</property-name> <map-entries> <map-entry> <key>CNTRY_NAME</key> <value>Name</value> </map-entry> <map-entry> <key>POP_CNTRY</key> <value>Population</value> </map-entry> <map-entry> <key>SQKM_CNTRY</key> <value>Area</value> </map-entry> </map-entries> </managed-property>
fields
- the field aliases name for the feature attributespublic Map<String,String> getFieldAliases()
public void setSearchFields(List<String> searchFields)
TextCriteria
.
searchFields
- the list of search field namespublic List<String> getSearchFields()
TextCriteria
.
public void setReturnFields(List<String> returnFields)
setFetchResultDetails(boolean)
for further information.
<managed-property> <property-name>returnFields</property-name> <list-entries> <value>CNTRY_NAME</value> <value>POP_CNTRY</value> <value>SQKM_CNTRY</value> <value>CURRENCY_TYPE</value> </list-entries> </managed-property>
returnFields
- the list of return field namespublic List<String> getReturnFields()
setFetchResultDetails(boolean)
for further information.
public void setMaxRecordCount(int count)
PredefinedQueryCriteria.getMaxRecordCount()
will take precedence over this value.
count
- the record limitpublic int getMaxRecordCount()
public void setRenderer(WebRenderer renderer)
renderer
- the default renderer for calloutpublic WebRenderer getRenderer()
public void setHighlightRenderer(WebRenderer highlightRenderer)
highlightRenderer
- the highlight renderer for calloutpublic WebRenderer getHighlightRenderer()
public void setCalloutTemplate(String calloutTemplate)
DEFAULT_TEMPLATE
for default formatting. In the template while specifying the field name
within ${} use the alias field name if you would have already set using
setFieldAliases(Map)
.
A sample managed bean with custom callout formatting, <managed-property> <property-name>calloutTemplate</property-name> <value> <![CDATA[ <header> <font style="background:#0404B4;color:#FFFFFF">Country Name : ${Name}</font> </header> <body> <table> <tr> <td><b>Name</b></td> <td>${Name}</td> <!-- if alias name is set then use the alias name --> </tr> <tr> <td>Population</td> <td>${Population}</td> </tr> <tr> <td>Area</td> <td>${Area}</td> </tr> <tr> <td>Currency</td> <td>${CURRENCY_TYPE}</td> <!-- alias name is not set using the actual field name --> </tr> </table> </body> <footer> <b>${Name}</b> </footer> ]]> </value> </managed-property>
calloutTemplate
- the template used for displaying calloutpublic String getCalloutTemplate()
public void setResultTemplate(String resultTemplate)
DEFAULT_TEMPLATE
for default
formatting. In the template while specifying the field name within ${} use the alias field name if you would have
already set using setFieldAliases(Map)
.
A Sample managed bean with custom result formatting, <managed-property> <property-name>resultTemplate</property-name> <value> <![CDATA[ <body> <table> <tr style="background:#0404B4;color:#FFFFFF"> <th>Field Name</th> <th>Field Value</th> </tr> <tr> <td>Name</td> <td>${Name}</td> </tr> <tr> <td>Population</td> <td>${Population}</td> </tr> <tr> <td>Area</td> <td>${Area}</td> </tr> <tr> <td>Currency</td> <td>${CURRENCY_TYPE}</td> </tr> </table> </body> ]]> </value> </managed-property>
resultTemplate
- the template for formatting result attributespublic String getResultTemplate()
public double getMaximumAllowableOffset()
spatial
reference
. For example, if the spatial reference units of the resource being queried is in decimal degrees and the
spatial reference units of the WebContext is in meters, the values specified for MaximumAllowableOffset must be in
meters. This property only applies for queries based on AGSMapResource
ArcGIS
Server resources. It will be ignored for other resources.
public void setMaximumAllowableOffset(double maximumAllowableOffset)
spatial
reference
. For example, if the spatial reference units of the resource being queried is in decimal degrees and the
spatial reference units of the WebContext is in meters, the values specified for MaximumAllowableOffset must be in
meters. This property only applies for queries based on AGSMapResource
ArcGIS
Server resources. It will be ignored for other resources. Sample XML Snippet:
<managed-property> <property-name>maximumAllowableOffset</property-name> <value>5</value> </managed-property>
maximumAllowableOffset
- The maximumAllowableOffset to set.public double getPointZoomToFactor()
public void setPointZoomToFactor(double factor)
QueryResult.ZOOMTO_POINT_FACTOR
. So if the map's full extent is [-180,-90,180,90] and the result point
feature is [0,0], a zoom factor of 20 would yield an extent [-9,-4.5,9,4.5] centered on the point.
factor
- the amount to zoom by for point featurespublic void setFetchRelatedRecords(boolean fetchRelatedRecords)
fetchRelatedRecords
- if true the related records are fetched for the querypublic boolean isFetchRelatedRecords()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |