[fusion-commits] r2252 - in trunk: . lib/OpenLayers

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Oct 19 13:44:10 EDT 2010


Author: madair
Date: 2010-10-19 10:44:10 -0700 (Tue, 19 Oct 2010)
New Revision: 2252

Modified:
   trunk/fusion.cfg
   trunk/lib/OpenLayers/OpenLayers.js
Log:
adding format version files for WFS capabilities

Modified: trunk/fusion.cfg
===================================================================
--- trunk/fusion.cfg	2010-10-19 14:48:02 UTC (rev 2251)
+++ trunk/fusion.cfg	2010-10-19 17:44:10 UTC (rev 2252)
@@ -45,6 +45,9 @@
 OpenLayers/Format/GML/v2.js
 OpenLayers/Format/GML/v3.js
 OpenLayers/Format/WFSCapabilities.js
+OpenLayers/Format/WFSCapabilities/v1.js
+OpenLayers/Format/WFSCapabilities/v1_0_0.js
+OpenLayers/Format/WFSCapabilities/v1_1_0.js
 OpenLayers/Format/WFSDescribeFeatureType.js
 OpenLayers/Handler/Box.js
 OpenLayers/Handler/Click.js

Modified: trunk/lib/OpenLayers/OpenLayers.js
===================================================================
--- trunk/lib/OpenLayers/OpenLayers.js	2010-10-19 14:48:02 UTC (rev 2251)
+++ trunk/lib/OpenLayers/OpenLayers.js	2010-10-19 17:44:10 UTC (rev 2252)
@@ -25001,6 +25001,136 @@
     }
 };    
 /* ======================================================================
+    OpenLayers/Format/WFSCapabilities/v1.js
+   ====================================================================== */
+
+/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for 
+ * full list of contributors). Published under the Clear BSD license.  
+ * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/WFSCapabilities.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WFSCapabilities.v1
+ * Abstract class not to be instantiated directly.
+ * 
+ * Inherits from:
+ *  - <OpenLayers.Format.XML>
+ */
+OpenLayers.Format.WFSCapabilities.v1 = OpenLayers.Class(
+    OpenLayers.Format.WFSCapabilities, {
+    
+    /**
+     * Constructor: OpenLayers.Format.WFSCapabilities.v1_1
+     * Create an instance of one of the subclasses.
+     *
+     * Parameters:
+     * options - {Object} An optional object whose properties will be set on
+     *     this instance.
+     */
+    initialize: function(options) {
+        OpenLayers.Format.XML.prototype.initialize.apply(this, [options]);
+        this.options = options;
+    },
+
+    /**
+     * APIMethod: read
+     * Read capabilities data from a string, and return a list of layers. 
+     * 
+     * Parameters: 
+     * data - {String} or {DOMElement} data to read/parse.
+     *
+     * Returns:
+     * {Array} List of named layers.
+     */
+    read: function(data) {
+        if(typeof data == "string") {
+            data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
+        }
+        var capabilities = {};
+        var root = data.documentElement;
+        this.runChildNodes(capabilities, root);
+        return capabilities;
+    },
+    
+    /**
+     * Method: runChildNodes
+     */
+    runChildNodes: function(obj, node) {
+        var children = node.childNodes;
+        var childNode, processor;
+        for(var i=0; i<children.length; ++i) {
+            childNode = children[i];
+            if(childNode.nodeType == 1) {
+                processor = this["read_cap_" + childNode.nodeName];
+                if(processor) {
+                    processor.apply(this, [obj, childNode]);
+                }
+            }
+        }
+    },
+    
+    /**
+     * Method: read_cap_FeatureTypeList
+     */
+    read_cap_FeatureTypeList: function(request, node) {
+        var featureTypeList = {
+            featureTypes: []
+        };
+        this.runChildNodes(featureTypeList, node);
+        request.featureTypeList = featureTypeList;
+    },
+    
+    /**
+     * Method: read_cap_FeatureType
+     */
+    read_cap_FeatureType: function(featureTypeList, node, parentLayer) {
+        var featureType = {};
+        this.runChildNodes(featureType, node);
+        featureTypeList.featureTypes.push(featureType);
+    },
+    
+    /**
+     * Method: read_cap_Name
+     */
+    read_cap_Name: function(obj, node) {
+        var name = this.getChildValue(node);
+        if(name) {
+            var parts = name.split(":");
+            obj.name = parts.pop();
+            if(parts.length > 0) {
+                obj.featureNS = this.lookupNamespaceURI(node, parts[0]);
+            }
+        }
+    },
+
+    /**
+     * Method: read_cap_Title
+     */
+    read_cap_Title: function(obj, node) {
+        var title = this.getChildValue(node);
+        if(title) {
+            obj.title = title;
+        }
+    },
+
+    /**
+     * Method: read_cap_Abstract
+     */
+    read_cap_Abstract: function(obj, node) {
+        var abst = this.getChildValue(node);
+        if(abst) {
+            obj["abstract"] = abst;
+        }
+    },
+    
+    CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1" 
+
+});
+/* ======================================================================
     OpenLayers/Handler/Box.js
    ====================================================================== */
 
@@ -27571,6 +27701,207 @@
     CLASS_NAME: "OpenLayers.Control.ZoomBox"
 });
 /* ======================================================================
+    OpenLayers/Format/WFSCapabilities/v1_0_0.js
+   ====================================================================== */
+
+/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for 
+ * full list of contributors). Published under the Clear BSD license.  
+ * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/WFSCapabilities/v1.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WFSCapabilities/v1_0_0
+ * Read WMS Capabilities version 1.0.0.
+ * 
+ * Inherits from:
+ *  - <OpenLayers.Format.WFSCapabilities>
+ */
+OpenLayers.Format.WFSCapabilities.v1_0_0 = OpenLayers.Class(
+    OpenLayers.Format.WFSCapabilities.v1, {
+    
+    /**
+     * Constructor: OpenLayers.Format.WFSCapabilities.v1_0_0
+     * Create a new parser for WFS capabilities version 1.0.0.
+     *
+     * Parameters:
+     * options - {Object} An optional object whose properties will be set on
+     *     this instance.
+     */
+    initialize: function(options) {
+        OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(
+            this, [options]
+        );
+    },
+    
+    /**
+     * Method: read_cap_Service
+     */
+    read_cap_Service: function(capabilities, node) {
+        var service = {};
+        this.runChildNodes(service, node);
+        capabilities.service = service;
+    },
+
+    /**
+     * Method: read_cap_Fees
+     */
+    read_cap_Fees: function(service, node) {
+        var fees = this.getChildValue(node);
+        if (fees && fees.toLowerCase() != "none") {
+            service.fees = fees;
+        }
+    },
+
+    /**
+     * Method: read_cap_AccessConstraints
+     */
+    read_cap_AccessConstraints: function(service, node) {
+        var constraints = this.getChildValue(node);
+        if (constraints && constraints.toLowerCase() != "none") {
+            service.accessConstraints = constraints;
+        }
+    },
+    
+    /**
+     * Method: read_cap_OnlineResource
+     */
+    read_cap_OnlineResource: function(service, node) {
+        var onlineResource = this.getChildValue(node);
+        if (onlineResource && onlineResource.toLowerCase() != "none") {
+            service.onlineResource = onlineResource;
+        }
+    },
+    
+    /**
+     * Method: read_cap_Keywords
+     */
+    read_cap_Keywords: function(service, node) {
+        var keywords = this.getChildValue(node);
+        if (keywords && keywords.toLowerCase() != "none") {
+            service.keywords = keywords.split(', ');
+        }
+    },
+    
+    /**
+     * Method: read_cap_Capability
+     */
+    read_cap_Capability: function(capabilities, node) {
+        var capability = {};
+        this.runChildNodes(capability, node);
+        capabilities.capability = capability;
+    },
+    
+    /**
+     * Method: read_cap_Request
+     */
+    read_cap_Request: function(obj, node) {
+        var request = {};
+        this.runChildNodes(request, node);
+        obj.request = request;
+    },
+    
+    /**
+     * Method: read_cap_GetFeature
+     */
+    read_cap_GetFeature: function(request, node) {
+        var getfeature = {
+            href: {}, // DCPType
+            formats: [] // ResultFormat
+        };
+        this.runChildNodes(getfeature, node);
+        request.getfeature = getfeature;
+    },
+    
+    /**
+     * Method: read_cap_ResultFormat
+     */
+    read_cap_ResultFormat: function(obj, node) {
+        var children = node.childNodes;
+        var childNode;
+        for(var i=0; i<children.length; i++) {
+            childNode = children[i];
+            if(childNode.nodeType == 1) {
+                obj.formats.push(childNode.nodeName);
+            }
+        }
+    },
+    
+    /**
+     * Method: read_cap_DCPType
+     */
+    read_cap_DCPType: function(obj, node) {
+        this.runChildNodes(obj, node);
+    },
+    
+    /**
+     * Method: read_cap_HTTP
+     */
+    read_cap_HTTP: function(obj, node) {
+        this.runChildNodes(obj.href, node);
+    },
+    
+    /**
+     * Method: read_cap_Get
+     */
+    read_cap_Get: function(obj, node) {
+        obj.get = node.getAttribute("onlineResource");
+    },
+    
+    /**
+     * Method: read_cap_Post
+     */
+    read_cap_Post: function(obj, node) {
+        obj.post = node.getAttribute("onlineResource");
+    },
+    
+    CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1_0_0" 
+
+});
+/* ======================================================================
+    OpenLayers/Format/WFSCapabilities/v1_1_0.js
+   ====================================================================== */
+
+/* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for 
+ * full list of contributors). Published under the Clear BSD license.  
+ * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * full text of the license. */
+
+/**
+ * @requires OpenLayers/Format/WFSCapabilities/v1.js
+ */
+
+/**
+ * Class: OpenLayers.Format.WFSCapabilities/v1_1_0
+ * Read WFS Capabilities version 1.1.0.
+ * 
+ * Inherits from:
+ *  - <OpenLayers.Format.WFSCapabilities>
+ */
+OpenLayers.Format.WFSCapabilities.v1_1_0 = OpenLayers.Class(
+    OpenLayers.Format.WFSCapabilities.v1, {
+    
+    /**
+     * Constructor: OpenLayers.Format.WFSCapabilities.v1_1_0
+     * Create a new parser for WFS capabilities version 1.1.0.
+     *
+     * Parameters:
+     * options - {Object} An optional object whose properties will be set on
+     *     this instance.
+     */
+    initialize: function(options) {
+        OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(
+            this, [options]
+        );
+    },
+
+    CLASS_NAME: "OpenLayers.Format.WFSCapabilities.v1_1_0" 
+
+});
+/* ======================================================================
     OpenLayers/Format/WKT.js
    ====================================================================== */
 



More information about the fusion-commits mailing list