[OpenLayers-Commits] r10924 - sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Nov 29 04:09:45 EST 2010


Author: fvanderbiest
Date: 2010-11-29 01:09:45 -0800 (Mon, 29 Nov 2010)
New Revision: 10924

Modified:
   sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js
Log:
camptocamp/ifremer sandbox: applying patch 2952_A0

Modified: sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js
===================================================================
--- sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js	2010-11-29 09:06:33 UTC (rev 10923)
+++ sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js	2010-11-29 09:09:45 UTC (rev 10924)
@@ -32,6 +32,7 @@
         csw: "http://www.opengis.net/cat/csw/2.0.2",
         dc: "http://purl.org/dc/elements/1.1/",
         dct: "http://purl.org/dc/terms/",
+        ogc: "http://www.opengis.net/ogc",
         ows: "http://www.opengis.net/ows"
     },
     
@@ -304,6 +305,45 @@
      *     node names they produce.
      */
     writers: {
+        "ogc": {
+            "SortBy": function(options) {
+                var node = this.createElementNSPlus("ogc:SortBy");
+                if (options.SortProperty) {
+                    this.writeNode(
+                        "ogc:SortProperty",
+                        options.SortProperty,
+                        node
+                    );
+                }
+                return node;
+            }, 
+            "SortProperty": function(options) {
+                var node = this.createElementNSPlus("ogc:SortProperty");
+                this.writeNode(
+                    "ogc:PropertyName",
+                    options.PropertyName,
+                    node
+                );
+                this.writeNode(
+                    "ogc:SortOrder",
+                    options.SortOrder ? options.SortOrder : 'ASC',
+                    node
+                );
+                return node;
+            },
+            "PropertyName": function(value) {
+                var node = this.createElementNSPlus("ogc:PropertyName", {
+                    value: value
+                });
+                return node;
+            },
+            "SortOrder": function(value) {
+                var node = this.createElementNSPlus("ogc:SortOrder", {
+                    value: value
+                });
+                return node;
+            }
+        },
         "csw": {
             "GetRecords": function(options) {
                 if (!options) {
@@ -389,14 +429,13 @@
                         node
                     );
                 }
-                //TODO: not implemented in ogc filters?
-                //if (options.SortBy) {
-                    //this.writeNode(
-                        //"ogc:SortBy",
-                        //options.SortBy,
-                        //node
-                    //);
-                //}
+                if (options.SortBy) {
+                    this.writeNode(
+                        "ogc:SortBy",
+                        options.SortBy,
+                        node
+                    );
+                }
                 return node;
             },
             "ElementName": function(options) {



More information about the Commits mailing list