2 * @requires OpenLayers/Format/WFST/v1.js
3 * @requires OpenLayers/Format/Filter/v1_0_0.js
7 * Class: OpenLayers.Format.WFST.v1_0_0
8 * A format for creating WFS v1.0.0 transactions. Create a new instance with the
9 * <OpenLayers.Format.WFST.v1_0_0> constructor.
12 * - <OpenLayers.Format.Filter.v1_0_0>
13 * - <OpenLayers.Format.WFST.v1>
15 OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class(
16 OpenLayers.Format.Filter.v1_0_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.0.0/WFS-transaction.xsd"
33 * Constructor: OpenLayers.Format.WFST.v1_0_0
34 * A class for parsing and generating WFS v1.0.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_0_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 "WFS_TransactionResponse": function(node, obj) {
65 this.readChildNodes(node, obj);
67 "InsertResult": function(node, container) {
69 this.readChildNodes(node, obj);
70 container.insertIds.push(obj.fids[0]);
72 "TransactionResult": function(node, obj) {
73 this.readChildNodes(node, obj);
75 "Status": function(node, obj) {
76 this.readChildNodes(node, obj);
78 "SUCCESS": function(node, obj) {
81 }, OpenLayers.Format.WFST.v1.prototype.readers["wfs"]),
82 "gml": OpenLayers.Format.GML.v2.prototype.readers["gml"],
83 "feature": OpenLayers.Format.GML.v2.prototype.readers["feature"],
84 "ogc": OpenLayers.Format.Filter.v1_0_0.prototype.readers["ogc"]
89 * As a compliment to the readers property, this structure contains public
90 * writing functions grouped by namespace alias and named like the
91 * node names they produce.
94 "wfs": OpenLayers.Util.applyDefaults({
95 "Query": function(options) {
96 options = OpenLayers.Util.extend({
97 featureNS: this.featureNS,
98 featurePrefix: this.featurePrefix,
99 featureType: this.featureType,
100 srsName: this.srsName
102 var node = this.createElementNSPlus("wfs:Query", {
104 typeName: (options.featureNS ? options.featurePrefix + ":" : "") +
108 if(options.featureNS) {
109 node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS);
111 if(options.propertyNames) {
112 for(var i=0,len = options.propertyNames.length; i<len; i++) {
115 {property: options.propertyNames[i]},
121 this.setFilterProperty(options.filter);
122 this.writeNode("ogc:Filter", options.filter, node);
126 }, OpenLayers.Format.WFST.v1.prototype.writers["wfs"]),
127 "gml": OpenLayers.Format.GML.v2.prototype.writers["gml"],
128 "feature": OpenLayers.Format.GML.v2.prototype.writers["feature"],
129 "ogc": OpenLayers.Format.Filter.v1_0_0.prototype.writers["ogc"]
132 CLASS_NAME: "OpenLayers.Format.WFST.v1_0_0"