From 6c132db0d312a7571c6e4c350cbbf61bf2492fd7 Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Thu, 19 Jun 2014 12:39:16 +0200 Subject: [PATCH 001/186] fixed logout buttons regression after tool scale option improvement --- mapcomposer/app/static/externals/gxp/src/script/plugins/Tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/Tool.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/Tool.js index 272313ef3..a8dce44b9 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/plugins/Tool.js +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/Tool.js @@ -227,7 +227,7 @@ gxp.plugins.Tool = Ext.extend(Ext.util.Observable, { if(actions[k] instanceof GeoExt.Action && actions[k].initialConfig){ actions[k].initialConfig.scale = this.target.actionToolScale; }else{ - actions[k].scale = this.target.actionToolScale; + actions[k].scale = this.target.actionToolScale || actions[k].scale; } } } From f39840c2a82e3ac0d5d3f412ef2c50e639523926 Mon Sep 17 00:00:00 2001 From: tobia Date: Thu, 19 Jun 2014 18:11:21 +0200 Subject: [PATCH 002/186] Label width issue in 'de' for DWITHIN field. Close #435. --- .../widgets/form/spatialselector/SpatialSelectorMethod.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js index f5ec3e8b5..d0c343c54 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js @@ -598,6 +598,7 @@ gxp.widgets.form.spatialselector.SpatialSelectorMethod = Ext.extend(Ext.Containe fieldLabel: this.distanceUnitsTitleText, name: "dunits", ref: "../dunits", + labelStyle: 'width: 130px;', value: this.target.mapPanel.map.units, allowBlank: false },{ @@ -605,6 +606,7 @@ gxp.widgets.form.spatialselector.SpatialSelectorMethod = Ext.extend(Ext.Containe fieldLabel: this.distanceTitleText, name: "distance", ref: "../distance", + labelStyle: 'width: 130px;', allowBlank: false }] } From b7b72408df99cc26671cabde30dd6ae0be332cd7 Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Tue, 24 Jun 2014 12:26:59 +0200 Subject: [PATCH 003/186] add optional column for enabled field --- .../mapmanager/src/MSMUserManager.js | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js b/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js index 0659952ef..0de11202a 100644 --- a/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js +++ b/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js @@ -56,6 +56,12 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { */ textName: 'Name', /** + * Property: textEnabled + * {string} column name for enabled column + * + */ + textEnabled : 'Enabled', + /** * Property: textPassword * {string} column name for password * @@ -351,7 +357,8 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { }], /** * Property: showEnabled - * Show 'enabled' property of the user as a checkbox and allows to change it + * Show 'enabled' property of the user as a checkbox in the user edit. + * or as a coumn in the user grid */ showEnabled:false, @@ -447,6 +454,7 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { id :'id', header : userManager.textId, sortable : true, + width: 50, dataIndex: 'id', hidden : true }, @@ -461,24 +469,37 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { header : userManager.textPassword, sortable : false, maxLength:255, + hideable : false, dataIndex: 'password', hidden : true + },{ + header : userManager.textEnabled, + sortable : false, + dataIndex: 'enabled', + hidden : !userManager.showEnabled, + width:55, + renderer: function(value, metaData, record, rowIndex, colIndex, store) { + var classes = 'x-grid-center-icon action_column_btn ' + (value ? 'accept' : 'close'); + return '
'; + return value; + } }, { header : userManager.textRole, sortable : true, dataIndex: 'role' + }, { xtype: 'actioncolumn', - + hideable:false, width: 50, items: [{ icon : ASSET.delete_icon, tooltip: userManager.tooltipDelete, getClass: function(v, meta, rec) { - var manager = userManager.login.username; - var username = rec.get('name'); + var manager = userManager.login.username; + var username = rec.get('name'); if(username == manager || rec.get('role')=='GUEST') { return 'x-hide-display'; } @@ -530,6 +551,7 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { { xtype: 'actioncolumn', width: 50, + hideable:false, items: [{ icon : ASSET.edit_icon, tooltip: userManager.tooltipEdit, @@ -576,7 +598,7 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { successProperty: 'ExtUserList', idProperty: 'id', remoteSort: false, - fields: ['id', 'name', 'password', 'role'], + fields: ['id', 'name', 'password', 'role','enabled'], sortInfo: { field: "name", direction: "ASC" }, proxy: new Ext.data.HttpProxy({ url: this.getSearchUrl(), @@ -753,7 +775,7 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { }) } ]; if( this.showEnabled ) { - userDataFields.push({xtype:'checkbox',fieldLabel:this.textEmabled || "Enabled",name:'enabled',checked:true,uncheckedValue: 'false'}); + userDataFields.push({xtype:'checkbox',fieldLabel:this.textEnabled || "Enabled",name:'enabled',checked:true,uncheckedValue: 'false'}); } @@ -1103,7 +1125,7 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { }) }]; if( this.showEnabled ) { - userDataFields.push({xtype:'checkbox',fieldLabel:this.textEmabled || "Enabled",name:'enabled',checked:userdata.enabled}); + userDataFields.push({xtype:'checkbox',fieldLabel:this.textEnabled || "Enabled",name:'enabled',checked:userdata.enabled}); } // headers for the request var defaultHeaders = this.target.defaultHeaders || {}; @@ -1806,4 +1828,4 @@ MSMUserGroupManager = Ext.extend(Ext.grid.GridPanel, { }); /** api: xtype = msm_usergroupmanager */ -Ext.reg(MSMUserGroupManager.prototype.xtype, MSMUserGroupManager); \ No newline at end of file +Ext.reg(MSMUserGroupManager.prototype.xtype, MSMUserGroupManager); From f51bc3e8ccdbb1e94aa04108ec08e5a03b564f37 Mon Sep 17 00:00:00 2001 From: Mauro Bartolomeoli Date: Wed, 25 Jun 2014 10:43:39 +0200 Subject: [PATCH 004/186] Fixed #436 Added WMTSSource and TMSSource plugins, enabled their usage in AddLayers plugin --- .../app/static/config/mapStoreConfig.js | 3 +- .../static/externals/gxp/src/script/loader.js | 3 + .../gxp/src/script/plugins/AddLayers.js | 63 +++- .../gxp/src/script/plugins/TMSSource.js | 249 ++++++++++++ .../gxp/src/script/plugins/WMTSSource.js | 354 ++++++++++++++++++ .../gxp/src/script/widgets/LayerPanel.js | 181 +++++++++ .../gxp/src/script/widgets/NewSourceWindow.js | 39 +- .../gxp/src/script/widgets/WMTSLayerPanel.js | 176 +++++++++ .../externals/gxp/tests/list-tests.html | 3 + .../gxp/tests/script/plugins/WMSSource.html | 8 +- .../gxp/tests/script/plugins/WMTSSource.html | 24 ++ .../gxp/tests/script/widgets/LayerPanel.html | 40 ++ .../tests/script/widgets/WMSLayerPanel.html | 2 +- .../tests/script/widgets/WMTSLayerPanel.html | 46 +++ .../lib/OpenLayers/Format/TMSCapabilities.js | 150 ++++++++ mapcomposer/app/static/translations/de.js | 10 +- mapcomposer/app/static/translations/en.js | 8 + mapcomposer/app/static/translations/es.js | 8 + mapcomposer/app/static/translations/fr.js | 8 + mapcomposer/app/static/translations/it.js | 8 + mapcomposer/buildjs.cfg | 10 +- 21 files changed, 1375 insertions(+), 18 deletions(-) create mode 100644 mapcomposer/app/static/externals/gxp/src/script/plugins/TMSSource.js create mode 100644 mapcomposer/app/static/externals/gxp/src/script/plugins/WMTSSource.js create mode 100644 mapcomposer/app/static/externals/gxp/src/script/widgets/LayerPanel.js create mode 100644 mapcomposer/app/static/externals/gxp/src/script/widgets/WMTSLayerPanel.js create mode 100644 mapcomposer/app/static/externals/gxp/tests/script/plugins/WMTSSource.html create mode 100644 mapcomposer/app/static/externals/gxp/tests/script/widgets/LayerPanel.html create mode 100644 mapcomposer/app/static/externals/gxp/tests/script/widgets/WMTSLayerPanel.html create mode 100644 mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/Format/TMSCapabilities.js diff --git a/mapcomposer/app/static/config/mapStoreConfig.js b/mapcomposer/app/static/config/mapStoreConfig.js index df0e86ad3..502dbf20d 100644 --- a/mapcomposer/app/static/config/mapStoreConfig.js +++ b/mapcomposer/app/static/config/mapStoreConfig.js @@ -96,7 +96,8 @@ "embeddedTemplateName": "viewer", "showDirectURL": true }, { - "ptype": "gxp_categoryinitializer" + "ptype": "gxp_categoryinitializer", + "silentErrors": true }, { "ptype": "gxp_mouseposition", "displayProjectionCode":"EPSG:4326", diff --git a/mapcomposer/app/static/externals/gxp/src/script/loader.js b/mapcomposer/app/static/externals/gxp/src/script/loader.js index 623ae59f1..5967881b2 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/loader.js +++ b/mapcomposer/app/static/externals/gxp/src/script/loader.js @@ -13,7 +13,9 @@ "widgets/FilterBuilder.js", "widgets/QueryPanel.js", "widgets/StylePropertiesDialog.js", + "widgets/LayerPanel.js", "widgets/WMSLayerPanel.js", + "widgets/WMTSLayerPanel.js", "widgets/WMSStylesDialog.js", "widgets/NewSourceWindow.js", "widgets/FillSymbolizer.js", @@ -47,6 +49,7 @@ "plugins/GoogleSource.js", "plugins/OLSource.js", "plugins/MapQuestSource.js", + "plugins/WMTSSource.js", "plugins/StyleWriter.js", "plugins/GeoServerStyleWriter.js", "plugins/Tool.js", diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/AddLayers.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/AddLayers.js index db4591fcb..7f16fef07 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/plugins/AddLayers.js +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/AddLayers.js @@ -167,6 +167,50 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, { iconCls: "gxp-icon-addlayers", hideByDefault: false, + + /** api: config[availableSources] + * ``Array`` + * List of available sources for Add Server, with related configuration. + */ + availableSources: [ + { + name: 'WMS', + description: 'Web Map Service (WMS)', + config: { + ptype : 'gxp_wmscsource' + } + }, + { + name: 'WMTS-KVP', + description: 'Web Map Tile Service KVP (WMTS)', + config: { + ptype : 'gxp_wmtssource', + preferredEncoding : 'KVP' + } + }, + { + name: 'WMTS-REST', + description: 'Web Map Tile Service REST (WMTS)', + config: { + ptype : 'gxp_wmtssource', + preferredEncoding : 'REST' + } + }, + { + name: 'TMS', + description: 'Tiled Map Service (TMS)', + config: { + ptype : 'gxp_tmssource' + } + } + ], + + /** api: config[additionalSources] + * ``Array`` + * List of sources to be added to default availableSources. + */ + additionalSources: [], + /** private: method[constructor] */ @@ -359,13 +403,26 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, { })); } + for(var count = 0, l = this.additionalSources.length; count < l; count++) { + this.availableSources.push(this.additionalSources[count]); + } + var newSourceWindow = new gxp.NewSourceWindow({ modal: true, + availableSources: this.availableSources, listeners: { - "server-added": function(url) { + "server-added": function(url, type) { newSourceWindow.setLoading(); + var sourceCfg; + for(var count = 0, l = this.availableSources.length; count < l; count++) { + var currentSource = this.availableSources[count]; + if(currentSource.name === type) { + sourceCfg = Ext.apply({url: url}, currentSource.config); + } + } + this.target.addLayerSource({ - config: {url: url}, // assumes default of gx_wmssource + config: sourceCfg, callback: function(id) { // add to combo and select var record = new sources.recordType({ @@ -378,7 +435,7 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, { }, fallback: function(source, msg) { newSourceWindow.setError( - new Ext.Template(this.addLayerSourceErrorText).apply({msg: msg}) + new Ext.Template(this.addLayerSourceErrorText).apply({type: type, msg: msg}) ); }, scope: this diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/TMSSource.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/TMSSource.js new file mode 100644 index 000000000..391633a90 --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/TMSSource.js @@ -0,0 +1,249 @@ +/** + * Copyright (c) 2008-2011 The Open Planning Project + * + * Published under the GPL license. + * See https://github.com/opengeo/gxp/raw/master/license.txt for the full text + * of the license. + */ + +/** + * @requires plugins/LayerSource.js + */ + +Ext.ns('gxp.data', 'gxp.plugins'); + +gxp.data.TMSCapabilitiesReader = Ext.extend(Ext.data.DataReader, { + noLayerInProjectionError: "No layer in the current map projection is available on this server", + warningTitle: "Warning", + constructor: function(meta, recordType) { + meta = meta || {}; + if (!meta.format) { + meta.format = new OpenLayers.Format.TMSCapabilities(); + } + if(typeof recordType !== "function") { + recordType = GeoExt.data.LayerRecord.create( + recordType || meta.fields || [ + {name: "name", type: "string"}, + {name: "title", type: "string"}, + {name: "tileMapUrl", type: "string"} + ]); + } + gxp.data.TMSCapabilitiesReader.superclass.constructor.call( + this, meta, recordType); + }, + read: function(request) { + var data = request.responseXML; + if(!data || !data.documentElement) { + data = request.responseText; + } + return this.readRecords(data); + }, + equivalentProj: function(proj1, proj2) { + // Necessary because OpenLayers.Projection.equals does not handle + // equivalent definitions, e.g. EPSG:900913 vs urn:ogc:def:crs:EPSG::900913 + if (proj1.length < proj2.length) { + var projtmp = proj1; + proj1 = proj2; + proj2 = projtmp; + } + + proj1 = proj1.replace(/::/g, ":").replace(/CRS84/g, "EPSG:4326").replace(/OSGEO:41001/g, "EPSG:900913"); + proj2 = proj2.replace(/::/g, ":").replace(/CRS84/g, "EPSG:4326").replace(/OSGEO:41001/g, "EPSG:900913"); + return (proj1.indexOf(proj2, proj1.length - proj2.length) !== -1); + }, + readRecords: function(data) { + var records = [], i, ii, url, proj, wrongProjCount = 0; + if (typeof data === "string" || data.nodeType) { + data = this.meta.format.read(data); + this.raw = data; + // a single tileMap, someone supplied a url to a TileMap + if (!data.tileMaps) { + if (data.tileSets) { + proj = new OpenLayers.Projection(data.srs); + if (this.meta.mapProjection.equals(proj) || + // handle equivalent defintions, e.g. EPSG:900913 vs urn:ogc:def:crs:EPSG::900913 + this.equivalentProj(data.srs, this.meta.mapProjection.projCode)) { + var serverResolutions = []; + for (i=0, ii=data.tileSets.length; i 0) { + Ext.Msg.show({ + title: this.warningTitle, + msg: this.noLayerInProjectionError, + buttons: Ext.Msg.OK, + width: 300, + icon: Ext.MessageBox.WARNING + }); + } + return { + totalRecords: records.length, + success: true, + records: records + }; + } +}); + +/** api: (define) + * module = gxp.plugins + * class = TMSSource + */ + +/** api: (extends) + * plugins/LayerSource.js + */ + +/** api: constructor + * .. class:: TMSSource(config) + * + * Plugin for using TMS layers with :class:`gxp.Viewer` instances. The + * plugin issues a Capabilities request to create a store of the TMS's + * tile maps. It is currently not supported to use this source type directly + * in the viewer config, it is only used to add a TMS service dynamically + * through the AddLayers plugin. + */ +gxp.plugins.TMSSource = Ext.extend(gxp.plugins.LayerSource, { + + /** api: ptype = gxp_tmssource */ + ptype: "gxp_tmssource", + + /** api: config[url] + * ``String`` TMS service URL for this source + */ + + /** api: config[version] + * ``String`` TMS version to use, defaults to 1.0.0 + */ + version: "1.0.0", + + /** private: method[constructor] + */ + constructor: function(config) { + gxp.plugins.TMSSource.superclass.constructor.apply(this, arguments); + this.format = new OpenLayers.Format.TMSCapabilities(); + }, + + /** api: method[createStore] + * + * Creates a store of layer records. Fires "ready" when store is loaded. + */ + createStore: function() { + var format = this.format; + this.store = new Ext.data.Store({ + autoLoad: true, + listeners: { + load: function() { + this.title = this.store.reader.raw.title; + this.fireEvent("ready", this); + }, + exception: function() { + var msg = "Trouble creating TMS layer store from response."; + var details = "Unable to handle response."; + this.fireEvent("failure", this, msg, details); + }, + scope: this + }, + proxy: new Ext.data.HttpProxy({ + url: this.url.indexOf(this.version) === -1 ? this.url + this.version : this.url, + disableCaching: false, + method: "GET" + }), + reader: new gxp.data.TMSCapabilitiesReader({ + baseUrl: this.url, + version: this.version, + mapProjection: this.getMapProjection() + }) + }); + }, + + /** api: method[createLayerRecord] + * :arg config: ``Object`` The application config for this layer. + * :returns: ``GeoExt.data.LayerRecord`` or null when the source is lazy. + * + * Create a layer record given the config. + */ + createLayerRecord: function(config, callback, scope) { + var index = this.store.findExact("name", config.name); + if (index > -1) { + var record = this.store.getAt(index); + var layer = record.getLayer(); + if (layer.serverResolutions !== null) { + return record; + } else { + Ext.Ajax.request({ + url: record.get('tileMapUrl'), + success: function(response) { + var serverResolutions = []; + var info = this.format.read(response.responseText); + for (var i=0, ii=info.tileSets.length; i 0) || !(1 / maxExtent.getWidth() > 0)) { + // maxExtent has infinite or non-numeric width or height + // in this case, the map maxExtent must be specified in the config + maxExtent = undefined; + } + return maxExtent; + }, + getEncodingStyles: function(response) { + var operationsMetadata = response.operationsMetadata; + var encodingStyles = {}; + if (operationsMetadata.GetTile && + operationsMetadata.GetTile.dcp && + operationsMetadata.GetTile.dcp.http && + operationsMetadata.GetTile.dcp.http.get) { + var getUrls = operationsMetadata.GetTile.dcp.http.get; + for(var i = 0, l = getUrls.length; i < l; i++) { + var getUrl = getUrls[i]; + if(this.supportsEncoding(getUrl, 'KVP')) { + encodingStyles['KVP'] = getUrl.url; + } + if(this.supportsEncoding(getUrl, 'RESTful')) { + encodingStyles['REST'] = getUrl.url; + } + } + } + + return encodingStyles; + }, + supportsEncoding: function(getUrl, encoding) { + return getUrl.constraints && getUrl.constraints.GetEncoding && getUrl.constraints.GetEncoding.allowedValues + && getUrl.constraints.GetEncoding.allowedValues[encoding] === true + }, + normalizeTemplate: function(template) { + var variables = ['TileMatrixSet', 'TileMatrix', 'TileRow', 'TileCol']; + for(var i = 0, l = variables.length; i < l; i++) { + var variable = variables[i]; + template = template.replace(new RegExp("\{" + variable + "\}", 'ig'), "{" + variable + "}"); + } + return template; + }, + readRecords: function(data) { + var records = [], i, ii, j, jj, url, proj, projStr, encoding, wrongProjCount = 0; + if (typeof data === "string" || data.nodeType) { + data = this.meta.format.read(data); + this.raw = data; + var encodingStyles = this.getEncodingStyles(data); + if(encodingStyles[this.preferredEncoding]) { + encoding = this.preferredEncoding; + url = encodingStyles[this.preferredEncoding]; + } else { + for(var enc in encodingStyles) { + if(encodingStyles.hasOwnProperty(enc)) { + encoding = enc; + url = encodingStyles[enc]; + } + } + } + if(!encoding) { + encoding = this.preferredEncoding; + } + if (data.contents) { + if (data.contents.layers && data.contents.tileMatrixSets) { + for (i=0, ii=data.contents.layers.length; i0){ + var matrixIds = data.contents.tileMatrixSets[layer.tileMatrixSetLinks[j].tileMatrixSet].matrixIds; + // assume all the matrices in the set have the same projection + projStr = matrixIds[0].supportedCRS; + proj = new OpenLayers.Projection(projStr); + if (this.meta.mapProjection.equals(proj) || + // handle equivalent defintions, e.g. EPSG:900913 vs urn:ogc:def:crs:EPSG::900913 + this.equivalentProj(projStr, this.meta.mapProjection.projCode)) { + var style=null; + if (layer.styles.length==0) { + // this shouldn't happen according the standard, but some Geoserver versions + // were buggy: https://jira.codehaus.org/browse/GEOS-6190 + style=""; + } + else { + var k, kk; + for (k=0, kk=layer.styles.length; k 0) { + Ext.Msg.show({ + title: this.warningTitle, + msg: this.noLayerInProjectionError, + buttons: Ext.Msg.OK, + width: 300, + icon: Ext.MessageBox.WARNING + }); + } + return { + totalRecords: records.length, + success: true, + records: records + }; + } +}); + +/** api: (define) + * module = gxp.plugins + * class = TMSSource + */ + +/** api: (extends) + * plugins/LayerSource.js + */ + +/** api: constructor + * .. class:: WMTSSource(config) + * + * Plugin for using WMTS layers with :class:`gxp.Viewer` instances. The + * plugin issues a Capabilities request to create a store of the WMTS's + * tile maps. It is currently not supported to use this source type directly + * in the viewer config, it is only used to add a TMS service dynamically + * through the AddLayers plugin. + */ +gxp.plugins.WMTSSource = Ext.extend(gxp.plugins.LayerSource, { + + /** api: ptype = gxp_wmtssource */ + ptype: "gxp_wmtssource", + + /** api: config[url] + * ``String`` WMTS service URL for this source + */ + + /** api: config[version] + * ``String`` WMTS version to use, defaults to 1.0.0 + */ + version: "1.0.0", + + /** private: method[constructor] + */ + constructor: function(config) { + gxp.plugins.WMTSSource.superclass.constructor.apply(this, arguments); + this.format = new OpenLayers.Format.WMTSCapabilities(); + }, + /** private: method + */ + getCapabilitiesUrl: function(url, version) { + var request = url; + if (request.indexOf("?") === -1) { // has no '?' + request = request + "?service=WMTS&request=GetCapabilities&version="+version; + } + else if ((request.indexOf("?")+1) === request.length) { // ends with '?" + request = request + "service=WMTS&request=GetCapabilities&version="+version; + } + else { // check each required parameter + request = request.toLowerCase().indexOf("service=wmts") === -1 ? request + "&service=WMTS" : request; + request = request.toLowerCase().indexOf("request=getcapabilities") === -1 ? request + "&request=GetCapabilities" : request; + request = request.toLowerCase().indexOf("version=") === -1 ? request + "&version=" + version : request; + } + return request; + }, + /** private: method + */ + getTitle: function(rawResponse) { + if (rawResponse.serviceIdentification) { + if (rawResponse.serviceIdentification.title) { + return rawResponse.serviceIdentification.title; + } + else if (rawResponse.serviceIdentification.abstract) { + return rawResponse.serviceIdentification.abstract; + } + } + return null; + }, + /** api: method[createStore] + * + * Creates a store of layer records. Fires "ready" when store is loaded. + */ + createStore: function() { + var format = this.format; + this.store = new Ext.data.Store({ + autoLoad: true, + listeners: { + load: function() { + this.title = this.getTitle(this.store.reader.raw); + this.fireEvent("ready", this); + }, + exception: function() { + var msg = "Trouble creating WMTS layer store from response."; + var details = "Unable to handle response."; + this.fireEvent("failure", this, msg, details); + }, + scope: this + }, + proxy: new Ext.data.HttpProxy({ + url: this.getCapabilitiesUrl(this.url, this.version), + disableCaching: false, + method: "GET" + }), + reader: new gxp.data.WMTSCapabilitiesReader({ + baseUrl: this.url, + version: this.version, + mapProjection: this.getMapProjection(), + preferredEncoding: this.preferredEncoding || undefined + }) + }); + }, + + /** api: method[createLayerRecord] + * :arg config: ``Object`` The application config for this layer. + * :returns: ``GeoExt.data.LayerRecord`` or null when the source is lazy. + * + * Create a layer record given the config. + */ + createLayerRecord: function(config, callback, scope) { + var index = this.store.findExact("name", config.name); + if (index > -1) { + var record = this.store.getAt(index); + var layer = record.getLayer(); + if (layer.matrixSet !== null) { + return record; + } + } + } + +}); + +Ext.preg(gxp.plugins.WMTSSource.prototype.ptype, gxp.plugins.WMTSSource); diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/LayerPanel.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/LayerPanel.js new file mode 100644 index 000000000..5983961ef --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/LayerPanel.js @@ -0,0 +1,181 @@ +/** +* Copyright (c) 2008-2011 The Open Planning Project +* +* Published under the GPL license. +* See https://github.com/opengeo/gxp/raw/master/license.txt for the full text +* of the license. +*/ + + +/** api: (define) + * module = gxp + * class = LayerPanel + * base_link = `Ext.TabPanel `_ + */ +Ext.namespace("gxp"); + +/** api: constructor + * .. class:: WMxSLayerPanel(config) + * + * Abstract class to create a dialog for setting for WMS, WMTS, etc + * layer properties like title, abstract, opacity, transparency and + * image format. + * + * It should be extended for each specific layer type to be supported. + */ +gxp.LayerPanel = Ext.extend(Ext.TabPanel, { + + /** api: config[layerRecord] + * ``GeoExt.data.LayerRecord`` + * Show properties for this layer record. + */ + layerRecord: null, + + /** api: config[source] + * ``gxp.plugins.LayerSource`` + * Source for the layer. Optional. If not provided, ``sameOriginStyling`` + * will be ignored. + */ + source: null, + + map: null, + + /** api: config[activeTab] + * ``String or Number`` + * A string id or the numeric index of the tab that should be initially + * activated on render. Defaults to ``0``. + */ + activeTab: 0, + + /** api: config[border] + * ``Boolean`` + * Display a border around the panel. Defaults to ``false``. + */ + border: false, + + /** i18n */ + aboutText: "About", + titleText: "Title", + nameText: "Name", + descriptionText: "Description", + displayText: "Display", + opacityText: "Opacity", + + initComponent: function() { + this.addEvents( + /** api: event[change] + * Fires when the ``layerRecord`` is changed using this dialog. + */ + "change" + ); + + this.items = this.createItems(); + gxp.LayerPanel.superclass.initComponent.call(this); + }, + + createItems: function() { + var items = [ + this.createAboutPanel(), + this.createDisplayPanel() + ]; + return items; + }, + + /** private: createAboutPanel + * Creates the about panel. + */ + createAboutPanel: function() { + return { + title: this.aboutText, + style: {"padding": "10px"}, + defaults: { + border: false + }, + items: [{ + layout: "form", + labelWidth: 70, + items: [{ + xtype: "textfield", + fieldLabel: this.titleText, + anchor: "99%", + value: this.layerRecord.get("title"), + listeners: { + change: function(field) { + this.layerRecord.set("title", field.getValue()); + //TODO revisit when discussion on + // http://trac.geoext.org/ticket/110 is complete + this.layerRecord.commit(); + this.fireEvent("change"); + }, + scope: this + } + }, { + xtype: "textfield", + fieldLabel: this.nameText, + anchor: "99%", + value: this.layerRecord.get("name"), + readOnly: true + }] + }, { + layout: "form", + labelAlign: "top", + items: [{ + xtype: "textarea", + fieldLabel: this.descriptionText, + grow: true, + growMax: 150, + anchor: "99%", + value: this.layerRecord.get("abstract"), + readOnly: true + }] + }] + }; + }, + + createDisplayPanel: function() { + var layer = this.layerRecord.getLayer(); + var opacity = layer.opacity; + if(opacity == null) { + opacity = 1; + } + var config = { + title: this.displayText, + style: {"padding": "10px"}, + layout: "form", + labelWidth: 70, + items: [{ + xtype: "slider", + name: "opacity", + fieldLabel: this.opacityText, + value: opacity * 100, + //TODO remove the line below when switching to Ext 3.2 final + values: [opacity * 100], + anchor: "99%", + isFormField: true, + listeners: { + change: function(slider, value) { + layer.setOpacity(value / 100); + this.fireEvent("change"); + }, + scope: this + } + }] + }; + return config; + }, + + loadMaskMsg: "Fetching data..", + noDataMsg: "No data available in current view", + showMask: function(cmp) { + if(!this.loadMask) this.loadMask = new Ext.LoadMask(cmp.getEl(), {msg: this.loadMaskMsg}); + this.loadMask.show(); + }, + + hideMask: function() { + if(this.loadMask){ + this.loadMask.hide(); + } + } +}); + +Ext.reg('gxp_layerpanel', gxp.LayerPanel); diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/NewSourceWindow.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/NewSourceWindow.js index 3bba492e2..d8f97602e 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/NewSourceWindow.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/NewSourceWindow.js @@ -43,7 +43,7 @@ gxp.NewSourceWindow = Ext.extend(Ext.Window, { * ``String`` * Message to display when an invalid URL is entered (i18n). */ - invalidURLText: "Enter a valid URL to a WMS endpoint (e.g. http://example.com/geoserver/wms)", + invalidURLText: "Enter a valid URL to a WMS/WMTS/TMS endpoint (e.g. http://example.com/geoserver/wms)", /** api: config[contactingServerText] * ``String`` @@ -71,6 +71,12 @@ gxp.NewSourceWindow = Ext.extend(Ext.Window, { * The error message set (for example, when adding the source failed) */ error: null, + + /** api: config[availableSources] + * ``Array`` + * List of available sources, with related configuration. + */ + availableSources: [], /** api: event[server-added] * Fired with the URL that the user provided as a parameter when the form @@ -87,16 +93,35 @@ gxp.NewSourceWindow = Ext.extend(Ext.Window, { msgTarget: "under", validator: this.urlValidator.createDelegate(this) }); - + + var store = []; + for(var count = 0, l = this.availableSources.length; count < l; count++) { + var source = this.availableSources[count]; + store.push([source.name, source.description]); + } + this.form = new Ext.form.FormPanel({ - items: [ - this.urlTextField - ], + items: [{ + xtype: 'combo', + width: 240, + name: 'type', + fieldLabel: "Type", + value: 'WMS', + mode: 'local', + triggerAction: 'all', + store: store + }, this.urlTextField], border: false, labelWidth: 30, bodyStyle: "padding: 5px", autoWidth: true, - autoHeight: true + autoHeight: true, + listeners: { + afterrender: function() { + this.urlTextField.focus(false, true); + }, + scope: this + } }); this.bbar = [ @@ -115,7 +140,7 @@ gxp.NewSourceWindow = Ext.extend(Ext.Window, { // Clear validation before trying again. this.error = null; if (this.urlTextField.validate()) { - this.fireEvent("server-added", this.urlTextField.getValue()); + this.fireEvent("server-added", this.urlTextField.getValue(), this.form.getForm().findField('type').getValue()); } }, scope: this diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/WMTSLayerPanel.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/WMTSLayerPanel.js new file mode 100644 index 000000000..7433cd568 --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/WMTSLayerPanel.js @@ -0,0 +1,176 @@ +/** +* Copyright (c) 2008-2011 The Open Planning Project +* +* Published under the GPL license. +* See https://github.com/opengeo/gxp/raw/master/license.txt for the full text +* of the license. +*/ + +//TODO remove the WMSStylesDialog and GeoServerStyleWriter includes +/** + * @include widgets/WMSStylesDialog.js + * @include plugins/GeoServerStyleWriter.js + */ + +/** api: (define) + * module = gxp + * class = WMTSLayerPanel + */ +Ext.namespace("gxp"); + +/** api: constructor + * .. class:: WMSLayerPanel(config) + * + * Create a dialog for setting WMTS layer properties like title, abstract, + * opacity, image format and styles + */ +gxp.WMTSLayerPanel = Ext.extend(gxp.LayerPanel, { + /** i18n */ + formatText: "Format", + stylesText: "Styles", + chooseStyleText: "Choose style", + + initComponent: function() { + gxp.WMTSLayerPanel.superclass.initComponent.call(this); + }, + + /** private: createStylesPanel + * :arg url: ``String`` url to save styles to + * + * Creates the Styles panel. + */ + createStylesPanel: function(url) { + var config = gxp.WMSStylesDialog.createGeoServerStylerConfig( + this.layerRecord, url + ); + if (this.rasterStyling === true) { + config.plugins.push({ + ptype: "gxp_wmsrasterstylesdialog" + }); + } + return Ext.apply(config, { + title: this.stylesText, + style: "padding: 10px", + editable: false, + listeners: Ext.apply(config.listeners, { + "beforerender": { + fn: function(cmp) { + var render = !this.editableStyles; + if (!render) { + if (typeof this.authorized == 'boolean') { + cmp.editable = this.authorized; + cmp.ownerCt.doLayout(); + } else { + Ext.Ajax.request({ + method: "PUT", + url: url + "/styles", + callback: function(options, success, response) { + // we expect a 405 error code here if we are dealing with + // GeoServer and have write access. Otherwise we will + // create the panel in readonly mode. + cmp.editable = (response.status == 405); + cmp.ownerCt.doLayout(); + } + }); + } + } + return render; + }, + scope: this, + single: true + } + }) + }); + }, + + createItems: function() { + var items = gxp.LayerPanel.prototype.createItems.apply(this); + items.push(this.createStylesPanel()); + return items; + }, + + /** private: createDisplayPanel + * Creates the display panel. + */ + createDisplayPanel: function() { + var layer = this.layerRecord.getLayer(); + var currentFormat = layer.format; + var config = gxp.LayerPanel.prototype.createDisplayPanel.apply(this); + var formats = this.layerRecord.get("formats"); + config.items.push( { + xtype: "combo", + fieldLabel: this.formatText, + store: formats, + value: currentFormat, + mode: "local", + triggerAction: "all", + editable: false, + anchor: "99%", + listeners: { + select: function(combo) { + var format = combo.getValue(); + // mergeNewParams() alone seems to have no effect for WMTS layer + layer.format = format; + layer.mergeNewParams({ + format: format + }); + this.fireEvent("change"); + }, + scope: this + } + }); + return config; + }, + + createStylesPanel: function() { + var styles = this.layerRecord.get("styles"); + var layer = this.layerRecord.getLayer(); + var fields = [ + {name: "identifier", mapping: "identifier"} + ]; + var displayField; + if (styles.length>0 && styles[0].title) { + displayField = "title"; + fields.push({name: "title", mappping: "title"}); + } + else { + displayField = "identifier"; + } + var store = new Ext.data.ArrayStore({ + data: styles, + fields: fields + }); + var config = { + title: this.stylesText, + style: {"padding": "10px"}, + layout: "form", + labelWidth: 70, + items: [{ + xtype: "combo", + fieldLabel: this.chooseStyleText, + store: store, + value: this.layerRecord.getLayer().style, + valueField: 'identifier', + displayField: displayField, + mode: "local", + triggerAction: "all", + editable: false, + anchor: "99%", + listeners: { + select: function(combo) { + var style = combo.getValue(); + layer.style = style; + layer.mergeNewParams({ + style: style + }); + this.fireEvent("change"); + }, + scope: this + } + }] + } + return config; + } +}); + +Ext.reg('gxp_wmtslayerpanel', gxp.WMTSLayerPanel); diff --git a/mapcomposer/app/static/externals/gxp/tests/list-tests.html b/mapcomposer/app/static/externals/gxp/tests/list-tests.html index 920713738..307d58d50 100644 --- a/mapcomposer/app/static/externals/gxp/tests/list-tests.html +++ b/mapcomposer/app/static/externals/gxp/tests/list-tests.html @@ -36,6 +36,7 @@
  • script/plugins/WMSGetFeatureInfo.html
  • script/plugins/WMSRasterStylesDialog.html
  • script/plugins/WMSSource.html
  • +
  • script/plugins/WMTSSource.html
  • script/plugins/Zoom.html
  • script/plugins/ZoomToDataExtent.html
  • script/plugins/ZoomToExtent.html
  • @@ -68,6 +69,8 @@
  • script/widgets/TextSymbolizer.html
  • script/widgets/tips/SliderTip.html
  • script/widgets/Viewer.html
  • +
  • script/widgets/LayerPanel.html
  • script/widgets/WMSLayerPanel.html
  • script/widgets/WMSStylesDialog.html
  • +
  • script/widgets/WMTSLayerPanel.html
  • diff --git a/mapcomposer/app/static/externals/gxp/tests/script/plugins/WMSSource.html b/mapcomposer/app/static/externals/gxp/tests/script/plugins/WMSSource.html index 3e329b256..bf6cb0392 100644 --- a/mapcomposer/app/static/externals/gxp/tests/script/plugins/WMSSource.html +++ b/mapcomposer/app/static/externals/gxp/tests/script/plugins/WMSSource.html @@ -4,17 +4,17 @@ - + + + + + + + + + + + diff --git a/mapcomposer/app/static/externals/gxp/tests/script/widgets/LayerPanel.html b/mapcomposer/app/static/externals/gxp/tests/script/widgets/LayerPanel.html new file mode 100644 index 000000000..6f4b5b961 --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/tests/script/widgets/LayerPanel.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + diff --git a/mapcomposer/app/static/externals/gxp/tests/script/widgets/WMSLayerPanel.html b/mapcomposer/app/static/externals/gxp/tests/script/widgets/WMSLayerPanel.html index 3f9da4844..76191e5e3 100644 --- a/mapcomposer/app/static/externals/gxp/tests/script/widgets/WMSLayerPanel.html +++ b/mapcomposer/app/static/externals/gxp/tests/script/widgets/WMSLayerPanel.html @@ -4,7 +4,7 @@ - + + + + + + + + + + + diff --git a/mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/Format/TMSCapabilities.js b/mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/Format/TMSCapabilities.js new file mode 100644 index 000000000..d71816417 --- /dev/null +++ b/mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/Format/TMSCapabilities.js @@ -0,0 +1,150 @@ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the 2-clause BSD license. + * See license.txt in the OpenLayers distribution or repository for the + * full text of the license. */ + +/** + * Dependences have been commented in order to make buildkit/merge to + * work, as they are available on openlayers but not on openlayers-ext. + * Ensure they are correctly included on buildjs.cfg if you are using + * TMSCapabilities. + * #requires OpenLayers/Format/XML.js + * #requires OpenLayers/BaseTypes/Bounds.js + * #requires OpenLayers/BaseTypes/LonLat.js + */ + +/** + * Class: OpenLayers.Format.TMSCapabilities + * Parse TMS Capabilities. + * See http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification + * + * Inherits from: + * - + */ +OpenLayers.Format.TMSCapabilities = OpenLayers.Class( + OpenLayers.Format.XML, { + + /** + * Property: defaultPrefix + */ + defaultPrefix: "tms", + + /** + * Property: readers + * Contains public functions, grouped by namespace prefix, that will + * be applied when a namespaced node is found matching the function + * name. The function will be applied in the scope of this parser + * with two arguments: the node being read and a context object passed + * from the parent. + */ + readers: { + "tms": { + "Services": function(node, obj) { + obj.services = []; + this.readChildNodes(node, obj); + }, + "TileMapService": function(node, obj) { + if (obj.services) { + obj.services.push({ + service: 'TMS', + version: node.getAttribute("version"), + title: node.getAttribute("title"), + href: node.getAttribute("href") + }); + } else { + this.readChildNodes(node, obj); + } + }, + "TileMaps": function(node, obj) { + obj.tileMaps = []; + this.readChildNodes(node, obj); + }, + "TileMap": function(node, obj) { + if (obj.tileMaps) { + obj.tileMaps.push({ + href: node.getAttribute("href"), + srs: node.getAttribute("srs"), + title: node.getAttribute("title"), + profile: node.getAttribute("profile") + }); + } else { + obj.version = node.getAttribute("version"); + obj.tileMapService = node.getAttribute("tilemapservice"); + this.readChildNodes(node, obj); + } + }, + "Title": function(node, obj) { + obj.title = this.getChildValue(node); + }, + "Abstract": function(node, obj) { + obj['abstract'] = this.getChildValue(node); + }, + "SRS": function(node, obj) { + obj.srs = this.getChildValue(node); + }, + "BoundingBox": function(node, obj) { + obj.bbox = new OpenLayers.Bounds( + node.getAttribute("minx"), + node.getAttribute("miny"), + node.getAttribute("maxx"), + node.getAttribute("maxy")); + }, + "Origin": function(node, obj) { + obj.origin = new OpenLayers.LonLat( + node.getAttribute("x"), + node.getAttribute("y")); + }, + "TileFormat": function(node, obj) { + obj.tileFormat = { + width: parseInt(node.getAttribute("width"), 10), + height: parseInt(node.getAttribute("height"), 10), + mimeType: node.getAttribute("mime-type"), + extension: node.getAttribute("extension") + }; + }, + "TileSets": function(node, obj) { + obj.tileSets = []; + this.readChildNodes(node, obj); + }, + "TileSet": function(node, obj) { + obj.tileSets.push({ + href: node.getAttribute("href"), + unitsPerPixel: parseFloat(node.getAttribute("units-per-pixel")), + order: parseInt(node.getAttribute("order"), 10) + }); + }, + "TileMapServerError": function(node, obj) { + obj.error = true; + }, + "Message": function(node, obj) { + obj.message = this.getChildValue(node); + } + } + }, + + /** + * APIMethod: read + * Read TMS capabilities data from a string, and return a list of tilesets. + * + * Parameters: + * data - {String} or {DOMElement} data to read/parse. + * + * Returns: + * {Object} Information about the services served by this TMS instance. + */ + read: function(data) { + if(typeof data == "string") { + data = OpenLayers.Format.XML.prototype.read.apply(this, [data]); + } + var raw = data; + if(data && data.nodeType == 9) { + data = data.documentElement; + } + var capabilities = {}; + this.readNode(data, capabilities); + return capabilities; + }, + + CLASS_NAME: "OpenLayers.Format.TMSCapabilities" + +}); diff --git a/mapcomposer/app/static/translations/de.js b/mapcomposer/app/static/translations/de.js index c32820aee..794d3e28a 100644 --- a/mapcomposer/app/static/translations/de.js +++ b/mapcomposer/app/static/translations/de.js @@ -808,5 +808,13 @@ GeoExt.Lang.add("de", { "gxp.plugins.FeatureManager.prototype":{ noValidWmsVersionMsgTitle: 'WMS Version ungültig', noValidWmsVersionMsgText: "Die Queryform-Plugin nicht mit WMS Source Version arbeiten: " - } + }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "Keine Schicht in der aktuellen Kartenprojektion ist auf diesem Server nicht verfügbar", + warningTitle: "Warnung" + }, + "gxp.data.TMSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "Keine Schicht in der aktuellen Kartenprojektion ist auf diesem Server nicht verfügbar", + warningTitle: "Warnung" + } }); diff --git a/mapcomposer/app/static/translations/en.js b/mapcomposer/app/static/translations/en.js index 7b635bdeb..67cd9ea63 100644 --- a/mapcomposer/app/static/translations/en.js +++ b/mapcomposer/app/static/translations/en.js @@ -782,5 +782,13 @@ GeoExt.Lang.add("en", { acceptText: "Create", cancelText: "Cancel", notInitializedCategoriesWithCredentials: "
    If you are an administrator please insert your credentials to create these categories: '{0}'
    " + }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "No layer in the current map projection is available on this server", + warningTitle: "Warning" + }, + "gxp.data.TMSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "No layer in the current map projection is available on this server", + warningTitle: "Warning" } }); diff --git a/mapcomposer/app/static/translations/es.js b/mapcomposer/app/static/translations/es.js index a176ea941..70c9cbf16 100644 --- a/mapcomposer/app/static/translations/es.js +++ b/mapcomposer/app/static/translations/es.js @@ -782,5 +782,13 @@ GeoExt.Lang.add("es", { acceptText: "Crear", cancelText: "Cancelar", notInitializedCategoriesWithCredentials: "
    Si es administrador introduzca sus credenciales para crear las categorías: '{0}'
    " + }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "No layer in the current map projection is available on this server", + warningTitle: "advertencia" + }, + "gxp.data.TMSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "No layer in the current map projection is available on this server", + warningTitle: "advertencia" } }); diff --git a/mapcomposer/app/static/translations/fr.js b/mapcomposer/app/static/translations/fr.js index 085981a9f..1b0580e55 100644 --- a/mapcomposer/app/static/translations/fr.js +++ b/mapcomposer/app/static/translations/fr.js @@ -767,5 +767,13 @@ GeoExt.Lang.add("fr", { "gxp.plugins.FeatureManager.prototype":{ noValidWmsVersionMsgTitle: 'WMS Version invalide', noValidWmsVersionMsgText: "Le queryForm plugin ne fonctionne pas avec la version une source WMS: " + }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "Aucune couche de la projection cartographique actuelle est disponible sur ce serveur", + warningTitle: "avertissement" + }, + "gxp.data.TMSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "Aucune couche de la projection cartographique actuelle est disponible sur ce serveur", + warningTitle: "avertissement" } }); diff --git a/mapcomposer/app/static/translations/it.js b/mapcomposer/app/static/translations/it.js index 5ddab2724..ddbef9b7b 100644 --- a/mapcomposer/app/static/translations/it.js +++ b/mapcomposer/app/static/translations/it.js @@ -795,5 +795,13 @@ GeoExt.Lang.add("it", { "gxp.plugins.FeatureManager.prototype":{ noValidWmsVersionMsgTitle: 'Versione WMS non valida', noValidWmsVersionMsgText: "Il plugin queryForm non funziona con una sorgente WMS versione: " + }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "Nessun layer disponibile su questo server nel sistema di coordinate della mappa", + warningTitle: "Attenzione" + }, + "gxp.data.TMSCapabilitiesReader.prototype" : { + noLayerInProjectionError: "Nessun layer disponibile su questo server nel sistema di coordinate della mappa", + warningTitle: "Attenzione" } }); diff --git a/mapcomposer/buildjs.cfg b/mapcomposer/buildjs.cfg index 3e7a7cd6c..38bd0d9f8 100644 --- a/mapcomposer/buildjs.cfg +++ b/mapcomposer/buildjs.cfg @@ -82,6 +82,7 @@ include = OpenLayers/Format/WMSGetFeatureInfo.js OpenLayers/Format/WMSDescribeLayer/v1_1.js OpenLayers/Format/WFSDescribeFeatureType.js + OpenLayers/Format/WMTSCapabilities/v1_0_0.js OpenLayers/Format/SLD/v1_0_0.js OpenLayers/Format/CSWGetRecords.js OpenLayers/Format/CSWGetRecords/v2_0_2.js @@ -96,6 +97,8 @@ include = OpenLayers/Layer/Vector.js OpenLayers/Layer/XYZ.js OpenLayers/Layer/OSM.js + OpenLayers/Layer/WMTS.js + OpenLayers/Layer/TMS.js OpenLayers/Protocol/HTTP.js OpenLayers/Protocol/WFS/v1_1_0.js OpenLayers/Renderer/SVG.js @@ -127,7 +130,8 @@ include = OpenLayers/Control/LoadingPanel.js OpenLayers/GeoStore.js OpenLayers/Format/GeoStore.js - OpenLayers/Format/WPSExecute.js + OpenLayers/Format/WPSExecute.js + OpenLayers/Format/TMSCapabilities.js OpenLayers/WPSProcess.js OpenLayers/Format/WPSExecuteRequest.js @@ -159,7 +163,9 @@ include = data/WPSUniqueValuesStore.js menu/LayerMenu.js widgets/LayerUploadPanel.js + widgets/LayerPanel.js widgets/WMSLayerPanel.js + widgets/WMTSLayerPanel.js widgets/GoogleEarthPanel.js widgets/Viewer.js widgets/EmbedMapDialog.js @@ -203,6 +209,8 @@ include = plugins/MapQuestSource.js plugins/WMSSource.js plugins/WMSCSource.js + plugins/WMTSSource.js + plugins/TMSSource.js plugins/ZoomToExtent.js plugins/NavigationHistory.js plugins/Zoom.js From 7c3e524649a64ef068c922f1af33d5dac99be78c Mon Sep 17 00:00:00 2001 From: Mauro Bartolomeoli Date: Wed, 25 Jun 2014 12:52:08 +0200 Subject: [PATCH 005/186] Review of french translations thanks to UNEP --- .../externals/mapmanager/translations/fr.js | 188 +++--- mapcomposer/app/static/translations/fr.js | 608 +++++++++--------- 2 files changed, 409 insertions(+), 387 deletions(-) diff --git a/mapcomposer/app/static/externals/mapmanager/translations/fr.js b/mapcomposer/app/static/externals/mapmanager/translations/fr.js index d611bba56..b3de7ca0a 100644 --- a/mapcomposer/app/static/externals/mapmanager/translations/fr.js +++ b/mapcomposer/app/static/externals/mapmanager/translations/fr.js @@ -4,100 +4,100 @@ GeoExt.Lang.add("fr", { "MSMGridPanel.prototype": { - msg: "Chargement...", - textSearch: "Recherche", - tooltipSearch: "Carte Recherche par nom", - textReset: "Remettre", + msg: "Chargement en cours...", + textSearch: "Rechercher", + tooltipSearch: "Réinitialiser tous les filtres", + textReset: "Réinitialiser", tooltipReset: "Supprimer tous les filtres", - gridResourceId: "Id ressources", + gridResourceId: "Identifiant de la ressource", gridName: "Nom", gridOwner: "Propriétaire", gridDescription: "Description", gridDateCreation: "Date de création", gridLastUpdate: "Dernière mise à jour", errorTitle: "échec de la demande", - errorMsg_500: "Le serveur renvoie le code d'état HTTP 500!

    Controllare il log!", - errorMsg_501: "Le serveur renvoie le code d'état HTTP 501!

    Le serveur n'a pas pu traiter votre demande!", - errorMsg_404: "Le serveur renvoie le code d'état HTTP 404!

    La ressource que vous recherchez ne peut être trouvée!", - errorMsg_timeout: "Deamnde expiré!", - textUserManager: "Gestion des utilisateurs", - textViewMap: '', // "Voir la carte", + errorMsg_500: "Le serveur renvoie le code d'état HTTP 500 !

    Vérifier le fichier de log!", + errorMsg_501: "Le serveur renvoie le code d'état HTTP 501 !

    Le serveur n'a pas pu traiter votre demande!", + errorMsg_404: "Le serveur renvoie le code d'état HTTP 404 !

    La ressource que vous recherchez ne peut pas être trouvée !", + errorMsg_timeout: "Délai d’attente dépassé !", + textUserManager: "Gestionnaire des utilisateurs", + textViewMap: '', // "Afficher la carte", tooltipViewMap: "Afficher la carte", - textEmbedMap: '', //"Embed Map", - tooltipEmbedMap: "Incorporer la carte", - textCopyMap: '', //"clone carte", - tooltipCopyMap: "Cloner la carte", + textEmbedMap: '', //"Inclure la carte", + tooltipEmbedMap: "Inclure la carte", + textCopyMap: '', //"Dupliquer la carte", + tooltipCopyMap: "Dupliquer la carte", textEditMap: '', //"Modifier la carte", tooltipEditMap: "Modifier la carte", - textDeleteMap: '', //"Effacer la carte", + textDeleteMap: '', //"Supprimer la carte", tooltipDeleteMap: "Supprimer la carte", textEditMetadata: '', //"Modifier les métadonnées", tooltipEditMetadata: "Modifier les informations", textSubmitEditMetadata: "Mettre à Jour", - tooltipSubmitEditMetadata: "Mise à Jour Info", + tooltipSubmitEditMetadata: "Mettre à Jour Info", titleConfirmCloseEditMetadata: "Confirmation", - textConfirmCloseEditMetadata: 'Fermer la fenêtre sans enregistrer? ', + textConfirmCloseEditMetadata: 'Fermer la fenêtre sans enregistrer ? ', metadataSaveSuccessTitle: "Succès", - metadataSaveSuccessMsg: "Métadonnées stockées correctement", - metadataSaveFailTitle: 'Erreur dans le stockage des métadonnées', + metadataSaveSuccessMsg: "Métadonnées sauvegardées correctement", + metadataSaveFailTitle: 'Erreur dans la sauvegarde des métadonnées', textClose: "Fermer", - msgSaveAlertTitle: "S'il vous plaît noter que la carte n'a pas été sauvé!", - msgSaveAlertBody: "Voulez-vous vraiment quitter sans enregistrer?", + msgSaveAlertTitle: "Attention votre carte n’est pas sauvegardée !", + msgSaveAlertBody: "Voulez-vous vraiment quitter sans enregistrer ?", tooltipClose: "Fermer la carte", msgDeleteMapTitle: "Attention", - msgDeleteMapBody: "Voulez-vous vraiment supprimer la carte? ", - msgSuccessDeleteMapTitle: "succès", - msgSuccessDeleteMapBody: "La carte a été éliminé", - msgFailureDeleteMapTitle: "Manqué", - msgFailureDeleteMapBody: "Quelque chose ne va arrivé", - IframeViewerTitle: "Map viewer", - IframeComposerTitle: "Map Editor- ", - IframeWaitMsg :"Chargement de la carte ...", - showMapTooltip: "Voir dans une nouvelle fenêtre", - embedCodeTitle: "Intégrer Le Code", + msgDeleteMapBody: "Voulez-vous vraiment supprimer la carte ? ", + msgSuccessDeleteMapTitle: "Succès", + msgSuccessDeleteMapBody: "La carte a été supprimée", + msgFailureDeleteMapTitle: "Echec", + msgFailureDeleteMapBody: "Une erreur est intervenue", + IframeViewerTitle: "Module cartographique", + IframeComposerTitle: "Editeur de carte - ", + IframeWaitMsg :"Chargement de la carte en cours...", + showMapTooltip: "Voir dans une nouvelle fenêtre", + embedCodeTitle: "Inclure Le Code", embedURL: "URL directe", urlLabel: "URL", - exportMapText: "Lien Carte", + exportMapText: "Lier la Carte", mobileText: "Mobile",         installApplicationText: "Installer l'application Android",         loadThisSourceText: "Ajouter cette source à MapStore Mobile", -        scanThisApplicationText: "Scannez ce code QR pour installer MapStore pour Android", -        scanThisSourceText: "Scannez ce code QR pour ajouter cette source de votre application mobile MapStore Vous devez installer MapStore pour Android avant.", +        scanThisApplicationText: "Scanner ce code QR pour installer MapStore pour Android", +        scanThisSourceText: "Scannez ce code QR pour ajouter cette source de votre application mobile MapStore. Vous devez au préalable installer MapStore pour Android .", mapPermissionText: "Autorisations", - tooltipMapPermissionText: "Modifier la carte autorisations par groupe", - mapPermissionTitleText: "Autorisations De La Carte" + tooltipMapPermissionText: "Modifier les autorisations sur la carte par groupe", + mapPermissionTitleText: "Autorisations sur la Carte" }, "MSMPagingToolbar.prototype": { desc: "Nouvelle carte", textNewMap: "Nouvelle carte", tooltipNewMap: "Créer une nouvelle carte", - textExpandAll: "Développer des lignes", - tooltipExpandAll: "Développe toutes les lignes", - textCollapseAll: "Fermer lignes", - tooltipCollapseAll: "Ferme toutes les lignes", - displayMsg: "Affichage des résultats {0} - {1}de {2}", + textExpandAll: "Développer", + tooltipExpandAll: "Développer tous les enregistrements", + textCollapseAll: "Refermer", + tooltipCollapseAll: "Refermer tous les enregistrements", + displayMsg: "Affichage des résultats {0} - {1} de {2}", emptyMsg: "Aucun résultat à afficher", firstText: "Première page", lastText: "Dernière page", nextText: "Page suivante", prevText: "Page précédente", - refreshText: "Recharger", + refreshText: "Actualiser", beforePageText: "Page", afterPageText : "de {0}", - resizerText: "Cartes pour page" + resizerText: "Cartes par page" }, "MSMPanel.prototype": { title : "MapManager" }, "MSMLogin.prototype": { loginText: "Se connecter", - logoutText: "Sortie", + logoutText: "Se déconnecter", ruleText: "Utilisateur connecté: {user}", - loginErrorText: "Le nom d'utilisateur ou mot de passe que vous avez entré est incorrect.", + loginErrorText: "Nom d'utilisateur ou mot de passe incorrect.", loginErrorTitle: "L'authentification a échoué", userFieldText: "Utilisateur", passwordFieldText: "Mot de passe", - loginFormTitle: "Authentifier" + loginFormTitle: "Veuillez vous connecter" }, "UserManagerView.prototype":{ textGeneral: "Général", @@ -107,21 +107,21 @@ GeoExt.Lang.add("fr", { textPassword: "Mot de passe", textPasswordEdit: 'Nouveau mot de passe', textPasswordConf: "Confirmer mot de passe", - textPasswordConfError: "Mot de passe non confirmée", - textBlankUserName: "Le nom ne doit pas être null", - textBlankPw: "Mot de passe ne doit pas être null", - textBlankRole: "Rôle devrait être sélectionné", + textPasswordConfError: "Mot de passe non confirmé", + textBlankUserName: "Le nom ne doit pas être null", + textBlankPw: "Le mot de passe ne doit pas être null", + textBlankRole: "Veuillez sélectionner un rôle", tooltipEdit: "Modifier les données utilisateur ", textEditUserTitle: "Modifier les données utilisateur", displayMsg: "Affichage des résultats {0} - {1} de {2}", - beforePageText: "Pagina", + beforePageText: "Page", afterPageText : "de {0}", - textRole: "Rôle", + textRole: "Rôle", tooltipDelete: "Supprimer cet utilisateur", textDelete: "Supprimer" , tooltipSave: "Enregistrer cet utilisateur", textSave: "Enregistrer", - tooltipCancel: "Annuler", + tooltipCancel: "Annuler l’enregistrement", textCancel: "Annuler", invalidFormMsg: "Certains champs ne sont pas valides", textAddUser: "", @@ -129,22 +129,22 @@ GeoExt.Lang.add("fr", { tooltipAddUser: "Créez un nouvel utilisateur", textTitle: "Gestionnaire Des Utilisateurs", tooltipSearch: "Rechercher", - textSelectRole: "Sélectionnez un rôle...", - userAlreadyTaken: "Nom de l'utilisateur present", - titleConfirmDeleteMsg: "Confirmer la suppression utilisateur", - textConfirmDeleteMsg: "Êtes-vous sûr de vouloir supprimer cet utilisateur?", + textSelectRole: "Veuillez sélectionner un rôle…", + userAlreadyTaken: "Nom d’utilisateur déjà pris", + titleConfirmDeleteMsg: "Confirmer la suppression de l’utilisateur", + textConfirmDeleteMsg: "Etes-vous certain de vouloir supprimer cet utilisateur ?", textManageGroups: "Gérer Les Groupes" }, "MSMUserGroupManager.prototype":{ - textGroupName: "Nom de groupe", + textGroupName: "Nom du groupe", textId: "Id", textDescription: "Description", textAddGroupButton: "Créer un nouveau groupe", groupNameAlreadyTaken: "Nom du groupe déjà pris", - titleConfirmDeleteMsg: "Confirmer pour supprimer le groupe", - textConfirmDeleteMsg: "Etes-vous sûr de vouloir supprimer ce groupe?", + titleConfirmDeleteMsg: "Confirmer la suppression du groupe", + textConfirmDeleteMsg: "Etes-vous certain de vouloir supprimer ce groupe ?", textName: "Nom", - textRole: "Rôle", + textRole: "Rôle", textGroup: "Groupe", textUsers: "Utilisateurs", textSave: "Enregistrer", @@ -154,7 +154,7 @@ GeoExt.Lang.add("fr", { tooltipDelete: "Supprimer ce groupe" }, "EmbedMapDialog.prototype": { - publishMessage: "Votre carte est prête à être publiée sur le web! Il suffit de copier le code HTML ci-dessous pour intégrer la carte dans votre site web:", + publishMessage: "Votre carte est prête à être publiée sur le web ! Il suffit de copier le code HTML ci-dessous pour intégrer la carte dans votre site web :", heightLabel: "Hauteur", widthLabel: "Largeur", mapSizeLabel: "Taille de la carte", @@ -162,51 +162,51 @@ GeoExt.Lang.add("fr", { smallSizeLabel: "Petit", premiumSizeLabel: "Premium", largeSizeLabel: "Grand", - loadMapText: "Chargez ce Plan (installer application avant)", + loadMapText: "Chargez cette carte (installer l’application avant)",         downloadAppText: "Installer l'application",         loadInMapStoreMobileText: "Mobile", - openImageInANewTab: "Ouvrir une image dans un nouvel onglet" + openImageInANewTab: "Ouvrir l’image dans un nouvel onglet" }, "mxp.plugins.CategoriesInitializer.prototype":{ - geostoreInitializationTitleText: "Échec de l'initialisation", - geostoreInitializationText: "Geostore réponse n'est pas le devrait", - notInitializedCategories: "Catégories manquantes: '{0}'. Voulez-vous le créer?", + geostoreInitializationTitleText: "Échec lors de l'initialisation", + geostoreInitializationText: "La réponse Geostore n’est pas celle attendue", + notInitializedCategories: "Catégories manquantes: '{0}'. Voulez-vous en créer une ?", userFieldText: "Utilisateur", - passwordFieldText: "Password", + passwordFieldText: "Mot de passe", acceptText: "Créer", cancelText: "Annuler", - notInitializedCategoriesWithCredentials: "
    Si vous êtes un administrateur s'il vous plaît insérer vos informations d'identification pour créer ces catégories: '{0}'
    " + notInitializedCategoriesWithCredentials: "
    Si vous êtes administrateur veuillez entrer vos crédits afin de créer ces catégories : '{0}'
    " }, "mxp.form.UserGroupComboBox.prototype":{ - fieldLabel: "Groupe D'Utilisateur" + fieldLabel: "Groupe D'Utilisateurs" }, "mxp.widgets.ResourceGroupPermissionGrid.prototype":{ - refreshText: "Grille Actualiser", + refreshText: "Actualiser la grille", addText: "Ajouter une nouvelle règle de sécurité basée sur les groupes d'utilisateurs", addNewSecurityRuleTitleText: "Créer Une Nouvelle Règle De Sécurité", editSecurityRuleTitleText: "Modifier la règle de sécurité pour le groupe '{0}'", - groupNameTitleText: "Error", - groupNameExistsText: "Déjà existe une règle pour ce nom de groupe , s'il vous plaît sélectionner un autre ou modifier sa règle", - groupNameIncompleteText: "Pas un groupe sélectionné . S'il vous plaît sélectionner un avant sauver", + groupNameTitleText: "Erreur", + groupNameExistsText: "Une règle existe déjà pour ce nom de groupe, veuillez en sélectionner une autre ou modifier la règle", + groupNameIncompleteText: "Aucun groupe sélectionné. Veuillez en sélectionner un avant d’enregistrer", textSave:"Enregistrer", textClose:"Fermer", textGroupName: "Groupe", textUserName: "Utilisateur", textCanRead: "Peut Lire", - textCanWrite: "Peut Écrire", - editText: "Modifier sélectionné règle de sécurité", - deleteText: "Supprimer la sélection règle de sécurité", + textCanWrite: "Peut écrire", + editText: "Modifier la règle de sécurité sélectionnée", + deleteText: "Supprimer la règle de sécurité sélectionnée", trueBooleanText: "Oui", falseBooleanText: "Non", confirmDeleteTitleText: "Supprimer La Règle De Sécurité", confirmDeleteText: "Voulez-vous vraiment supprimer la règle pour le groupe '{0}' ?" }, "mxp.widgets.ResourceGroupPermissionWindow.prototype":{ - title:"Autorisations De Ressources" + title:"Autorisations sur la Ressource" }, "MSMTemplatePanel.prototype":{ - title: "Éditeur De Modèle", - headerTitleText: "En-tête", + title: "Editeur De Modèle", + headerTitleText: "Entête", footerTitleText: "Pied de page", sectionContentTitleText: "Contenu de {0}", sectionCSSTitleText: "Style CSS", @@ -216,18 +216,18 @@ GeoExt.Lang.add("fr", { hideCollapseText: "Masquer Plié", splitText: "Split", collapsibleText: "Pliable", - collapseModeText: "Mode de Plié", + collapseModeText: "Mode Plié", widthText: "Largeur", heightText: "Hauteur ", - minWidthText: "Min Largeur", - maxHeightText: "Max Hauteur", - failSuccessTitle: "Error", + minWidthText: "Largeur Min", + maxHeightText: "Hauteur Max", + failSuccessTitle: "Erreur", mapMetadataTitle: "Enregistrer un Modèle", mapMedatataSetTitle: "", mapNameLabel: "Nom", mapDescriptionLabel: "Description", addResourceButtonText: "Enregistrer", - templateSuccessMsgText: "Sauvés succès", + templateSuccessMsgText: "Enregistré avec succès", templateSuccessTitleText: "OK", newTemplateText: "Nouveau", saveTemplateText: "Enregistrer" @@ -238,22 +238,22 @@ GeoExt.Lang.add("fr", { textOwner: "Propriétaire", textCreation: "Date De Création", textLastUpdate: "Dernière Mise à Jour", - tooltipSearch: "Tapez un nom à chercher", - textReset: "Reset", - tooltipReset: "Recherche propre", - failSuccessTitle: "Error", - resizerText: "Modèles par page", + tooltipSearch: "Saisir un nom pour la recherche", + textReset: "Réinitialiser", + tooltipReset: "Réinitialiser la recherche", + failSuccessTitle: "Erreur", + resizerText: "Nombre de Modèles par page", tooltipDelete: "Supprimer Modèle", deleteTemplateTitleText: "Attention", - deleteTemplateBodyText: "Voulez-vous supprimer ce modèle?" + deleteTemplateBodyText: "Voulez-vous supprimer ce modèle ?" }, "mxp.plugins.MapManager.prototype":{ buttonText: "Gestionnaire De Cartes", - tooltipText: "Ouvrez le Gestionnaire De Cartes" + tooltipText: "Ouvrir le Gestionnaire De Cartes" }, "mxp.plugins.TemplateManager.prototype":{ buttonText: "Modèles", - tooltipText: "Ouvrez le Gestionnaire De Modèles" + tooltipText: "Ouvrir le Gestionnaire De Modèles" }, "MSMTemplateManager.prototype":{ title: "Gestionnaire De Modèles" diff --git a/mapcomposer/app/static/translations/fr.js b/mapcomposer/app/static/translations/fr.js index 1b0580e55..fc1bbf2f7 100644 --- a/mapcomposer/app/static/translations/fr.js +++ b/mapcomposer/app/static/translations/fr.js @@ -9,34 +9,34 @@ GeoExt.Lang.add("fr", { "GeoExplorer.prototype": { zoomSliderText: "
    Niveau de zoom: {zoom}
    ", - loadConfigErrorText: "Difficulté à lire la configuration enregistrée:
    ", - loadConfigErrorDefaultText: "Erreur de serveur.", + loadConfigErrorText: "Difficulté pour lire la configuration enregistrée:
    ", + loadConfigErrorDefaultText: "Erreur du serveur.", xhrTroubleText: "Problème de communication: état", - layersText: "Couvertures", + layersText: "Couches", legendText: "Légende", titleText: "Titre", - zoomLevelText: "Niveau de Zoom ", - saveErrorText: "Problème de sauvegarde", - bookmarkText: "Mettre l`URL en favori", + zoomLevelText: "Niveau de Zoom", + saveErrorText: "Problème lors de la sauvegarde", + bookmarkText: "Mettre l`URL dans les favoris", permakinkText: "Permalien", appInfoText: "Crédits", aboutText: "À propos de GeoExplorer", - mapInfoText: "Info cartographique", + mapInfoText: "Info sur la carte", descriptionText: "Description", contactText: "Contact", aboutThisMapText: "À propos de cette carte", resetButtonTooltip: "Réinitialiser la Page", helpButtonTooltip: "Aide", - searchTabTitle : "Chercher", + searchTabTitle : "Rechercher", viewTabTitle : "Vue", portalTabTitle : "Portail", markerPopupTitle: "Détails", - mainLoadingMask: "S'il vous plaît attendre ..." + mainLoadingMask: "Veuillez attendre, chargement en cours ..." }, "GeoExplorer.Composer.prototype": { - uploadText: "Télécharger", - backText: "Retour en arrière", + uploadText: "Téléverser", + backText: "Précédent", nextText: "Suivant", loginText: "Se connecter", loginErrorText: "Nom d`utilisateur ou mot de passe incorrect", @@ -44,88 +44,88 @@ GeoExt.Lang.add("fr", { passwordFieldText: "Mot de passe", fullScreenText: "Plein écran", cswMsg: 'Chargement...', - cswFailureAddLayer: ' La couche ne peuvent pas être ajoutés à la carte', - cswZoomToExtentMsg: "BBOX pas disponible", - cswZoomToExtent: "CSW zoom dans la mesure" + cswFailureAddLayer: ' La couche ne peut pas être ajoutée à la carte', + cswZoomToExtentMsg: "BBOX non disponible", + cswZoomToExtent: "CSW zoom sur l’étendue" }, "gxp.menu.LayerMenu.prototype": { - layerText: "Couverture" + layerText: "Couche" }, "gxp.plugins.AddLayers.prototype": { - addActionMenuText: "Ajouter des couvertures", - addActionTip: "Ajouter des couvertures", + addActionMenuText: "Ajouter des couches", + addActionTip: "Ajouter des couches", addServerText: "Ajouter un nouveau serveur", - addButtonText: "Ajouter des couvertures", + addButtonText: "Ajouter des couches", untitledText: "Sans titre", - addLayerSourceErrorText: "Erreur d`obtention des capacités WMS ({msg}).\nVeuillez vérifier l`URL et essayez à nouveau.", - availableLayersText: "Couvertures disponibles", + addLayerSourceErrorText: "Erreur d’obtention des capacités WMS ({msg}).\nVeuillez vérifier l`URL et essayer à nouveau.", + availableLayersText: "Couches disponibles", expanderTemplateText: "

    Résumé: {abstract}

    ", panelTitleText: "Titre", layerSelectionText: "Visualiser les données disponibles depuis:", doneText: "Terminé", - removeFilterText: "effacer le filtre", + removeFilterText: "Effacer le filtre", filterEmptyText: "Filtre", - uploadText: "Télécharger les données" + uploadText: "Téléverser les données" }, "gxp.plugins.RemoveOverlays.prototype": { - removeOverlaysMenuText: "Retirer des superpositions", + removeOverlaysMenuText: "Retirer les superpositions", removeOverlaysActionTip: "Supprime toutes les superpositions de la carte", - removeOverlaysConfirmationText: "Etes-vous sûr de vouloir supprimer tous les calques chargés de la carte?" + removeOverlaysConfirmationText: "Etes-vous sûr de vouloir supprimer toutes les superpositions présentes dans la carte?" }, "gxp.plugins.BingSource.prototype": { - title: "Bing couvertures", - roadTitle: "Bing routes", - aerialTitle: "Bing aérienne", - labeledAerialTitle: "Bing aérienne avec des étiquettes" + title: "Couches Bing", + roadTitle: "Couche Bing des routes", + aerialTitle: "Couche aérienne Bing", + labeledAerialTitle: "Couche aérienne Bing avec étiquettes" }, "gxp.plugins.GoogleEarth.prototype": { - apiKeyPrompt: "Introduire SVP la clef Google API ", + apiKeyPrompt: "Veuillez introduire la clef pour l’API Google", menuText: "Vue 3D", - tooltip: "Passer à la vue 3D" + tooltip: "Basculer en vue 3D" }, "gxp.plugins.GoogleSource.prototype": { - title: "Couvertures Google", + title: "Couches Google", roadmapAbstract: "Voir la carte des rues", - satelliteAbstract: "Voir les images satellites", - hybridAbstract: "Afficher des images avec les noms de rue", - terrainAbstract: "Voir la cartes des rues avec le relief" + satelliteAbstract: "Voir la carte satellite", + hybridAbstract: "Afficher la carte satellite avec les noms de rue", + terrainAbstract: "Voir la carte des rues avec le relief" }, "gxp.plugins.LayerProperties.prototype": { - menuText: "Propriétés de la couverture", - toolTip: "Propriétés de la couverture" + menuText: "Propriétés de la couche", + toolTip: "Propriétés de la couche" }, "gxp.plugins.LayerTree.prototype": { - rootNodeText: "Couvertures", + rootNodeText: "Couches", overlayNodeText: "Surimpressions", - baseNodeText: "Couvertures de base" + baseNodeText: "Couches de base" }, "gxp.plugins.Legend.prototype": { - menuText: "Légende", - tooltip: "Montrer la légende" + menuText: "Afficher la légende", + tooltip: "Afficher la légende" }, "gxp.plugins.Measure.prototype": { lengthMenuText: "Longueur", - areaMenuText: "Surface", + areaMenuText: "Superficie", lengthTooltip: "Mesure de longueur", - areaTooltip: "Mesure de surface", + areaTooltip: "Mesure de superficie", measureTooltip: "Mesure", - bearingMenuText: "Roulement", - bearingTooltip: "Mesurer le roulement" + bearingMenuText: "Angle", + bearingTooltip: "Mesure d’angle" }, "gxp.plugins.Navigation.prototype": { - menuText: "Carte Panoramique", - tooltip: "Carte Panoramique" + menuText: "Navigation dans la carte", + tooltip: "Navigation dans la carte" }, "gxp.plugins.NavigationHistory.prototype": { @@ -137,45 +137,45 @@ GeoExt.Lang.add("fr", { "gxp.plugins.OSMSource.prototype": { title: "Calques OpenStreetMap", - mapnikAttribution: "Les données CC-By-SA by OpenStreetMap", - osmarenderAttribution: "Les données CC-By-SA by OpenStreetMap" + mapnikAttribution: "Les données CC-By-SA produites par OpenStreetMap", + osmarenderAttribution: "Les données CC-By-SA produites par OpenStreetMap" }, "gxp.plugins.Print.prototype": { menuText: "Imprimer la carte", tooltip: "Imprimer la carte", previewText: "Aperçu avant impression", - notAllNotPrintableText: "Toutes les couvertures ne sont pas imprimables", - nonePrintableText: "Aucune couverture n`est imprimable", - notPrintableLayersText: "Veuillez enlever ces couches et tous les marqueurs avant impression. Les couvertures suivantes ne sont pas imprimables:" + notAllNotPrintableText: "Impossible d’imprimer toutes les couches", + nonePrintableText: "Aucune couche ne peut être imprimée", + notPrintableLayersText: "Veuillez supprimer ces couches et tous les marqueurs avant impression. Les couches suivantes ne peuvent être imprimées :" }, "gxp.plugins.MapQuestSource.prototype": { title: "Couvertures MapQuest", - osmAttribution: "Avec la permission de tuiles MapQuest ", + osmAttribution: "Avec l’autorisation ‘Tile’ de Avec la permission de tuiles MapQuest ", osmTitle: "MapQuest OpenStreetMap", - naipAttribution: "Avec la permission de tuiles MapQuest ", + naipAttribution: "Avec l’autorisation ‘Tile’ de Avec la permission de tuiles MapQuest ", naipTitle: "MapQuest images" }, "gxp.plugins.RemoveLayer.prototype": { - removeMenuText: "Enlever la couverture", - removeActionTip: "Enlever la couverture" + removeMenuText: "Supprimer la couche ", + removeActionTip: "Supprimer la couche" }, "gxp.plugins.WMSGetFeatureInfo.prototype": { - infoActionTip: "Obtenir des infos sur l`entité", - popupTitle: "Info sur l`entité", + infoActionTip: "Obtenir des infos sur l’entité", + popupTitle: "Info sur l’entité", noDataMsg: "Aucune donnée n'a été renvoyée par le serveur", - maskMessage: "Obtenir des infos sur l`entité..." + maskMessage: "Obtenir des infos sur l’entité..." }, "gxp.plugins.WMSGetFeatureInfoMenu.prototype": { - infoActionTip: "Obtenir des infos sur l`entité", - popupTitle: "Info sur l`entité", + infoActionTip: "Obtenir des infos sur l’entité", + popupTitle: "Info sur l’entité", noDataMsg: "Aucune donnée n'a été renvoyée par le serveur", - maskMessage: "Obtenir des infos sur l`entité...", - activeActionTip:"Obtenir des infos sur l`entité sélectionnée" + maskMessage: "Obtenir des infos sur l’entité...", + activeActionTip:"Obtenir des infos sur l’entité sélectionnée" }, "gxp.plugins.Zoom.prototype": { @@ -191,13 +191,13 @@ GeoExt.Lang.add("fr", { }, "gxp.plugins.ZoomToDataExtent.prototype": { - menuText: "Zoom sur l`étendue de la couverture", - tooltip: "Zoom sur l`étendue de la couverture" + menuText: "Zoom sur l`étendue de la couche", + tooltip: "Zoom sur l`étendue de la couche" }, "gxp.plugins.ZoomToLayerExtent.prototype": { - menuText: "Zoom sur l`étendue de la couverture", - tooltip: "Zoom sur l`étendue de la couverture" + menuText: "Zoom sur l`étendue de la couche", + tooltip: "Zoom sur l`étendue de la couche" }, "gxp.WMSLayerPanel.prototype": { @@ -213,9 +213,9 @@ GeoExt.Lang.add("fr", { cacheFieldText: "Utiliser la version mise en cache", stylesText: "Styles", summaryText: "Statistiques", - summaryInfoText: "Current Viewport Raster Statistics", - loadMaskMsg: "Chargement des donnees ...", - noDataMsg: "Pas de données disponibles en la vue actuelle", + summaryInfoText: "StatisticsStatistiques des données raster sur l’étendue actuelle", + loadMaskMsg: "Extraction des données en cours...", + noDataMsg: "Pas de données disponibles dans la vue actuelle", refreshText: "Actualiser" }, @@ -223,8 +223,8 @@ GeoExt.Lang.add("fr", { title: "Ajouter un nouveau serveur...", cancelText: "Annuler", addServerText: "Ajouter un serveur", - invalidURLText: "Enter un URL valide jusqu`au WMS final (e.g. http://example.com/geoserver/wms)", - contactingServerText: "Contacter un serveur" + invalidURLText: "Saisir l’URL d’un serveur WMS(par ex. : http://example.com/geoserver/wms)", + contactingServerText: "Contact du serveur en cours" }, "gxp.ScaleOverlay.prototype": { @@ -232,27 +232,27 @@ GeoExt.Lang.add("fr", { }, "gxp.plugins.AddGroup.prototype": { addGroupMenuText: "Ajouter un Groupe", - addGroupActionTip: "Ajoutez un nouveau groupe à l'arbre des couvertures.", + addGroupActionTip: "Ajouter un nouveau groupe à l’arborescence", addGroupDialogTitle: "Nouveau Groupe", - addGroupFieldSetText: "Groupe Nom", + addGroupFieldSetText: "Nom du Groupe", addGroupFieldLabel: "Nouveau Groupe", addGroupButtonText: "Ajouter un Groupe", - addGroupMsg: "Entrez le nom du groupe" + addGroupMsg: "Saisir le nom du groupe" }, "gxp.plugins.RemoveGroup.prototype": { removeGroupMenuText: "Supprimer le groupe", - removeGroupActionTip: "Supprimer le groupe de l'arbre des couvertures", - removeGroupActionTip: "Supprimer le groupe sélectionné et ses couvertures de la carte", - removeGroupConfirmationText: "Vous êtes certain que vous souhaitez supprimer le groupe ? Tous les couvertures au sein du groupe seront supprimés de la carte." + removeGroupActionTip: "Supprimer le groupe de l’arborescence", + removeGroupActionTip: "Supprimer le groupe sélectionné et ses couches de la carte", + removeGroupConfirmationText: "Etes-vous certain de vouloir supprimer le groupe ? Tous les couches du groupe seront également supprimées de la carte." }, "gxp.plugins.SaveDefaultContext.prototype": { - saveDefaultContextMenuText: "Enregistrez le contexte par défaut.", - saveDefaultContextActionTip: "Enregistrer contexte Carte.", - contextSaveSuccessString: "Sauver le contexte est géré.", - contextSaveFailString: "Sauver le contexte a échoué.", - contextMsg: "Chargement...", + saveDefaultContextMenuText: "Enregistrer le contexte par défaut", + saveDefaultContextActionTip: "Enregistrer le contexte de carte", + contextSaveSuccessString: "Enregistrement du contexte effectué avec succès", + contextSaveFailString: "Echec lors de l’enregistrement du contexte", + contextMsg: "Chargement en cours...", userLabel: "Utilisateur", passwordLabel: "Mot de passe", loginLabel: "Connexion", @@ -260,7 +260,7 @@ GeoExt.Lang.add("fr", { mapMedatataSetTitle: "Métadonnées de la carte", mapNameLabel: "Nom", mapDescriptionLabel: "Description", - addResourceButtonText: "Ajouter Carte" + addResourceButtonText: "Ajouter la carte" }, "gxp.plugins.GeoReferences.prototype":{ initialText: "Sélectionner une zone", @@ -269,21 +269,21 @@ GeoExt.Lang.add("fr", { }, "gxp.plugins.ZoomBox.prototype":{ - zoomInMenuText: "Zoom Box Avant", - zoomOutMenuText: "Zoom Box Arrière", - zoomInTooltip: "Zoom Box Avant", - zoomOutTooltip: "Zoom Box Arrière" + zoomInMenuText: "Outil de Zoom Avant", + zoomOutMenuText: "Outil de Zoom Arrière", + zoomInTooltip: "Outil de Zoom Avant", + zoomOutTooltip: "Outil de Zoom Arrière" }, "GeoExt.ux.PrintPreview.prototype":{ paperSizeText: "Taille de papier:", resolutionText: "Résolution:", printText: "Imprimer", - emptyTitleText: "Entrez le titre de la carte ici.", - includeLegendText: "Inclure la légende?", - legendOnSeparatePageText: "Légende sur une page distincte?", - compactLegendText: "Légende compact?", - emptyCommentText: "Entrer des commentaires d'ici.", - creatingPdfText: "Création PDF...", + emptyTitleText: "Saisir le titre de la carte ici.", + includeLegendText: "Inclure la légende ?", + legendOnSeparatePageText: "Légende sur une page distincte ?", + compactLegendText: "Légende compacte ?", + emptyCommentText: "Entrer des commentaires ici.", + creatingPdfText: "Création du PDF en cours...", graticuleFieldLabelText: 'Réticule actif', defaultTabText: "Défaut", legendTabText: "Légende" @@ -291,12 +291,12 @@ GeoExt.Lang.add("fr", { "GeoExt.ux.LegendStylePanel.prototype":{ iconsSizeText: "Taille des icônes", - fontSizeText: "Taille de la police", + fontSizeText: "Taille de police", fontFamilyText: "Famille de polices", - forceLabelsText: "Force Étiquettes", + forceLabelsText: "Forcer l’étiquetage", dpiText: "Dpi", - fontStyleText: "Le style de police", - fontEditorText: "Etiquette config", + fontStyleText: "Style de police", + fontEditorText: "Configuration de l’étiquetage", sizeText: "Taille" }, @@ -305,8 +305,8 @@ GeoExt.Lang.add("fr", { sizeText: "Taille", colorText: "Couleur", fontFamilyText: "Famille de polices", - fontStyleText: "Le style de police", - fontEditorText: "Etiquette config" + fontStyleText: "Style de police", + fontEditorText: "Configuration de l’étiquetage" }, "gxp.plugins.GeonetworkSearch.prototype":{ @@ -318,9 +318,9 @@ GeoExt.Lang.add("fr", { groupPropertiesActionTip: "Propriétés du groupe", groupPropertiesDialogTitle: "Propriétés du groupe - ", groupPropertiesFieldSetText: "Nom du groupe", - groupPropertiesFieldLabel: "nom du nouveau groupe", - groupPropertiesButtonText: "Fait", - groupPropertiesMsg: "Veuillez entrer un nom de groupe" + groupPropertiesFieldLabel: "Nom du nouveau groupe", + groupPropertiesButtonText: "Terminé", + groupPropertiesMsg: "Veuillez saisir un nom pour le groupe" }, "gxp.plugins.Login.prototype":{ @@ -338,59 +338,64 @@ GeoExt.Lang.add("fr", { nextPageTip: "Page suivante", lastPageTip: "Dernière page", title: "Entités", - totalMsg: "Total: {0} entités", + totalMsg: "Total : {0} entités", displayExportCSVText: "Exporter au format CSV", exportCSVSingleText: "Une seule page", - exportCSVMultipleText: "Toutes les pages", - failedExportCSV: "Impossible de trouver la réponse pour le format de sortie CSV", + exportCSVMultipleText: "Toute la page", + failedExportCSV: "Impossible de trouver une réponse pour le format de sortie CSV", invalidParameterValueErrorText: "Valeur de paramètre non valide", - zoomToFeature: "Zoom sur Feature" + zoomToFeature: "Zoom sur l’Entité", + comboFormatMethodLabel: "Format", + comboFormatEmptyText: "Veuillez sélectionner un format", + noFormatTitleText: "Format incorrect", + noFormatBodyText: "Veuillez sélectionner un format valide", + exportTitleText: "Exporter" }, "gxp.plugins.QueryForm.prototype": { - queryActionText: "Query", - queryMenuText: "Couche de requêtes", + queryActionText: "Requête", + queryMenuText: "Interroger la couche", queryActionTip: "Interroger la couche sélectionnée", - queryByLocationText: "Query selon le lieu", - currentTextText: "Mesure actuelle", + queryByLocationText: "Requête par emplacement", + currentTextText: "Etendue actuelle", queryByAttributesText: "Requête par attributs", - queryMsg: "Recherche...", - cancelButtonText: "Remettre", - noFeaturesTitle: "Pas de correspondance", - noFeaturesMessage: "Votre requête n'a retourné aucun résultat.", + queryMsg: "Recherche en cours...", + cancelButtonText: "Réinitialiser", + noFeaturesTitle: "Aucune correspondance", + noFeaturesMessage: "Votre recherche n'a renvoyé aucun résultat.", title: "Rechercher", - attributeEnablement: "Requête par attributs", - attributeEnablementMsg: "Invalid search Type! To use this you have to select 'Feature' type and to select a vector layer before.", + attributeEnablement: "Recherche par attributs", + attributeEnablementMsg: "Type de recherche non valide ! Vous devez sélectionner le type 'Entité' après avoir choisi une couche vectorielle.", searchType: "Réglages de base", typeLabel: "Type", - featureLabel: "Max Features" + featureLabel: "Nombre maximum d’entités" }, "gxp.plugins.BBOXQueryForm.prototype": { selectionMethodFieldSetComboTitle: "Méthode de sélection", - comboEmptyText: "Sélectionner une méthode..", + comboEmptyText: "Sélectionner une méthode…", comboSelectionMethodLabel: "Sélection", - comboPolygonSelection: 'Polygon', - comboCircleSelection: 'Arrondissez', - comboBBOXSelection: 'BBox', - errorBBOXText: "Le BBox choisi n'est pas valide!", - errorDrawPolygonText: "Vous devez dessiner le polygone", - errorDrawCircleText: "Vous devez dessiner le cercle", - errorDrawTitle: "Demande erreur", - errorBufferTitle: "Le tampon est incorrecte", - errorBufferText: "Le tampon sélectionné n'est pas valide!", - areaLabel: "Région", - perimeterLabel: "Perimetro", - radiusLabel: "Perimeter", - centroidLabel: "Centroid", - selectionSummary: "Résumé de Sélection" + comboPolygonSelection: 'Polygone', + comboCircleSelection: 'Cercle', + comboBBOXSelection: 'Rectangle englobant', + errorBBOXText: "Le rectangle englobant choisi n'est pas valide!", + errorDrawPolygonText: "Vous devez dessiner un polygone", + errorDrawCircleText: "Vous devez dessiner un cercle", + errorDrawTitle: "Erreur dans la requête", + errorBufferTitle: "Erreur de buffer", + errorBufferText: "Le tampon sélectionné n'est pas valide !", + areaLabel: "Superficie", + perimeterLabel: "Périmètre", + radiusLabel: "Rayon", + centroidLabel: "Centroïde", + selectionSummary: "Récapitulatif sur la Sélection" }, "gxp.widgets.form.BufferFieldset.prototype": { - bufferFieldLabel: "Gamme de tampon", - bufferFieldSetTitle: "Tampon", + bufferFieldLabel: "Etendue de la zone tampon", + bufferFieldSetTitle: "Zone tampon", coordinatePickerLabel: "Coordonnées", - draweBufferTooltip: "Dessinez le tampon" + draweBufferTooltip: "Dessiner la zone tampon" }, "gxp.form.BBOXFieldset.prototype":{ @@ -398,22 +403,22 @@ GeoExt.Lang.add("fr", { westLabel:"Ouest", eastLabel:"Est", southLabel:"Sud", - waitEPSGMsg: "S'il vous plaît attendre...", + waitEPSGMsg: "Veuillez patienter s'il vous plaît...", setAoiText: "FixéROI", - setAoiTooltip: "Activer le contrôle TextBox pour dessiner un ROI (BBox) sur la carte", + setAoiTooltip: "Activer le contrôle SetBox pour dessiner un rectangle englobant dans la carte", title: "Région d'Intérêt" }, "gxp.FilterBuilder.prototype":{ - preComboText: "égaler", + preComboText: "Correspondance", postComboText: "de ce qui suit:", addConditionText: "ajouter la condition", addGroupText: "ajouter un groupe", - removeConditionText: "suppression de la condition" + removeConditionText: "supprimer la condition" }, "gxp.EmbedMapDialog.prototype": { - publishMessage: "Votre carte est prête à être publiée sur le web! Il suffit de copier le code HTML ci-dessous pour intégrer la carte dans votre site web:", + publishMessage: "Votre carte est prête à être publiée sur le web ! Il suffit de copier le code HTML ci-dessous pour intégrer la carte dans votre site web:", heightLabel: "Hauteur", widthLabel: "Largeur", mapSizeLabel: "Taille de la carte", @@ -424,91 +429,91 @@ GeoExt.Lang.add("fr", { }, "gxp.plugins.GoogleGeocoder.prototype": { - addMarkerTooltip: "Réinitialiser Marker" + addMarkerTooltip: "Réinitialiser le Marqueur" }, "gxp.plugins.DynamicGeocoder.prototype": { - addMarkerTooltip: "Réinitialiser Marker", - emptyText: "Géocoder..." + addMarkerTooltip: "Réinitialiser le marqueur", + emptyText: "Géocodage en cours..." }, "gxp.plugins.ReverseGeocoder.prototype": { buttonText: "Adresse", emptyText: "Adresse...", errorMsg: "Aucune adresse trouvée", - waitMsg: "S'il vous plaît attendre...", + waitMsg: "Veuillez patienter s'il vous plaît...", addressTitle: "Adresse trouvée" }, "gxp.form.WFSSearchComboBox.prototype": { emptyText:"Rechercher", - loadingText: "recherche..." + loadingText: "Recherche en cours..." }, "gxp.form.ContextSwitcher.prototype":{ - switchActionTip : "Changement de carte", - switchSaveAlert: " Toutes les données non enregistrées seront a perdu.", - switchConfirmationText : "Vous êtes certain que vous souhaitez le carte?" + switchActionTip : "Changer de carte", + switchSaveAlert: " Toutes les données non enregistrées seront perdues.", + switchConfirmationText : "Etes-vous certain de vouloir changer de carte?" }, "gxp.form.LanguageSwitcher.prototype":{ - switchActionTip : "Changement de langue", - switchConfirmationText : "Vous êtes certain que vous souhaitez modifier la langue?"//Vous êtes certain que vous souhaitez modifier la langue? toutes les données non enregistrées seront a perdu?" + switchActionTip : "Changer de langue", + switchConfirmationText : "Etes-vous certain de vouloir changer de langue?"//Vous êtes certain que vous souhaitez modifier la langue? toutes les données non enregistrées seront perdues ?" }, "gxp.plugins.MarkerEditor.prototype":{ - markerName:'Markers', - copyText:'Copiez le texte ci-dessous et le coller dans le "Importer Marqueurs" fenêtre dans un second temps ...', - pasteText:'Collez le texte dans la zone de texte et cliquez sur imoport.', + markerName:'Marqueurs', + copyText:'Copiez le texte ci-dessous puis collez-le dans la fenêtre "Importer des Marqueurs"...', + pasteText:'Collez le texte dans la zone de texte et cliquez sur Importer.', addToTheMapText:'Ajouter à la carte', updateText: 'Mettre à jour', - resetText:'Remettre', - removeText:'Enlever', + resetText:'Réinitialiser', + removeText:'Supprimer', compositeFieldTitle: 'Titre', - compositeFieldLabel: 'étiquette', + compositeFieldLabel: 'Etiquette', coordinatesText: 'Coordonnées', - contentText: 'Teneur', + contentText: 'Contenu', gridColTitle: 'Titre', - gridColLabel: 'étiquette', + gridColLabel: 'Etiquette', gridColLat: 'Lat', gridColLon: 'Lon', - gridColContent: 'Teneur', - exportBtn: "Marqueurs d'exportation", - importBtn: "Marqueurs d'importation", + gridColContent: 'Contenu', + exportBtn: "Exporter les Marqueurs", + importBtn: "Importer les Marqueurs", removeAllBnt: 'Supprimer tout', - markerChooserTitle:'Choisissez un marqueur', - useThisMarkerText:'Utilisez cette Marker', - selectMarkerText:'Marker Select', - insertImageText:'«Insérer une image', + markerChooserTitle:'Choisir un marqueur', + useThisMarkerText:'Utiliser ce Marker', + selectMarkerText:'Sélectionner un Marqueur', + insertImageText:'Insérer une image', imageUrlText:'URL de l\'image', importGeoJsonText:'Importer GeoJSON', - errorText:"Error", - notWellFormedText:"Le texte que vous avez ajouté n'est pas bien formé Veuillez le vérifier" + errorText:"Erreur", + notWellFormedText:"Le texte que vous avez ajouté n'est pas bien formé. Veuillez vérifier" }, "gxp.widgets.form.CoordinatePicker.prototype":{ fieldLabel: 'Coordonnées', - pointSelectionButtionTip: 'Cliquez pour activer la sélection du collimateur', + pointSelectionButtionTip: 'Cliquer pour activer la sélection du collimateur', latitudeEmptyText: 'Latitude', longitudeEmptyText: 'Longitude' }, "gxp.plugins.AddLayer.prototype":{ - waitMsg: "S'il vous plaît attendre...", - capabilitiesFailureMsg: " La couche peut pas être ajouté à la carte" + waitMsg: "Veuillez patienter s'il vous plaît...", + capabilitiesFailureMsg: " La couche WMS ne peut pas être ajoutée à la carte suite à des problèmes lié au service" }, "gxp.plugins.Geolocate.prototype":{ geolocateMenuText: "Géolocaliser", - geolocateTooltip: "Localiser mon poste", + geolocateTooltip: "Localiser ma position", trackMenuText: "Suivre position", trackTooltip: "Suivre ma position", - waitMsg: "Recherche...", - errorMsg: "Ce navigateur ne supporte pas Géolocalisation" + waitMsg: "Localisation en cours...", + errorMsg: "Votre navigateur ne supporte pas la Géolocalisation" }, "gxp.plugins.GeoLocationMenu.prototype":{ initialText: "Sélectionner une zone", menuText: "Codification Géographique", tooltip: "Codification Géographique", - addMarkerTooltip: "Réinitialiser Marker", - emptyText: "Géocoder...", + addMarkerTooltip: "Réinitialiser le Marqueur", + emptyText: "Géocodage en cours...", buttonText: "Adresse", emptyText: "Adresse...", errorMsg: "Aucune adresse trouvée", @@ -516,11 +521,11 @@ GeoExt.Lang.add("fr", { addressTitle: "Adresse trouvée", geolocate: { geolocateMenuText: "Géolocaliser", - geolocateTooltip: "Localiser mon poste", + geolocateTooltip: "Localiser ma position", trackMenuText: "Suivre position", trackTooltip: "Suivre ma position", - waitMsg: "Recherche...", - errorMsg: "Ce navigateur ne supporte pas Géolocalisation" + waitMsg: "Localisation en cours...", + errorMsg: "Ce navigateur ne supporte pas la Géolocalisation" }, actionText: "Géolocalisations" }, @@ -529,173 +534,173 @@ GeoExt.Lang.add("fr", { importexportLabel: "Import / Export", labels:{ "map": { - "saveText" : "Exportez la Carte", + "saveText" : "Exporter la Carte", "loadText" : "Importer la Carte", - "uploadWindowTitle" : "Importez le fichier de contexte de carte", + "uploadWindowTitle" : "Importer le fichier de contexte de carte", "downloadWindowTitle" : "Exporter le fichier de contexte de carte" }, "kml/kmz": { "saveText" : "Export KML", "loadText" : "Importer KML/KMZ", - "uploadWindowTitle" : "Importez KML/KMZ fichier", - "downloadWindowTitle" : "Export KML fichier", - "kmlExportTitleText": "KML/KMZ Export", + "uploadWindowTitle" : "Import KML/KMZ", + "downloadWindowTitle" : "Export KML", + "kmlExportTitleText": "Export KML/KMZ", "layerEmptyText": "La couche sélectionnée est vide", - "notVectorlayerText": "S'il vous plaît sélectionner seulement couche vectoriel", - "notLayerSelectedText": "S'il vous plaît sélectionner un couche vectoriel" + "notVectorlayerText": "Veuillez sélectionner uniquement des couches vectorielles", + "notLayerSelectedText": " Veuillez sélectionner uniquement des couches vectorielles" } } }, "gxp.MapFileUploadPanel" :{ - fileLabel: "Fichier de la carte", - fieldEmptyText: "Recherchez les fichiers de carte contexte ...", - uploadText: "Envoyez", - waitMsgText: "Téléchargement de vos données ...", - resetText: "Rréinitialiser", - failedUploadingTitle: "Téléchargement de fichier erreur" + fileLabel: "Fichier de carte", + fieldEmptyText: "Rechercher les fichiers de contexte de carte...", + uploadText: "Envoyer", + waitMsgText: "Téléversement de vos données en cours ...", + resetText: "Réinitialiser", + failedUploadingTitle: "Erreur lors du téléversement du fichier" }, "gxp.MapFileDownloadPanel" :{ - buttonText: "Exportez la Carte", - filenameLabel: "Carte nom de fichier", - waitMsgText: "Générer fichier de mappage de contexte ...", - resetText: "Rréinitialiser", - failedUploadingTitle: "Impossible de générer un fichier de la carte", - saveErrorText: "Économie d'Trouble:" + buttonText: "Exporter la Carte", + filenameLabel: "Nom du fichier de carte", + waitMsgText: "Générer le fichier de contexte de carte...", + resetText: "Réinitialiser", + failedUploadingTitle: "Impossible de générer un fichier de carte", + saveErrorText: "Problème lors de la sauvegarde :" }, "gxp.KMLFileDownloadPanel" :{ buttonText: "Exporter", filenameLabel: "Nom du fichier KML", - waitMsgText: "Génération KML ...", - invalidFileExtensionText: "L'extension du fichier doit être:", - resetText: "Rréinitialiser", + waitMsgText: "Génération KML en cours...", + invalidFileExtensionText: "L'extension du fichier doit être choisie parmi les options suivantes :", + resetText: "Réinitialiser", failedUploadingTitle: "Impossible de générer le fichier KML" }, "gxp.KMLFileUploadPanel" :{ fileLabel: "Le fichier KML", fieldEmptyText: "Rechercher des fichiers KML ou KMZ ...", - uploadText: "Envoyez", - waitMsgText: "Téléchargement de vos données ...", - invalidFileExtensionText: "File extension must be one of: ", - resetText: "Rréinitialiser", - failedUploadingTitle: "Téléchargement de fichier erreur", + uploadText: "Envoyer", + waitMsgText: "Données en cours de téléversement...", + invalidFileExtensionText: " L'extension du fichier doit être choisie parmi les options suivantes : ", + resetText: "Réinitialiser", + failedUploadingTitle: "Erreur lors du téléversement du fichier", layerNameLabel: "Nom de la couche" }, "gxp.plugins.PrintSnapshot.prototype" :{ - noSupportedLayersErrorMsg: "Une erreur s'est produite lors de la génération de la carte Instantané: pas de couches en charge ont été trouvés!", - generatingErrorMsg: "Une erreur s'est produite lors de la génération de la carte Snapshot", - printStapshotTitle: "Imprimer Snapshot", - serverErrorMsg: "Une erreur s'est produite lors de la génération de la carte Snapshot: Erreur de serveur", - menuText: "Snapshot", - tooltip: "Snapshot" + noSupportedLayersErrorMsg: "Une erreur s'est produite lors de la génération de l’aperçu de la carte : aucune couche supportée n’a été trouvée !", + generatingErrorMsg: "Une erreur s'est produite lors de la génération de l’aperçu de la carte ", + printStapshotTitle: "Imprimer l’aperçu de la carte", + serverErrorMsg: "Une erreur s'est produite lors de la génération de l’aperçu de la carte : Erreur du serveur", + menuText: "Aperçu", + tooltip: "Aperçu" }, "gxp.plugins.EmbedMapDialog.prototype" :{ - exportMapText: "Lien Carte", - toolsTitle: "Sélectionner l`application à inclure dans la barre d`outils", + exportMapText: "Lier la Carte", + toolsTitle: "Sélectionner les outils à inclure dans la barre d`outils", alertEmbedTitle: "Attention", alertEmbedText: "Enregistrer la carte avant d'utiliser l'outil 'Publier la carte'", - previewText: "Previsualiser", + previewText: "Prévisualiser", embedCodeTitle: "Intégrer le code", embedURL: "URL directe", urlLabel: "URL", - showMapTooltip: "Voir dans une nouvelle fenêtre", - loadMapText: "Chargez ce Plan (installer application avant)", -        downloadAppText: "installer l'application", + showMapTooltip: "Afficher dans une nouvelle fenêtre", + loadMapText: "Charger cette carte (installer l’application d’abord)", +        downloadAppText: "Installer l'application",         loadInMapStoreMobileText: "Mobile", - openImageInANewTab: "Ouvrir une image dans un nouvel onglet" + openImageInANewTab: "Ouvrir l’image dans un nouvel onglet" }, "gxp.widgets.form.SpatialSelectorField.prototype" :{ title : "Région d'Intérêt", selectionMethodLabel : "Méthode de Sélection", - comboEmptyText : "Vous sélectionnez une Méthode..", + comboEmptyText : "Sélectionner une Méthode..", comboSelectionMethodLabel : "Sélection", northLabel : "Nord", westLabel : "Ouest", eastLabel : "Est", southLabel : "Sud", - setAoiTitle : "Bounding Box", - setAoiText : "Il dessine", - setAoiTooltip : "Permettez au contrôle de SetBox de dessiner(tirer) un ROI (Limitant la Boîte) sur la carte", - areaLabel : "Zone", + setAoiTitle : "Rectangle englobant", + setAoiText : "Dessiner le rectangle englobant", + setAoiTooltip : " Activer le contrôle SetBox pour dessiner un rectangle englobant dans la carte ", + areaLabel : "Superficie", perimeterLabel : "Périmètre", radiusLabel : "Rayon", - centroidLabel : "Centroide", + centroidLabel : "Centroïde", latitudeEmptyText : 'Y', longitudeEmptyText : 'X', - geocodingFieldSetTitle : "GeoCoder", - geocodingPanelTitle : "Choisir une Localité", - geocodingPanelBtnRefreshTxt : "Il montre Géométries", - geocodingPanelBtnDestroyTxt : "Tu caches Géométries", - geocodingPanelBtnDeleteTxt : "Tu enlèves Localitéà", - geocodingPanelLocationHeader: "Localité", + geocodingFieldSetTitle : "Géocodage", + geocodingPanelTitle : "Localisations sélectionnées", + geocodingPanelBtnRefreshTxt : "Afficher les Géométries", + geocodingPanelBtnDestroyTxt : "Cacher les Géométries", + geocodingPanelBtnDeleteTxt : "Supprimer la localisation", + geocodingPanelLocationHeader: "Localisation", geocodingPanelCustomHeader: "Parent", - geocodingPanelGeometryHeader: "WKT de la Géométrie", - geocodingPanelBtnSelectAllTxt : "Il sélectionne Tout", - geocodingPanelBtnDeSelectAllTxt : "Tu enlèves toute la sélection", - geocodingPanelMsgRemRunningTitle : "Tu enlèves Localité", - geocodingPanelMsgRemRunningMsg : "Est-ce que tu veux enlever les Localités sélectionnées par la liste?", - geocodingFieldLabel : "Il cherche une Localité", - geocodingFieldEmptyText : "Tu insères une Localité...", - geocodingFieldBtnAddTooltip : "Tu ajoutes une Localité à la liste", - geocodingFieldBtnDelTooltip : "Tu nettoies...", - selectionSummary : "Sommaire des Sélections", - geocoderSelectorsLabels: ['Union des géométries', 'Liste des Zones Administratives', 'Zone Administrative et sottoaree'], + geocodingPanelGeometryHeader: "Géométrie WKT", + geocodingPanelBtnSelectAllTxt : "Tout sélectionner", + geocodingPanelBtnDeSelectAllTxt : "Tout déselectionner", + geocodingPanelMsgRemRunningTitle : "Supprimer les localisations", + geocodingPanelMsgRemRunningMsg : "Souhaitez-vous supprimer les localisations sélectionnées de la liste ?", + geocodingFieldLabel : "Rechercher une localisation", + geocodingFieldEmptyText : "Saisir une localisation...", + geocodingFieldBtnAddTooltip : "Ajouter une localisation à la liste", + geocodingFieldBtnDelTooltip : "Effacer...", + selectionSummary : "Récapitulatif sur la sélection", + geocoderSelectorsLabels: ['Union des géométries', 'Liste des Zones Administratives', 'Sous-liste des Zones Administratives'], selectionReturnTypeLabel: "Type de sélection" }, "gxp.plugins.WFSGrid.prototype":{ - displayMsgPaging: "Elements {0} - {1} of {2}", - emptyMsg: "No elements found", - loadMsg: "S'il vous plaît attendre ...", + displayMsgPaging: "Eléments {0} - {1} sur {2}", + emptyMsg: "Aucun élément à afficher", + loadMsg: "Veuillez patienter SVP ...", zoomToTooltip: "Zoom sur la cible" }, "gxp.plugins.TabPanelWFSGrids.prototype":{ - displayMsgPaging: "Elements {0} - {1} of {2}", - emptyMsg: "No elements found", - noRecordFoundLabel: "No elements found", - loadMsg: "S'il vous plaît attendre ..." + displayMsgPaging: "Eléments {0} - {1} sur {2}", + emptyMsg: "Aucun élément trouvé", + noRecordFoundLabel: " Aucun élément trouvé ", + loadMsg: "Chargement en cours ..." }, "gxp.plugins.spatialselector.SpatialSelector.prototype" :{ titleText : "Région d'Intérêt", selectionMethodLabel : "Méthode de Sélection", - comboEmptyText : "Vous sélectionnez une Méthode..", + comboEmptyText : "Choisir une Méthode..", comboSelectionMethodLabel : "Sélection" }, "gxp.widgets.form.spatialselector.SpatialSelectorMethod.prototype" :{ - areaLabel : "Zone", + areaLabel : "Superficie", perimeterLabel : "Périmètre", - lengthLabel: "Lunghezza", + lengthLabel: "Longueur", radiusLabel : "Rayon", - centroidLabel : "Centroide", - selectionSummary: "Sommaire des Sélections", - geometryOperationText: "Opération de géométrie", + centroidLabel : "Centroïde", + selectionSummary: "Récapitulatif sur la sélection", + geometryOperationText: "Opération sur la géométrie", geometryOperationEmptyText: "Choisissez une opération", distanceTitleText: "Distance", distanceUnitsTitleText: "Unités de distance", noOperationTitleText: "Aucune opération valable", - noOperationMsgText: "S'il vous plaît, choisissez une opération avant la questiony", - noCompleteMsgText: "S'il vous plaît, forme(formulaire) complète avant question" + noOperationMsgText: "Veuillez choisir une opération avant la recherche", + noCompleteMsgText: "Veuillez compléter le formulaire avant la recherche" }, "gxp.widgets.form.spatialselector.BBOXSpatialSelectorMethod.prototype" :{ name : 'BBOX', - label : 'Bounding Box', + label : 'Rectangle englobant', northLabel : "Nord", westLabel : "Ouest", eastLabel : "Est", southLabel : "Sud", - setAoiTitle : "Bounding Box", - setAoiText : "Il dessine", - setAoiTooltip : "Permettez au contrôle de SetBox de dessiner(tirer) un ROI (Limitant la Boîte) sur la carte" + setAoiTitle : "Rectangle englobant", + setAoiText : "Dessiner le rectangle englobant", + setAoiTooltip : " Activer le contrôle SetBox pour dessiner un rectangle englobant dans la carte " }, "gxp.widgets.form.spatialselector.BufferSpatialSelectorMethod.prototype" :{ @@ -711,25 +716,25 @@ GeoExt.Lang.add("fr", { }, "gxp.widgets.form.spatialselector.GeocoderSpatialSelectorMethod.prototype" :{ - name : 'Geocoding', - label : 'Geocoding', - geocodingFieldSetTitle : "GeoCoder", - geocodingPanelTitle : "Choisir une Localité", - geocodingPanelBtnRefreshTxt : "Il montre Géométries", - geocodingPanelBtnDestroyTxt : "Tu caches Géométries", - geocodingPanelBtnDeleteTxt : "Tu enlèves Localitéà", - geocodingPanelLocationHeader: "Localité", + name : 'Géocodage', + label : 'Géocodage', + geocodingFieldSetTitle : "Géocodage", + geocodingPanelTitle : "Localisations sélectionnées", + geocodingPanelBtnRefreshTxt : "Afficher les Géométries", + geocodingPanelBtnDestroyTxt : "Cacher les Géométries", + geocodingPanelBtnDeleteTxt : "Supprimer la localisation", + geocodingPanelLocationHeader: "Localisation", geocodingPanelCustomHeader: "Parent", - geocodingPanelGeometryHeader: "WKT de la Géométrie", - geocodingPanelBtnSelectAllTxt : "Il sélectionne Tout", - geocodingPanelBtnDeSelectAllTxt : "Tu enlèves toute la sélection", - geocodingPanelMsgRemRunningTitle : "Tu enlèves Localité", - geocodingPanelMsgRemRunningMsg : "Est-ce que tu veux enlever les Localités sélectionnées par la liste?", - geocodingFieldLabel : "Il cherche une Localité", - geocodingFieldEmptyText : "Tu insères une Localité...", - geocodingFieldBtnAddTooltip : "u ajoutes une Localité à la liste", - geocodingFieldBtnDelTooltip : "Tu nettoies...", - selectionSummary : "Sommaire des Sélections" + geocodingPanelGeometryHeader: " Géométrie WKT", + geocodingPanelBtnSelectAllTxt : " Tout sélectionner", + geocodingPanelBtnDeSelectAllTxt : "Tout désélectionner", + geocodingPanelMsgRemRunningTitle : "Supprimer les localisations", + geocodingPanelMsgRemRunningMsg : "Souhaitez-vous supprimer les localisations sélectionnées de la liste ?", + geocodingFieldLabel : "Rechercher une localisation", + geocodingFieldEmptyText : "Saisir une localisation...", + geocodingFieldBtnAddTooltip : "Ajouter une localisation à la liste", + geocodingFieldBtnDelTooltip : "Effacer...", + selectionSummary : "Récapitulatif sur la Sélection" }, "gxp.widgets.form.spatialselector.PolygonSpatialSelectorMethod.prototype" :{ @@ -738,35 +743,35 @@ GeoExt.Lang.add("fr", { }, "gxp.plugins.spatialselector.Geocoder.prototype" :{ - titleText: "Geocoder", - searchText: "Il trouve", - searchTpText: "Il recherche la zone sélectionnée et tu exécutes le zoom sur la carte", - resetText: "Remettre", - resetTpText: "Recherche d'emplacement Remise", + titleText: "Géocodage", + searchText: "Rechercher", + searchTpText: "Rechercher la localisation sélectionnée et zoomer dessus", + resetText: "Réinitialiser", + resetTpText: "Réinitialiser la recherche de localisation", translatedKeys: { "name": "Rue", - "number": "Nombre(Numéro)" + "number": "Numéro" } }, "gxp.plugins.ResourceStatus.prototype":{ - rootNodeText: "Ressources d'importation", - serviceErrorTitle: "Erreur de Service", + rootNodeText: "Ressources importées", + serviceErrorTitle: "Erreur du Service", tabTitle: "Importé", - layerNodeName: "Niveaux", - serviceNodeName: "Service" + layerNodeName: "Couches", + serviceNodeName: "Services" }, "gxp.plugins.SpatialSelectorQueryForm.prototype":{ - noFilterSelectedMsgTitle: "Pas de filtre sélectionné", + noFilterSelectedMsgTitle: "Aucun filtre sélectionné", noFilterSelectedMsgText: "Vous devez sélectionner au moins un filtre", - invalidRegexFieldMsgTitle: "Domaine invalide", + invalidRegexFieldMsgTitle: "Domaines invalides", invalidRegexFieldMsgText: "Un ou plusieurs domaines sont incorrects!" }, "gxp.plugins.FeatureManager.prototype":{ - noValidWmsVersionMsgTitle: 'WMS Version invalide', - noValidWmsVersionMsgText: "Le queryForm plugin ne fonctionne pas avec la version une source WMS: " + noValidWmsVersionMsgTitle: 'Version de WMS invalide', + noValidWmsVersionMsgText: "L’extension queryForm ne fonctionne pas avec la version de cette source WMS: " }, "gxp.data.WMTSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Aucune couche de la projection cartographique actuelle est disponible sur ce serveur", @@ -775,5 +780,22 @@ GeoExt.Lang.add("fr", { "gxp.data.TMSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Aucune couche de la projection cartographique actuelle est disponible sur ce serveur", warningTitle: "avertissement" - } + }, + "gxp.plugins.CategoriesInitializer.prototype":{ + geostoreInitializationTitleText: "L’initialisation a échoué", + geostoreInitializationText: "La réponse Geostore n’est pas celle attendue", + notInitializedCategories: "Catégories manquantes : '{0}'. Voulez-vous en créer une ?", + userFieldText: "Utilisateur", + passwordFieldText: "Mot de passe", + acceptText: "Créer", + cancelText: "Annuler", + notInitializedCategoriesWithCredentials: "
    Si vous êtes administrateur veuillez entrer vos crédits afin de créer ces catégories: '{0}'
    " + } }); + + + + + + + From ab6fe6a69f6a7fdc2cfd020cba6041fd24d4920f Mon Sep 17 00:00:00 2001 From: tobia Date: Mon, 30 Jun 2014 12:24:02 +0200 Subject: [PATCH 006/186] Improvements for SnappingAgent and FeatureGrid plugins. Close #440, Close #441. --- .../script/plugins/AdvancedSnappingAgent.js | 223 ++++++++++++++++++ .../gxp/src/script/plugins/FeatureGrid.js | 186 +++++++++++++-- .../static/externals/gxp/src/theme/all.css | 5 + .../externals/gxp/src/theme/img/magnet.png | Bin 0 -> 653 bytes mapcomposer/app/static/translations/de.js | 12 +- mapcomposer/app/static/translations/en.js | 18 +- mapcomposer/app/static/translations/es.js | 13 +- mapcomposer/app/static/translations/fr.js | 16 +- mapcomposer/app/static/translations/it.js | 14 +- mapcomposer/buildjs.cfg | 3 + 10 files changed, 456 insertions(+), 34 deletions(-) create mode 100644 mapcomposer/app/static/externals/gxp/src/script/plugins/AdvancedSnappingAgent.js create mode 100644 mapcomposer/app/static/externals/gxp/src/theme/img/magnet.png diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/AdvancedSnappingAgent.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/AdvancedSnappingAgent.js new file mode 100644 index 000000000..65f70a8e3 --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/AdvancedSnappingAgent.js @@ -0,0 +1,223 @@ +/** + * Copyright (C) 2007 - 2012 GeoSolutions S.A.S. + * http://www.geo-solutions.it + * + * GPLv3 + Classpath exception + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @requires plugins/Tool.js + */ + +/** api: (define) + * module = gxp.plugins + * class = AdvancedSnappingAgent + */ + +/** api: (extends) + * plugins/Tool.js + */ +Ext.namespace("gxp.plugins"); + +/** api: constructor + * .. class:: AdvancedSnappingAgent(config) + * + * Plugin for managing snapping while editing. + * + * Author: Tobia Di Pisa at tobia.dipisa@geo-solutions.it + */ +gxp.plugins.AdvancedSnappingAgent = Ext.extend(gxp.plugins.Tool, { + + /** api: ptype = gxp_advancedsnappingagent */ + ptype: "gxp_advancedsnappingagent", + + iconCls: "snapping-button", + + tooltipText: "Enable/Disable Snapping", + + /** api: config[controlOptions] + * ``Object`` Options for the ``OpenLayers.Control.Snapping`` used with + * this tool. + */ + + /** private: method[init] + */ + init: function(target) { + gxp.plugins.AdvancedSnappingAgent.superclass.init.apply(this, arguments); + this.snappingTargets = []; + this.controls = []; + this.setSnappingTargets(this.targets); + }, + + /** private: method[setSnappingTargets] + */ + setSnappingTargets: function(targets) { + // clear any previous targets + this.snappingTargets.length = 0; + // configure any given targets + if (targets) { + for (var i=0, ii=targets.length; i"].concat(!this.alwaysDisplayOnMap ? [{ + }, { + xtype: 'tbspacer', + width: 10 + }, + this.displayItem + ); + + var bbar = (featureManager.paging ? [toolbarElements] : []).concat(["->"].concat(!this.alwaysDisplayOnMap ? [{ text: this.displayFeatureText, id: "showButton", iconCls: "gxp-icon-addtomap", @@ -488,6 +598,10 @@ gxp.plugins.FeatureGrid = Ext.extend(gxp.plugins.ClickableFeatures, { featureManager.showLayer(this.id, this.displayMode); } + // ///////////////////////////////////// + // FeatureManager events's listeners + // ///////////////////////////////////// + var me = this; featureManager.paging && featureManager.on("setpage", function(mgr, condition, callback, scope, pageIndex, numPages) { var paging = (mgr.page && (mgr.page.numFeatures > 0)) || numPages > 1; featureGrid.zoomToPageButton.setDisabled(!paging); @@ -497,9 +611,29 @@ gxp.plugins.FeatureGrid = Ext.extend(gxp.plugins.ClickableFeatures, { var next = (paging && (pageIndex !== numPages-1)); featureGrid.lastPageButton.setDisabled(!next); featureGrid.nextPageButton.setDisabled(!next); + + if(featureManager.pagingType == 1){ + featureGrid.currentPage.enable(); + featureGrid.currentPage.setValue(featureManager.pageIndex + 1); + featureGrid.numberOfPagesLabel.setText(featureManager.numPages); + + if(me.showNumberOfRecords === true){ + featureGrid.totalRecords.setText(featureManager.numberOfFeatures + "}"); + } + } }, this); - featureManager.on("layerchange", function(mgr, rec, schema) { + featureManager.on("layerchange", function(mgr, rec, schema) { + if(featureManager.pagingType == 1){ + featureGrid.currentPage.disable(); + featureGrid.currentPage.setValue("0"); + featureGrid.numberOfPagesLabel.setText("0"); + + if(me.showNumberOfRecords === true){ + featureGrid.totalRecords.setText("0}"); + } + } + //TODO use schema instead of store to configure the fields var ignoreFields = ["feature", "state", "fid"]; schema && schema.each(function(r) { @@ -508,6 +642,18 @@ gxp.plugins.FeatureGrid = Ext.extend(gxp.plugins.ClickableFeatures, { featureGrid.ignoreFields = ignoreFields; featureGrid.setStore(featureManager.featureStore, schema); }, this); + + featureManager.on("clearfeatures", function(mgr, rec, schema) { + if(featureManager.pagingType == 1){ + featureGrid.currentPage.disable(); + featureGrid.currentPage.setValue("0"); + featureGrid.numberOfPagesLabel.setText("0"); + + if(me.showNumberOfRecords === true){ + featureGrid.totalRecords.setText("0}"); + } + } + }, this); return featureGrid; }, diff --git a/mapcomposer/app/static/externals/gxp/src/theme/all.css b/mapcomposer/app/static/externals/gxp/src/theme/all.css index 1272334f6..254b6aea4 100644 --- a/mapcomposer/app/static/externals/gxp/src/theme/all.css +++ b/mapcomposer/app/static/externals/gxp/src/theme/all.css @@ -26,6 +26,11 @@ background-image: url(img/silk/folder.png); } +/*gxp_advancedsnappingagent*/ +.snapping-button{ + background-image: url(img/magnet.png) !important; +} + /* position the zoom slider within map panel */ .gx-zoomslider { top: 90px; diff --git a/mapcomposer/app/static/externals/gxp/src/theme/img/magnet.png b/mapcomposer/app/static/externals/gxp/src/theme/img/magnet.png new file mode 100644 index 0000000000000000000000000000000000000000..ba01be7a795077ca60ec2f3c3d489724d74aa176 GIT binary patch literal 653 zcmV;80&@L{P)us zy~Y1!u=|cX40`Y^w96l$*?NeyAY-ugmh~b;x|x+OAtsWMbbW6pMdKWMr^ollhxfj` zhZtk9Z8Z-L@&EwZ*_pMi2E~C|t;V-nt=Gj;sZq%1ivR%ME$ixPGCA${`!7eM(XXvQ zr_*^*uh$39o6SlhkywK%rSM+UJ`ab(7pkh>EaG^zs9LQa9k$yQ#u$7YjlNDT>k9zD zPCozSX|4A7u-&fA=kp@~P?k-MF<^{=EX(PErrA@=V%=`{Tv3$tBBv-yy4&rZPc4fL zG|iS}d6`?DQ<9|p-EujL0KhPe6IE4bi=3*eGs7@W5CH6!%UMa1_7}O;izYaZgCGdN zaU3H)ZO3tpAP9itxV66J#x%{b=Xnt!1O!3I!~sDNGK3KDJTEd$bG!jiO0R9(c12MH z!t;eVKzP0&iXzyy?NUmwHvnDN=f3ZI7-Puha$+3F=5iv&7<}LNbX}kSZ3YlU(F|h@ zVk)%(h^dr_F@`9LW~=cvAPhqnAp|@j={Ud>l12zY7>4dvpx5gqpEVlpyW``%IPmt< zkGadIng8%39t(#-AMT@VL;-hUK)D>X8+dk-&H<7-bD0ZbS|7mTqe4iLwT nc76{olHtu{t><6g`G3|QOn2`16KeC900000NkvXXu0mjf`$8WA literal 0 HcmV?d00001 diff --git a/mapcomposer/app/static/translations/de.js b/mapcomposer/app/static/translations/de.js index 794d3e28a..b7df6f56d 100644 --- a/mapcomposer/app/static/translations/de.js +++ b/mapcomposer/app/static/translations/de.js @@ -377,7 +377,11 @@ GeoExt.Lang.add("de", { exportCSVMultipleText: "Alle Seite", failedExportCSV: "Fehler beim Ansprechen für Ausgabeformat CSV finden", invalidParameterValueErrorText: "Ungültige Parameter Wert", - zoomToFeature: "Zoom auf Funktionen" + zoomToFeature: "Zoom auf Funktionen", + exportTitleText: "Export", + pageLabel: "Seite", + pageOfLabel: "von", + totalRecordsLabel: "Einträge Insgesamt" }, "gxp.plugins.QueryForm.prototype": { @@ -816,5 +820,9 @@ GeoExt.Lang.add("de", { "gxp.data.TMSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Keine Schicht in der aktuellen Kartenprojektion ist auf diesem Server nicht verfügbar", warningTitle: "Warnung" - } + }, + + "gxp.plugins.AdvancedSnappingAgent.prototype":{ + tooltipText: "Aktivieren/Deaktivieren Snapping" + } }); diff --git a/mapcomposer/app/static/translations/en.js b/mapcomposer/app/static/translations/en.js index 67cd9ea63..b04cdc78d 100644 --- a/mapcomposer/app/static/translations/en.js +++ b/mapcomposer/app/static/translations/en.js @@ -308,8 +308,7 @@ GeoExt.Lang.add("en", { fontFamilyText: "Font Family", fontStyleText: "Font style", fontEditorText: "Label config" - }, - + }, "gxp.plugins.GeonetworkSearch.prototype":{ geonetworkSearchText: "View metadata", geonetworkSearchActionTip: "View metadata" @@ -348,7 +347,10 @@ GeoExt.Lang.add("en", { comboFormatEmptyText: "Please, select format", noFormatTitleText: "Incorrect format", noFormatBodyText: "Please, select a valid format", - exportTitleText: "Export" + exportTitleText: "Export", + pageLabel: "Page", + pageOfLabel: "of", + totalRecordsLabel: "Total Records" }, "gxp.plugins.QueryForm.prototype": { queryActionText: "Query", @@ -767,7 +769,7 @@ GeoExt.Lang.add("en", { invalidRegexFieldMsgTitle: "Invalid Fields", invalidRegexFieldMsgText: "One or more fields are incorrect!" }, - + "gxp.plugins.FeatureManager.prototype":{ noValidWmsVersionMsgTitle: 'No valid WMS version', noValidWmsVersionMsgText: "The queryForm plugin doesn't work with WMS Source version: " @@ -783,12 +785,18 @@ GeoExt.Lang.add("en", { cancelText: "Cancel", notInitializedCategoriesWithCredentials: "
    If you are an administrator please insert your credentials to create these categories: '{0}'
    " }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { noLayerInProjectionError: "No layer in the current map projection is available on this server", warningTitle: "Warning" }, + "gxp.data.TMSCapabilitiesReader.prototype" : { noLayerInProjectionError: "No layer in the current map projection is available on this server", warningTitle: "Warning" - } + }, + + "gxp.plugins.AdvancedSnappingAgent.prototype":{ + tooltipText: "Enable/Disable Snapping" + } }); diff --git a/mapcomposer/app/static/translations/es.js b/mapcomposer/app/static/translations/es.js index 70c9cbf16..d33c2bd1d 100644 --- a/mapcomposer/app/static/translations/es.js +++ b/mapcomposer/app/static/translations/es.js @@ -348,7 +348,10 @@ GeoExt.Lang.add("es", { comboFormatEmptyText: "Por favor, seleccione un formato", noFormatTitleText: "Formato inválido", noFormatBodyText: "Por favor, seleccione un formato válido", - exportTitleText: "Exportar" + exportTitleText: "Exportar", + pageLabel: "Página", + pageOfLabel: "de", + totalRecordsLabel: "Registros Totales" }, "gxp.plugins.QueryForm.prototype": { queryActionText: "Consultar", @@ -783,12 +786,18 @@ GeoExt.Lang.add("es", { cancelText: "Cancelar", notInitializedCategoriesWithCredentials: "
    Si es administrador introduzca sus credenciales para crear las categorías: '{0}'
    " }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { noLayerInProjectionError: "No layer in the current map projection is available on this server", warningTitle: "advertencia" }, + "gxp.data.TMSCapabilitiesReader.prototype" : { noLayerInProjectionError: "No layer in the current map projection is available on this server", warningTitle: "advertencia" - } + }, + + "gxp.plugins.AdvancedSnappingAgent.prototype":{ + tooltipText: "Activar/Desactivar Snapping" + } }); diff --git a/mapcomposer/app/static/translations/fr.js b/mapcomposer/app/static/translations/fr.js index fc1bbf2f7..e9cb3da79 100644 --- a/mapcomposer/app/static/translations/fr.js +++ b/mapcomposer/app/static/translations/fr.js @@ -349,7 +349,10 @@ GeoExt.Lang.add("fr", { comboFormatEmptyText: "Veuillez sélectionner un format", noFormatTitleText: "Format incorrect", noFormatBodyText: "Veuillez sélectionner un format valide", - exportTitleText: "Exporter" + exportTitleText: "Exporter", + pageLabel: "Page", + pageOfLabel: "sur", + totalRecordsLabel: "Nombre de Dossiers" }, "gxp.plugins.QueryForm.prototype": { @@ -768,19 +771,22 @@ GeoExt.Lang.add("fr", { invalidRegexFieldMsgTitle: "Domaines invalides", invalidRegexFieldMsgText: "Un ou plusieurs domaines sont incorrects!" }, - + "gxp.plugins.FeatureManager.prototype":{ noValidWmsVersionMsgTitle: 'Version de WMS invalide', noValidWmsVersionMsgText: "L’extension queryForm ne fonctionne pas avec la version de cette source WMS: " }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Aucune couche de la projection cartographique actuelle est disponible sur ce serveur", warningTitle: "avertissement" }, + "gxp.data.TMSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Aucune couche de la projection cartographique actuelle est disponible sur ce serveur", warningTitle: "avertissement" }, + "gxp.plugins.CategoriesInitializer.prototype":{ geostoreInitializationTitleText: "L’initialisation a échoué", geostoreInitializationText: "La réponse Geostore n’est pas celle attendue", @@ -790,7 +796,11 @@ GeoExt.Lang.add("fr", { acceptText: "Créer", cancelText: "Annuler", notInitializedCategoriesWithCredentials: "
    Si vous êtes administrateur veuillez entrer vos crédits afin de créer ces catégories: '{0}'
    " - } + }, + + "gxp.plugins.AdvancedSnappingAgent.prototype":{ + tooltipText: "Activer/Désactiver Engagement" + } }); diff --git a/mapcomposer/app/static/translations/it.js b/mapcomposer/app/static/translations/it.js index ddbef9b7b..c1f3c6f6b 100644 --- a/mapcomposer/app/static/translations/it.js +++ b/mapcomposer/app/static/translations/it.js @@ -372,7 +372,11 @@ GeoExt.Lang.add("it", { exportCSVMultipleText: "Tutte le pagine", failedExportCSV: "Impossibile esportare nel formato CSV", invalidParameterValueErrorText: "Valore parametro non valido", - zoomToFeature: "Zoom alla Feature" + zoomToFeature: "Zoom alla Feature", + exportTitleText: "Esporta", + pageLabel: "Pagina", + pageOfLabel: "di", + totalRecordsLabel: "Elementi Totali" }, "gxp.plugins.QueryForm.prototype": { @@ -796,12 +800,18 @@ GeoExt.Lang.add("it", { noValidWmsVersionMsgTitle: 'Versione WMS non valida', noValidWmsVersionMsgText: "Il plugin queryForm non funziona con una sorgente WMS versione: " }, + "gxp.data.WMTSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Nessun layer disponibile su questo server nel sistema di coordinate della mappa", warningTitle: "Attenzione" }, + "gxp.data.TMSCapabilitiesReader.prototype" : { noLayerInProjectionError: "Nessun layer disponibile su questo server nel sistema di coordinate della mappa", warningTitle: "Attenzione" - } + }, + + "gxp.plugins.AdvancedSnappingAgent.prototype":{ + tooltipText: "Abilita/Disabilita Aggancio" + } }); diff --git a/mapcomposer/buildjs.cfg b/mapcomposer/buildjs.cfg index 38bd0d9f8..dc8a299bf 100644 --- a/mapcomposer/buildjs.cfg +++ b/mapcomposer/buildjs.cfg @@ -54,6 +54,7 @@ include = OpenLayers/Rule.js OpenLayers/StyleMap.js OpenLayers/Style2.js + OpenLayers/Strategy/BBOX.js OpenLayers/Handler/Path.js OpenLayers/Handler/Polygon.js OpenLayers/Handler/RegularPolygon.js @@ -70,6 +71,7 @@ include = OpenLayers/Control/Graticule.js OpenLayers/Control/Geolocate.js OpenLayers/Control/SelectFeature.js + OpenLayers/Control/Snapping.js OpenLayers/Control/MousePosition.js OpenLayers/Control/OverviewMap.js OpenLayers/Events.js @@ -266,6 +268,7 @@ include = plugins/About.js plugins/ResourceStatus.js plugins/CategoriesInitializer.js + plugins/AdvancedSnappingAgent.js locale/en.js locale/fr.js GeoExplorerLoader.js From c173a77ad9d6144388cb287d1526221a51ea87f5 Mon Sep 17 00:00:00 2001 From: tobia Date: Mon, 30 Jun 2014 13:35:47 +0200 Subject: [PATCH 007/186] #440, small fix for the total number of records visualizzation in FeatureGrid. --- .../gxp/src/script/plugins/FeatureGrid.js | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js index b765866e1..e72864c0c 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js @@ -400,32 +400,32 @@ gxp.plugins.FeatureGrid = Ext.extend(gxp.plugins.ClickableFeatures, { }] } ); - } - - if(this.showNumberOfRecords === true){ - toolbarElements.push( - /*{ - xtype: 'compositefield', - width: 120, - items: [*/{ - xtype: 'label', - text: "{" + this.totalRecordsLabel + " - ", - autoWidth: true, - style: { - marginTop: '3px' - } - }, { - xtype: 'label', - ref: "../totalRecords", - width: 20, - text: "0}", - style: { - marginTop: '3px' + + if(this.showNumberOfRecords === true){ + toolbarElements.push( + /*{ + xtype: 'compositefield', + width: 120, + items: [*/{ + xtype: 'label', + text: "{" + this.totalRecordsLabel + " - ", + autoWidth: true, + style: { + marginTop: '3px' + } + }, { + xtype: 'label', + ref: "../totalRecords", + width: 20, + text: "0}", + style: { + marginTop: '3px' + } } - } - /*] - }*/ - ); + /*] + }*/ + ); + } } toolbarElements.push( From 7518d733d60e6eb249bfc56327f1107fab45be47 Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Mon, 30 Jun 2014 13:51:07 +0200 Subject: [PATCH 008/186] added expiring date management tool. Fixes on user and template manager --- .../externals/mapmanager/src/MSMGridPanel.js | 2 +- .../mapmanager/src/MSMTemplatePanel.js | 2 +- .../mapmanager/src/MSMUserManager.js | 2 +- .../src/mxp/plugins/ExpiringTaskStatus.js | 391 ++++++++++++++++++ .../mapmanager/theme/css/mapstoremanager.css | 9 +- .../externals/mapmanager/theme/img/clock.png | Bin 0 -> 882 bytes .../mapmanager/theme/img/sheduled_task.png | Bin 0 -> 811 bytes mapcomposer/buildjs.cfg | 1 + 8 files changed, 403 insertions(+), 4 deletions(-) create mode 100644 mapcomposer/app/static/externals/mapmanager/src/mxp/plugins/ExpiringTaskStatus.js create mode 100644 mapcomposer/app/static/externals/mapmanager/theme/img/clock.png create mode 100644 mapcomposer/app/static/externals/mapmanager/theme/img/sheduled_task.png diff --git a/mapcomposer/app/static/externals/mapmanager/src/MSMGridPanel.js b/mapcomposer/app/static/externals/mapmanager/src/MSMGridPanel.js index 97e8df42b..2a8067063 100644 --- a/mapcomposer/app/static/externals/mapmanager/src/MSMGridPanel.js +++ b/mapcomposer/app/static/externals/mapmanager/src/MSMGridPanel.js @@ -876,7 +876,7 @@ MSMGridPanel = Ext.extend(Ext.grid.GridPanel, { mapId, { name:mapName, - description: mapDescription, + description: mapDescription // add the template id //templateId: templateId }, diff --git a/mapcomposer/app/static/externals/mapmanager/src/MSMTemplatePanel.js b/mapcomposer/app/static/externals/mapmanager/src/MSMTemplatePanel.js index 4c0414c6b..1fd4c18c4 100644 --- a/mapcomposer/app/static/externals/mapmanager/src/MSMTemplatePanel.js +++ b/mapcomposer/app/static/externals/mapmanager/src/MSMTemplatePanel.js @@ -313,7 +313,7 @@ MSMTemplatePanel = Ext.extend(Ext.Panel, { hiddenName:'groupId', maxLength:200, allowBlank:false, - target: me.target, + target: me.target } ] diff --git a/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js b/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js index 0de11202a..19f5567e1 100644 --- a/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js +++ b/mapcomposer/app/static/externals/mapmanager/src/MSMUserManager.js @@ -950,7 +950,7 @@ UserManagerView = Ext.extend(Ext.grid.GridPanel, { //special behiviour for dates var value =values[name]; if(value instanceof Date){ - var field = form.findField(name); + var field = form.getForm().findField(name); if(field && field.format){ attribute[arr[1]] = value.format(field.format); }else{ diff --git a/mapcomposer/app/static/externals/mapmanager/src/mxp/plugins/ExpiringTaskStatus.js b/mapcomposer/app/static/externals/mapmanager/src/mxp/plugins/ExpiringTaskStatus.js new file mode 100644 index 000000000..9a9a46132 --- /dev/null +++ b/mapcomposer/app/static/externals/mapmanager/src/mxp/plugins/ExpiringTaskStatus.js @@ -0,0 +1,391 @@ +/* + * Copyright (C) 2007 - 2014 GeoSolutions S.A.S. + * http://www.geo-solutions.it + * + * GPLv3 + Classpath exception + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** api: (define) + * module = mxp.plugins + * class = Tool + * base_link = `Ext.util.Observable `_ + */ +Ext.ns("mxp.plugins"); + + +/** api: constructor + * .. class:: he.ExpiringTaskStatus(config) + * + * Open a plugin to check the status of the Expire user task + * and OpenSDI Mangager to : + * + */ +mxp.plugins.ExpiringTaskStatus = Ext.extend(mxp.plugins.Tool, { + + /** api: ptype = mxp_he_expiring_task_status */ + ptype: "mxp_he_expiring_task_status", + serverDateFormat: 'D M d H:i:s T Y', + displayDateFormat: 'd/m/Y H:i:s', + buttonText: "Account Expiration", + latestAccountExpiringText : "Recent Expired Accounts", + taskStatusText : "Expiring Task Status", + taskDetailText: "Event Detail", + reloadText: "Reload", + lastExecutionLabel: "Last Execution", + executedLabel: "Executed", + lastExecutionStatusLabel: "Last Run Status", + statusLabel:'Execution Outcome', + emailNotificationStatusLabel:'Email Notification', + currentStatusLabel: "Current Status", + lastMessageLabel: "Last Message", + emailText:"Email", + statusText:"Status", + messageText:"Message", + receiverText:"Receiver", + emailNotificationText:"Email Notification", + expiredAccountsText: "Expired Accounts", + dateText: "Date", + loginManager: null, + setActiveOnOutput: true, + + /** api: method[addActions] + */ + addActions: function() { + + var thisButton = new Ext.Button({ + iconCls:'sheduled_task_ic', + text: this.buttonText, + tooltip: this.tooltipText, + handler: function() { + this.addOutput(); + + + }, + scope: this + }); + + var actions = [thisButton]; + + return mxp.plugins.ExpiringTaskStatus.superclass.addActions.apply(this, [actions]); + }, + + /** api: method[addOutput] + * :arg config: ``Object`` configuration for the ``Ext.Component`` to be + * added to the ``outputTarget``. Properties of this configuration + * will be overridden by the applications ``outputConfig`` for the + * tool instance. + * :return: ``Ext.Component`` The component added to the ``outputTarget``. + * + * Adds output to the tool's ``outputTarget``. This method is meant to be + * called and/or overridden by subclasses. + */ + addOutput: function(config) { + + var login = this.target.login ? this.target.login: + this.loginManager && this.target.currentTools[this.loginManager] + ? this.target.currentTools[this.loginManager] : null; + this.auth = this.target.auth; + + this.outputConfig = this.outputConfig || {}; + + var statusUrl = this.statusUrl ? this.statusUrl : // the upload URL is configured in th plugin + this.target.adminUrl ? this.target.adminUrl + "/mvc/admin/tasks/status" : // use relative path from adminUrl + "/opensdi2-manager/mvc/admin/tasks/status"; // by default search on root opensdi-manager2 + + var me = this; + var objId =Ext.id(); + Ext.apply(this.outputConfig,{ + layout: 'border', + id: objId, //The unique identifier for the panel + itemId:'task_status', + xtype:'panel', + closable: true, + closeAction: 'close', + iconCls: "sheduled_task_ic", + header: false, + deferredReneder:false, + viewConfig: { + forceFit: true + }, + title: this.buttonText, + + items:[ + //EXPIRED USER PANEL + { + title: this.latestAccountExpiringText, + iconCls: 'group_delete_ic', + xtype:'grid', + ref:'statuslog', + loadMask:true, + autoExpandColumn: 'expiredUsers', + tbar: [{ + ref:'../reloadBtn', + iconCls:'refresh_ic', + text: this.reloadText, + tooltip: this.reloadText, + handler:function(bt){ + bt.refOwner.getStore().load(); + bt.refOwner.getSelectionModel().clearSelections(); + bt.refOwner.refOwner.detail.hide(); + } + }], + sm: new Ext.grid.RowSelectionModel( + { + singleSelect:true, + listeners:{ + //load details + rowSelect: function(sm,rowIndex,record){ + var detailPanel = sm.grid.refOwner.detail + detailPanel.form.getForm().loadRecord(record); + if(record.json.emailNotificationLog){ + detailPanel.notificationLogGrid.getStore().loadData(record.json); + } + detailPanel.show(); + } + } + } + ), + columns:[ + { + header: this.dateText, + width: 170, + xtype:'datecolumn', + format:this.displayDateFormat, + dataIndex: 'date' + }, { + + id: 'expiredUsers', + xtype: 'templatecolumn', + tpl: '{name} ', + header: this.expiredAccountsText, + dataIndex: 'expiredUsers' + }, { + header: this.statusText, + width: 170, + dataIndex: 'status', + xtype:'gridcolumn', + renderer: function(value, metaData, record, rowIndex, colIndex, store) { + //render icon in case of success + var classes = 'x-grid-center-icon action_column_btn ' + (value =="Success" ? 'accept' : 'close'); + return '
    '+'
    ' + value; + return value; + } + },{ + header: this.emailNotificationText, + width: 170, + dataIndex: 'emailNotificationStatusSummary', + xtype:'gridcolumn', + renderer: function(value, metaData, record, rowIndex, colIndex, store) { + //render icon in case of success + var classes = 'x-grid-center-icon action_column_btn ' + (value =="Success" ? 'accept' : 'close'); + return '
    '+'
    ' + value; + return value; + } + } + ], + store: new Ext.data.JsonStore({ + root: 'expiredUsersLog', + id: 'date', + sortInfo: { + field: 'date', + direction: 'DESC' // or 'DESC' (case sensitive for local sorting) + }, + fields: [ + { name: 'date', type: 'date', dateFormat: this.serverDateFormat}, + 'expiredUsers', + 'status', + 'emailNotificationStatusSummary', + 'emailNotificationLog' + ], + autoLoad: true, + url: statusUrl, + auth:this.auth, + headers: {Authorization:this.auth}, + listeners: { + beforeload: function(a,b,c){ + a.proxy.conn.headers = a.proxy.conn.headers ? a.proxy.conn.headers : {}; + if( a.proxy.conn.headers ){ + if(this.auth){ + a.proxy.conn.headers['Authorization'] = me.auth; + } + }else{ + if(this.auth){ + a.proxy.conn.headers['Authorization'] = me.auth; + } + } + + }, + load : function( store, records, options ){ + var json = store.reader.jsonData; + var CurrentStatus = Ext.data.Record.create([ + {name: "lastExecutionOutCome", type: "date",dateFormat: this.serverDateFormat }, + {name: "lastRun", type: "string"}, + {name: "status", type: "string"}, + {name: "message", type: "string"} + ]); + var record = new CurrentStatus(json); + var container = Ext.getCmp(objId); + if(container!=null){ + container.status.getForm().loadRecord(record); + } + } + } + }), + layout:'fit', + autoScroll:true, + auth: this.auth, + autoWidth:true, + region:'center' + },{ + frame: true, + region:'west', + resizable:true, + width:400, + autoScroll:true, + items:[ + //LAST RUN STATUS + { + title: this.taskStatusText, + bodyStyle:'padding:5px 5px 0', + iconCls: 'clock_ic', + xtype:'form', + frame: true, + ref:'../status', + items:[{ + xtype:'displayfield', + anchor:'90%', + renderer: Ext.util.Format.dateRenderer(this.displayDateFormat), + fieldLabel: this.lastExecutionLabel, + + name: 'lastRun' + },{ + xtype:'displayfield', + fieldLabel:this.lastExecutionStatusLabel, + name: 'lastExecutionOutCome' + },{ + xtype:'displayfield', + fieldLabel:this.currentStatusLabel, + name: 'status' + },{ + xtype:'displayfield', + fieldLabel:this.lastMessageLabel, + name: 'message' + } + ] + },{ + //DETAIL PANEL + title: this.taskDetailText, + iconCls: 'clock_ic', + ref:'../detail', + hidden:true , + frame: true, + + items:[ + { + xtype:'form', + ref:'form', + items:[ + + { + xtype:'displayfield', + renderer: Ext.util.Format.dateRenderer(this.displayDateFormat), + fieldLabel: this.executedLabel, + + name: 'date' + },{ + xtype:'displayfield', + fieldLabel:this.statusLabel, + name: 'status' + },{ + xtype:'displayfield', + fieldLabel:this.emailNotificationStatusLabel, + name: 'emailNotificationStatusSummary' + }] + },{ + xtype:'grid', + ref: 'notificationLogGrid', + autoExpandColumn:'message', + columns:[ + { + name:'receiver', + dataIndex:'receiver', + header:this.receiverText, + },{ + name:'address', + dataIndex:'address', + hidden: true, + header:this.emailText, + },{ + name:'status', + dataIndex:'status', + header:this.statusText, + renderer: function(value, metaData, record, rowIndex, colIndex, store) { + //render icon in case of success + var classes = 'x-grid-center-icon action_column_btn ' + (value =="Success" ? 'accept' : 'close'); + return '
    '+'
    ' + value; + return value; + } + },{ + id:'message', + dataIndex:'message', + header: this.messageText, + + + } + ], + height: 200, + + + store: new Ext.data.JsonStore({ + + title:'Expired Users',//TODO i18n + root:'emailNotificationLog', + fields: ['receiver','address','status','message'] + }), + name: 'expiredUsers' + } + ] + }] + } + ] + }); + // In user information the output is generated in the component and we can't check the item.initialConfig. + if(this.output.length > 0 + && this.outputTarget){ + for(var i = 0; i < this.output.length; i++){ + if(this.output[i].ownerCt + && this.output[i].ownerCt.xtype + && this.output[i].ownerCt.xtype == "tabpanel" + && !this.output[i].isDestroyed){ + var outputConfig = config || this.outputConfig; + // Not duplicate tabs + for(var index = 0; index < this.output[i].ownerCt.items.items.length; index++){ + var item = this.output[i].ownerCt.items.items[index]; + // only check iconCls + var isCurrentItem = "task_status" == item.initialConfig["itemId"]; + if(isCurrentItem){ + this.output[i].ownerCt.setActiveTab(index); + return; + } + } + } + } + } + return mxp.plugins.ExpiringTaskStatus.superclass.addOutput.apply(this, arguments); + } +}); + +Ext.preg(mxp.plugins.ExpiringTaskStatus.prototype.ptype, mxp.plugins.ExpiringTaskStatus); \ No newline at end of file diff --git a/mapcomposer/app/static/externals/mapmanager/theme/css/mapstoremanager.css b/mapcomposer/app/static/externals/mapmanager/theme/css/mapstoremanager.css index 9a5b69aa7..845728e7e 100644 --- a/mapcomposer/app/static/externals/mapmanager/theme/css/mapstoremanager.css +++ b/mapcomposer/app/static/externals/mapmanager/theme/css/mapstoremanager.css @@ -331,4 +331,11 @@ left: 80px !important; .lock_ic{ background-image: url(../img/lock.png); -} \ No newline at end of file +} +/** schedule tasks **/ +.sheduled_task_ic{ + background-image: url(../img/sheduled_task.png); +} +.clock_ic{ + background-image: url(../img/clock.png) !important;; +} diff --git a/mapcomposer/app/static/externals/mapmanager/theme/img/clock.png b/mapcomposer/app/static/externals/mapmanager/theme/img/clock.png new file mode 100644 index 0000000000000000000000000000000000000000..e2672c20676177efb2fdea593b8f000fd5f12342 GIT binary patch literal 882 zcmV-&1C9KNP)Zkp%;s8}r$h6cUMpt8KZ&`memftw9r2BH zXZp!+CFaEnJk?xA$eKJbHrNPn>;Axd{TeCT;zL2Z2lqOE#$fse--k~9GCAnb$WrIY zUzF=05;%7ScRp;-^ba=g4+!_yjOVxZHrAy=-Qy;3W{V_ws3i3@rj zN6Uq**d4Ifp5hMksmBf!JrmJQC(GkeNV1GOW##ZtQFwF|H80+P{}RL%{YNk_%ft(I z#;Cz`v~ti@ZP83cwQ@*mu2Dwn=d>z@4RV(M%#h6&LDo!N4vuc zo|;?G=MQ0U0&vMd?WX`v6t{tSSteePbgELlMO}xKy8^QHBD{2ALkbX%5TpZC;3a)d zD?(MwgLzpdUa8!vFvP literal 0 HcmV?d00001 diff --git a/mapcomposer/app/static/externals/mapmanager/theme/img/sheduled_task.png b/mapcomposer/app/static/externals/mapmanager/theme/img/sheduled_task.png new file mode 100644 index 0000000000000000000000000000000000000000..75f2c636e5fe5221844b81cd052bd38cfb662b3b GIT binary patch literal 811 zcmV+`1JwM9P)(@Q5636KIhC#rH<4? z4;dt-5%d^^8s5vxgz1E-AQjQ|IqD_wKlB!uD5RL#gO@SJAWXs#Ntu#Si2fE~xyi94vSszhr`^D|x7>Hr4IvbwHZyI$Wv zFbL24$AGqn+#EYacZBE>wtbN-1gZa0Ez-TI>T~VqdYu63q~Eb^fQw$vP`#Zhs087) z-7gl^wT%dUisJLS0pZxYDlo3$h&PGcWBbt4-45L_7-JI4Rv@}f$htQJn|qVE+fa$W zNq6r{iZNi@7Br1RV-~_GM8rx^3yuRbwgJa+so<~Q7NJTgf&zy#4k=cNSe&c{W($P9 zHPD1f{}wT!Kyz#JPqpc(Nx0o^%+5@aPAi|LF*xQ1G$)C9Z#5++R0~YD00%JRQL1`C z1s4<+Dh7o`Mc|x64tFj*hfpXABdrSDjLLDprcKo_AtG`M1P~!KrT~VAhH$Q|3~$I< zG@p@?F_e~;Aip3VFP?Yda$P<7LM4NPuQuE+cN(XBnn9FW-Ug`jU4YAQ!RPZ~Wo4C; zi;#?UngO~ Date: Mon, 30 Jun 2014 16:49:04 +0200 Subject: [PATCH 009/186] temporaney fix for #444 --- .../lib/OpenLayers/IE11_WFSfix.js | 19 +++++++++++++++++++ mapcomposer/buildjs.cfg | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/IE11_WFSfix.js diff --git a/mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/IE11_WFSfix.js b/mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/IE11_WFSfix.js new file mode 100644 index 000000000..df2e6d8ed --- /dev/null +++ b/mapcomposer/app/static/externals/openlayers-ext/lib/OpenLayers/IE11_WFSfix.js @@ -0,0 +1,19 @@ +//this script is a patch for this issue: http://osgeo-org.1560.x6.nabble.com/WFS-and-IE-11-td5090636.html +//remove it when fixed in openlayers + +var _class = OpenLayers.Format.XML; + +var originalWriteFunction = _class.prototype.write; + +var patchedWriteFunction = function() +{ + var child = originalWriteFunction.apply( this, arguments ); + + // NOTE: Remove the rogue namespaces as one block of text. + // The second fragment "NS1:" is too small on its own and could cause valid text (in, say, ogc:Literal elements) to be erroneously removed. + child = child.replace(new RegExp('xmlns:NS\\d+="" NS\\d+:', 'g'), ''); + + return child; +} + +_class.prototype.write = patchedWriteFunction; \ No newline at end of file diff --git a/mapcomposer/buildjs.cfg b/mapcomposer/buildjs.cfg index 7e5a773db..f5b1b74c8 100644 --- a/mapcomposer/buildjs.cfg +++ b/mapcomposer/buildjs.cfg @@ -135,7 +135,8 @@ include = OpenLayers/Format/WPSExecute.js OpenLayers/Format/TMSCapabilities.js OpenLayers/WPSProcess.js - OpenLayers/Format/WPSExecuteRequest.js + OpenLayers/Format/WPSExecuteRequest.js + OpenLayers/IE11_WFSfix.js [GeoExplorer.js] root = app/static/script/app From 692e950952a7c5d26952dfcb87abe0979ee869ec Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Mon, 30 Jun 2014 16:56:02 +0200 Subject: [PATCH 010/186] #445 implemented for Circular and Bounding box selectors, fix infoSRS for BBox selector. --- .../src/script/widgets/form/BBOXFieldset.js | 8 +++- .../BBOXSpatialSelectorMethod.js | 34 ++++++++++++-- .../CircleSpatialSelectorMethod.js | 46 ++++++++++++++++--- .../spatialselector/SpatialSelectorMethod.js | 9 +++- 4 files changed, 81 insertions(+), 16 deletions(-) diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/BBOXFieldset.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/BBOXFieldset.js index d8294945f..f3ff6980d 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/BBOXFieldset.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/BBOXFieldset.js @@ -319,7 +319,11 @@ gxp.form.BBOXFieldset = Ext.extend(Ext.form.FieldSet, { this.listeners = { "afterlayout": function(){ - Ext.get(me.id+"_bboxAOI-set-EPSG").addListener("click", me.openEPSGWin, me); + var link = Ext.get(me.id+"_bboxAOI-set-EPSG"); + if(link){ + link.addListener("click", me.openEPSGWin, me); + } + var baseProj = me.map.getProjection(); var projection = baseProj ? baseProj : me.map.projection; me.mapProjection = new OpenLayers.Projection(projection); @@ -505,7 +509,7 @@ gxp.form.BBOXFieldset = Ext.extend(Ext.form.FieldSet, { break; default: - srsURL+= "/epsg/"+( +this.bboxProjection.getCode().split(":")[1]+"/"); + srsURL+= "epsg/"+( +this.bboxProjection.getCode().split(":")[1]+"/"); } }else srsURL=this.infoEPSGURL; diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/BBOXSpatialSelectorMethod.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/BBOXSpatialSelectorMethod.js index b2fcdac8f..291c3b298 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/BBOXSpatialSelectorMethod.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/BBOXSpatialSelectorMethod.js @@ -46,7 +46,24 @@ gxp.widgets.form.spatialselector.BBOXSpatialSelectorMethod = Ext.extend(gxp.widg /* xtype = gxp_spatial_bbox_selector */ xtype : 'gxp_spatial_bbox_selector', - /** api: config[name] + /** api: config[metricUnit] + * ``Object`` + * The metric unit to display summary + */ + metricUnit :"km", + + /** api: config[displayProjection] + * ``Object`` + * The projection for coordinate display (if null, the map one) default null + */ + displayProjection: null, + /** api: property[infoEPSG] + * ``Boolean`` + * Display information about current reference system + */ + infoSRS: true, + + /** api: config[name] * ``String`` * Name to show on the combo box of the spatial selected. */ @@ -115,17 +132,18 @@ gxp.widgets.form.spatialselector.BBOXSpatialSelectorMethod = Ext.extend(gxp.widg * Override */ initComponent: function() { - + var displayProjection = this.displayProjection; // /////////////////////////////////////////// // Spatial AOI Selector FieldSet // /////////////////////////////////////////// var confbbox = { map: this.target.mapPanel.map, - outputSRS : this.target.mapPanel.map.projection, + outputSRS : this.displayProjection || this.target.mapPanel.map.projection, spatialFilterOptions: this.spatialFilterOptions, // checkboxToggle: false, ref: "spatialFieldset", id: this.id + "_bbox", + infoSRS: this.infoSRS, defaultStyle: this.defaultStyle, selectStyle: this.selectStyle, temporaryStyle: this.temporaryStyle, @@ -143,7 +161,13 @@ gxp.widgets.form.spatialselector.BBOXSpatialSelectorMethod = Ext.extend(gxp.widg waitEPSGMsg: "Please Wait...", listeners : { "onChangeAOI" : function(bounds) { - this.setCurrentGeometry(bounds.toGeometry()); + var geom = bounds.toGeometry(); + if(displayProjection){ + geom = bounds.toGeometry().transform(new OpenLayers.Projection(displayProjection),this.target.mapPanel.map.projection ); + this.setCurrentGeometry(geom); + }else{ + this.setCurrentGeometry(geom); + } }, scope: this } @@ -187,7 +211,7 @@ gxp.widgets.form.spatialselector.BBOXSpatialSelectorMethod = Ext.extend(gxp.widg getSummary: function(geometry){ var summary = gxp.widgets.form.spatialselector.BBOXSpatialSelectorMethod.superclass.getSummary.call(this, geometry); - var metricUnit = "km"; + var metricUnit = this.metricUnit; var perimeter = this.getLength(geometry, metricUnit); if (perimeter) { diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/CircleSpatialSelectorMethod.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/CircleSpatialSelectorMethod.js index b9b75fbdc..72dd5e6c0 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/CircleSpatialSelectorMethod.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/CircleSpatialSelectorMethod.js @@ -45,7 +45,24 @@ gxp.widgets.form.spatialselector.CircleSpatialSelectorMethod = Ext.extend(gxp.wi /* xtype = gxp_spatial_circle_selector */ xtype : 'gxp_spatial_circle_selector', - + + /** api: config[metricUnit] + * ``Object`` + * The metric unit to display summary + */ + metricUnit :"km", + + /** api: config[displayProjection] + * ``Object`` + * The projection for coordinate display (if null, the native) default null + */ + displayProjection: null, + +/** api: config[CRSDecimalPrecision] + * ``Object`` + * The decimal precision of lon lat + */ + CRSDecimalPrecision: 3, /** api: config[name] * ``String`` * Name to show on the combo box of the spatial selected. @@ -85,7 +102,7 @@ gxp.widgets.form.spatialselector.CircleSpatialSelectorMethod = Ext.extend(gxp.wi */ getSummary: function(geometry){ - var summary = "", metricUnit = "km"; + var summary = "", metricUnit = this.metricUnit; var area = this.getArea(geometry, metricUnit); if (area) { @@ -103,11 +120,26 @@ gxp.widgets.form.spatialselector.CircleSpatialSelectorMethod = Ext.extend(gxp.wi var circleSelectionCentroid = geometry.getCentroid(); if (circleSelectionCentroid) { - var lon = circleSelectionCentroid.x.toFixed(3); - var lat = circleSelectionCentroid.y.toFixed(3); - var xField = this.target.mapPanel.map.projection == "EPSG:4326" ? "Lon" : "X"; - var yField = this.target.mapPanel.map.projection == "EPSG:4326" ? "Lat" : "Y"; - summary += this.centroidLabel + ": " + lon + " ("+xField+") " + lat + " ("+yField+")" + '
    '; + var lon = circleSelectionCentroid.x; + var lat = circleSelectionCentroid.y; + var xField,yField; + var projWGS84 = new OpenLayers.Projection("EPSG:4326"); + + if(this.displayProjection){ + var dProj = new OpenLayers.Projection(this.displayProjection); + var point = new OpenLayers.Geometry.Point(lon,lat).transform(this.target.mapPanel.map.projection,dProj); + lon = point.x; + lat = point.y; + xField = "Lon"; //TODO distinguish if projected or not + yField= "Lat"; + + }else{ + xField = this.target.mapPanel.map.projection == "EPSG:4326" ? "Lon" : "X"; + yField = this.target.mapPanel.map.projection == "EPSG:4326" ? "Lat" : "Y"; + + } + summary += this.centroidLabel + ": " + lon.toFixed(this.CRSDecimalPrecision) + " ("+xField+") " + lat.toFixed(this.CRSDecimalPrecision) + " ("+yField+")" + '
    '; + } var options = {}; diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js index d0c343c54..333eebe72 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/spatialselector/SpatialSelectorMethod.js @@ -78,7 +78,12 @@ gxp.widgets.form.spatialselector.SpatialSelectorMethod = Ext.extend(Ext.Containe * ``Object`` * Parameter to perform the filter */ - + + /** api: config[metricUnit] + * ``Object`` + * The metric unit to display summary + */ + metricUnit :"km", /** api: config[hideWhenDeactivate] * ``Boolean`` * Flag to hide output when the selection method is deactivated. Default is true @@ -467,7 +472,7 @@ gxp.widgets.form.spatialselector.SpatialSelectorMethod = Ext.extend(Ext.Containe */ getSummary: function(geometry){ - var summary = "", metricUnit = "km"; + var summary = "", metricUnit = this.metricUnit; var area = this.getArea(geometry, metricUnit); var length = this.getLength(geometry, metricUnit); From 2f8dd71859337bccd149b541f70466e46a073d10 Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Tue, 1 Jul 2014 11:03:36 +0200 Subject: [PATCH 011/186] close #446 . displayPanels option true by default. set to false to use templates. added customizable control bar on right --- .../gxp/src/script/plugins/GeoStoreAccount.js | 60 ++++++++++++---- .../mapmanager/src/mxp/plugins/MyAccount.js | 69 ++++++++++++++----- 2 files changed, 101 insertions(+), 28 deletions(-) diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/GeoStoreAccount.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/GeoStoreAccount.js index a02776a79..c13ce53d6 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/plugins/GeoStoreAccount.js +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/GeoStoreAccount.js @@ -42,7 +42,7 @@ Ext.namespace("gxp.plugins"); */ gxp.plugins.GeoStoreAccount = Ext.extend(gxp.plugins.Tool, { ptype: "gxp_geostore_account", - displayAttributes:['Name','Surname','email'], + //i18n usernameLabel:'User Name', changePassword:'Change Password', textPassword: 'Password', @@ -51,10 +51,34 @@ gxp.plugins.GeoStoreAccount = Ext.extend(gxp.plugins.Tool, { textCancel: 'Cancel', textPasswordChangeSuccess: 'Password Changed', textErrorPasswordChange: 'Error Changing Password', - scrollable:true, + //config geoStoreBase: null, auth: null, - notAllowedAttributes:['UUID'], + scrollable:true, + /** api: config[displayPanels] + * ``boolean`` use panels to see attributes instead of template + */ + displayPanels:true, + + /** api: config[additionalControls] + * ``Array``buttons to place in the right panel + */ + additionalControls:null, + + /** api: config[controlsWidth] + * ``integer``width of the `dditionalControls` + */ + controlsWidth:200, + + /** api: config[hideAttributes] + * ``Array`` user attributes to hide in the my account tab + */ + hideAttributes:['UUID'], + + /** api: config[userTemplate] + * ``Array`` XTemplate to display user page. + * user is the root element. groups.group and attribute are arrays to iterate + */ userTemplate: [ ' + + +
    +
    + +
    +

    Privacy e Cookies Policy

    +
    +

    + In accordance with Legislative Decree No. 196/2003, which replaced the Law No. 675/1996 regarding + Personal Data Protection, we inform you that continuing navigation on this site you consent + the processing of your personal data (sensitive information will not be treated in any way). + Your data will only be used for operations at the site and will not be + disclosed to third party companies without your consent. In any case, it is possible + exercise the rights granted to you under the Legislative Decree 196/2003 (access to data, + updating, cancellation). + If you click the "Agree" button, you acknowledge that you have read this text and consent to treatment + of personal data. At any time you can ask the staff of the site to delete you from + service. +

    + +

    Cosa sono i Cookies

    + +

    + A cookie is a small piece of text sent to your browser by a website you visit. + It helps the website to remember information about your visit, like your preferred language and other settings. + That can make your next visit easier and the site more useful to you. + The browser saves the information and forward it to the site server when you visit again + that website. +

    + +

    + Our cookies help us to: +

    + +
      +
    • Make our website work as you'd expect
    • +
    • Remember your settings during and between visits
    • +
    • Improve the performance/security of our website
    • +
    • Allow you to share pages with social networks like Facebook
    • +
    + +

    + We do not use cookies to: +

    + +
      +
    • Collect any personally identifiable information (without your express permission)
    • +
    • Collect any sensitive information (without your express permission)
    • +
    • Pass data to advertising networks
    • +
    +

    + You can learn more about all the cookies we use below. +

    + +

    + If the settings on your software that you are using to view this website (your browser) are adjusted to accept cookies we take this, and your continued use of our website, to mean that you are fine with this. Should you wish to remove or not use cookies from our site you can learn how to do this below, however doing so will likely mean that our site will not work as you would expect. +

    + +

    I nostri Cookies

    + +

    + We use cookies to make our site work, including: +

    + +
      +
    • Determining if you are logged in or not
    • +
    • Authentication to services WMS, WFS, WPS through HTTP requests
    • +
    + +

    Social Website Cookies

    +

    + To facilitate easy sharing or liking of content on social network platforms such Facebook and Twitter, we have included sharing buttons on our site. Cookies are enabled for: +

    + +
      +
    • Twitter
    • +
    • Facebook
    • +
    +

    + The privacy implications on this will vary from social network to social network and will be dependent on the privacy settings you have chosen on these networks. +

    +

    Disabilitare i Cookies

    + +

    + All browsers allow you to manage which cookies you accept, reject and delete via controls found under the ‘Preferences' or ‘Tools' menu. Further information on deleting or controlling cookies is available + here). + Please note however that if you disable cookies you may not be able to access certain services or facilities of this as of many of the Web sites around the world (cookies are a standard component of most modern websites). +

    + +


    + +
    +
    +
    + + \ No newline at end of file diff --git a/mapcomposer/app/static/cookies-policy-it.html b/mapcomposer/app/static/cookies-policy-it.html new file mode 100644 index 000000000..691eb6928 --- /dev/null +++ b/mapcomposer/app/static/cookies-policy-it.html @@ -0,0 +1,138 @@ + + + + Privacy e Cookies Policy + + + + + +
    +
    + +
    +

    Privacy e Cookies Policy

    +
    +

    + Ai sensi del Decreto Legislativo n ° 196/2003, che ha sostituito la legge n ° 675/1996 in materia di + protezione dei dati personali, Vi informiamo che proseguendo la navigazione su questo sito voi acconsentite + al trattamento dei vostri dati personali (i dati sensibili non saranno trattati in alcun modo). + I suoi dati saranno utilizzati esclusivamente per le operazioni all'interno del sito e non potranno essere + comunicati a società di terze parti senza il vostro consenso. In ogni caso, è possibile + esercitare i diritti concessi all'utente ai sensi del Decreto Legislativo n ° 196/2003 (accesso ai dati, + aggiornamento, integrazione, cancellazione). + Facendo clic sul pulsante "Accetto", si dichiara di aver letto questo testo e di acconsentire al trattamento + dei dati personali. In qualsiasi momento è possibile chiedere alla redazione del sito di cancellarti dal + servizio. +

    + +

    Cosa sono i Cookies

    + +

    + Un cookie è un file di testo che un sito web salva sul browser del computer dell’utente. Solitamente i cookie + consentono di memorizzare le preferenze espresse dall’utente per non dover essere reinserite successivamente. + Il browser salva l’informazione e la ritrasmette al server del sito nel momento in cui l’utente visita nuovamente + quel sito web. +

    + +

    + I nostri cookie ci aiutano a: +

    + +
      +
    • Permettere al sito web di lavorare come atteso
    • +
    • Ricordare le impostazioni durante e tra le visite al sito
    • +
    • Migliorare la velocità / sicurezza del sito
    • +
    • Permette di condividere le pagine con i social network come Facebook
    • +
    + +

    + Non viene fatto uso di cookies per: +

    + +
      +
    • Raccogliere tutte le informazioni di identificazione personale (senza il vostro consenso)
    • +
    • Raccogliere tutte le informazioni sensibili (senza il tuo esplicito consenso)
    • +
    • Passare i dati alle reti pubblicitarie
    • +
    +

    + Potete saperne di più su tutti i cookies che utilizziamo qui sotto. +

    + +

    + Se le impostazioni del software che si sta utilizzando per la navigazione del sito (il browser) sono regolati per accettare + i cookies prendiamo questo, e l'uso continuato del nostro sito web, a significare che si acconsente all'utilizzo di cookies. + Se si desidera rimuovere o non usare i cookies dal nostro sito lo si può fare seguendo le indicazioni riportate di seguito, + così facendo tuttavia il nostro sito potrebbe non funzionare come ci si aspetterebbe. +

    + +

    I nostri Cookies

    + +

    + Utilizziamo i cookie per garantire determinate funzionalità del sito web tra cui: +

    + +
      +
    • Operazioni di Login e successive autenticazioni
    • +
    • Autenticazione a servizi WMS, WFS, WPS attraverso richieste HTTP
    • +
    + +

    Social Website Cookies

    +

    + Tu puoi facilmente esprimere il tuo gradimento o condividere alcuni contenuti su Facebook e Twitter (abbiamo incluso + i pulsanti di condivisione sul nostro sito). I cookies sono stati abilitati per: +

    + +
      +
    • Twitter
    • +
    • Facebook
    • +
    +

    + Le implicazioni di privacy su questo variano da social network a social network e dipenderanno dalle impostazioni di privacy + che avete scelto su queste reti. +

    +

    Disabilitare i Cookies

    + +

    + Di solito è possibile disattivare i cookies modificando le impostazioni del browser per impedire l'uso degli stessi (vedi + qui). + In questo modo però probabilmente si limiteranno le funzionalità del nostro come di molti dei siti web di tutto il mondo (i cookie + sono una componente standard della maggior parte dei siti web moderni). +

    + +


    + +
    +
    +
    + + \ No newline at end of file diff --git a/mapcomposer/app/static/externals/mapmanager/translations/de.js b/mapcomposer/app/static/externals/mapmanager/translations/de.js index ff599af5c..e2d575217 100644 --- a/mapcomposer/app/static/externals/mapmanager/translations/de.js +++ b/mapcomposer/app/static/externals/mapmanager/translations/de.js @@ -342,7 +342,7 @@ GeoExt.Lang.add("de", { "cookieText": "Cookies erleichtern die Bereitstellung unserer Dienste. Mit der Nutzung unserer Dienste erklären Sie sich damit einverstanden, dass wir Cookies verwenden.", "dismissText": "OK", "linkText":"Weitere Informationen", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/externals/mapmanager/translations/en.js b/mapcomposer/app/static/externals/mapmanager/translations/en.js index a8fb6eb19..ea2bfd087 100644 --- a/mapcomposer/app/static/externals/mapmanager/translations/en.js +++ b/mapcomposer/app/static/externals/mapmanager/translations/en.js @@ -340,8 +340,8 @@ GeoExt.Lang.add("en", { }, "cookieChoices": { "cookieText": "Cookies help us deliver our services. By using our services, you agree to our use of cookies.", - "dismissText": "Got it", + "dismissText": "I Agree", "linkText":"Learn more", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/externals/mapmanager/translations/es.js b/mapcomposer/app/static/externals/mapmanager/translations/es.js index 1ff64998e..eff40cf11 100644 --- a/mapcomposer/app/static/externals/mapmanager/translations/es.js +++ b/mapcomposer/app/static/externals/mapmanager/translations/es.js @@ -342,7 +342,7 @@ GeoExt.Lang.add("es", { "cookieText": "Las cookies nos ayudan a ofrecer nuestros servicios. Al utilizarlos, usted acepta el uso de cookies.", "dismissText": "Entendido", "linkText":"Más información", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/externals/mapmanager/translations/fr.js b/mapcomposer/app/static/externals/mapmanager/translations/fr.js index c8fcf6d3a..2f9639220 100644 --- a/mapcomposer/app/static/externals/mapmanager/translations/fr.js +++ b/mapcomposer/app/static/externals/mapmanager/translations/fr.js @@ -342,6 +342,6 @@ GeoExt.Lang.add("fr", { "cookieText": "Les cookies nous permettent de vous proposer nos services plus facilement. En utilisant nos services, vous nous donnez expressément votre accord pour exploiter ces cookies.", "dismissText": "OK", "linkText":"En Savoir plus", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/externals/mapmanager/translations/it.js b/mapcomposer/app/static/externals/mapmanager/translations/it.js index 4dacea491..87becc614 100644 --- a/mapcomposer/app/static/externals/mapmanager/translations/it.js +++ b/mapcomposer/app/static/externals/mapmanager/translations/it.js @@ -341,7 +341,7 @@ GeoExt.Lang.add("it", { "cookieText": "I cookie ci aiutano ad erogare servizi di qualità. Utilizzando i nostri servizi, l'utente accetta le nostre modalità d'uso dei cookie.", "dismissText": "Accetto", "linkText":"Dettagli", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-it.html" } }); diff --git a/mapcomposer/app/static/translations/de.js b/mapcomposer/app/static/translations/de.js index f73824bb3..f75b2ef0d 100644 --- a/mapcomposer/app/static/translations/de.js +++ b/mapcomposer/app/static/translations/de.js @@ -1035,7 +1035,7 @@ GeoExt.Lang.add("de", { "cookieText": "Cookies erleichtern die Bereitstellung unserer Dienste. Mit der Nutzung unserer Dienste erklären Sie sich damit einverstanden, dass wir Cookies verwenden.", "dismissText": "OK", "linkText":"Weitere Informationen", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/translations/en.js b/mapcomposer/app/static/translations/en.js index 4913fe905..b7b7450ad 100644 --- a/mapcomposer/app/static/translations/en.js +++ b/mapcomposer/app/static/translations/en.js @@ -1019,9 +1019,9 @@ GeoExt.Lang.add("en", { }, "cookieChoices": { "cookieText": "Cookies help us deliver our services. By using our services, you agree to our use of cookies.", - "dismissText": "Got it", + "dismissText": "I Agree", "linkText":"Learn more", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/translations/es.js b/mapcomposer/app/static/translations/es.js index aacb79979..289fa536e 100644 --- a/mapcomposer/app/static/translations/es.js +++ b/mapcomposer/app/static/translations/es.js @@ -863,7 +863,7 @@ GeoExt.Lang.add("es", { "cookieText": "Las cookies nos ayudan a ofrecer nuestros servicios. Al utilizarlos, usted acepta el uso de cookies.", "dismissText": "Entendido", "linkText":"Más información", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/translations/fr.js b/mapcomposer/app/static/translations/fr.js index 9cca52dc5..5107c7487 100644 --- a/mapcomposer/app/static/translations/fr.js +++ b/mapcomposer/app/static/translations/fr.js @@ -908,7 +908,7 @@ GeoExt.Lang.add("fr", { "cookieText": "Les cookies nous permettent de vous proposer nos services plus facilement. En utilisant nos services, vous nous donnez expressément votre accord pour exploiter ces cookies.", "dismissText": "OK", "linkText":"En Savoir plus", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-en.html" } }); diff --git a/mapcomposer/app/static/translations/it.js b/mapcomposer/app/static/translations/it.js index 72ac63f01..00262c32e 100644 --- a/mapcomposer/app/static/translations/it.js +++ b/mapcomposer/app/static/translations/it.js @@ -1036,7 +1036,7 @@ GeoExt.Lang.add("it", { "cookieText": "I cookie ci aiutano ad erogare servizi di qualità. Utilizzando i nostri servizi, l'utente accetta le nostre modalità d'uso dei cookie.", "dismissText": "Accetto", "linkText":"Dettagli", - "linkHref":"http://google.com" + "linkHref":"cookies-policy-it.html" } diff --git a/mapcomposer/app/templates/composer.html b/mapcomposer/app/templates/composer.html index e1db50544..18ff76b8b 100644 --- a/mapcomposer/app/templates/composer.html +++ b/mapcomposer/app/templates/composer.html @@ -555,7 +555,7 @@ /*Consent cookie text and link from transaltion files, google cookieChoices.js lib must be added to page's body*/ if(serverConfig.cookieConsent && cookieChoices.cookieText && !parent.manager){ cookieChoices.showCookieConsentBar(cookieChoices.cookieText, - cookieChoices.dismissText, (serverConfig.cookieConsent.link)?cookieChoices.linkText:null, cookieChoices.linkHref); + cookieChoices.dismissText, cookieChoices.linkText, cookieChoices.linkHref); }; }; diff --git a/mapcomposer/app/templates/manager.html b/mapcomposer/app/templates/manager.html index 6c77afa1f..1ef0c9eb0 100644 --- a/mapcomposer/app/templates/manager.html +++ b/mapcomposer/app/templates/manager.html @@ -147,7 +147,7 @@ /*Consent cookie text and link from transaltion files, google cookieChoices.js lib must be added to page's body*/ if(serverConfig.cookieConsent && cookieChoices.cookieText){ cookieChoices.showCookieConsentBar(cookieChoices.cookieText, - cookieChoices.dismissText, (serverConfig.cookieConsent.link)?cookieChoices.linkText:null, cookieChoices.linkHref); + cookieChoices.dismissText, cookieChoices.linkText, cookieChoices.linkHref); } }; diff --git a/mapcomposer/app/templates/viewer.html b/mapcomposer/app/templates/viewer.html index b53d090ef..39b6931e4 100644 --- a/mapcomposer/app/templates/viewer.html +++ b/mapcomposer/app/templates/viewer.html @@ -403,7 +403,7 @@ /*Consent cookie text and link from transaltion files, google cookieChoices.js lib must be added to page's body*/ if(serverConfig.cookieConsent && cookieChoices.cookieText){ cookieChoices.showCookieConsentBar(cookieChoices.cookieText, - cookieChoices.dismissText, (serverConfig.cookieConsent.link)?cookieChoices.linkText:null, cookieChoices.linkHref); + cookieChoices.dismissText, cookieChoices.linkText, cookieChoices.linkHref); }; }; From 9da68c0814660cb6ac2baf43cf0120e2fbef9c15 Mon Sep 17 00:00:00 2001 From: kappu Date: Wed, 8 Jul 2015 10:57:32 +0200 Subject: [PATCH 180/186] fixed paragraph title --- mapcomposer/app/static/cookies-policy-en.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapcomposer/app/static/cookies-policy-en.html b/mapcomposer/app/static/cookies-policy-en.html index 882567c18..16d724faf 100644 --- a/mapcomposer/app/static/cookies-policy-en.html +++ b/mapcomposer/app/static/cookies-policy-en.html @@ -55,7 +55,7 @@

    Privacy e Cookies Policy

    service.

    -

    Cosa sono i Cookies

    +

    What are Cookies

    A cookie is a small piece of text sent to your browser by a website you visit. From baf180a1337dc2cd08b3ed8f9801d6ec9feaf9e8 Mon Sep 17 00:00:00 2001 From: kappu Date: Wed, 8 Jul 2015 11:05:14 +0200 Subject: [PATCH 181/186] fixed paragraph title --- mapcomposer/app/static/cookies-policy-en.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapcomposer/app/static/cookies-policy-en.html b/mapcomposer/app/static/cookies-policy-en.html index 16d724faf..3632733ed 100644 --- a/mapcomposer/app/static/cookies-policy-en.html +++ b/mapcomposer/app/static/cookies-policy-en.html @@ -40,7 +40,7 @@

    -

    Privacy e Cookies Policy

    +

    Privacy and Cookies Policy


    In accordance with Legislative Decree No. 196/2003, which replaced the Law No. 675/1996 regarding @@ -116,7 +116,7 @@

    Social Website Cookies

    The privacy implications on this will vary from social network to social network and will be dependent on the privacy settings you have chosen on these networks.

    -

    Disabilitare i Cookies

    +

    Controlling Cookies

    All browsers allow you to manage which cookies you accept, reject and delete via controls found under the ‘Preferences' or ‘Tools' menu. Further information on deleting or controlling cookies is available From 345cc956f0bedb5f58089a4b4b19da8920c13523 Mon Sep 17 00:00:00 2001 From: kappu Date: Wed, 8 Jul 2015 12:18:53 +0200 Subject: [PATCH 182/186] fixed paragraph title --- mapcomposer/app/static/cookies-policy-en.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapcomposer/app/static/cookies-policy-en.html b/mapcomposer/app/static/cookies-policy-en.html index 3632733ed..7e9295f74 100644 --- a/mapcomposer/app/static/cookies-policy-en.html +++ b/mapcomposer/app/static/cookies-policy-en.html @@ -93,12 +93,12 @@

    What are Cookies

    If the settings on your software that you are using to view this website (your browser) are adjusted to accept cookies we take this, and your continued use of our website, to mean that you are fine with this. Should you wish to remove or not use cookies from our site you can learn how to do this below, however doing so will likely mean that our site will not work as you would expect.

    -

    I nostri Cookies

    +

    Cookies set by our own Website

    We use cookies to make our site work, including:

    - +
    • Determining if you are logged in or not
    • Authentication to services WMS, WFS, WPS through HTTP requests
    • From 5162180e10291990751817e93f2321c7d71b966b Mon Sep 17 00:00:00 2001 From: kappu Date: Mon, 13 Jul 2015 17:53:29 +0200 Subject: [PATCH 183/186] Close #414 --- mapcomposer/app/static/externals/csw/src/CSWSearchTool.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mapcomposer/app/static/externals/csw/src/CSWSearchTool.js b/mapcomposer/app/static/externals/csw/src/CSWSearchTool.js index 89a784b53..8efab9f4c 100644 --- a/mapcomposer/app/static/externals/csw/src/CSWSearchTool.js +++ b/mapcomposer/app/static/externals/csw/src/CSWSearchTool.js @@ -221,13 +221,16 @@ CSWSearchTool = Ext.extend(Ext.form.FormPanel, { // If no filter has been set, builds the query as to select every record, // otherwise the conditions are applied as filters - if (filters.length != 0) { + if (filters.length > 1){ options.filter = new OpenLayers.Filter.Logical({ type : OpenLayers.Filter.Logical.AND, filters : filters }); options.emptySearch = false; - } else { + } else if (filters.length == 1){ + options.filter=filters.pop(); + options.emptySearch = false; + }else { options.emptySearch = true; } From c9a44c17a3860229a6b2dbb193fef3caf0ae2b81 Mon Sep 17 00:00:00 2001 From: Lorenzo Pini Date: Tue, 14 Jul 2015 12:33:47 +0200 Subject: [PATCH 184/186] Add Cookie Notice to final WAR --- build.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.xml b/build.xml index ed9781767..bde01edef 100644 --- a/build.xml +++ b/build.xml @@ -228,6 +228,10 @@ + + + + From f39ee548bcdbc72e0a37cdeaf2551d06f2e130e8 Mon Sep 17 00:00:00 2001 From: kappu Date: Thu, 16 Jul 2015 15:08:24 +0200 Subject: [PATCH 185/186] Close#760 --- .../gxp/src/script/plugins/FeatureGrid.js | 1 + .../src/script/widgets/grid/FeatureGrid.js | 394 +++++++++--------- 2 files changed, 200 insertions(+), 195 deletions(-) diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js index 15236c5c4..02cbb227b 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/FeatureGrid.js @@ -522,6 +522,7 @@ gxp.plugins.FeatureGrid = Ext.extend(gxp.plugins.ClickableFeatures, { autoScroll: true, title: this.title, bbar: bbar, + featureMaxZoomLevel:(this.featureMaxZoomLevel)?this.featureMaxZoomLevel:null, listeners: { "added": function(cmp, ownerCt) { var onClear = OpenLayers.Function.bind(function() { diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/grid/FeatureGrid.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/grid/FeatureGrid.js index e0b8e3177..9ed4436b5 100644 --- a/mapcomposer/app/static/externals/gxp/src/script/widgets/grid/FeatureGrid.js +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/grid/FeatureGrid.js @@ -7,127 +7,127 @@ */ /** api: (define) - * module = gxp.grid - * class = FeatureGrid - * base_link = `Ext.grid.GridPanel `_ - */ +* module = gxp.grid +* class = FeatureGrid +* base_link = `Ext.grid.GridPanel `_ +*/ Ext.namespace("gxp.grid"); /** api: constructor - * .. class:: FeatureGrid(config) - * - * Create a new grid displaying the contents of a - * ``GeoExt.data.FeatureStore`` . - */ +* .. class:: FeatureGrid(config) +* +* Create a new grid displaying the contents of a +* ``GeoExt.data.FeatureStore`` . +*/ gxp.grid.FeatureGrid = Ext.extend(Ext.grid.GridPanel, { - /** api: config[map] - * ``OpenLayers.Map`` If provided, a layer with the features from this - * grid will be added to the map. - */ - map: null, - - /** api: config[ignoreFields] - * ``Array`` of field names from the store's records that should not be - * displayed in the grid. - */ - ignoreFields: null, - - /** api: config[layer] - * ``OpenLayers.Layer.Vector`` - * The vector layer that will be synchronized with the layer store. - * If the ``map`` config property is provided, this value will be ignored. - */ - - /** api: config[schema] - * ``GeoExt.data.AttributeStore`` - * Optional schema for the grid. If provided, appropriate field - * renderers (e.g. for date or boolean fields) will be used. - */ - - /** api: config[dateFormat] - * ``String`` Date format. Default is the value of - * ``Ext.form.DateField.prototype.format``. - */ - - /** api: config[timeFormat] - * ``String`` Time format. Default is the value of - * ``Ext.form.TimeField.prototype.format``. - */ - - /** private: property[layer] - * ``OpenLayers.Layer.Vector`` layer displaying features from this grid's - * store - */ - layer: null, - - actionTooltip: "Zoom To Feature", - - /** api: config[emptyText] - * ``String`` - * Default text (html tags are accepted) to display in the grid body when no rows are available - */ - emptyText:'No data to display', - /** api: method[initComponent] - * Initializes the FeatureGrid. - */ +/** api: config[map] +* ``OpenLayers.Map`` If provided, a layer with the features from this +* grid will be added to the map. +*/ +map: null, + +/** api: config[ignoreFields] +* ``Array`` of field names from the store's records that should not be +* displayed in the grid. +*/ +ignoreFields: null, + +/** api: config[layer] +* ``OpenLayers.Layer.Vector`` +* The vector layer that will be synchronized with the layer store. +* If the ``map`` config property is provided, this value will be ignored. +*/ + +/** api: config[schema] +* ``GeoExt.data.AttributeStore`` +* Optional schema for the grid. If provided, appropriate field +* renderers (e.g. for date or boolean fields) will be used. +*/ + +/** api: config[dateFormat] +* ``String`` Date format. Default is the value of +* ``Ext.form.DateField.prototype.format``. +*/ + +/** api: config[timeFormat] +* ``String`` Time format. Default is the value of +* ``Ext.form.TimeField.prototype.format``. +*/ + +/** private: property[layer] +* ``OpenLayers.Layer.Vector`` layer displaying features from this grid's +* store +*/ +layer: null, + +actionTooltip: "Zoom To Feature", + +/** api: config[emptyText] +* ``String`` +* Default text (html tags are accepted) to display in the grid body when no rows are available +*/ +emptyText:'No data to display', +/** api: method[initComponent] +* Initializes the FeatureGrid. +*/ initComponent: function(){ - - this.viewConfig=Ext.apply({emptyText:this.emptyText },this.viewConfig||{}); - this.ignoreFields = ["feature", "state", "fid"].concat(this.ignoreFields); + + this.viewConfig=Ext.apply({emptyText:this.emptyText },this.viewConfig||{}); + this.ignoreFields = ["feature", "state", "fid"].concat(this.ignoreFields); if(this.store) { this.cm = this.createColumnModel(this.store); - // layer automatically added if map provided, otherwise check for - // layer in config - if(this.map) { - this.layer = new OpenLayers.Layer.Vector(this.id + "_layer"); - this.map.addLayer(this.layer); - } - } else { - this.store = new Ext.data.Store(); - this.cm = new Ext.grid.ColumnModel({ - columns: [] - }); - } - if(this.layer) { - this.sm = this.sm || new GeoExt.grid.FeatureSelectionModel({ - layerFromStore: false, - layer: this.layer - }); - if(this.store instanceof GeoExt.data.FeatureStore) { - this.store.bind(this.layer); - } - } - if (!this.dateFormat) { - this.dateFormat = Ext.form.DateField.prototype.format; - } - if (!this.timeFormat) { - this.timeFormat = Ext.form.TimeField.prototype.format; + // layer automatically added if map provided, otherwise check for + // layer in config + if(this.map) { + this.layer = new OpenLayers.Layer.Vector(this.id + "_layer"); + this.map.addLayer(this.layer); + } + } else { + this.store = new Ext.data.Store(); + this.cm = new Ext.grid.ColumnModel({ + columns: [] + }); + } + if(this.layer) { + this.sm = this.sm || new GeoExt.grid.FeatureSelectionModel({ + layerFromStore: false, + layer: this.layer + }); + if(this.store instanceof GeoExt.data.FeatureStore) { + this.store.bind(this.layer); } + } + if (!this.dateFormat) { + this.dateFormat = Ext.form.DateField.prototype.format; + } + if (!this.timeFormat) { + this.timeFormat = Ext.form.TimeField.prototype.format; + } - gxp.grid.FeatureGrid.superclass.initComponent.call(this); + gxp.grid.FeatureGrid.superclass.initComponent.call(this); }, - + /** private: method[onDestroy] - * Clean up anything created here before calling super onDestroy. - */ + * Clean up anything created here before calling super onDestroy. + */ onDestroy: function() { if(this.initialConfig && this.initialConfig.map - && !this.initialConfig.layer) { - // we created the layer, let's destroy it - this.layer.destroy(); - delete this.layer; - } - gxp.grid.FeatureGrid.superclass.onDestroy.apply(this, arguments); + && !this.initialConfig.layer) { + // we created the layer, let's destroy it + this.layer.destroy(); + delete this.layer; + } + gxp.grid.FeatureGrid.superclass.onDestroy.apply(this, arguments); }, - + /** api: method[setStore] - * :arg store: ``GeoExt.data.FeatureStore`` - * :arg schema: ``GeoExt.data.AttributeStore`` Optional schema to - * determine appropriate field renderers for the grid. - * - * Sets the store for this grid, reconfiguring the column model - */ + * :arg store: ``GeoExt.data.FeatureStore`` + * :arg schema: ``GeoExt.data.AttributeStore`` Optional schema to + * determine appropriate field renderers for the grid. + * + * Sets the store for this grid, reconfiguring the column model + */ setStore: function(store, schema) { if (schema) { this.schema = schema; @@ -145,110 +145,114 @@ gxp.grid.FeatureGrid = Ext.extend(Ext.grid.GridPanel, { this.reconfigure( new Ext.data.Store(), new Ext.grid.ColumnModel({columns: []}) - ); + ); } }, /** api: method[getColumns] - * :arg store: ``GeoExt.data.FeatureStore`` - * :return: ``Array`` - * - * Gets the configuration for the column model. - */ + * :arg store: ``GeoExt.data.FeatureStore`` + * :return: ``Array`` + * + * Gets the configuration for the column model. + */ getColumns: function(store) { function getRenderer(format) { return function(value) { - //TODO When http://trac.osgeo.org/openlayers/ticket/3131 - // is resolved, change the 5 lines below to - // return value.format(format); - var date = value; - if (typeof value == "string") { - date = Date.parseDate(value.replace(/Z$/, ""), "c"); - } - return date ? date.format(format) : value; - }; - } - - var columns = [{ - xtype: 'actioncolumn', - header: "", - width: 30, - hidden: false, - scope: this, - items: [{ - iconCls: 'zoomaction', - tooltip: this.actionTooltip, - scope: this, - handler: function(grid, rowIndex, colIndex){ - var store = grid.getStore(); - var row = store.getAt(rowIndex); - var feature = row.data.feature; - if(feature){ - var bounds = feature.geometry.getBounds(); - if(bounds){ - this.map.zoomToExtent(bounds); - - var showButton = Ext.getCmp("showButton"); - if(!showButton.pressed){ - showButton.toggle(true); - } - - grid.getSelectionModel().selectRow(rowIndex); - } - } - } - }] - }]; - - var name, type, xtype, format, renderer; - (this.schema || store.fields).each(function(f) { - if (this.schema) { - name = f.get("name"); - type = f.get("type").split(":").pop(); - format = null; - switch (type) { - case "date": - format = this.dateFormat; - case "datetime": - format = format ? format : this.dateFormat + " " + this.timeFormat; - xtype = undefined; - renderer = getRenderer(format); - break; - case "boolean": - xtype = "booleancolumn"; - break; - case "string": - xtype = "gridcolumn"; - break; - default: - xtype = "numbercolumn"; + //TODO When http://trac.osgeo.org/openlayers/ticket/3131 + // is resolved, change the 5 lines below to + // return value.format(format); + var date = value; + if (typeof value == "string") { + date = Date.parseDate(value.replace(/Z$/, ""), "c"); + } + return date ? date.format(format) : value; + }; + } + + var columns = [{ + xtype: 'actioncolumn', + header: "", + width: 30, + hidden: false, + scope: this, + items: [{ + iconCls: 'zoomaction', + tooltip: this.actionTooltip, + scope: this, + handler: function(grid, rowIndex, colIndex){ + var store = grid.getStore(); + var row = store.getAt(rowIndex); + var feature = row.data.feature; + if(feature){ + var bounds = feature.geometry.getBounds(); + if(bounds){ + if( this.featureMaxZoomLevel && this.map.getZoomForExtent(bounds,false)>this.featureMaxZoomLevel){ + if( feature.geometry instanceof OpenLayers.Geometry.Point) + this.map.setCenter(new OpenLayers.LonLat(feature.geometry.x,feature.geometry.y),this.featureMaxZoomLevel); + else + this.map.setCenter(bounds.getCenterLonLat(),this.featureMaxZoomLevel); + } + else this.map.zoomToExtent(bounds); + var showButton = Ext.getCmp("showButton"); + if(!showButton.pressed){ + showButton.toggle(true); + } + grid.getSelectionModel().selectRow(rowIndex); + } } - } else { - name = f.name; } - if (this.ignoreFields.indexOf(name) === -1) { - columns.push({ - dataIndex: name, - header: name, - sortable: true, - xtype: xtype, - format: format, - renderer: xtype ? undefined : renderer - }); + }] + }]; + + var name, type, xtype, format, renderer; + (this.schema || store.fields).each(function(f) { + if (this.schema) { + name = f.get("name"); + type = f.get("type").split(":").pop(); + format = null; + switch (type) { + case "date": + format = this.dateFormat; + case "datetime": + format = format ? format : this.dateFormat + " " + this.timeFormat; + xtype = undefined; + renderer = getRenderer(format); + break; + case "boolean": + xtype = "booleancolumn"; + break; + case "string": + xtype = "gridcolumn"; + break; + default: + xtype = "numbercolumn"; } - }, this); - return columns; + } else { + name = f.name; + } + if (this.ignoreFields.indexOf(name) === -1) { + columns.push({ + dataIndex: name, + header: name, + sortable: true, + xtype: xtype, + format: format, + renderer: xtype ? undefined : renderer + }); + } + }, this); + return columns; }, - + /** private: method[createColumnModel] - * :arg store: ``GeoExt.data.FeatureStore`` - * :return: ``Ext.grid.ColumnModel`` - */ + * :arg store: ``GeoExt.data.FeatureStore`` + * :return: ``Ext.grid.ColumnModel`` + */ createColumnModel: function(store) { var columns = this.getColumns(store); return new Ext.grid.ColumnModel(columns); } -}); + }); -/** api: xtype = gxp_featuregrid */ -Ext.reg('gxp_featuregrid', gxp.grid.FeatureGrid); + /** api: xtype = gxp_featuregrid */ + Ext.reg('gxp_featuregrid', gxp.grid.FeatureGrid); From 4129f62c364a49d1d33b7819d6be9a1a7f58ab9c Mon Sep 17 00:00:00 2001 From: kappu Date: Mon, 20 Jul 2015 18:02:57 +0200 Subject: [PATCH 186/186] Close #408C --- .../src/script/plugins/SaveDefaultContext.js | 472 ----------- .../gxp/src/script/plugins/SaveMapPlugin.js | 768 ++++++++++++++++++ .../widgets/form/UserGroupMultiSelect.js | 178 ++++ .../static/externals/gxp/src/theme/all.css | 12 + .../app/static/script/app/GeoExplorer.js | 4 +- .../static/script/app/GeoExplorer/Composer.js | 4 +- mapcomposer/app/static/translations/de.js | 8 +- mapcomposer/app/static/translations/en.js | 34 +- mapcomposer/app/static/translations/es.js | 12 +- mapcomposer/app/static/translations/fr.js | 8 +- mapcomposer/app/static/translations/it.js | 34 +- mapcomposer/app/templates/composer.html | 4 +- mapcomposer/buildjs.cfg | 3 +- 13 files changed, 1024 insertions(+), 517 deletions(-) delete mode 100644 mapcomposer/app/static/externals/gxp/src/script/plugins/SaveDefaultContext.js create mode 100644 mapcomposer/app/static/externals/gxp/src/script/plugins/SaveMapPlugin.js create mode 100644 mapcomposer/app/static/externals/gxp/src/script/widgets/form/UserGroupMultiSelect.js diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/SaveDefaultContext.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/SaveDefaultContext.js deleted file mode 100644 index 0795ca127..000000000 --- a/mapcomposer/app/static/externals/gxp/src/script/plugins/SaveDefaultContext.js +++ /dev/null @@ -1,472 +0,0 @@ -/** - * Copyright (C) 2007 - 2012 GeoSolutions S.A.S. - * http://www.geo-solutions.it - * - * GPLv3 + Classpath exception - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * @requires plugins/Tool.js - */ - -/** api: (define) - * module = gxp.plugins - * class = saveDefaultContext - */ - -/** api: (extends) - * plugins/Tool.js - */ -Ext.namespace("gxp.plugins"); - -/** api: constructor - * .. class:: saveDefaultContext(config) - * - * Plugin for Save Context Map as geostore resource. - */ -gxp.plugins.SaveDefaultContext = Ext.extend(gxp.plugins.Tool, { - - /** api: ptype = gxp_saveDefaultContext */ - ptype: "gxp_saveDefaultContext", - - /** api: config[saveDefaultContextMenuText] - * ``String`` - */ - saveDefaultContextMenuText: "Save default context", - - /** api: config[saveDefaultContextActionTip] - * ``String`` - */ - saveDefaultContextActionTip: "Save Map context", - - /** api: config[contextSaveSuccessString] - * ``String`` - */ - contextSaveSuccessString: "Context saved succesfully", - - /** api: config[contextSaveFailString] - * ``String`` - */ - contextSaveFailString: "Context not saved succesfully", - - /** api: config[addResourceButtonText] - * ``String`` - */ - addResourceButtonText: "Add Map", - - /** api: config[authHeader] - * ``String`` - */ - authHeader: null, - - /** - * Property: contextMsg - * {string} string to add in loading message - * - */ - contextMsg: 'Loading...', - - /** - * Property: userLabel - * {string} - * - */ - userLabel: "User", - - /** - * Property: passwordLabel - * {string} - * - */ - passwordLabel: "Password", - - /** - * Property: loginLabel - * {string} - * - */ - loginLabel: "Login", - - /** - * Property: mapMetadataTitle - * {string} - * - */ - mapMetadataTitle: "Insert Map Metadata", - - /** - * Property: mapMedatataSetTitle - * {string} - * - */ - mapMedatataSetTitle: "Map Metadata", - - /** - * Property: mapNameLabel - * {string} - * - */ - mapNameLabel: "Name", - - /** - * Property: mapDescriptionLabel - * {string} - * - */ - mapDescriptionLabel: "Description", - - getUser: function() { - if(this.target.userDetails && this.target.userDetails.user) { - return this.target.userDetails.user.name; - } else { - var auth = this.getAuth(); - if(auth) { - return Base64.decode(auth.split(' ')[1]); - } - } - return ''; - }, - - /** - * Property: conflictErrMsg - * {string} - */ - conflictErrMsg: "A map with the same name already exists", - - /** api: method[addActions] - */ - addActions: function() { - - //var pattern=/(.+:\/\/)?([^\/]+)(\/.*)*/i; - //var mHost=pattern.exec(geoStoreBaseURL); - var plugin =this; - var saveContext = new Ext.Button({ - id: "save-context-button", - menuText: this.saveDefaultContextMenuText, - iconCls: "gxp-icon-savedefaultcontext", - disabled: false, - tooltip: this.saveDefaultContextActionTip, - handler: function() { - - if(this.target.authHeader || this.authHeader){ - - var configStr = Ext.util.JSON.encode(this.target.getState()); - - if(this.target.mapId == -1){ - // - // SAVE MAP - // - //console.log(configStr); - this.metadataDialog(configStr); - }else{ - // - // UPDATE MAP - // - var mUrl = this.target.geoStoreBaseURL + "data/" + this.target.mapId; - var url = /*mHost[2] == location.host ? mUrl : this.target.proxy + */mUrl; - var method = 'PUT'; - var contentType = 'application/json'; - var auth = plugin.getAuth(); - this.save(url, method, contentType, configStr, auth); - } - }else{ - var loginPanel; - var loginWin; - var thisObj = this; - - var submitLogin = function() { - var form = loginPanel.getForm(); - var fields = form.getValues(); - - var pass = fields.password; - var user = fields.username; - - loginWin.destroy(); - - thisObj.authHeader = 'Basic ' + Base64.encode(user + ':' + pass); - var configStr = Ext.util.JSON.encode(thisObj.target.getState()); - - if(thisObj.target.mapId == -1){ - // - // SAVE MAP - // - thisObj.metadataDialog(configStr); - }else{ - // - // UPDATE MAP - // - var mUrl = thisObj.target.geoStoreBaseURL + "data/" + thisObj.target.mapId; - var url = /*mHost[2] == location.host ? mUrl : this.target.proxy +*/ mUrl; - var method = 'PUT'; - var contentType = 'application/json'; - - thisObj.save(url, method, contentType, configStr, thisObj.authHeader); - } - }; - - loginPanel = new Ext.FormPanel({ - frame: true, - labelWidth: 80, - defaultType: "textfield", - items: [{ - fieldLabel: this.userLabel, - name: "username", - allowBlank: false - }, { - fieldLabel: this.passwordLabel, - name: "password", - inputType: "password", - allowBlank: false - }], - buttons: [{ - text: this.loginLabel, - formBind: true, - handler: submitLogin - }], - keys: [{ - key: [Ext.EventObject.ENTER], - handler: submitLogin - }] - }); - - var loginWin = new Ext.Window({ - title: "Login", - layout: "fit", - width: 275, - height: 130, - plain: true, - border: false, - modal: true, - items: [loginPanel] - }); - - loginWin.show(); - } - }, - scope: this - }); - - var actions = [saveContext]; - - return gxp.plugins.SaveDefaultContext.superclass.addActions.apply(this, [actions]); - }, - - save: function(url, method, contentType, configStr, auth){ - var mask = new Ext.LoadMask(Ext.getBody(), {msg: this.contextMsg}); - mask.show(); - - Ext.Ajax.request({ - url: url, - method: method, - headers:{ - 'Content-Type' : contentType, - 'Accept' : 'application/json, text/plain, text/xml', - 'Authorization' : auth - }, - params: configStr, - scope: this, - success: function(response, opts){ - mask.hide(); - this.target.modified = false; - - // - // if the user change language the page is reloaded and this.authHeader is cleared - // - if(!this.authHeader) - this.authHeader = auth; - - this.target.mapId = response.responseText; - - var reload = function(buttonId, text, opt){ - if(buttonId === 'ok'){ - var href = location.href; - if(href.indexOf('mapId') == -1){ - if(href.indexOf('?') != -1){ - window.open(href + '&mapId=' + this.target.mapId, '_self'); - }else{ - window.open(href + '?mapId=' + this.target.mapId, '_self'); - } - } - } - }; - - Ext.Msg.show({ - title: this.contextSaveSuccessString, - msg: response.statusText + " " + this.contextSaveSuccessString, - buttons: Ext.Msg.OK, - fn: reload, - icon: Ext.MessageBox.OK, - scope: this - }); - }, - failure: function(response, opts){ - mask.hide(); - - this.authHeader = null; - - Ext.Msg.show({ - title: this.contextSaveFailString, - msg: this.getSaveFailedErrMsg(response), - buttons: Ext.Msg.OK, - icon: Ext.MessageBox.ERROR - }); - } - }); - }, - - getSaveFailedErrMsg: function(response) { - var errMsg = null; - var defaultErrMsg = response.statusText + "(status " + response.status + "): " + response.responseText; - - switch (response.status) { - case 409: - errMsg = this.conflictErrMsg; - break; - default: - errMsg = defaultErrMsg; - break; - } - - return errMsg; - }, - - metadataDialog: function(configStr){ - var enableBtnFunction = function(){ - if(this.getValue() != "") - Ext.getCmp("resource-addbutton").enable(); - else - Ext.getCmp("resource-addbutton").disable(); - }; - - var templateId = this.target.templateId; - var plugin = this; - var win = new Ext.Window({ - title: this.mapMetadataTitle, - width: 415, - height: 200, - resizable: false, - //title: "Map Name", - items: [ - new Ext.form.FormPanel({ - width: 400, - height: 150, - items: [ - { - xtype: 'fieldset', - id: 'name-field-set', - title: this.mapMedatataSetTitle, - items: [ - { - xtype: 'textfield', - width: 120, - id: 'diag-text-field', - fieldLabel: this.mapNameLabel, - listeners: { - render: function(f){ - f.el.on('keydown', enableBtnFunction, f, {buffer: 350}); - } - } - }, - { - xtype: 'textarea', - width: 200, - id: 'diag-text-description', - fieldLabel: this.mapDescriptionLabel, - readOnly: false, - hideLabel : false - } - ] - } - ] - }) - ], - bbar: new Ext.Toolbar({ - items:[ - '->', - { - text: this.addResourceButtonText, - iconCls: "gxp-icon-addgroup-button", - id: "resource-addbutton", - scope: this, - disabled: true, - handler: function(){ - win.hide(); - - var mapName = Ext.getCmp("diag-text-field").getValue(); - var mapDescription = Ext.getCmp("diag-text-description").getValue(); - var auth = plugin.getAuth(); - var owner = plugin.getUser(); - //var owner = Base64.decode(auth.split(' ')[1]); - owner = owner.split(':')[0]; - var resourceXML = - '' + - '' + - '' + - 'owner' + - 'STRING' + - '' + owner + '' + - '' + - '' + - 'templateId' + - 'STRING' + - '' + templateId + '' + - '' + - '' + - '' + mapDescription + '' + - '' + - '' + mapName + '' + - '' + - 'MAP' + - '' + - '' + - '' + - '' + - ''; - - //var pattern=/(.+:\/\/)?([^\/]+)(\/.*)*/i; - //var mHost=pattern.exec(geoStoreBaseURL); - - var mUrl = this.target.geoStoreBaseURL + "resources"; - - var url = /*mHost[2] == location.host ? mUrl : this.target.proxy +*/ mUrl; - var method = 'POST'; - var contentType = 'text/xml'; - - this.save(url, method, contentType, resourceXML, auth); - - win.destroy(); - } - } - ] - }) - }); - - win.show(); - }, - - /** - * Retrieves auth from (in this order) - * * the parent window (For usage in manager) - * * the session storage (if enabled userDetails, see ManagerViewPort.js class of mapmanager) - * We should imagine to get the auth from other contexts. - */ - getAuth: function(){ - var authorization = this.target.getAuth(); - return (authorization ? authorization : this.authHeader); - } -}); - -Ext.preg(gxp.plugins.SaveDefaultContext.prototype.ptype, gxp.plugins.SaveDefaultContext); \ No newline at end of file diff --git a/mapcomposer/app/static/externals/gxp/src/script/plugins/SaveMapPlugin.js b/mapcomposer/app/static/externals/gxp/src/script/plugins/SaveMapPlugin.js new file mode 100644 index 000000000..59672be8f --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/src/script/plugins/SaveMapPlugin.js @@ -0,0 +1,768 @@ +/** + * Copyright (C) 2007 - 2012 GeoSolutions S.A.S. + * http://www.geo-solutions.it + * + * GPLv3 + Classpath exception + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @requires plugins/Tool.js + */ + +/** api: (define) + * module = gxp.plugins + * class = saveDefaultContext + */ + +/** api: (extends) + * plugins/Tool.js + */ +Ext.namespace("gxp.plugins"); + +/** api: constructor + * .. class:: SaveMapPlugin(config) + * + * Plugin for Save Context Map as geostore resource. + */ +gxp.plugins.SaveMapPlugin = Ext.extend(gxp.plugins.Tool, { + + /** api: ptype = gxp_saveMapPlugin */ + ptype: "gxp_saveMapPlugin", + + /** api: config[saveDefaultContextMenuText] + * ``String`` + */ + saveDefaultContextMenuText: "Save default context", + + /** api: config[saveDefaultContextActionTip] + * ``String`` + */ + saveDefaultContextActionTip: "Save Map context", + + /** api: config[contextSaveSuccessString] + * ``String`` + */ + contextSaveSuccessString: "Context saved succesfully", + + /** api: config[contextSaveFailString] + * ``String`` + */ + contextSaveFailString: "Context not saved succesfully", + + /** api: config[addResourceButtonText] + * ``String`` + */ + addResourceButtonText: "Add Map", + + selectionErrorTitle:"Error", + + groupSelectionError:"Select at least one group", + + permissionsLabel:"Permissions", + + groupsLabel:"User groups", + /** api: config[authHeader] + * ``String`` + */ + authHeader: null, + + /** + * Property: contextMsg + * {string} string to add in loading message + * + */ + contextMsg: 'Loading...', + + /** + * Property: userLabel + * {string} + * + */ + userLabel: "User", + + /** + * Property: passwordLabel + * {string} + * + */ + passwordLabel: "Password", + + /** + * Property: loginLabel + * {string} + * + */ + loginLabel: "Login", + + /** + * Property: mapMetadataTitle + * {string} + * + */ + mapMetadataTitle: "Insert Map Metadata", + + /** + * Property: mapMedatataSetTitle + * {string} + * + */ + mapMedatataSetTitle: "Map Metadata", + + /** + * Property: mapNameLabel + * {string} + * + */ + mapNameLabel: "Name", + + /** + * Property: mapDescriptionLabel + * {string} + * + */ + mapDescriptionLabel: "Description", + + getUser: function() { + if(this.target.userDetails && this.target.userDetails.user) { + return this.target.userDetails.user; + } else { + var auth = this.getAuth(); + if(auth) { + return Base64.decode(auth.split(' ')[1]); + } + } + return ''; + }, + + /** + * Property: conflictErrMsg + * {string} + */ + conflictErrMsg: "A map with the same name already exists", + + /** api: method[addActions] + */ + addActions: function() { + + //var pattern=/(.+:\/\/)?([^\/]+)(\/.*)*/i; + //var mHost=pattern.exec(geoStoreBaseURL); + var plugin =this; + var saveContext = new Ext.Button({ + id: "save-context-button", + menuText: this.saveDefaultContextMenuText, + iconCls: "gxp-icon-savedefaultcontext", + disabled: false, + tooltip: this.saveDefaultContextActionTip, + handler: function() { + + if(this.target.authHeader || this.authHeader){ + + var configStr = Ext.util.JSON.encode(this.target.getState()); + + if(this.target.mapId == -1){ + // + // SAVE MAP + // + this.metadataDialog(configStr); + }else{ + // + // UPDATE MAP + // + var mUrl = this.target.geoStoreBaseURL + "data/" + this.target.mapId; + var url = /*mHost[2] == location.host ? mUrl : this.target.proxy + */mUrl; + var method = 'PUT'; + var contentType = 'application/json'; + var auth = plugin.getAuth(); + this.updateMap(url, method, contentType, configStr, auth); + } + }else{ + var loginPanel; + var loginWin; + var thisObj = this; + + var submitLogin = function() { + var form = loginPanel.getForm(); + var fields = form.getValues(); + + var pass = fields.password; + var user = fields.username; + + loginWin.destroy(); + + thisObj.authHeader = 'Basic ' + Base64.encode(user + ':' + pass); + var configStr = Ext.util.JSON.encode(thisObj.target.getState()); + + if(thisObj.target.mapId == -1){ + // + // SAVE MAP + // + thisObj.metadataDialog(configStr); + }else{ + // + // UPDATE MAP + // + var mUrl = thisObj.target.geoStoreBaseURL + "data/" + thisObj.target.mapId; + var url = /*mHost[2] == location.host ? mUrl : this.target.proxy +*/ mUrl; + var method = 'PUT'; + var contentType = 'application/json'; + + thisObj.updateMap(url, method, contentType, configStr, thisObj.authHeader); + } + }; + + loginPanel = new Ext.FormPanel({ + frame: true, + labelWidth: 80, + defaultType: "textfield", + items: [{ + fieldLabel: this.userLabel, + name: "username", + allowBlank: false + }, { + fieldLabel: this.passwordLabel, + name: "password", + inputType: "password", + allowBlank: false + }], + buttons: [{ + text: this.loginLabel, + formBind: true, + handler: submitLogin + }], + keys: [{ + key: [Ext.EventObject.ENTER], + handler: submitLogin + }] + }); + + var loginWin = new Ext.Window({ + title: "Login", + layout: "fit", + width: 275, + height: 130, + plain: true, + border: false, + modal: true, + items: [loginPanel] + }); + + loginWin.show(); + } + }, + scope: this + }); + + var actions = [saveContext]; + + return gxp.plugins.SaveMapPlugin.superclass.addActions.apply(this, [actions]); + }, + + updateMap: function(url, method, contentType, configStr, auth){ + var mask = new Ext.LoadMask(Ext.getBody(), {msg: this.contextMsg}); + mask.show(); + + Ext.Ajax.request({ + url: url, + method: method, + headers:{ + 'Content-Type' : contentType, + 'Accept' : 'application/json, text/plain, text/xml', + 'Authorization' : auth + }, + params: configStr, + scope: this, + success: function(response, opts){ + mask.hide(); + this.target.modified = false; + + // + // if the user change language the page is reloaded and this.authHeader is cleared + // + if(!this.authHeader) + this.authHeader = auth; + + this.target.mapId = response.responseText; + + var reload = function(buttonId, text, opt){ + if(buttonId === 'ok'){ + var href = location.href; + if(href.indexOf('mapId') == -1){ + if(href.indexOf('?') != -1){ + window.open(href + '&mapId=' + this.target.mapId, '_self'); + }else{ + window.open(href + '?mapId=' + this.target.mapId, '_self'); + } + } + } + }; + + Ext.Msg.show({ + title: this.contextSaveSuccessString, + msg: response.statusText + " " + this.contextSaveSuccessString, + buttons: Ext.Msg.OK, + fn: reload, + icon: Ext.MessageBox.OK, + scope: this + }); + }, + failure: function(response, opts){ + mask.hide(); + + this.authHeader = null; + + Ext.Msg.show({ + title: this.contextSaveFailString, + msg: this.getSaveFailedErrMsg(response), + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + } + }); + }, + + getSaveFailedErrMsg: function(response) { + var errMsg = null; + var defaultErrMsg = response.statusText + "(status " + response.status + "): " + response.responseText; + + switch (response.status) { + case 409: + errMsg = this.conflictErrMsg; + break; + default: + errMsg = defaultErrMsg; + break; + } + + return errMsg; + }, + createMap :function (url, method, contentType, configStr, auth,permissions){ + + var mask = new Ext.LoadMask(Ext.getBody(), {msg: this.contextMsg}); + mask.show(); + + Ext.Ajax.request({ + url: url, + method: method, + headers:{ + 'Content-Type' : contentType, + 'Accept' : 'application/json, text/plain, text/xml', + 'Authorization' : auth + }, + params: configStr, + scope: this, + success: function(response, opts){ + mask.hide(); + this.target.modified = false; + + // + // if the user change language the page is reloaded and this.authHeader is cleared + // + if(!this.authHeader) + this.authHeader = auth; + this.target.mapId = response.responseText + var reload = function(buttonId, text, opt){ + if(buttonId === 'ok'){ + var href = location.href; + if(href.indexOf('mapId') == -1){ + if(href.indexOf('?') != -1){ + window.open(href + '&mapId=' + this.target.mapId, '_self'); + }else{ + window.open(href + '?mapId=' + this.target.mapId, '_self'); + } + } + } + }; + //Save permissions + permissionUrl= url+'/resource/'+this.target.mapId+'/permissions'; + this.createPermission(permissionUrl, method, contentType, permissions, auth,reload); + }, + failure: function(response, opts){ + mask.hide(); + + this.authHeader = null; + + Ext.Msg.show({ + title: this.contextSaveFailString, + msg: this.getSaveFailedErrMsg(response), + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + } + }); + }, +createPermission :function (url, method, contentType, configStr, auth,reload){ + + var mask = new Ext.LoadMask(Ext.getBody(), {msg: this.contextMsg}); + mask.show(); + + Ext.Ajax.request({ + url: url, + method: method, + headers:{ + 'Content-Type' : contentType, + 'Accept' : 'application/json, text/plain, text/xml', + 'Authorization' : auth + }, + params: configStr, + scope: this, + success: function(response, opts){ + mask.hide(); + + // if the user change language the page is reloaded and this.authHeader is cleared + // + if(!this.authHeader) + this.authHeader = auth; + + + Ext.Msg.show({ + title: this.contextSaveSuccessString, + msg: this.contextSaveSuccessString, + buttons: Ext.Msg.OK, + fn: reload, + icon: Ext.MessageBox.OK, + scope: this + }); + }, + failure: function(response, opts){ + mask.hide(); + + this.authHeader = null; + + Ext.Msg.show({ + title: this.contextSaveFailString, + msg: this.getSaveFailedErrMsg(response), + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + } + }); + + }, + + + metadataDialog: function(configStr){ + var enableBtnFunction = function(){ + if(this.getValue() != "") + Ext.getCmp("resource-addbutton").enable(); + else + Ext.getCmp("resource-addbutton").disable(); + }; + var saveBtn=Ext.getCmp("save-context-button"); + var templateId = this.target.templateId; + var plugin = this; + var win = new Ext.Window({ + title: this.mapMetadataTitle, + width: 415, + height: 400, + resizable: true, + plain: true, + layout: "fit", + listeners:{ + + destroy:function(){ + saveBtn.enable(); + }, + show:function(){ + saveBtn.disable(); + } + }, + //title: "Map Name", + items: [ + { + xtype:'form', + layout: "fit", + border:true, + items: [ + { + xtype: 'fieldset', + id: 'name-field-set', + items: [ + { + xtype: 'textfield', + width: 200, + allowBlank:false, + id: 'diag-text-field', + ref: "../../mapName", + fieldLabel: this.mapNameLabel, + listeners: { + render: function(f){ + f.el.on('keydown', enableBtnFunction, f, {buffer: 350}); + } + } + }, + { + xtype: 'textarea', + width: 200, + id: 'diag-text-description', + ref: "../../mapDescription", + fieldLabel: this.mapDescriptionLabel, + readOnly: false, + hideLabel : false + }, + { + xtype:'combo', + typeAhead: true, + triggerAction: 'all', + mode: 'local', + width: 200, + fieldLabel: this.permissionsLabel, + ref: "../../generalPermissions", + store: new Ext.data.ArrayStore({ + id: 0, + fields: ['value','displayText'], + data: [['public', 'Public (default)'], ['private', 'Private'],['group','Group']] + }), + valueField: 'value', + displayField: 'displayText', + value:'public', + listeners:{ + scope: this, + 'select': function( combo, record, index){ + if(index==2){ + win.groupPermissions.enable(); + } + else win.groupPermissions.disable(); + } + } + },{ + xtype:'gxp_usergroupmultiselect', + width: 200, + ref:"../../groupPermissions", + disabled:true, + fieldLabel:this.groupsLabel, + url: this.target.geoStoreBaseURL +'/usergroups', + auth: this.getAuth(), + name:'groupId', + editable:false, + maxLength:200, + allowBlank:true, + target: this.target + } + ] + } + ] + } + ], + bbar: new Ext.Toolbar({ + items:[ + '->', + { + text: this.addResourceButtonText, + iconCls: "gxp-icon-addgroup-button", + id: "resource-addbutton", + scope: this, + disabled: true, + handler: function(){ + + var mapName = win.mapName.getValue(); + var mapDescription = win.mapDescription.getValue(); + var generalPermission= win.generalPermissions.getValue(); + var groups=win.groupPermissions.getValue(); + + if(mapName){ + + // ///////////////////////////////////// + // Get info about logged user if any + // ///////////////////////////////////// + var auth =plugin.getAuth(); + + // ///////////////////////// + // Fetch base url + // ///////////////////////// + var url = plugin.target.geoStoreBaseURL+'resources'; + + var owner=null,userId=null; + var user=plugin.getUser(); + + if(user.name ) { + owner= user.name; + userId=user.id + } + + var attributes=null; + if(templateId) + attributes=[{name:'templateId','@type':'STRING',value:templateId}]; + + var objConfig= { + owner: owner, + name:mapName, + description: mapDescription, + attributes:attributes, + blob:configStr + }; + //owner rule + var permissionsConfig=[{ + user:{name:owner,id:userId}, + canRead:true, + canWrite:true + }]; + if(generalPermission=='public'){ + //get everyone group id + var everyone=win.groupPermissions.store.getAt(win.groupPermissions.store.find('name','everyone')); + permissionsConfig.push({ + group:{name:everyone.get('name'),id:everyone.get('id')}, + canRead:true, + canWrite:false + }); + }else if(generalPermission=='group'){ + + if(groups==""){ + Ext.Msg.show({ + title: plugin.selectionErrorTitle, + msg: plugin.groupSelectionError, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + return; + }else{ + var st=win.groupPermissions.store; + Ext.each(groups.split(','), function(id){ + + permissionsConfig.push({ + group:{name:st.getById(id).get('name'),id:id}, + canRead:true, + canWrite:false + }); + }); + } + } + + var method = 'POST'; + var contentType = 'text/xml'; + + plugin.createMap(url, method, contentType, plugin.createXmlMapResource(objConfig), auth,plugin.createXmlPermissionsResource(permissionsConfig)); + + win.destroy(); + + } + else{ + Ext.Msg.show({ + title: "Error", + msg: plugin.mapRequiredError, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + + } + } + } + ] + }) + }); + + win.show(); + }, + + /** + * Retrieves auth from (in this order) + * * the parent window (For usage in manager) + * * the session storage (if enabled userDetails, see ManagerViewPort.js class of mapmanager) + * We should imagine to get the auth from other contexts. + */ + getAuth: function(){ + var authorization = this.target.getAuth(); + return (authorization ? authorization : this.authHeader); + }, + createXmlMapResource: function(data){ + // /////////////////////////////////////// + // Wrap new map within an xml envelop + // /////////////////////////////////////// + //var addedAttributes = false; + var xml = ''; + + if(data.owner || data.attributes){ + xml += ''; + + if(data.owner){ + xml += + '' + + 'owner' + + 'STRING' + + '' + data.owner + '' + + ''; + } + + if(data.attributes){ + for(var i=0; i' + + '' + data.attributes[i].name + '' + + '' + data.attributes[i]["@type"] + '' + + '' + data.attributes[i].value + '' + + ''; + } + } + + xml += ''; + } + + xml += + '' + data.description + '' + + '' + + '' + data.name + ''; + if (data.blob) + xml+= + '' + + 'MAP' + + '' + + '' + + '' + + ''; + + xml += ''; + return xml; + }, + + createXmlPermissionsResource: function(data){ + // wrap security rule list + var xml = ''; + if(data && data.length > 0){ + for(var i = 0; i < data.length; i++){ + var rule = data[i]; + // valid rule + if(rule && (rule.user || rule.group)){ + xml += + '' + + '' + rule.canRead + '' + + '' + rule.canWrite + ''; + if(rule.user){ + xml += + '' + + '' + rule.user.id + '' + + '' + rule.user.name + '' + + ''; + } else if(rule.group){ + xml += + '' + + '' + rule.group.id + '' + + '' + rule.group.groupName + '' + + ''; + } + + xml += + ''; + } + } + } + + xml += ''; + + + return xml; + }, +}); + +Ext.preg(gxp.plugins.SaveMapPlugin.prototype.ptype, gxp.plugins.SaveMapPlugin); \ No newline at end of file diff --git a/mapcomposer/app/static/externals/gxp/src/script/widgets/form/UserGroupMultiSelect.js b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/UserGroupMultiSelect.js new file mode 100644 index 000000000..8f0206a7f --- /dev/null +++ b/mapcomposer/app/static/externals/gxp/src/script/widgets/form/UserGroupMultiSelect.js @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2007 - 2014 GeoSolutions S.A.S. + * http://www.geo-solutions.it + * + * GPLv3 + Classpath exception + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** api: (define) + * module = gxp.form + * class = UserGroupMultiSelect + * + */ +Ext.ns('gxp.form'); + +/** + * Class: UserGroupComboBox + * User group simple combobox + * + * Inherits from: + * - + * + */ +gxp.form.UserGroupMultiSelect = Ext.extend(Ext.ux.form.MultiSelect, { + + /** xtype = gxp_usergroupmultiselect **/ + xtype: "gxp_usergroupmultiselect", + + // i18n + fieldLabel: "User group", + + // base config + typeAhead: true, + triggerAction: 'all', + lazyRender:true, + valueField: 'id', + displayField: 'name', + + // specifig config + url: null, + auth: null, + width:175, + // select by default by name + defaultSelection: null, + + // by default the combo include all groups in the system (include everyone group) + showAll: true, + + initComponent: function(){ + + // headers + var defaultHeaders = {'Accept': 'application/json'}; + if(this.auth){ + defaultHeaders['Authorization'] = this.auth; + } + + // add all + var url = this.url; + if(url && this.showAll){ + if(url.indexOf("?")<0){ + url += "?all=true"; + }else{ + url += "&all=true"; + } + } + + // If user is admin, load the groups from geostore url, otherwise load from user context + var role,groups; + if(sessionStorage && sessionStorage["userDetails"]){ + var userDetails = sessionStorage["userDetails"]; + userDetails = Ext.decode(userDetails); + role = userDetails.user.role; + groups = userDetails.user.groups.group; + }else{ + role = this.target && this.target.user && this.target.user.role == "ADMIN"; + } + var userIsAdmin = (role =="ADMIN"); + // store + this.store = { + xtype: "jsonstore", + fields: [ + {name:'id', mapping:'id'}, + {name:'name', mapping:'groupName'} + ], + listeners:{ + load: function(store){ + this.fireEvent("storeload", store, this); + this.loadDefault(store); + }, + scope: this + } + }; + + if(userIsAdmin){ + // load from geostore + Ext.apply(this.store,{ + xtype: "jsonstore", + idProperty: 'id', + root: 'UserGroupList.UserGroup', + autoLoad: true, + proxy: new Ext.data.HttpProxy({ + url: url, + restful: true, + method : 'GET', + disableCaching: true, + failure: function (response) { + Ext.Msg.show({ + title: "Error", + msg: response.statusText + "(status " + response.status + "): " + response.responseText, + buttons: Ext.Msg.OK, + icon: Ext.MessageBox.ERROR + }); + }, + headers: defaultHeaders + }) + }); + }else{ + // load user groups from user logged details + this.autoLoad = true; + this.mode = 'local'; + var data = []; + //if not alredy loaded from the session storage + if (!groups && this.target){ + if(this.target.user.groups.group && this.target.user.groups.group.length){ + // it have more than one group + data = this.target.user.groups.group; + }else if(this.target.user.groups.group){ + // only one group + data.push(this.target.user.groups.group); + } + }else if(groups){ + if(groups instanceof Array){ + data = groups; + }else{ + data = [groups] ; + } + + } + + Ext.apply(this.store,{ + mode: "local", + data: data + }); + } + + gxp.form.UserGroupMultiSelect.superclass.initComponent.call(this, arguments); + }, + + /** + * private:[loadDefault] + * + * Select `this.defaultSelection` if it's configurated + **/ + loadDefault: function(store){ + if(this.defaultSelection){ + store.each(function(record){ + if(this.defaultSelection == record.get("name") || this.defaultSelection == record.get("groupName")){ + this.setValue(record.get("id")); + } + }, this); + } + } +}); + +/** api: xtype = msm_usergroupcombobox */ +Ext.reg(gxp.form.UserGroupMultiSelect.prototype.xtype, gxp.form.UserGroupMultiSelect); \ No newline at end of file diff --git a/mapcomposer/app/static/externals/gxp/src/theme/all.css b/mapcomposer/app/static/externals/gxp/src/theme/all.css index 8a4334462..bd7130521 100644 --- a/mapcomposer/app/static/externals/gxp/src/theme/all.css +++ b/mapcomposer/app/static/externals/gxp/src/theme/all.css @@ -543,4 +543,16 @@ div.olMap div.gx-overlay-playback { .crsInfoButton { background-image: url(img/silk/information.png) !important; +} +/* Background for items selected in multiselect */ +.ux-mselect-selected{ + background-color: rgb(204, 204, 204); +} +/** NEEDED TO MAKE MULTISELECT SCROLL **/ +.ux-mselect{ + overflow:auto; + background:white; + position:relative; /* for calculating scroll offsets */ + zoom:1; + overflow:auto; } \ No newline at end of file diff --git a/mapcomposer/app/static/script/app/GeoExplorer.js b/mapcomposer/app/static/script/app/GeoExplorer.js index 023b78509..1d02580d6 100644 --- a/mapcomposer/app/static/script/app/GeoExplorer.js +++ b/mapcomposer/app/static/script/app/GeoExplorer.js @@ -1431,11 +1431,11 @@ var GeoExplorer = Ext.extend(gxp.Viewer, { /** private: method[setAuthHeader] * - * Set Authorization Headers in gxp_saveDefaultContext. + * Set Authorization Headers in gxp_saveMapPlugin. */ setAuthHeaders: function(auth) { for(var tool in this.tools){ - if(this.tools[tool].ptype == "gxp_saveDefaultContext"){ + if(this.tools[tool].ptype == "gxp_saveMapPlugin"){ this.tools[tool].authHeader = auth; } } diff --git a/mapcomposer/app/static/script/app/GeoExplorer/Composer.js b/mapcomposer/app/static/script/app/GeoExplorer/Composer.js index 66a36c574..35514c373 100644 --- a/mapcomposer/app/static/script/app/GeoExplorer/Composer.js +++ b/mapcomposer/app/static/script/app/GeoExplorer/Composer.js @@ -204,7 +204,7 @@ GeoExplorer.Composer = Ext.extend(GeoExplorer, { // //////////////////////////////////////////////////////////// var savePlugin = false; for(i=0; i - + @@ -52,7 +52,7 @@ - + diff --git a/mapcomposer/buildjs.cfg b/mapcomposer/buildjs.cfg index 55336c19c..1d288fb05 100644 --- a/mapcomposer/buildjs.cfg +++ b/mapcomposer/buildjs.cfg @@ -190,6 +190,7 @@ include = widgets/form/CoordinatePicker.js widgets/form/BufferFieldset.js widgets/form/TextStyleField.js + widgets/form/UserGroupMultiSelect.js widgets/form/WPSUniqueValuesCombo.js widgets/form/spatialselector/SpatialSelectorMethod.js widgets/form/spatialselector/BBOXSpatialSelectorMethod.js @@ -248,7 +249,7 @@ include = plugins/spatialselector/SpatialSelector.js plugins/SpatialSelectorQueryForm.js plugins/spatialselector/Geocoder.js - plugins/SaveDefaultContext.js + plugins/SaveMapPlugin.js plugins/LayerProperties.js plugins/ZoomToLayerExtent.js plugins/Legend.js