From 23ee75ce830b4b8e35ef40210995ac24e82b1db3 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Fri, 20 Dec 2024 10:55:58 +0100 Subject: [PATCH] Link internally to RPB titles (RPB-228) --- app/views/TableRow.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/TableRow.java b/app/views/TableRow.java index 3c88ced..de0672b 100644 --- a/app/views/TableRow.java +++ b/app/views/TableRow.java @@ -217,7 +217,9 @@ String[] refAndLabel(String property, String value, if ((property.equals("containedIn") || property.equals("hasPart") || property.equals("isPartOf") || property.equals("hasSuperordinate") || property.equals("bibliographicCitation")) && value.contains("lobid.org")) { - return new String[] { value, Lobid.resourceLabel(value) }; + return new String[] { value.matches(".*?[as]\\d+.*|.*?\\d{3}[a-z]\\d+.*") // rpbId + ? value.replace("https://lobid.org/resources/", "/") + : value, Lobid.resourceLabel(value) }; } String label = labels.isPresent() && labels.get().size() > 0 ? labels.get().get(0)