Source: api/SpwCSWMetawal.js

Retour à la documentation
define([
    'dojo/_base/declare',
    'dojo/_base/array',
    'dojo/_base/lang',
    'spw/api/SpwCSWCatalog',
    'spw/api/SpwViewer',

    'spw/libs/Jsonix-all',

    'spw/libs/ogc/OWS_1_0_0',
    'spw/libs/ogc/DC_1_1_metawal',
    'spw/libs/ogc/DCT',
    'spw/libs/ogc/XLink_1_0',
    'spw/libs/ogc/CSW_2_0_2_metawal',
    'spw/libs/ogc/Filter_1_1_0',
    'spw/libs/ogc/GML_3_1_1',
    'spw/libs/ogc/SMIL_2_0_Language',
    'spw/libs/ogc/SMIL_2_0',
    'spw/libs/ogc/GML_3_2_0',
    'spw/libs/ogc/ISO19139_GCO_20060504',
    'spw/libs/ogc/ISO19139_GMD_20060504',
    'spw/libs/ogc/ISO19139_GTS_20060504',
    'spw/libs/ogc/ISO19139_GSS_20060504',
    'spw/libs/ogc/ISO19139_GSR_20060504',
    'spw/libs/ogc/ISO19139_GMX_20060504',
    'spw/libs/ogc/ISO19139_SRV_20060504'
],
function(declare, array, lang, SpwCSWCatalog, SpwViewer, Jsonix, OWS_1_0_0, DC_1_1, DCT, XLink_1_0,
    CSW_2_0_2, Filter_1_1_0, GML_3_1_1, SMIL_2_0_Language, SMIL_2_0, GML_3_2_0, ISO19139_GCO_20060504,
    ISO19139_GMD_20060504, ISO19139_GTS_20060504, ISO19139_GSS_20060504, ISO19139_GSR_20060504,
    ISO19139_GMX_20060504, ISO19139_SRV_20060504) {

	/**
	 * @class spw.api.SpwCSWMetawal
     * @classdesc Classe permettant d'interroger le service CSW Metawal. Nécessaire car ce service ne respecte pas le standard
     * @extends {spw.api.SpwCSWCatalog}
     */
    return declare('spw.api.SpwCSWMetawal', [SpwCSWCatalog], /** @lends spw.api.SpwCSWMetawal.prototype */{

    	
        /**
         * Initialise le contexte jsonix, le mapping des propriétés et les protocoles
         */
        initContext: function() {
            this.propertiesMapping = {
                'dc:identifier': {
                    property: 'id',
                    type: 'value',
                    label: 'Id'
                },
                'dc:date': {
                    property: 'date',
                    type: 'value',
                    label: 'Date'
                },
                'dc:title': {
                    property: 'title',
                    type: 'value',
                    label: 'Titre'
                },
                'dc:subject': {
                    property: 'subjects',
                    type: 'array',
                    label: 'Mots-clés'
                },
                'dct:abstract': {
                    property: 'abstract',
                    type: 'value',
                    label: 'Longue description'
                },
                'dc:description': {
                    property: 'description',
                    type: 'value',
                    label: 'Description'
                },
                'dc:rights': {
                    property: 'rights',
                    type: 'value',
                    label: 'Droits'
                },
                'dc:language': {
                    property: 'language',
                    type: 'value',
                    label: 'Langue'
                },
                'dc:source': {
                    property: 'source',
                    type: 'value',
                    label: 'Source'
                },
                'dc:type': {
                    property: 'type',
                    type: 'value',
                    label: 'Type'
                },
                'dc:URI': {
                    property: 'uri',
                    type: 'array',
                    label: 'Liens',
                    descriptionProperty: 'description',
                    nameProperty: 'name',
                    protocolProperty: 'protocol'
                }
            };

            this.serviceProperty = 'dc:URI';

            this.protocols = [{
                protocol: 'ESRI:REST',
                priority: 10,
                config: {
                    type: 'AGS_DYNAMIC',
                    hasLegend: true,
                    alpha: 100,
                    toLoad: true,
                    visible: true,
                    identifiable: true
                }
            }, {
                protocol: 'OGC:WMS',
                config: {
                    type: 'WMS',
                    hasLegend: true,
                    alpha: 100,
                    toLoad: true,
                    visible: true,
                    identifiable: false,
                    wmsParameters: {}
                }
            }];

            this.jsonixContext = new Jsonix.Jsonix.Context([
                OWS_1_0_0.OWS_1_0_0,
                DC_1_1.DC_1_1,
                DCT.DCT,
                XLink_1_0.XLink_1_0,
                SMIL_2_0.SMIL_2_0,
                SMIL_2_0_Language.SMIL_2_0_Language,
                GML_3_1_1.GML_3_1_1,
                Filter_1_1_0.Filter_1_1_0,
                CSW_2_0_2.CSW_2_0_2,
                GML_3_2_0.GML_3_2_0,
                ISO19139_GSS_20060504.ISO19139_GSS_20060504,
                ISO19139_GSR_20060504.ISO19139_GSR_20060504,
                ISO19139_GTS_20060504.ISO19139_GTS_20060504,
                ISO19139_GMD_20060504.ISO19139_GMD_20060504,
                ISO19139_GCO_20060504.ISO19139_GCO_20060504,
                ISO19139_SRV_20060504.ISO19139_SRV_20060504
            ], {
                namespacePrefixes: {
                    'http://www.opengis.net/cat/csw/2.0.2': 'csw',
                    'http://www.opengis.net/ogc': 'ogc',
                    'http://www.opengis.net/gml': 'gml',
                    'http://purl.org/dc/elements/1.1/':'dc',
                    'http://purl.org/dc/terms/':'dct',
                    'http://www.isotc211.org/2005/gmd' : 'gmd',
                    'http://www.isotc211.org/2005/gco' : 'gco'
                },
                mappingStyle: 'simplified'
            });
        }

    });
});