Skip to content

Commit 3f28516

Browse files
committed
Merge branch '3.2.x' of github.com:geonetwork/core-geonetwork into 3.4.x
2 parents ab64414 + c74d105 commit 3f28516

File tree

7 files changed

+54
-31
lines changed

7 files changed

+54
-31
lines changed

core/src/main/java/org/fao/geonet/kernel/search/UserQueryInput.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,19 @@
2323

2424
package org.fao.geonet.kernel.search;
2525

26+
import org.apache.commons.lang.StringUtils;
27+
import org.fao.geonet.constants.Geonet;
28+
import org.jdom.Element;
29+
2630
import java.io.UnsupportedEncodingException;
2731
import java.net.URLDecoder;
2832
import java.util.Arrays;
29-
import java.util.HashMap;
3033
import java.util.LinkedHashMap;
3134
import java.util.LinkedHashSet;
3235
import java.util.List;
3336
import java.util.Map;
3437
import java.util.Set;
3538

36-
import org.apache.commons.lang.StringUtils;
37-
import org.fao.geonet.constants.Geonet;
38-
import org.jdom.Element;
39-
4039
/**
4140
* Search parameters that can be provided by a search client.
4241
*
@@ -278,7 +277,13 @@ private void addValues(Map<String, Set<String>> hash, String nodeName, String no
278277
try {
279278
if (currentValues == null) {
280279
Set<String> values = new LinkedHashSet<String>();
281-
values.add(URLDecoder.decode(nodeValue, "UTF-8"));
280+
String val = nodeValue;
281+
try {
282+
val = URLDecoder.decode(nodeValue, "UTF-8");
283+
} catch (IllegalArgumentException iea) {
284+
// keep val as the original nodeValue
285+
}
286+
values.add(val);
282287
hash.put(nodeName, values);
283288
} else {
284289
currentValues.add(URLDecoder.decode(nodeValue, "UTF-8"));

schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
<name>srv:serviceTypeVersion</name>
319319
<name>srv:operationName</name>
320320
<name>srv:identifier</name>
321+
<name>srv:serviceType</name>
321322
</exclude>
322323
</multilingualFields>
323324

services/src/main/java/org/fao/geonet/api/records/formatters/ConfigFile.java

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,22 @@
2323

2424
package org.fao.geonet.api.records.formatters;
2525

26-
import com.google.common.collect.Lists;
27-
2826
import org.fao.geonet.Constants;
2927
import org.fao.geonet.utils.IO;
3028

29+
import javax.annotation.Nonnull;
30+
import javax.annotation.Nullable;
3131
import java.io.IOException;
3232
import java.io.PrintStream;
3333
import java.io.Reader;
3434
import java.nio.file.Files;
3535
import java.nio.file.Path;
3636
import java.util.ArrayList;
3737
import java.util.Arrays;
38+
import java.util.Collections;
3839
import java.util.List;
3940
import java.util.Properties;
4041

41-
import javax.annotation.Nonnull;
42-
import javax.annotation.Nullable;
43-
4442
public class ConfigFile {
4543
private static final String CONFIG_PROPERTIES_FILENAME = "config.properties";
4644
private static final String FIXED_LANG_CONFIG_PROP = "fixedLang";
@@ -52,29 +50,42 @@ public class ConfigFile {
5250

5351
private Properties config;
5452

53+
/**
54+
* Create a new Config file reading the config.properties file from the specific formatter dir, general formatter
55+
* dir and schema dir. Properties are override if the same property is found in more than one file. The more general
56+
* property is the one in the schema folder and the most specific one is the one from the actual formatter folder.
57+
*
58+
* @param bundleDir formatter folder.
59+
* @param searchParentDir {@code true} if config.properties in the parent folders must be included.
60+
* @param schemaDir the schema root folder.
61+
* @throws IOException thrown if there are problems reading the config files.
62+
*
63+
* @see ConfigFile#CONFIG_PROPERTIES_FILENAME
64+
*/
5565
public ConfigFile(Path bundleDir, boolean searchParentDir, Path schemaDir) throws IOException {
5666
this.config = new Properties();
57-
Path[] properties;
67+
List<Path> properties = new ArrayList<>();
5868
if (searchParentDir) {
5969
if (schemaDir == null) {
60-
properties = new Path[]{
61-
bundleDir.getParent().resolve(CONFIG_PROPERTIES_FILENAME),
62-
bundleDir.resolve(CONFIG_PROPERTIES_FILENAME)};
70+
properties.add(bundleDir.getParent().resolve(CONFIG_PROPERTIES_FILENAME));
71+
properties.add(bundleDir.resolve(CONFIG_PROPERTIES_FILENAME));
6372

6473
} else {
65-
List<Path> tmp = Lists.newArrayList();
6674
Path current = bundleDir;
6775
while (current.getParent() != null && !schemaDir.equals(current) && Files.exists(current.getParent())) {
68-
tmp.add(current.resolve(CONFIG_PROPERTIES_FILENAME));
76+
properties.add(current.resolve(CONFIG_PROPERTIES_FILENAME));
6977
current = current.getParent();
7078
}
71-
tmp.add(schemaDir.resolve(CONFIG_PROPERTIES_FILENAME));
72-
properties = tmp.toArray(new Path[tmp.size()]);
79+
properties.add(schemaDir.resolve(CONFIG_PROPERTIES_FILENAME));
7380
}
7481
} else {
75-
properties = new Path[]{bundleDir.resolve(CONFIG_PROPERTIES_FILENAME)};
82+
properties.add(bundleDir.resolve(CONFIG_PROPERTIES_FILENAME));
7683
}
7784

85+
// Reverse to allow override (issue #1973):
86+
// more general -> file in the schema root
87+
// more specific -> file in the formatter dir
88+
Collections.reverse(properties);
7889
for (Path file : properties) {
7990
if (Files.exists(file)) {
8091
try (Reader reader = IO.newBufferedReader(file, Constants.CHARSET)) {

web-ui/src/main/resources/catalog/components/catalog/CatalogService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,9 @@
533533
'securityConstraints', 'resourceConstraints', 'legalConstraints',
534534
'denominator', 'resolution', 'geoDesc', 'geoBox', 'inspirethemewithac',
535535
'status', 'status_text', 'crs', 'identifier', 'responsibleParty',
536-
'mdLanguage', 'datasetLang', 'type', 'link', 'crsDetails'];
537-
// See below; probably not necessary
538-
var listOfJsonFields = ['keywordGroup', 'crsDetails'];
536+
'mdLanguage', 'datasetLang', 'type', 'link', 'crsDetails',
537+
'creationDate', 'publicationDate', 'revisionDate'];
538+
var listOfJsonFields = ['keywordGroup', 'crsDetails']; // See below; probably not necessary
539539
var record = this;
540540
this.linksCache = [];
541541
$.each(listOfArrayFields, function(idx) {

web-ui/src/main/resources/catalog/components/search/searchmanager/SearchFormDirective.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@
194194
$scope.finalParams = finalParams;
195195
gnSearchManagerService.gnSearch(finalParams).then(
196196
function(data) {
197-
$scope.searching--;
198197
$scope.searchResults.records = [];
199198
for (var i = 0; i < data.metadata.length; i++) {
200199
$scope.searchResults.records.push(new Metadata(data.metadata[i]));
@@ -225,7 +224,9 @@
225224
);
226225
paging.from = (paging.currentPage - 1) * paging.hitsPerPage + 1;
227226
}
228-
});
227+
}).finally(function() {
228+
$scope.searching--;
229+
});
229230
};
230231

231232

web-ui/src/main/resources/catalog/components/search/searchmanager/SearchManagerService.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@
221221
} else {
222222
defer.reject('No records to index');
223223
}
224+
}, function(reason) {
225+
defer.reject("error: " + reason);
224226
});
225227
return defer.promise;
226228
};

web-ui/src/main/resources/catalog/views/default/templates/recordView.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,22 @@ <h4>
435435
</h4>
436436

437437
<p>
438-
<dl data-ng-show="mdView.current.record.creationDate">
438+
<dl data-ng-show="mdView.current.record.creationDate.length > 0">
439439
<dt data-translate>creationDate</dt>
440-
<dd data-gn-humanize-time="{{mdView.current.record.creationDate}}"
440+
<dd data-ng-repeat="creaDate in mdView.current.record.creationDate track by $index"
441+
data-gn-humanize-time="{{creaDate}}"
441442
data-format="YYYY-MM-DD"/>
442443
</dl>
443-
<dl data-ng-show="mdView.current.record.publicationDate">
444+
<dl data-ng-show="mdView.current.record.publicationDate.length > 0">
444445
<dt data-translate>publicationDate</dt>
445-
<dd data-gn-humanize-time="{{mdView.current.record.publicationDate}}"
446+
<dd data-ng-repeat="pubDate in mdView.current.record.publicationDate track by $index"
447+
data-gn-humanize-time="{{pubDate}}"
446448
data-format="YYYY-MM-DD"/>
447449
</dl>
448-
<dl data-ng-show="mdView.current.record.revisionDate">
450+
<dl data-ng-show="mdView.current.record.revisionDate.length > 0">
449451
<dt data-translate>revisionDate</dt>
450-
<dd data-gn-humanize-time="{{mdView.current.record.revisionDate}}"
452+
<dd data-ng-repeat="revDate in mdView.current.record.revisionDate track by $index"
453+
data-gn-humanize-time="{{revDate}}"
451454
data-format="YYYY-MM-DD"/>
452455
</dl>
453456
<dl data-ng-show="mdView.current.record.tempExtentBegin ||

0 commit comments

Comments
 (0)