Module: IiifPrint::BlacklightIiifSearch::AnnotationDecorator

Defined in:
lib/iiif_print/blacklight_iiif_search/annotation_decorator.rb

Constant Summary collapse

INVALID_MATCH_TEXT =
"#xywh=0,0,0,0".freeze

Instance Method Summary collapse

Instance Method Details

#annotation_idString

Create a URL for the annotation use a Hyrax-y URL syntax: protocol://host:port/concern/model_type/work_id/manifest/canvas/file_set_id/annotation/index

Returns:

  • (String)


11
12
13
# File 'lib/iiif_print/blacklight_iiif_search/annotation_decorator.rb', line 11

def annotation_id
  "#{base_url}/manifest/canvas/#{file_set_id}/annotation/#{hl_index}"
end

#canvas_uri_for_annotationString

Create a URL for the canvas that the annotation refers to match the Hyrax default canvas URL syntax: protocol://host:port/concern/model_type/work_id/manifest/canvas/file_set_id

Returns:

  • (String)


20
21
22
# File 'lib/iiif_print/blacklight_iiif_search/annotation_decorator.rb', line 20

def canvas_uri_for_annotation
  "#{base_url}/manifest/canvas/#{file_set_id}#{coordinates}"
end