mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
Import shared constants into IIIFUtils.
This commit is contained in:
@@ -34,6 +34,7 @@ public class IIIFSharedUtils {
|
|||||||
protected static final String OTHER_CONTENT_BUNDLE = "OtherContent";
|
protected static final String OTHER_CONTENT_BUNDLE = "OtherContent";
|
||||||
// The IIIF image server url from configuration
|
// The IIIF image server url from configuration
|
||||||
protected static final String IMAGE_SERVER_PATH = "iiif.image.server";
|
protected static final String IMAGE_SERVER_PATH = "iiif.image.server";
|
||||||
|
// IIIF metadata definitions
|
||||||
public static final String METADATA_IIIF_SCHEMA = "iiif";
|
public static final String METADATA_IIIF_SCHEMA = "iiif";
|
||||||
public static final String METADATA_IIIF_IMAGE = "image";
|
public static final String METADATA_IIIF_IMAGE = "image";
|
||||||
public static final String METADATA_IIIF_HEIGHT = "height";
|
public static final String METADATA_IIIF_HEIGHT = "height";
|
||||||
|
@@ -7,6 +7,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.app.iiif.service.utils;
|
package org.dspace.app.iiif.service.utils;
|
||||||
|
|
||||||
|
import static org.dspace.iiif.IIIFSharedUtils.METADATA_IIIF_HEIGHT;
|
||||||
|
import static org.dspace.iiif.IIIFSharedUtils.METADATA_IIIF_IMAGE;
|
||||||
|
import static org.dspace.iiif.IIIFSharedUtils.METADATA_IIIF_SCHEMA;
|
||||||
|
import static org.dspace.iiif.IIIFSharedUtils.METADATA_IIIF_WIDTH;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -58,9 +63,11 @@ public class IIIFUtils {
|
|||||||
// metadata used to set the iiif viewing hint
|
// metadata used to set the iiif viewing hint
|
||||||
public static final String METADATA_IIIF_VIEWING_HINT = "iiif.viewing.hint";
|
public static final String METADATA_IIIF_VIEWING_HINT = "iiif.viewing.hint";
|
||||||
// metadata used to set the width of the canvas that has not an explicit name
|
// metadata used to set the width of the canvas that has not an explicit name
|
||||||
public static final String METADATA_IMAGE_WIDTH = "iiif.image.width";
|
public static final String METADATA_IMAGE_WIDTH = METADATA_IIIF_SCHEMA + "." + METADATA_IIIF_IMAGE
|
||||||
|
+ "." + METADATA_IIIF_WIDTH;
|
||||||
// metadata used to set the height of the canvas that has not an explicit name
|
// metadata used to set the height of the canvas that has not an explicit name
|
||||||
public static final String METADATA_IMAGE_HEIGTH = "iiif.image.height";
|
public static final String METADATA_IMAGE_HEIGHT = METADATA_IIIF_SCHEMA + "." + METADATA_IIIF_IMAGE
|
||||||
|
+ "." + METADATA_IIIF_HEIGHT;
|
||||||
|
|
||||||
// string used in the metadata toc as separator among the different levels
|
// string used in the metadata toc as separator among the different levels
|
||||||
public static final String TOC_SEPARATOR = "|||";
|
public static final String TOC_SEPARATOR = "|||";
|
||||||
@@ -348,9 +355,9 @@ public class IIIFUtils {
|
|||||||
* @return the height in pixel for the canvas associated with the bitstream
|
* @return the height in pixel for the canvas associated with the bitstream
|
||||||
*/
|
*/
|
||||||
public int getCanvasHeight(Bitstream bitstream, Bundle bundle, Item item, int defaultHeight) {
|
public int getCanvasHeight(Bitstream bitstream, Bundle bundle, Item item, int defaultHeight) {
|
||||||
return getSizeFromMetadata(bitstream, METADATA_IMAGE_HEIGTH,
|
return getSizeFromMetadata(bitstream, METADATA_IMAGE_HEIGHT,
|
||||||
getSizeFromMetadata(bundle, METADATA_IMAGE_HEIGTH,
|
getSizeFromMetadata(bundle, METADATA_IMAGE_HEIGHT,
|
||||||
getSizeFromMetadata(item, METADATA_IMAGE_HEIGTH, defaultHeight)));
|
getSizeFromMetadata(item, METADATA_IMAGE_HEIGHT, defaultHeight)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user