Skip to content

Commit

Permalink
feat(emm): Add partOf to dump CollectionPage
Browse files Browse the repository at this point in the history
  • Loading branch information
olovy committed Nov 27, 2024
1 parent 0a9e4ce commit 7a7fc81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions emm/src/main/java/whelk/Dump.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ private static void sendFormattedResponse(Whelk whelk, String apiBaseUrl, String
responseObject.put("totalItems", totalEntityCount);
}

var partOf = new LinkedHashMap<>();
partOf.put("type", "Collection");
partOf.put("id", apiBaseUrl + "?selection=" + dump);
responseObject.put("partOf", partOf);

long nextOffset = offset + EmmChangeSet.TARGET_HITS_PER_PAGE;
if (totalEntityCount == null || nextOffset < totalEntityCount) {
responseObject.put("next", apiBaseUrl+"?selection="+dump+"&offset="+nextOffset);
Expand Down

0 comments on commit 7a7fc81

Please sign in to comment.