|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.adf.web.data.query.WebQuery
public class WebQuery
It is generally defined in the faces-config.xml of web applications. The following shows how it can be added as an attribute of the WebContext.
<managed-bean>
<managed-bean-name>mapContext</managed-bean-name>
<managed-bean-class>com.esri.adf.web.data.WebContext</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>attributes</property-name>
<map-entries>
<map-entry>
<key>query</key>
<value>#{webappQuery}</value>
</map-entry>
...
Below is the declaration of a WebQuery managed bean. Note the LayerDefinition managed beans being referenced below.
<managed-bean>
<managed-bean-name>webappQuery</managed-bean-name>
<managed-bean-class>com.esri.adf.web.data.query.WebQuery</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>layerDefinitions</property-name>
<list-entries>
<value>#{arcgis_localmapgrid2_usa_2d_v_layer1}</value>
....
</list-entries>
</managed-property>
</managed-bean>
The layer definitions are generally created through Java Manager or ArcGIS Server Java SDK IDE plug-ins.
// Get WebQuery object from WebContext
WebQuery wQuery = wContext.getWebQuery();
resource = wContext.getResourceById(this.resourceId);
// set query criteria
if (resource != null && layerId != -1) {
LayerDefinition lyrDef = this.getLayerDefinition() != null ? this.getLayerDefinition() : null;
PredefinedQueryCriteria pqc = new PredefinedQueryCriteria();
//set field for display
pqc.setDisplayFieldName(displayFieldName);
pqc.setWhereClause(whereClause);
pqc.setMaxRecordCount(maxRecordCount);
if (lyrDef != null) {
List<LayerDefinition> lyrDefs = new ArrayList<LayerDefinition>(1);
lyrDefs.add(lyrDef);
pqc.setLayerDefinitions(lyrDefs);
}
//convert layer definition to WebLayerInfo
WebLayerInfo layerInfo = QueryUtil.getWebLayerInfo(wQuery.getQueryLayers(), resource, layerId);
ArrayList<WebLayerInfo> list = new ArrayList<WebLayerInfo>();
list.add(layerInfo);
//perform query
results = wQuery.query(pqc, list);
}
also see QueryFunctionality
for detail query implementation.
Field Summary | |
---|---|
static int |
ALL_LAYERS_OPTION_ID
A constant layer ID used to instantiates allLayersOption which stands for "All Layers". |
static WebLayerInfo |
allLayersOption
The layer option stands for to all the layers. |
protected WebContext |
context
The WebQuery associated WebContext. |
protected ArrayList<GISFunctionality> |
funcs
A list stored the QueryFunctionality within the GIS resources. |
protected ArrayList<WebLayerInfo> |
layers
A list stored the WebLayerInfo objects for query |
protected ArrayList<GraphicElement> |
multipointGraphics
A list stored the multi-point graphics elements, which are created when process the query. |
protected GraphicElement |
pointGraphic
A GraphicElement for rendering point and multi-points. |
protected ArrayList<GraphicElement> |
pointGraphics
A list stored the point graphics elements, which are created when process the query. |
protected WebMultiPoint |
points
Deprecated. As of ArcGIS Java Server 9.3, instead use multipointGraphics |
protected WebSimpleMarkerSymbol |
pointSymbol
A Point symbol for drawing point and multi-points. |
protected GraphicElement |
polygonGraphic
GraphicElement for rendering polygons. |
protected ArrayList<GraphicElement> |
polygonGraphics
A list stored the polygon graphics, which are created when process the query. |
protected WebSimplePolygonSymbol |
polygonSymbol
A Polygon symbol for drawing polygons. |
protected WebPolyline |
polyline
Deprecated. As of ArcGIS Java Server 9.3, instead use polylineGraphics |
protected GraphicElement |
polylineGraphic
A GraphicElement for rendering polyline. |
protected ArrayList<GraphicElement> |
polylineGraphics
A list stored the polyline graphics, which are created when process the query. |
protected WebSimpleLineSymbol |
polylineSymbol
A Polyline symbol for drawing lines. |
Constructor Summary | |
---|---|
WebQuery()
|
Method Summary | |
---|---|
WebGeometry |
addDisplayGeometry(WebGeometry geometry)
The method will do a projection transformation for the given geometry object, add it to an appropriate geometry collection based on its type and displaying on the map with proper symbol. |
void |
clearGraphic(WebGeometry geometry)
Removes the given geometry object from the WebGraphics as well as from geometry collections. |
void |
clearGraphics()
Removes all graphic elements from the web graphic of |
boolean |
containsDisplayGeometry(WebGeometry geometry)
Returns true if the specified geometry and the corresponding symbol available in the WebGraphics . |
void |
destroy()
The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in
this method. |
protected void |
generateQueryLayers()
Generates a list of queryable layers from the |
List<? extends LayerDefinition> |
getLayerDefinitions()
Returns the list of LayerDefinition . |
GraphicElement |
getLineGraphic()
Returns the GraphicElement object used to render the line geometries. |
WebSimpleLineSymbol |
getLineGraphicSymbol()
Returns the WebSimpleLineSymbol object used to symbolize the line geometry. |
GraphicElement |
getPointGraphic()
Returns the GraphicElement object used to render the point geometries. |
WebSimpleMarkerSymbol |
getPointGraphicSymbol()
Returns the WebSimpleMarkerSymbol object used to symbolize the point geometry. |
GraphicElement |
getPolgonGraphic()
Deprecated. As of ArcGIS Java Server 9.3, instead use getPolygonGraphic() |
GraphicElement |
getPolygonGraphic()
Returns the GraphicElement object used to render the polygon geometries. |
WebSimplePolygonSymbol |
getPolygonGraphicSymbol()
Returns the WebSimplePolygonSymbol object used to symbolize the polygon geometry. |
List<WebLayerInfo> |
getQueryLayers()
Returns a list of WebLayerInfo objects |
WebContext |
getWebContext()
Returns the WebContext object associated with this query. |
void |
init(WebContext webContext)
Initializes the |
List<QueryResult> |
query(QueryCriteria criteria,
List<? extends WebLayerInfo> queryLayers)
Do a query based on the given list of queryLayers and criteria . |
void |
setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
Sets the list of LayerDefinition objects. |
void |
setLineGraphicSymbol(WebSimpleLineSymbol symbol)
Sets the WebSimpleLineSymbol object used to symbolize the line geometry. |
void |
setPointGraphicSymbol(WebSimpleMarkerSymbol symbol)
Sets the WebSimpleMarkerSymbol object used to symbolize the point geometry. |
void |
setPolygonGraphicSymbol(WebSimplePolygonSymbol symbol)
Sets the WebSimplePolygonSymbol object used to symbolize the polygon geometry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALL_LAYERS_OPTION_ID
allLayersOption
which stands for "All Layers".
public static final WebLayerInfo allLayersOption
protected WebContext context
protected ArrayList<GISFunctionality> funcs
protected ArrayList<WebLayerInfo> layers
protected ArrayList<GraphicElement> pointGraphics
protected GraphicElement pointGraphic
protected WebSimpleMarkerSymbol pointSymbol
protected ArrayList<GraphicElement> multipointGraphics
@Deprecated protected WebMultiPoint points
multipointGraphics
protected ArrayList<GraphicElement> polylineGraphics
protected GraphicElement polylineGraphic
protected WebSimpleLineSymbol polylineSymbol
@Deprecated protected WebPolyline polyline
polylineGraphics
protected ArrayList<GraphicElement> polygonGraphics
protected GraphicElement polygonGraphic
protected WebSimplePolygonSymbol polygonSymbol
Constructor Detail |
---|
public WebQuery()
Method Detail |
---|
public void init(WebContext webContext)
Initializes the
Then it will use the
init
in interface WebContextInitialize
webContext
- - a WebContext objectWebContext.init(WebContext)
,
WebContext.addResource(String, GISResource, int)
,
WebContext.removeResource(GISResource)
public void destroy()
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.
destroy
in interface WebContextInitialize
WebContext.destroy()
protected void generateQueryLayers()
getQueryLayers()
public WebGeometry addDisplayGeometry(WebGeometry geometry)
geometry
- a WebGeometry object
public boolean containsDisplayGeometry(WebGeometry geometry)
WebGraphics
.
geometry
- - a WebGeometry
object
WebGraphics
.getPointGraphicSymbol()
,
getLineGraphicSymbol()
,
getPolygonGraphicSymbol()
public void clearGraphic(WebGeometry geometry)
isFuseGraphics
of the WebMap object returns true
geometry
- - a WebGeometry
objectWebMap
public void clearGraphics()
WebContext
public List<QueryResult> query(QueryCriteria criteria, List<? extends WebLayerInfo> queryLayers)
Do a query based on the given list of queryLayers
and criteria
. The results will be
returned in a List
of QueryResult
objects.
The method delegates the actual query to the appropriate query handler found in the
criteria
.
criteria
- the QueryCriteria
based on which the query is performedqueryLayers
- the List
of WebLayerInfo
s to query.
List
of QueryResult
objectspublic WebContext getWebContext()
public List<WebLayerInfo> getQueryLayers()
WebLayerInfo
objects
public GraphicElement getPointGraphic()
GraphicElement
object used to render the point geometries.
public void setPointGraphicSymbol(WebSimpleMarkerSymbol symbol)
WebSimpleMarkerSymbol
object used to symbolize the point geometry.
public WebSimpleMarkerSymbol getPointGraphicSymbol()
WebSimpleMarkerSymbol
object used to symbolize the point geometry.
public GraphicElement getLineGraphic()
GraphicElement
object used to render the line geometries.
public void setLineGraphicSymbol(WebSimpleLineSymbol symbol)
WebSimpleLineSymbol
object used to symbolize the line geometry.
public WebSimpleLineSymbol getLineGraphicSymbol()
WebSimpleLineSymbol
object used to symbolize the line geometry.
public GraphicElement getPolygonGraphic()
GraphicElement
object used to render the polygon geometries.
public void setPolygonGraphicSymbol(WebSimplePolygonSymbol symbol)
WebSimplePolygonSymbol
object used to symbolize the polygon geometry.
public WebSimplePolygonSymbol getPolygonGraphicSymbol()
WebSimplePolygonSymbol
object used to symbolize the polygon geometry.
public void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
LayerDefinition
objects.
layerDefinitions
- the list of layer definition objectspublic List<? extends LayerDefinition> getLayerDefinitions()
LayerDefinition
.
@Deprecated public GraphicElement getPolgonGraphic()
getPolygonGraphic()
GraphicElement
object used to render the polygon geometries.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |