2 * @requires OpenLayers/Format/WFST/v1.js
3 * @requires OpenLayers/Format/Filter/v1_1_0.js
7 * Class: OpenLayers.Format.WFST.v1_1_0
8 * A format for creating WFS v1.1.0 transactions. Create a new instance with the
9 * <OpenLayers.Format.WFST.v1_1_0> constructor.
12 * - <OpenLayers.Format.Filter.v1_1_0>
13 * - <OpenLayers.Format.WFST.v1>
15 OpenLayers.Format.WFST.v1_1_0 = OpenLayers.Class(
16 OpenLayers.Format.Filter.v1_1_0, OpenLayers.Format.WFST.v1, {
20 * {String} WFS version number.
25 * Property: schemaLocations
26 * {Object} Properties are namespace aliases, values are schema locations.
29 "wfs": "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
33 * Constructor: OpenLayers.Format.WFST.v1_1_0
34 * A class for parsing and generating WFS v1.1.0 transactions.
37 * options - {Object} Optional object whose properties will be set on the
40 * Valid options properties:
41 * featureType - {String} Local (without prefix) feature typeName (required).
42 * featureNS - {String} Feature namespace (optional).
43 * featurePrefix - {String} Feature namespace alias (optional - only used
44 * if featureNS is provided). Default is 'feature'.
45 * geometryName - {String} Name of geometry attribute. Default is 'the_geom'.
47 initialize: function(options) {
48 OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this, [options]);
49 OpenLayers.Format.WFST.v1.prototype.initialize.apply(this, [options]);
54 * Contains public functions, grouped by namespace prefix, that will
55 * be applied when a namespaced node is found matching the function
56 * name. The function will be applied in the scope of this parser
57 * with two arguments: the node being read and a context object passed
61 "wfs": OpenLayers.Util.applyDefaults({
62 "TransactionResponse": function(node, obj) {
65 this.readChildNodes(node, obj);
67 "TransactionSummary": function(node, obj) {
68 // this is a limited test of success
71 "InsertResults": function(node, obj) {
72 this.readChildNodes(node, obj);
74 "Feature": function(node, container) {
76 this.readChildNodes(node, obj);
77 container.insertIds.push(obj.fids[0]);
79 }, OpenLayers.Format.WFST.v1.prototype.readers["wfs"]),
80 "gml": OpenLayers.Format.GML.v3.prototype.readers["gml"],
81 "feature": OpenLayers.Format.GML.v3.prototype.readers["feature"],
82 "ogc": OpenLayers.Format.Filter.v1_1_0.prototype.readers["ogc"]
87 * As a compliment to the readers property, this structure contains public
88 * writing functions grouped by namespace alias and named like the
89 * node names they produce.
92 "wfs": OpenLayers.Util.applyDefaults({
93 "Query": function(options) {
94 options = OpenLayers.Util.extend({
95 featureNS: this.featureNS,
96 featurePrefix: this.featurePrefix,
97 featureType: this.featureType,
100 var node = this.createElementNSPlus("wfs:Query", {
102 typeName: (options.featureNS ? options.featurePrefix + ":" : "") +
104 srsName: options.srsName
107 if(options.featureNS) {
108 node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS);
110 if(options.propertyNames) {
111 for(var i=0,len = options.propertyNames.length; i<len; i++) {
114 {property: options.propertyNames[i]},
120 this.setFilterProperty(options.filter);
121 this.writeNode("ogc:Filter", options.filter, node);
125 "PropertyName": function(obj) {
126 return this.createElementNSPlus("wfs:PropertyName", {
130 }, OpenLayers.Format.WFST.v1.prototype.writers["wfs"]),
131 "gml": OpenLayers.Format.GML.v3.prototype.writers["gml"],
132 "feature": OpenLayers.Format.GML.v3.prototype.writers["feature"],
133 "ogc": OpenLayers.Format.Filter.v1_1_0.prototype.writers["ogc"]
136 CLASS_NAME: "OpenLayers.Format.WFST.v1_1_0"