Class CanvasService


  • @RequestScope
    @Component
    public class CanvasService
    extends AbstractResourceService
    This service provides methods for creating Canvases. There should be a single instance of this service per request. The @RequestScope provides a single instance created and available during complete lifecycle of the HTTP request.
    Author:
    Michael Spalti mspalti@willamette.edu, Andrea Bollini (andrea.bollini at 4science.it)
    • Field Detail

      • BITSTREAM_METADATA_FIELDS

        protected String[] BITSTREAM_METADATA_FIELDS
    • Constructor Detail

      • CanvasService

        public CanvasService​(org.dspace.services.ConfigurationService configurationService)
        Constructor.
        Parameters:
        configurationService - the DSpace configuration service.
    • Method Detail

      • guessCanvasDimensions

        protected void guessCanvasDimensions​(List<Bundle> bundles)
        Checks for bitstream iiif.image.width metadata in the first bitstream in first IIIF bundle. If bitstream metadata is not found, use the IIIF image service to update the default canvas dimensions for this request. Called once for each manifest.
        Parameters:
        bundles - IIIF bundles for this item
      • getCanvas

        protected CanvasGenerator getCanvas​(Context context,
                                            String manifestId,
                                            Bitstream bitstream,
                                            Bundle bundle,
                                            Item item,
                                            int count,
                                            String mimeType)
        Creates a single CanvasGenerator.
        Parameters:
        context - DSpace Context
        manifestId - manifest id
        bitstream - DSpace bitstream
        bundle - DSpace bundle
        item - DSpace item
        count - the canvas position in the sequence.
        mimeType - bitstream mimetype
        Returns:
        a canvas generator
      • getRangeCanvasReference

        protected CanvasGenerator getRangeCanvasReference​(String startCanvas)
        Ranges expect the Canvas object to have only an identifier.
        Parameters:
        startCanvas - the start canvas identifier
        Returns:
        canvas generator