mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
Intermediate commit - refactoring to rely on metadata for feature activation and configuration
This commit is contained in:
@@ -136,6 +136,27 @@ public class BitstreamBuilder extends AbstractDSpaceObjectBuilder<Bitstream> {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public BitstreamBuilder withIIIFLabel(String label) throws SQLException {
|
||||
bitstreamService.addMetadata(context, bitstream, "iiif", "label", null, null, label);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BitstreamBuilder withIIIFCanvasWidth(int i) throws SQLException {
|
||||
bitstreamService.addMetadata(context, bitstream, "iiif", "image", "width", null, String.valueOf(i));
|
||||
return this;
|
||||
}
|
||||
|
||||
public BitstreamBuilder withIIIFCanvasHeight(int i) throws SQLException {
|
||||
bitstreamService.addMetadata(context, bitstream, "iiif", "image", "height", null, String.valueOf(i));
|
||||
return this;
|
||||
}
|
||||
|
||||
public BitstreamBuilder withIIIFToC(String toc) throws SQLException {
|
||||
bitstreamService.addMetadata(context, bitstream, "iiif", "toc", null, null, toc);
|
||||
return this;
|
||||
}
|
||||
|
||||
private Bundle getOriginalBundle(Item item) throws SQLException, AuthorizeException {
|
||||
List<Bundle> bundles = itemService.getBundles(item, ORIGINAL);
|
||||
Bundle targetBundle = null;
|
||||
@@ -199,4 +220,5 @@ public class BitstreamBuilder extends AbstractDSpaceObjectBuilder<Bitstream> {
|
||||
protected DSpaceObjectService<Bitstream> getService() {
|
||||
return bitstreamService;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -115,6 +115,30 @@ public class ItemBuilder extends AbstractDSpaceObjectBuilder<Item> {
|
||||
return addMetadataValue(item, MetadataSchemaEnum.DC.getName(), "description", "provenance", provenanceData);
|
||||
}
|
||||
|
||||
public ItemBuilder enableIIIF() {
|
||||
return addMetadataValue(item, "dspace", "iiif", "enabled", "true");
|
||||
}
|
||||
|
||||
public ItemBuilder disableIIIF() {
|
||||
return addMetadataValue(item, "dspace", "iiif", "enabled", "false");
|
||||
}
|
||||
|
||||
public ItemBuilder enableIIIFSearch() {
|
||||
return addMetadataValue(item, "iiif", "search", "enabled", "true");
|
||||
}
|
||||
|
||||
public ItemBuilder withIIIFCanvasLabel(String label) {
|
||||
return addMetadataValue(item, "iiif", "canvas", "label", label);
|
||||
}
|
||||
|
||||
public ItemBuilder withIIIFCanvasWidth(int i) {
|
||||
return addMetadataValue(item, "iiif", "image", "width", String.valueOf(i));
|
||||
}
|
||||
|
||||
public ItemBuilder withIIIFCanvasHeight(int i) {
|
||||
return addMetadataValue(item, "iiif", "image", "height", String.valueOf(i));
|
||||
}
|
||||
|
||||
public ItemBuilder withMetadata(final String schema, final String element, final String qualifier,
|
||||
final String value) {
|
||||
return addMetadataValue(item, schema, element, qualifier, value);
|
||||
@@ -220,4 +244,5 @@ public class ItemBuilder extends AbstractDSpaceObjectBuilder<Item> {
|
||||
c.complete();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user