Skip to content

Commit 22a54c4

Browse files
committed
Merge branch 'rppd_rpb-259-rppdDescribedBySourceNote' of https://github.com/hbz/lobid-gnd into rppd
See https://jira.hbz-nrw.de/browse/RPB-259
2 parents 2107a5a + e58041f commit 22a54c4

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Set up JDK 1.8

app/models/AuthorityResource.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -469,29 +469,35 @@ private String process(String field, String value, String label, int i, int size
469469
} else if (Arrays.asList("dateOfBirth", "dateOfDeath").contains(field)) {
470470
result = germanDate(value);
471471
}
472-
else if (value.startsWith("http") && !value.contains(" ")) {
472+
else if (value.startsWith("http")) {
473+
String url = value;
474+
String rest = "";
475+
if (value.contains(" ")) {
476+
url = value.substring(0, value.indexOf(' '));
477+
rest = value.substring(value.indexOf(' ') + 1, value.length());
478+
}
473479
List<String> facets = Arrays.asList(HomeController.AGGREGATIONS);
474480
boolean labelBasedFacet = facets.contains(field + ".label");
475481
boolean qBasedSearch = facets.stream().noneMatch(s -> s.startsWith(field));
476482
boolean plainUriField = field.equals("source") || field.equals("publication");
477483
String searchField = (field + (plainUriField ? "" : ".id")).replace("source",
478484
"describedBy.source");
479-
label = plainUriField ? labelFor(value) : label;
485+
label = plainUriField ? labelFor(url) : label;
480486
String search = controllers.routes.HomeController
481-
.search(qBasedSearch ? searchField + ":\"" + value + "\"" : "", "", "", "", "", "",
487+
.search(qBasedSearch ? searchField + ":\"" + url + "\"" : "", "", "", "", "", "",
482488
labelBasedFacet ? field + ".label:\"" + label + "\""
483-
: searchField + ":\"" + value + "\"", "", 0, 10, "html")
489+
: searchField + ":\"" + url + "\"", "", 0, 10, "html")
484490
.toString();
485491
String searchLink = String.format(
486492
"<a id='%s-%s' title='Weitere Einträge mit %s \"%s\" suchen' href='%s'>%s</a>", //
487493
field, i, GndOntology.label(field), label, search, label);
488494
String entityLink = String.format(
489495
"<a title='Linked-Data-Quelle zu \"%s\" anzeigen' href='%s'>"
490496
+ "<i class='octicon octicon-link text-muted' aria-hidden='true'></i></a>",
491-
label, value);
497+
label, url);
492498
boolean linkableEntity = field.equals("relatedPerson") || plainUriField
493-
|| (field.startsWith("place") && value.contains("spatial"));
494-
result = searchLink + "&nbsp;" + (linkableEntity ? entityLink : "");
499+
|| (field.startsWith("place") && url.contains("spatial"));
500+
result = searchLink + "&nbsp;" + (linkableEntity ? entityLink : "") + " " + rest;
495501
} else if (field.endsWith("AsLiteral")) {
496502
String search = controllers.routes.HomeController
497503
.search("", "", "", "", "", "", field + ":\"" + value + "\"", "", 0, 10, "html")

0 commit comments

Comments
 (0)