Skip to content

Metadata Explorer plugin

Riccardo Mari edited this page May 27, 2013 · 15 revisions

Introduction

This plugin allows you to interact with the catalogs that comply with the standard CSW - Catalog Service for the Web using the Metadata Explorer, an indipendent JavaScript component of MapStore.

Needed Files

Include in buildjs these files:

  • gxp/src/script/plugins/MetadataExplorer.js
  • gxp/src/script/plugins/AddLayer.js

Configuration Example

This plugin can be configured as outputTarget that as actionTarget

REMARK: you need to add to the plugin configuration tools also addLayer because it is used to add layers to the map from the Metadata Explorer

"outputTarget" configuration

    ...
    "customPanels":[
        ...
        {
            "xtype": "panel",
            "title": "Metadata Explorer",
            "iconCls": "csw-viewer",             
            "border": false,
            "id": "south",
            "region": "south",
            "layout": "fit",
            "split":true,
            "height": 330,
            "collapsed": true,
            "collapsible": true,
            "ctCls": "south-panel",
            "header": true
        }
    ],

	"customTools":[
                ...
                {
			"ptype": "gxp_metadataexplorer",
			"id": "metadataexplorer",
            "outputTarget": "south",
            "saveState":true, 
            "cswconfig": {
                "catalogs": [
                        {"name": "CSI Piemonte", "url": "http://www.ruparpiemonte.it/geocatalogorp/geonetworkrp/srv/it/csw", "description": "GeoPortale della Regione Piemonte"}
                    ],
                "dcProperty": "title",
                "initialBBox": {
                    "minx": 11.145,
                    "miny": 43.718,
                    "maxx": 11.348,
                    "maxy": 43.84
                },
                "cswVersion": "2.0.2",
                "filterVersion": "1.1.0",
                "start": 1,
                "limit": 10,
                "timeout": 60000
            }            
		}, {
			"ptype": "gxp_addlayer",
			"showCapabilitiesGrid": true,
			"id": "addlayer"
		}
          ...
    ]
    ...

"actionTarget" configuration

As for the outputTarget but without the south panel and with "actionTarget": {"target": "paneltbar", "index": 16} in place of "outputTarget": "south"

  ...
	"customTools":[
                ...
                {
			"ptype": "gxp_metadataexplorer",
			"id": "metadataexplorer",
            "actionTarget": {"target": "paneltbar", "index": 16},
            "saveState":true,
            "cswconfig": {
                "catalogs": [
                        {"name": "CSI Piemonte", "url": "http://www.ruparpiemonte.it/geocatalogorp/geonetworkrp/srv/it/csw", "description": "GeoPortale della Regione Piemonte"}
                    ],
                "dcProperty": "title",
                "initialBBox": {
                    "minx": 11.145,
                    "miny": 43.718,
                    "maxx": 11.348,
                    "maxy": 43.84
                },
                "cswVersion": "2.0.2",
                "filterVersion": "1.1.0",
                "start": 1,
                "limit": 10,
                "timeout": 60000
            }            
		}, {
			"ptype": "gxp_addlayer",
			"showCapabilitiesGrid": true,
			"id": "addlayer"
		}
          ...
    ]
    ...

Configurations properties

  • "ptype": ptype of the plugin
  • "id": id of the plugin
  • "outpuTarget" or "actionTarget" : plugin target (plugin general configuration)
  • "saveState" : set to true to enable to save the plugin's state
  • "cswconfig": An object that contains the configuration parameters of the components
    • "catalags": Array of catalogs. Each element of this array contains the following fields: name,url,description
    • "dcProperties": Property 'Dublin Core to be included as a parameter in the advanced search.
    • "initialBBox": Values ​​of the Bounding Box to be included as a parameter in the advanced search. the object contains the following values minx,miny,maxx,maxy
    • "cswVersion": CSW Protocol Version
    • "filterVersion": OGC Filter Version
    • "start": The starting point of search corresponding to the StartPosition of the Protocol CSW getRecords
    • "limit": Limit of search corresponding to the StartPosition of the Protocol CSW getRecords
    • "timeout": Maximum waiting time before the search is canceled

Important!!!

This plugin requires that the viewer is configured as Ext.TabPanel

This is the code that checks for this requirement in app/templates/composer.html:

            ...
            //check if MetadataExplorer plugin is defined in customTools configuration
            var customToolsME = [];
            if(serverConfig.customTools){
                for(var cTools in serverConfig.customTools){
                    if(serverConfig.customTools[cTools].ptype == "gxp_metadataexplorer"){  
                        customToolsME.push(serverConfig.customTools[cTools].ptype);
                    }
                }
            }
            
            //check if MetadataExplorer plugin is defined in tools configuration
            var toolsME = [];                
            if(serverConfig.tools){
                for(var tools in serverConfig.tools){
                    if(serverConfig.tools[tools].ptype == "gxp_metadataexplorer"){  
                        toolsME.push(serverConfig.tools[tools].ptype);
                    }
                }
            }            
            
            if(!serverConfig.tab && toolsME.length == 0 && customToolsME.length == 0){
                appTabsOpts.layout = 'fit';
                appTabs = new Ext.Panel(appTabsOpts); 
            }else{
                appTabs = new Ext.TabPanel(appTabsOpts); 
            }
            ...
Clone this wiki locally