app/models/iiif_presentation_manifest.rb
# Bypass this method if there are no image resources in contentMetadata
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
Bypass this method if there are no image resources in contentMetadata
rubocop:disable Metrics/AbcSize, Metrics/MethodLength
Bypass this method if there are no image resources in contentMetadata rubocop : disable Metrics / AbcSize Metrics / MethodLength
def body(controller = nil)
    controller ||= Rails.application.routes.url_helpers
    purl_base_uri = controller.purl_url(druid)
    manifest_data = {
      '@id' => controller.iiif_manifest_url(druid),
      'label' => title,
      'attribution' => copyright || 'Provided by the Stanford University Libraries',
      'logo' => {
        '@id' => 'https://stacks.stanford.edu/image/iiif/wy534zh7137%2FSULAIR_rosette/full/400,/0/default.jpg',
        'service' => iiif_service('https://stacks.stanford.edu/image/iiif/wy534zh7137%2FSULAIR_rosette')
      },
      'seeAlso' => {
        '@id' => controller.purl_url(druid, format: 'mods'),
        'format' => 'application/mods+xml'
      }
    }
    manifest = IIIF::Presentation::Manifest.new manifest_data
    manifest.service << content_search_service if content_search_service
    manifest.viewingHint = 'paged' if type == 'book'
    manifest.metadata = dc_to_iiif_metadata if dc_to_iiif_metadata.present?
    manifest.metadata.unshift(
      'label' => 'Available Online',
      'value' => "<a href='#{controller.purl_url(druid)}'>#{controller.purl_url(druid)}</a>"
    )
    manifest.description = description_or_note
    order = reading_order
    sequence = IIIF::Presentation::Sequence.new(
      '@id' => "#{purl_base_uri}#sequence-1",
      'label' => 'Current order'
    )
    sequence.viewingDirection = case order
                                when nil
                                  VIEWING_DIRECTION['ltr']
                                else
                                  VIEWING_DIRECTION[order]
                                end
    manifest.thumbnail = thumbnail_resource
    renderings = []
    object_files.each do |resource|
      renderings.push(
        rendering_resource(resource)
      )
    end
    sequence['rendering'] = renderings if renderings.present?
    page_images.each do |resource|
      sequence.canvases << canvas_for_resource(purl_base_uri, resource)
    end
    manifest.sequences << sequence
    manifest
  end
def body ( controller = nil ) controller ||= Rails . application . routes . url_helpers purl_base_uri = controller . purl_url ( druid ) manifest_data = { '@id' => controller . iiif_manifest_url ( druid ) , 'label' => title , 'attribution' => copyright || 'Provided by the Stanford University Libraries' , 'logo' => { '@id' => 'https://stacks.stanford.edu/image/iiif/wy534zh7137%2FSULAIR_rosette/full/400,/0/default.jpg' , 'service' => iiif_service ( 'https://stacks.stanford.edu/image/iiif/wy534zh7137%2FSULAIR_rosette' ) } , 'seeAlso' => { '@id' => controller . purl_url ( druid , format : 'mods' ) , 'format' => 'application/mods+xml' } } manifest = IIIF :: Presentation :: Manifest . new manifest_data manifest . service << content_search_service if content_search_service manifest . viewingHint = 'paged' if type == 'book' manifest . metadata = dc_to_iiif_metadata if dc_to_iiif_metadata . present? manifest . metadata . unshift ( 'label' => 'Available Online' , 'value' => "<a href='#{controller.purl_url(druid)}'>#{controller.purl_url(druid)}</a>" ) manifest . description = description_or_note order = reading_order sequence = IIIF :: Presentation :: Sequence . new ( '@id' => "#{purl_base_uri}#sequence-1" , 'label' => 'Current order' ) sequence . viewingDirection = case order when nil VIEWING_DIRECTION [ 'ltr' ] else VIEWING_DIRECTION [ order ] end manifest . thumbnail = thumbnail_resource renderings = [ ] object_files . each do | resource | renderings . push ( rendering_resource ( resource ) ) end sequence [ 'rendering' ] = renderings if renderings . present? page_images . each do | resource | sequence . canvases << canvas_for_resource ( purl_base_uri , resource ) end manifest . sequences << sequence manifest end
Bypass this method if there are no image resources in contentMetadata
rubocop:disable Metrics/AbcSize, Metrics/MethodLength
Bypass this method if there are no image resources in contentMetadata rubocop : disable Metrics / AbcSize Metrics / MethodLength
# Set viewingHint to paged if this is a book # for each resource image, create a canvas
controller
<not_specific>