[OpenLayers-Commits] r10961 -
sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Tue Dec 14 09:29:33 EST 2010
Author: fvanderbiest
Date: 2010-12-14 06:29:33 -0800 (Tue, 14 Dec 2010)
New Revision: 10961
Modified:
sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js
Log:
camptocamp/ifremer sandbox: added basic support for gmd & gco namespaces in CSW getRecords format
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-12-14 08:07:29 UTC (rev 10960)
+++ sandbox/camptocamp/ifremer/openlayers/lib/OpenLayers/Format/CSWGetRecords/v2_0_2.js 2010-12-14 14:29:33 UTC (rev 10961)
@@ -32,9 +32,12 @@
csw: "http://www.opengis.net/cat/csw/2.0.2",
dc: "http://purl.org/dc/elements/1.1/",
dct: "http://purl.org/dc/terms/",
+ gco: "http://www.isotc211.org/2005/gco",
+ geonet: "http://www.fao.org/geonetwork",
+ gmd: "http://www.isotc211.org/2005/gmd",
+ gml: "http://www.opengis.net/gml",
ogc: "http://www.opengis.net/ogc",
ows: "http://www.opengis.net/ows",
- geonet: "http://www.fao.org/geonetwork"
},
/**
@@ -240,6 +243,21 @@
obj[name] = this.getChildValue(node);
}
},
+ "gco": {
+ "Measure": function(node, obj) {
+ obj.Measure = {
+ value: this.getChildValue(node),
+ };
+ var attrs = node.attributes;
+ for(var i=0, len=attrs.length; i<len; ++i) {
+ obj.Measure[attrs[i].name] = attrs[i].nodeValue;
+ }
+ },
+ "*": function(node, obj) {
+ var name = node.localName || node.nodeName.split(":").pop();
+ obj[name] = {value: this.getChildValue(node)};
+ }
+ },
"geonet": {
"info": function(node, obj) {
var gninfo = {};
@@ -247,6 +265,210 @@
obj.gninfo = gninfo;
}
},
+ "gmd": {
+ "MD_Metadata": function(node, obj) {
+ var record = {type: "MD_Metadata"};
+ this.readChildNodes(node, record);
+ obj.records.push(record);
+ },
+ "MD_TopicCategoryCode": function(node, obj) {
+ obj.topicCategoryCode = this.getChildValue(node);
+ },
+ "URL": function(node, obj) {
+ obj.URL = this.getChildValue(node);
+ },
+ "*": function(node, obj) {
+ var name = node.localName || node.nodeName.split(":").pop();
+ if (name in this.readers.gmd._createOneChild) {
+ obj[name] = this.readChildNodes(node);
+ } else if (name in this.readers.gmd._createManyChildren) {
+ if (!(obj[name] instanceof Array)) {
+ obj[name] = [];
+ }
+ obj[name].push(this.readChildNodes(node));
+ } else if (name in this.readers.gmd._pass) {
+ this.readChildNodes(node, obj);
+ } else if (name in this.readers.gmd._readAttributes) {
+ var attrs = node.attributes;
+ for(var i=0, len=attrs.length; i<len; ++i) {
+ obj[attrs[i].name] = attrs[i].nodeValue;
+ }
+ }
+ },
+ "_readAttributes": {
+ "CI_RoleCode": null,
+ "MD_ProgressCode": null,
+ "MD_KeywordTypeCode": null,
+ "MD_RestrictionCode": null,
+ "MD_SpatialRepresentationTypeCode": null,
+ "MD_CharacterSetCode": null,
+ "CI_DateTypeCode": null,
+ "MD_TopologyLevelCode": null,
+ "MD_GeometricObjectTypeCode": null,
+ "MD_DimensionNameTypeCode": null,
+ "MD_CellGeometryCode": null,
+ "MD_MaintenanceFrequencyCode": null,
+ "MD_ScopeCode": null
+ },
+ "_pass": {
+ "CI_ResponsibleParty": null,
+ "CI_Contact": null,
+ "CI_Telephone": null,
+ "CI_Address": null,
+ "MD_DataIdentification": null,
+ "MD_Keywords": null,
+ "MD_LegalConstraints": null,
+ "MD_Resolution": null,
+ "MD_RepresentativeFraction": null,
+ "EX_Extent": null,
+ "EX_GeographicBoundingBox": null,
+ "EX_TemporalExtent": null,
+ "MD_Distribution": null,
+ "MD_Distributor": null,
+ "MD_DigitalTransferOptions": null,
+ "MD_Format": null,
+ "MD_Medium": null,
+ "CI_OnlineResource": null,
+ "MD_ReferenceSystem": null,
+ "RS_Identifier": null,
+ "CI_Citation": null,
+ "CI_Date": null,
+ "MD_GridSpatialRepresentation": null,
+ "MD_VectorSpatialRepresentation": null,
+ "MD_GeometricObjects": null,
+ "MD_Dimension": null,
+ "MD_MaintenanceInformation": null,
+ "MD_ScopeDescription": null
+ },
+ "_createManyChildren": {
+ "contact": null,
+ "voice": null,
+ "facsimile": null,
+ "deliveryPoint": null,
+ "electronicMailAddress": null,
+ "identificationInfo": null,
+ "pointOfContact": null,
+ "status": null,
+ "descriptiveKeywords": null,
+ "keyword": null,
+ "resourceConstraints": null,
+ "useLimitation": null,
+ "accessConstraints": null,
+ "useConstraints": null,
+ "otherConstraints": null,
+ "spatialResolution": null,
+ "spatialRepresentationType": null,
+ "language": null,
+ "characterSet": null,
+ "topicCategory": null,
+ "extent": null,
+ "geographicElement": null,
+ "temporalElement": null,
+ "distributor": null,
+ "transferOptions": null,
+ "distributionFormat": null,
+ "distributionOrderProcess": null,
+ "distributorFormat": null,
+ "formatDistributor": null,
+ "distributorTransferOptions": null,
+ "onLine": null,
+ "referenceSystemInfo": null,
+ "alternateTitle": null,
+ "date": null,
+ "identifier": null,
+ "citedResponsibleParty": null,
+ "presentationForm": null,
+ "spatialRepresentationInfo": null,
+ "geometricObjects": null,
+ "axisDimensionProperties": null,
+ "resourceMaintenance": null,
+ "updateScope": null,
+ "updateScopeDescription": null,
+ "maintenanceNote": null,
+ "attributes": null,
+ "features": null,
+ "featureInstances": null,
+ "attributeInstances": null
+ },
+ "_createOneChild": {
+ "other":null,
+ "maintenanceAndUpdateFrequency":null,
+ "userDefinedMaintenanceFrequency":null,
+ "dataset":null,
+ "citation":null,
+ "dateOfNextUpdate":null,
+ "dimensionName":null,
+ "dimensionSize":null,
+ "resolution":null,
+ "numberOfDimensions":null,
+ "cellGeometry":null,
+ "transformationParameterAvailability":null,
+ "geometricObjectType":null,
+ "geometricObjectCount":null,
+ "topologyLevel":null,
+ "dateType":null,
+ "title":null,
+ "edition":null,
+ "editionDate":null,
+ "series":null,
+ "otherCitationDetails":null,
+ "collectiveTitle":null,
+ "ISBN":null,
+ "ISSN":null,
+ "authority":null,
+ "code":null,
+ "referenceSystemIdentifier":null,
+ "linkage":null,
+ "unitsOfDistribution":null,
+ "transferSize":null,
+ "offLine":null,
+ "name":null,
+ "version":null,
+ "amendmentNumber":null,
+ "specification":null,
+ "fileDecompressionTechnique":null,
+ "distributorContact":null,
+ "distributionInfo":null,
+ "westBoundLongitude":null,
+ "eastBoundLongitude":null,
+ "southBoundLatitude":null,
+ "northBoundLatitude":null,
+ "supplementalInformation":null,
+ "denominator":null,
+ "equivalentScale":null,
+ "type":null,
+ "purpose":null,
+ "abstract":null,
+ "city":null,
+ "administrativeArea":null,
+ "postalCode":null,
+ "country":null,
+ "address":null,
+ "phone":null,
+ "contactInfo":null,
+ "role": null,
+ "fileIdentifier": null,
+ "language": null,
+ "dateStamp": null,
+ "metadataStandardName": null,
+ "metadataStandardVersion": null,
+ "individualName": null,
+ "organisationName":null,
+ "positionName":null
+ }
+ },
+ "gml": { // TODO: should be elsewhere
+ "TimePeriod": function(node, obj) {
+ obj.TimePeriod = {};
+ this.readChildNodes(node, obj.TimePeriod);
+ },
+ "beginPosition": function(node, obj) {
+ obj.beginPosition = this.getChildValue(node);
+ },
+ "endPosition": function(node, obj) {
+ obj.endPosition = this.getChildValue(node);
+ }
+ },
"dc": {
// audience, contributor, coverage, creator, date, description, format,
// identifier, language, provenance, publisher, relation, rights,
More information about the Commits
mailing list