mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Omit "iiif" bundle from toc ranges.
This commit is contained in:
@@ -48,6 +48,8 @@ public class IIIFUtils {
|
||||
// The DSpace bundle for other content related to item.
|
||||
protected static final String OTHER_CONTENT_BUNDLE = "OtherContent";
|
||||
|
||||
private static final String OMIT_FROM_TOC_BUNDLE = "iiif";
|
||||
|
||||
// The canvas position will be appended to this string.
|
||||
private static final String CANVAS_PATH_BASE = "/canvas/c";
|
||||
|
||||
@@ -335,12 +337,19 @@ public class IIIFUtils {
|
||||
public String getBundleIIIFToC(Bundle bundle) {
|
||||
String label = bundle.getMetadata().stream()
|
||||
.filter(m -> m.getMetadataField().toString('.').contentEquals(METADATA_IIIF_LABEL))
|
||||
.findFirst().map(m -> m.getValue()).orElse(bundle.getName());
|
||||
.findFirst().map(m -> m.getValue()).orElse(getBundleLabel(bundle));
|
||||
return bundle.getMetadata().stream()
|
||||
.filter(m -> m.getMetadataField().toString('.').contentEquals(METADATA_IIIF_TOC))
|
||||
.findFirst().map(m -> m.getValue() + TOC_SEPARATOR + label).orElse(label);
|
||||
}
|
||||
|
||||
private String getBundleLabel(Bundle bundle) {
|
||||
if (bundle.getName().contentEquals(OMIT_FROM_TOC_BUNDLE)) {
|
||||
return null;
|
||||
}
|
||||
return bundle.getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the iiif viewing hint for the item
|
||||
*
|
||||
|
Reference in New Issue
Block a user