public class WFSMessage extends Object
Constructor and Description |
---|
WFSMessage() |
Modifier and Type | Method and Description |
---|---|
static void |
addInsertStatement(Document request,
Node feature)
Appends a wfs:Insert element to the document element in the given request
entity.
|
static void |
addNamespaceBinding(Document doc,
QName qName)
Adds a namespace binding to the document element.
|
static void |
addReplaceStatements(Document trxRequest,
List<Element> replacements)
Adds a sequence of wfs:Replace statements to the given transaction
request entity.
|
static void |
addResourceIdPredicate(Document request,
Set<String> idSet)
Adds a ResourceId predicate to a GetFeature (or GetFeatureWithLock)
request entity that contains a simple query expression without a filter.
|
static void |
addTemporalPredicate(Document request,
String temporalOp,
Document gmlTime,
Element valueRef)
Adds a temporal predicate to a GetFeature request entity.
|
static Element |
appendSimpleQuery(Document doc,
QName... qNames)
Adds a simple wfs:Query element (without a filter) to the given request
entity.
|
static void |
appendStoredQuery(Document doc,
String queryId,
Map<String,Object> params)
Adds a wfs:StoredQuery element to the given request entity.
|
static boolean |
containsGetProtocolBinding(Object[] testParams)
Checks the given list of objects for the presence of a
ProtocolBinding.GET object. |
static Document |
createGMLEnvelope()
Creates a GML envelope covering the area of use for the "WGS 84" CRS
(srsName="urn:ogc:def:crs:EPSG::4326").
|
static Document |
createRequestEntity(String reqResource,
String wfsVersion)
Creates an XML request entity of the specified request type.
|
static Element |
createValueReference(org.apache.xerces.xs.XSElementDeclaration propertyElem)
Creates an Element node (fes:ValueReference) containing an XPath
expression derived from a property element declaration.
|
static Set<String> |
extractFeatureIdentifiers(Document doc,
QName featureType)
Returns the set of feature identifiers found in the given WFS response
entity.
|
static List<Node> |
findMatchingElements(Document doc,
org.apache.xerces.xs.XSElementDeclaration... elemDeclarations)
Finds elements in a DOM Document that correspond to the given collection
of element declarations.
|
static void |
insertGMLProperty(Element feature,
Element gmlProperty)
Inserts a standard GML property into a given feature instance.
|
static Element |
newResourceIdFilter(String id)
Builds a filter predicate containing a fes:ResourceId element that
identifies the feature instance to be modified.
|
static void |
setReturnTypesAndTypeNamesAttribute(Document request,
QName featureTypeName)
Sets the attribute CreateStoredQuery/StoredQueryDefinition/QueryExpressionText/Query/@typeNames to the passed
feature type name.
|
static void |
setTypeName(Element elem,
QName qName)
Sets the value of the typeName attribute on an action element
(wfs:Update, wfs:Delete) contained in a Transaction request entity.
|
static String |
transformEntityToKVP(Source xmlSource)
Transforms the XML representation of a WFS request entity to its
corresponding KVP serialization format.
|
static void |
updateVersion(Document doc,
String wfsVersion)
Sets the @version attribute in the root element of the doc to the specified version
|
static Document |
wrapEntityInSOAPEnvelope(Source xmlSource,
String version)
Wraps the given XML request entity in the body of a SOAP envelope.
|
public static String transformEntityToKVP(Source xmlSource)
xmlSource
- A Source representing the XML request entity.public static Document wrapEntityInSOAPEnvelope(Source xmlSource, String version)
xmlSource
- The Source providing the XML request entity.version
- The version of the SOAP protocol (either "1.1" or "1.2"); if
not specified the latest version is assumed.public static Element appendSimpleQuery(Document doc, QName... qNames)
doc
- A Document representing a WFS request entity that accepts
wfs:Query elements as children of the document element
(GetFeature, GetPropertyValue, GetFeatureWithLock,
LockFeature).qNames
- A sequence of QName objects representing (qualified) feature
type names recognized by the IUT.public static void appendStoredQuery(Document doc, String queryId, Map<String,Object> params)
doc
- A Document representing a WFS request entity that accepts
wfs:StoredQuery elements as children of the document element
(GetFeature, GetPropertyValue, GetFeatureWithLock,
LockFeature).queryId
- A URI that identifies the stored query to invoke.params
- A Map containing query parameters (may be empty, e.g.
Collections.<String, Object>.emptyMap()). A
parameter name is associated with an Object (String or QName)
representing its value.public static Document createRequestEntity(String reqResource, String wfsVersion)
reqResource
- The name of a classpath resource containing an XML request
entity.wfsVersion
- A WFS version identifier ("2.0.0" if not specified).public static void updateVersion(Document doc, String wfsVersion)
doc
- the doc to update. never null
wfsVersion
- A WFS version identifier ("2.0.0" if not specified).public static void setTypeName(Element elem, QName qName)
elem
- An action element in a transaction request.qName
- The qualified name of a feature type.public static Element newResourceIdFilter(String id)
id
- A String denoting a GML object identifier (gml:id).public static void insertGMLProperty(Element feature, Element gmlProperty)
feature
- An Element node representing a GML featuregmlProperty
- An Element node representing a standard (non-deprecated) GML
feature property.public static Element createValueReference(org.apache.xerces.xs.XSElementDeclaration propertyElem)
propertyElem
- An element declaration that defines some feature property.public static Document createGMLEnvelope()
public static void addNamespaceBinding(Document doc, QName qName)
doc
- A Document representing a request entity.qName
- A QName containing a namespace URI and prefix; the local part
is ignored.public static void addReplaceStatements(Document trxRequest, List<Element> replacements)
trxRequest
- A Document node representing a wfs:Transaction request entity.replacements
- A List containing replacement feature representations (as
GML).public static void addInsertStatement(Document request, Node feature)
request
- A Document node representing a wfs:Transaction request entity.feature
- A Node representing a GML feature instance.public static void addResourceIdPredicate(Document request, Set<String> idSet)
request
- The request entity (/wfs:GetFeature/[wfs:Query]).idSet
- A Set<String> of feature identifiers that conform
to the xsd:ID datatype.public static boolean containsGetProtocolBinding(Object[] testParams)
ProtocolBinding.GET
object.testParams
- A list of objects representing test method parameters.public static List<Node> findMatchingElements(Document doc, org.apache.xerces.xs.XSElementDeclaration... elemDeclarations)
doc
- A Document node containing an XML entity.elemDeclarations
- A collection of element declarations.public static Set<String> extractFeatureIdentifiers(Document doc, QName featureType)
doc
- A WFS response entity that may contain feature instances.featureType
- The feature type of interest.public static void addTemporalPredicate(Document request, String temporalOp, Document gmlTime, Element valueRef)
request
- The request entity (wfs:GetFeature).temporalOp
- The name of a spatial operator.gmlTime
- A Document containing a GML temporal primitive.valueRef
- An Element (fes:ValueReference) that specifies the temporal
property to check. If it is null
, the predicate
applies to all temporal properties.public static void setReturnTypesAndTypeNamesAttribute(Document request, QName featureTypeName)
request
- request to modify, never null
featureTypeName
- name to set, never null
Copyright © 2022 Open Geospatial Consortium. All rights reserved.