diff --git a/core/src/main/java/org/fao/geonet/util/XslUtil.java b/core/src/main/java/org/fao/geonet/util/XslUtil.java index 7074ef4ee6a8..172044559a9d 100644 --- a/core/src/main/java/org/fao/geonet/util/XslUtil.java +++ b/core/src/main/java/org/fao/geonet/util/XslUtil.java @@ -70,6 +70,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -682,4 +683,10 @@ public static String encodeForURL(String str) { return str; } } + + private static final Random RANDOM = new Random(); + + public static String randomId() { + return "N" + RANDOM.nextInt(Integer.MAX_VALUE); + } } diff --git a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java index c1a91f538ea9..ccd28ab7d8fc 100644 --- a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java +++ b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java @@ -472,7 +472,7 @@ public Pair search(ServiceContext context, int startPos, int m Element summary = summaryAndSearchResults.one(); int numMatches = Integer.parseInt(summary.getAttributeValue("count")); - if (startPos > numMatches) { + if (numMatches != 0 && startPos > numMatches) { throw new InvalidParameterValueEx("startPosition", String.format( "Start position (%d) can't be greater than number of matching records (%d for current search).", startPos, numMatches diff --git a/schemas/config-editor.xsd b/schemas/config-editor.xsd index 9409c708498d..758e822022fd 100644 --- a/schemas/config-editor.xsd +++ b/schemas/config-editor.xsd @@ -596,6 +596,13 @@ section which is not used often by the end-user. More than one tab could be grou ]]> + + + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl b/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl index 78c076e127c4..a91aa4300a98 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl @@ -79,6 +79,7 @@ match="gmd:CI_Date/gmd:date"> + @@ -97,7 +98,7 @@ diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml index 5d3ff2cf1217..915011ec1600 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml @@ -1351,7 +1351,7 @@ onGoing - + Ressource continuellement mise à jour diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl index 2a0349d587bf..6583ef2905f3 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl @@ -50,9 +50,11 @@ - + diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl index 2f353d6410b3..b21f646215fe 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl @@ -23,11 +23,13 @@ ~ Rome - Italy. email: geonetwork@osgeo.org --> - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + version="2.0" exclude-result-prefixes="#all"> @@ -35,7 +37,7 @@ - + @@ -45,24 +47,22 @@ - + - - + + - + - + @@ -106,7 +106,9 @@ - + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl index 2f99c00eca10..2db066e16022 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl @@ -23,20 +23,23 @@ ~ Rome - Italy. email: geonetwork@osgeo.org --> - + - - - + + + + + + @@ -49,6 +52,7 @@ - - + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl index 29c53292c6e8..13eebf20073a 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl @@ -23,11 +23,14 @@ ~ Rome - Italy. email: geonetwork@osgeo.org --> - + exclude-result-prefixes="#all" + version="2.0"> @@ -35,7 +38,7 @@ - + @@ -56,7 +59,7 @@ - + @@ -157,13 +160,13 @@ - - - - + + @@ -179,35 +182,12 @@ - - - - - - - - - - - - - - - - - - - - - + - + @@ -230,8 +210,9 @@ - - + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl index f7260aab3209..3e2bb197f26c 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl @@ -26,14 +26,14 @@ Stylesheet used to update metadata for a service and attached it to the metadata for data. --> - - - + exclude-result-prefixes="#all"> @@ -42,28 +42,26 @@ attached it to the metadata for data. - - + gmd:language| + gmd:characterSet| + gmd:parentIdentifier| + gmd:hierarchyLevel| + gmd:hierarchyLevelName| + gmd:contact| + gmd:dateStamp| + gmd:metadataStandardName| + gmd:metadataStandardVersion| + gmd:dataSetURI| + gmd:locale| + gmd:spatialRepresentationInfo| + gmd:referenceSystemInfo| + gmd:metadataExtensionInfo"/> @@ -74,49 +72,49 @@ attached it to the metadata for data. + select="gmd:identificationInfo/*/gmd:citation| + gmd:identificationInfo/*/gmd:abstract| + gmd:identificationInfo/*/gmd:purpose| + gmd:identificationInfo/*/gmd:credit| + gmd:identificationInfo/*/gmd:statut| + gmd:identificationInfo/*/gmd:pointOfContact| + gmd:identificationInfo/*/gmd:resourceMaintenance| + gmd:identificationInfo/*/gmd:graphicOverview| + gmd:identificationInfo/*/gmd:resourceFormat| + gmd:identificationInfo/*/gmd:descriptiveKeywords| + gmd:identificationInfo/*/gmd:resourceSpecificUsage| + gmd:identificationInfo/*/gmd:resourceConstraints| + gmd:identificationInfo/*/gmd:aggregationInfo| + gmd:identificationInfo/*/srv:serviceType| + gmd:identificationInfo/*/srv:serviceTypeVersion| + gmd:identificationInfo/*/srv:accessProperties| + gmd:identificationInfo/*/srv:restrictions| + gmd:identificationInfo/*/srv:keywords| + gmd:identificationInfo/*/srv:extent"/> - + + + + + + GetCapabilities + + + + + + + + + + + + + + @@ -127,21 +125,16 @@ attached it to the metadata for data. - - - - + + test="gmd:identificationInfo/*/srv:coupledResource"> + select="gmd:identificationInfo/*/srv:coupledResource"> + select="gmd:identificationInfo/*/srv:couplingType| + gmd:identificationInfo/*/srv:containsOperations| + gmd:identificationInfo/*/srv:operatesOn[@uuidref!=$uuidref]"/> + // TODO : it looks like the dataset identifier and not the + // metadata UUID should be set in the operatesOn element of + // the service metadata record. + --> + @@ -195,7 +187,7 @@ attached it to the metadata for data. + gmd:identificationInfo/*[@gco:isoType='srv:SV_ServiceIdentification']"> @@ -259,19 +251,31 @@ attached it to the metadata for data. + gmd:portrayalCatalogueInfo| + gmd:metadataConstraints| + gmd:applicationSchemaInfo| + gmd:metadataMaintenance| + gmd:series| + gmd:describes| + gmd:propertyType| + gmd:featureType| + gmd:featureAttribute"/> + + + + + + + + + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl index bf53637fc512..7b96175c21e3 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl @@ -40,7 +40,9 @@ Stylesheet used to remove a reference to a online resource. diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl index ace837ea8f6d..f55716d68ab4 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl @@ -26,39 +26,37 @@ Stylesheet used to update metadata for a service and attached it to the metadata for data. --> - - - + exclude-result-prefixes="#all"> - - + gmd:language| + gmd:characterSet| + gmd:parentIdentifier| + gmd:hierarchyLevel| + gmd:hierarchyLevelName| + gmd:contact| + gmd:dateStamp| + gmd:metadataStandardName| + gmd:metadataStandardVersion| + gmd:dataSetURI| + gmd:locale| + gmd:spatialRepresentationInfo| + gmd:referenceSystemInfo| + gmd:metadataExtensionInfo| + gmd:identificationInfo"/> @@ -68,13 +66,13 @@ attached it to the metadata for data. + gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation[@uuidref = $uuidref]/../gmd:language| + gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation[@uuidref = $uuidref]/../gmd:includedWithDataset| + gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation[@uuidref = $uuidref]/../gmd:featureTypes"/> + xlink:href="{$siteUrl}csw?service=CSW&request=GetRecordById&version=2.0.2&outputSchema=http://www.isotc211.org/2005/gmd&elementSetName=full&id={$uuidref}"> @@ -82,33 +80,45 @@ attached it to the metadata for data. - + xlink:href="{$siteUrl}csw?service=CSW&request=GetRecordById&version=2.0.2&outputSchema=http://www.isotc211.org/2005/gmd&elementSetName=full&id={$uuidref}"/> + gmd:dataQualityInfo| + gmd:portrayalCatalogueInfo| + gmd:metadataConstraints| + gmd:applicationSchemaInfo| + gmd:metadataMaintenance| + gmd:series| + gmd:describes| + gmd:propertyType| + gmd:featureType| + gmd:featureAttribute"/> + + + + + + + + + + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl index 8aa0f8b60942..2ccc603495ec 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl @@ -23,13 +23,11 @@ --> + version="2.0"> diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl index b6c82444212d..d0c4712aa5a4 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl @@ -25,7 +25,9 @@ - @@ -43,7 +45,7 @@ Stylesheet used to add a reference to a related record using aggregation info. - + @@ -72,6 +74,10 @@ Stylesheet used to add a reference to a related record using aggregation info. + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl index bfa842a662db..052a59a7fc2f 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl @@ -24,8 +24,10 @@ - + @@ -73,6 +75,11 @@ + + + + diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java index 980f78957870..ba2eb4e955e8 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java @@ -202,13 +202,9 @@ public Map getSchemaTranslations( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - String elementName = StandardsUtils.findNamespace(codelist, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "codelists.xml", - schema, elementName, parent, xpath, isoType, context); - if (e == null) { - throw new ResourceNotFoundException(String.format( - "'%s' not found.", codelist)); - } + Element e = StandardsUtils.getCodelist(codelist, schemaManager, + schema, parent, xpath, isoType, context); + List listOfEntry = e.getChildren("entry"); for (Element entry : listOfEntry) { response.put(entry.getChildText("code"), entry.getChildText("label")); @@ -243,13 +239,9 @@ public Codelists.Codelist getSchemaCodelistsWithDetails( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - String elementName = StandardsUtils.findNamespace(codelist, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "codelists.xml", - schema, elementName, parent, xpath, isoType, context); - if (e == null) { - throw new ResourceNotFoundException(String.format( - "'%s' not found.", codelist)); - } + Element e = StandardsUtils.getCodelist(codelist, schemaManager, + schema, parent, xpath, isoType, context); + return (Codelists.Codelist) Xml.unmarshall(e, Codelists.Codelist.class); } @@ -281,13 +273,9 @@ public org.fao.geonet.kernel.schema.labels.Element getElementDetails( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - String elementName = StandardsUtils.findNamespace(element, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "labels.xml", - schema, elementName, parent, xpath, isoType, context); - if (e == null) { - throw new ResourceNotFoundException(String.format( - "'%s' not found.", element)); - } + Element e = StandardsUtils.getLabel(element, schemaManager, + schema, parent, xpath, isoType, context); + return (org.fao.geonet.kernel.schema.labels.Element) Xml.unmarshall(e, org.fao.geonet.kernel.schema.labels.Element.class); } } diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java index ab3391755561..c0f3e709ffca 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java @@ -25,6 +25,7 @@ import jeeves.server.context.ServiceContext; import jeeves.server.dispatchers.guiservices.XmlFile; +import org.fao.geonet.api.exception.ResourceNotFoundException; import org.fao.geonet.constants.Geonet; import org.fao.geonet.exceptions.OperationAbortedEx; import org.fao.geonet.kernel.SchemaManager; @@ -37,6 +38,46 @@ * Created by francois on 23/06/16. */ public class StandardsUtils { + public static Element getCodelist(String codelist, SchemaManager schemaManager, + String schema, + String parent, String xpath, + String isoType, ServiceContext context) + throws Exception { + return getCodelistOrLabel(codelist, schemaManager, schema, + parent, xpath, isoType, context, "codelists.xml"); + } + + public static Element getLabel(String element, SchemaManager schemaManager, + String schema, + String parent, String xpath, + String isoType, ServiceContext context) + throws Exception { + return getCodelistOrLabel(element, schemaManager, schema, + parent, xpath, isoType, context, "labels.xml"); + } + + private static Element getCodelistOrLabel(String element, SchemaManager schemaManager, + String schema, String parent, String xpath, + String isoType, ServiceContext context, + String fileName) throws Exception { + String elementName = StandardsUtils.findNamespace(element, schemaManager, schema); + Element e = StandardsUtils.getHelp(schemaManager, fileName, + schema, elementName, parent, xpath, isoType, context); + if (e == null) { + if (schema.startsWith("iso19139.")) { + e = StandardsUtils.getHelp(schemaManager, fileName, + "iso19139", elementName, parent, xpath, isoType, context); + } + if (e == null) { + throw new ResourceNotFoundException(String.format( + "Element '%s' from schema '%s' not found in '%s'.", + elementName, schema, fileName)); + } + } + return e; + } + + public static Element getHelp(SchemaManager scm, String fileName, String schema, String name, String parent, String xpath, String isoType, ServiceContext context) throws Exception { diff --git a/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java b/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java index f87539e813af..c110f0f31a16 100644 --- a/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java +++ b/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java @@ -143,7 +143,7 @@ public Element serviceSpecificExec(Element params, ServiceContext context) throw // Update the MD Map onlineSrcParams = new HashMap(); onlineSrcParams.put("protocol", "WWW:DOWNLOAD-OGC:OWS-C"); - onlineSrcParams.put("url", sm.getSiteURL(context) + String.format("/resources.get?uuid=%s&fname=%s&access=public", uuid, mapFileName)); + onlineSrcParams.put("url", sm.getNodeURL() + String.format("api/records/%s/attachments/%s", uuid, mapFileName)); onlineSrcParams.put("name", mapFileName); onlineSrcParams.put("desc", title); Element mdWithOLRes = Xml.transform(transformedMd, schemaMan.getSchemaDir("iso19139").resolve("process").resolve("onlinesrc-add.xsl"), onlineSrcParams); diff --git a/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js b/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js index 24d1cb55fd86..3fa86a34b117 100644 --- a/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js +++ b/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js @@ -169,7 +169,7 @@ if (tab) { path += '/tab/' + tab; } - $location.path(path); + $location.path(path).search('justcreated'); }); }, diff --git a/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html b/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html index db48cfdcb417..50c46f11a4d8 100644 --- a/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html +++ b/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html @@ -17,80 +17,6 @@ - - - - - - - - - - - - - - - - - - -
- - -
- - -
- -
-
- -
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js index cc5295241ec5..dbfc2f02d77b 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js +++ b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js @@ -100,6 +100,7 @@ types: '@', title: '@', list: '@', + filter: '@', user: '=', hasResults: '=?' }, @@ -112,12 +113,28 @@ (promise = gnRelatedService.get( scope.uuid, scope.types) ).then(function(data) { - scope.relations = data; - angular.forEach(data, function(value) { + scope.relations = {}; + angular.forEach(data, function(value, idx) { if (value) { scope.relationFound = true; scope.hasResults = true; } + if (!scope.relations[idx]) { + scope.relations[idx] = []; + } + if (scope.filter && angular.isArray(value)) { + var tokens = scope.filter.split(':'), + field = tokens[0], + filter = tokens[1]; + scope.relations[idx] = []; + for (var i = 0; i < value.length; i++) { + if (filter.indexOf(value[i][field]) !== -1) { + scope.relations[idx].push(value[i]); + } + } + } else { + scope.relations[idx] = value; + } }); }); } diff --git a/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js b/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js index 35546df3d210..ac8861b08aa7 100644 --- a/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js +++ b/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js @@ -236,12 +236,12 @@ $event.preventDefault(); }; - scope.isOnDrillDownPath = function(category, $event) { + scope.isOnDrillDownPath = function(category) { return gnFacetConfigService .isOnDrillDownPath(scope, category); }; - scope.isInFilter = function(category, $event) { + scope.isInFilter = function(category) { return gnFacetConfigService.isInFilter(scope, category); }; @@ -256,6 +256,30 @@ !evt || evt.preventDefault(); return false; }; + + scope.toggleAllNode = function(evt) { + el = evt ? + $(evt.currentTarget).parent() : + element.find('span.fa'); + var isExpanded = undefined; + el.find('.fa').each(function (idx, e) { + e = $(e); + if (angular.isUndefined(isExpanded)) { + isExpanded = !e.hasClass('fa-plus-square'); + } + e.removeClass(isExpanded ? 'fa-minus-square' : 'fa-plus-square'); + e.addClass(isExpanded ? 'fa-plus-square' : 'fa-minus-square'); + }); + el.find('div[data-gn-facet-dimension-category]').each(function (idx, e) { + if(isExpanded) { + $(e).addClass('hidden'); + } else { + $(e).removeClass('hidden'); + } + }); + !evt || evt.preventDefault(); + return false; + }; }); } }; diff --git a/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html b/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html index 292388f1ac8d..0aa39fdd705f 100644 --- a/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html +++ b/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html @@ -4,6 +4,7 @@ data-ng-if="$index < maxItems" class="list-group-item"> diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js index fc6b236e4054..eb3037e8eb41 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js @@ -127,7 +127,7 @@ id: 'geonames' }); } - scope.regionType = data[0]; + scope.regionType = scope.regionTypes[0]; }); scope.setRegion = function(regionType) { @@ -171,8 +171,8 @@ * to catch event from selection. */ module.directive('gnRegionPickerInput', [ - 'gnRegionService', 'gnUrlUtils', - function(gnRegionService, gnUrlUtils) { + 'gnRegionService', 'gnUrlUtils', 'gnGlobalSettings', + function(gnRegionService, gnUrlUtils, gnGlobalSettings) { return { restrict: 'A', link: function(scope, element, attrs) { @@ -201,6 +201,8 @@ username: 'georchestra' })); + url = gnGlobalSettings.proxyUrl + encodeURIComponent(url); + var autocompleter = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityService.js b/web-ui/src/main/resources/catalog/components/utility/UtilityService.js index ae6462b50a0b..d16c9895e8e7 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityService.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityService.js @@ -418,11 +418,14 @@ listDefer = $q.defer(); $http.get('../api/regions/types').success(function(data) { angular.forEach(data, function(value, key) { - if (value.id && value.id.indexOf('#') >= 0) { + if (value.id) { + var tokens = value.id.split('#'), + asHash = tokens.length > 0, + name = asHash ? tokens[1] : value.id; regionsList.push({ id: value.id, - name: value.id.split('#')[1], - label: value.label || value.id.split('#')[1] + name: name, + label: value.label || name }); } }); diff --git a/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html b/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html index fd33bf1ca5d8..70ecc6e72b36 100644 --- a/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html +++ b/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html @@ -2,7 +2,6 @@
diff --git a/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js b/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js index e9d32d936c8e..b5504f2591dd 100644 --- a/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js +++ b/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js @@ -307,7 +307,7 @@ // if (/^(f|ht)tps?:\/\//i.test(url)) { // url = gnGlobalSettings.proxyUrl + encodeURIComponent(url); // } - $http.get(url).then(function(r) { + $http.get(url, {headers: {accept: 'application/xml'}}).then(function(r) { if (r.data === '') { var msg = $translate.instant('emptyMapLoadError', { url: url diff --git a/web-ui/src/main/resources/catalog/js/CatController.js b/web-ui/src/main/resources/catalog/js/CatController.js index f027433ea0e8..bc84df0ff896 100644 --- a/web-ui/src/main/resources/catalog/js/CatController.js +++ b/web-ui/src/main/resources/catalog/js/CatController.js @@ -359,7 +359,8 @@ $scope.langLabels = {'eng': 'English', 'dut': 'Nederlands', 'fre': 'Français', 'ger': 'Deutsch', 'kor': '한국의', 'spa': 'Español', 'cat': 'Català', 'cze': 'Czech', - 'fin': 'Suomeksi', 'fin': 'Suomeksi', 'ice': 'Íslenska'}; + 'ita': 'Italiano', 'fin': 'Suomeksi', 'fin': 'Suomeksi', + 'ice': 'Íslenska'}; $scope.url = ''; $scope.gnUrl = gnGlobalSettings.gnUrl; $scope.gnCfg = gnGlobalSettings.gnCfg; diff --git a/web-ui/src/main/resources/catalog/js/edit/EditorController.js b/web-ui/src/main/resources/catalog/js/edit/EditorController.js index c72c720bcc49..426e609eb3d2 100644 --- a/web-ui/src/main/resources/catalog/js/edit/EditorController.js +++ b/web-ui/src/main/resources/catalog/js/edit/EditorController.js @@ -456,23 +456,44 @@ $scope.cancel = function(refreshForm) { $scope.savedStatus = gnCurrentEdit.savedStatus; - return gnEditor.cancel(refreshForm) - .then(function(form) { - // Refresh editor form after cancel - // $scope.savedStatus = gnCurrentEdit.savedStatus; - // $rootScope.$broadcast('StatusUpdated', { - // title: $translate.instant('cancelMetadataSuccess') - // }); - // gnEditor.refreshEditorForm(null, true); - closeEditor(); - }, function(error) { - $scope.savedStatus = gnCurrentEdit.savedStatus; - $rootScope.$broadcast('StatusUpdated', { - title: $translate.instant('cancelMetadataError'), - error: error, - timeout: 0, - type: 'danger'}); - }); + if ($location.search()['justcreated']) { + // Remove newly created record + var md = gnCurrentEdit.metadata; + gnMetadataActions.deleteMd(md). + then(function(data) { + $rootScope.$broadcast('StatusUpdated', { + title: $translate.instant('metadataRemoved', + {title: md.title || md.defaultTitle}), + timeout: 2 + }); + closeEditor(); + }, function(reason) { + $rootScope.$broadcast('StatusUpdated', { + title: $translate.instant(reason.data.error.message), + timeout: 0, + type: 'danger' + }); + }); + + } else { + return gnEditor.cancel(refreshForm) + .then(function(form) { + // Refresh editor form after cancel + // $scope.savedStatus = gnCurrentEdit.savedStatus; + // $rootScope.$broadcast('StatusUpdated', { + // title: $translate.instant('cancelMetadataSuccess') + // }); + // gnEditor.refreshEditorForm(null, true); + closeEditor(); + }, function(error) { + $scope.savedStatus = gnCurrentEdit.savedStatus; + $rootScope.$broadcast('StatusUpdated', { + title: $translate.instant('cancelMetadataError'), + error: error, + timeout: 0, + type: 'danger'}); + }); + } }; $scope.close = function() { diff --git a/web-ui/src/main/resources/catalog/locales/en-core.json b/web-ui/src/main/resources/catalog/locales/en-core.json index 914aa5e92f47..f0fae7639b82 100644 --- a/web-ui/src/main/resources/catalog/locales/en-core.json +++ b/web-ui/src/main/resources/catalog/locales/en-core.json @@ -61,6 +61,7 @@ "validStatus-0": "Invalid", "validStatus--1": "Never validated", "fre": "Français", + "roh": "Rumantsch", "ara": "عربي", "kor": "Korean", "by": "by", diff --git a/web-ui/src/main/resources/catalog/views/default/config.js b/web-ui/src/main/resources/catalog/views/default/config.js index a6b83ef11c09..3442df08c56a 100644 --- a/web-ui/src/main/resources/catalog/views/default/config.js +++ b/web-ui/src/main/resources/catalog/views/default/config.js @@ -38,13 +38,14 @@ 'gnMap', 'gnNcWms', 'gnGlobalSettings', + '$location', function(searchSettings, viewerSettings, gnOwsContextService, - gnMap, gnNcWms, gnGlobalSettings) { + gnMap, gnNcWms, gnGlobalSettings, $location) { // Load the context defined in the configuration viewerSettings.defaultContext = - viewerSettings.mapConfig.map || - '../../map/config-viewer.xml'; + (viewerSettings.mapConfig.map || '../../map/config-viewer.xml'); + viewerSettings.owsContext = $location.search().map; // Keep one layer in the background // while the context is not yet loaded. diff --git a/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl b/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl index 14f27de4e8f5..370cc6308811 100644 --- a/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl +++ b/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl @@ -63,7 +63,15 @@ - + + + + + + +