[OpenLayers-Commits] r11972 - in sandbox/bartvde/wps/openlayers:
lib/OpenLayers/Format lib/OpenLayers/Format/OWSCommon tests/Format
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed May 18 11:13:24 EDT 2011
Author: bartvde
Date: 2011-05-18 08:13:23 -0700 (Wed, 18 May 2011)
New Revision: 11972
Modified:
sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1.js
sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1_1_0.js
sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSExecute.js
sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html
Log:
work in progress on WPS Execute Format
Modified: sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1.js
===================================================================
--- sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1.js 2011-05-17 15:29:44 UTC (rev 11971)
+++ sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1.js 2011-05-18 15:13:23 UTC (rev 11972)
@@ -241,6 +241,11 @@
value: options.bounds.right + " " + options.bounds.top });
return node;
},
+ "Identifier": function(identifier) {
+ var node = this.createElementNSPlus("ows:Identifier", {
+ value: identifier });
+ return node;
+ },
"Title": function(title) {
var node = this.createElementNSPlus("ows:Title", {
value: title });
Modified: sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1_1_0.js
===================================================================
--- sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1_1_0.js 2011-05-17 15:29:44 UTC (rev 11971)
+++ sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1_1_0.js 2011-05-18 15:13:23 UTC (rev 11972)
@@ -61,7 +61,7 @@
}
}, OpenLayers.Format.OWSCommon.v1.prototype.readers["ows"])
},
-
+
CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_1_0"
});
Modified: sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSExecute.js
===================================================================
--- sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSExecute.js 2011-05-17 15:29:44 UTC (rev 11971)
+++ sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/WPSExecute.js 2011-05-18 15:13:23 UTC (rev 11972)
@@ -20,7 +20,7 @@
* {Object} Mapping of namespace aliases to namespace URIs.
*/
namespaces: {
- ows: "http://www.opengis.net/ows",
+ ows: "http://www.opengis.net/ows/1.1",
gml: "http://www.opengis.net/gml",
wps: "http://www.opengis.net/wps/1.0.0",
ogc: "http://www.opengis.net/ogc",
@@ -92,16 +92,43 @@
writers: {
"wps": {
"Execute": function(options) {
- var node = this.createElementNSPlus("Execute", {
+ var node = this.createElementNSPlus("wps:Execute", {
attributes: {
version: this.VERSION,
service: 'WPS'
}
});
- this.writeNode("ows:Identifier", options, node);
+ this.writeNode("ows:Identifier", options.identifier, node);
+ this.writeNode("wps:DataInputs", options.dataInputs, node);
return node;
+ },
+ "DataInputs": function(dataInputs) {
+ var node = this.createElementNSPlus("wps:DataInputs", {});
+ for (var i=0, ii=dataInputs.inputs.length; i<ii; ++i) {
+ this.writeNode("wps:Input", dataInputs.inputs[i], node);
+ }
+ return node;
+ },
+ "Input": function(input) {
+ var node = this.createElementNSPlus("wps:Input", {});
+ this.writeNode("ows:Identifier", input.identifier, node);
+ if (input.reference) {
+ this.writeNode("wps:Reference", input.reference, node);
+ }
+ return node;
+ },
+ "Reference": function(reference) {
+ var node = this.createElementNSPlus("wps:Reference", {
+ attributes: {
+ mimeType: reference.mimeType,
+ "xlink:href": reference.href,
+ method: reference.method
+ }
+ });
+ return node;
}
- }
+ },
+ "ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows
},
CLASS_NAME: "OpenLayers.Format.WPSExecute"
Modified: sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html
===================================================================
--- sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html 2011-05-17 15:29:44 UTC (rev 11971)
+++ sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html 2011-05-18 15:13:23 UTC (rev 11972)
@@ -51,6 +51,11 @@
' </wps:ResponseForm>' +
'</wps:Execute>';
+ var format = new OpenLayers.Format.WPSExecute();
+ var result = format.write({identifier: "JTS:area", dataInputs: {inputs: [{identifier: 'geom',
+ reference: {mimeType: "text/xml; subtype=gml/3.1.1", href: "http://geoserver/wps", method: "POST"}
+ }]}});
+ console.log(result);
}
</script>
More information about the Commits
mailing list