Skip to content

Commit

Permalink
Support access by rppdId, redirect to gndIdentifier (RPB-108)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Nov 16, 2023
1 parent 242dc04 commit 93e3565
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ public Result authority(String id, String format) {
}
String jsonLd = getAuthorityResource(id);
if (jsonLd == null) {
SearchHits hitsById = index.query("rppdId:" + id, "", "", 0, 1).getHits();
if (hitsById.getTotalHits() > 0) {
return movedPermanently(hitsById.getAt(0).getSource().get("gndIdentifier").toString());
}
return responseFormat == Format.HTML ? notFound(views.html.details.render(null, allHits()))
: notFound("Not found: " + id);
}
Expand Down

0 comments on commit 93e3565

Please sign in to comment.