[OpenLayers-Commits] r12073 - in sandbox/bartvde/wps/openlayers: lib/OpenLayers/Format/OWSCommon tests/Format

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Jun 8 10:35:18 EDT 2011


Author: bartvde
Date: 2011-06-08 07:35:16 -0700 (Wed, 08 Jun 2011)
New Revision: 12073

Modified:
   sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1_1_0.js
   sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html
Log:
writing complexData will require someone to write their own Format that extends WPSExecute so removing that testcase, adding a few writers for OWSCommon that I did in the process of trying to implement writing out that sample request

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-06-08 13:05:12 UTC (rev 12072)
+++ sandbox/bartvde/wps/openlayers/lib/OpenLayers/Format/OWSCommon/v1_1_0.js	2011-06-08 14:35:16 UTC (rev 12073)
@@ -62,6 +62,45 @@
         }, OpenLayers.Format.OWSCommon.v1.prototype.readers["ows"])
     },
 
+    /**
+     * Property: writers
+     * As a compliment to the readers property, this structure contains public
+     *     writing functions grouped by namespace alias and named like the
+     *     node names they produce.
+     */
+    writers: {
+        "ows": OpenLayers.Util.applyDefaults({
+            "Range": function(range) {
+                var node = this.createElementNSPlus("ows:Range", {
+                    attributes: {
+                        'ows:rangeClosure': range.closure
+                    }
+                });
+                this.writeNode("ows:MinimumValue", range.minValue, node);
+                this.writeNode("ows:MaximumValue", range.maxValue, node);
+                return node;
+            },
+            "MinimumValue": function(minValue) {
+                var node = this.createElementNSPlus("ows:MinimumValue", {
+                    value: minValue
+                });
+                return node;
+            },
+            "MaximumValue": function(maxValue) {
+                var node = this.createElementNSPlus("ows:MaximumValue", {
+                    value: maxValue
+                });
+                return node;
+            },
+            "Value": function(value) {
+                var node = this.createElementNSPlus("ows:Value", {
+                    value: value
+                });
+                return node;
+            }
+        }, OpenLayers.Format.OWSCommon.v1.prototype.writers["ows"])
+    },
+
     CLASS_NAME: "OpenLayers.Format.OWSCommon.v1_1_0"
 
 });

Modified: sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html
===================================================================
--- sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html	2011-06-08 13:05:12 UTC (rev 12072)
+++ sandbox/bartvde/wps/openlayers/tests/Format/WPSExecute.html	2011-06-08 14:35:16 UTC (rev 12073)
@@ -307,60 +307,6 @@
         t.xml_eq(result, expected, "WPS Execute written out correctly");
     }
 
-    function test_request_embedded_complex_data_input(t) {
-        t.plan(1);
-        // taken from http://geoprocessing.info/schemas/wps/1.0/examples/53_wpsExecute_request_ComplexValue.xml
-        var expected = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
-'<wps:Execute service="WPS" version="1.0.0" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" ' +
-'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0' +
-'	http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">' +
-'	<ows:Identifier>Reclassification</ows:Identifier>' +
-'	<wps:DataInputs>' +
-'		<wps:Input>' +
-'			<ows:Identifier>InputLayer</ows:Identifier>' +
-'			<ows:Title>The layer which\'s values shall be reclassified</ows:Title>' +
-'			<wps:Reference xlink:href="http://orchestra.pisa.intecs.it/geoserver/test/height.tif" method="GET"/>' +
-'		</wps:Input>' +
-'		<wps:Input>' +
-'			<ows:Identifier>BufferDistance</ows:Identifier>' +
-'			<ows:Title>Distance which people will walk to get to a playground.</ows:Title>' +
-'			<wps:Data>' +
-'				<wps:ComplexData>' +
-'					<RangeToValueMappings xmlns="http://mas.orchestra.jrc.it" xmlns:ows="http://www.opengeospatial.net/ows" ' +
-'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' +
-'						<Mapping>' +
-'							<ows:Range ows:rangeClosure="closed-open">' +
-'								<ows:MinimumValue>0</ows:MinimumValue>' +
-'								<ows:MaximumValue>119</ows:MaximumValue>' +
-'							</ows:Range>' +
-'							<ows:Value>A</ows:Value>' +
-'						</Mapping>' +
-'						<Mapping>' +
-'							<ows:Range ows:rangeClosure="closed-open">' +
-'								<ows:MinimumValue>120</ows:MinimumValue>' +
-'								<ows:MaximumValue/>' +
-'							</ows:Range>' +
-'							<ows:Value>B</ows:Value>' +
-'						</Mapping>' +
-'					</RangeToValueMappings>' +
-'				</wps:ComplexData>' +
-'			</wps:Data>' +
-'		</wps:Input>' +
-'	</wps:DataInputs>' +
-'	<wps:ResponseForm>' +
-'		<wps:ResponseDocument storeExecuteResponse="true" lineage="true" status="true">' +
-'			<wps:Output asReference="true">' +
-'				<ows:Identifier>Outlayer</ows:Identifier>' +
-'				<ows:Title>Reclassified Layer.</ows:Title>' +
-'				<ows:Abstract>Layer classified into two classes, where class A is less than or equal 120 and class B is more than 120.</ows:Abstract>' +
-'			</wps:Output>' +
-'		</wps:ResponseDocument>' +
-'	</wps:ResponseForm>' +
-'</wps:Execute>';
-
-        t.ok(true, "TODO");
-
-    }
     </script>
 </head>
 <body>



More information about the Commits mailing list