@@ -24,18 +24,28 @@ def metadata
24
24
fields = [ ]
25
25
presenter = Dcv ::ShowPresenter . new ( @solr_document , @route_helper . view_context )
26
26
presenter . fields_to_render do |name , field_config , field_presenter |
27
+ field_presenter . except_operations << Blacklight ::Rendering ::Join
27
28
fields << {
28
- label : { en : [ field_config . label ] } ,
29
+ label : { en : [ field_presenter . label ] } ,
29
30
value : { en : Array ( field_presenter . render ) }
30
- }
31
+ } unless field_config . iiif == false
32
+ end
33
+
34
+ if self . marcorg . present?
35
+ fields << self . marcorg
31
36
end
32
-
33
- if @solr_document [ 'lib_repo_full_ssim' ] . present?
37
+ if self . doi
34
38
fields << {
35
- label : { en : [ 'Location' ] } ,
36
- value : { en : Array ( @solr_document [ 'lib_repo_full_ssim' ] ) }
39
+ profile : "http://purl.org/ontology/bibo/doi" ,
40
+ seeAlso : [ { id : "https://doi.org/#{ self . doi } " } ] ,
41
+ label : { none : [ 'DOI' ] } ,
42
+ value : { none : [ self . doi ] }
37
43
}
38
44
end
45
+ if self . archival_collection . present?
46
+ fields << self . archival_collection
47
+ end
48
+
39
49
descriptor_values = descriptors
40
50
if descriptor_values . present?
41
51
fields . unshift ( {
@@ -47,7 +57,7 @@ def metadata
47
57
more_at_url = route_helper . resolve_doi_url ( registrant : registrant , doi : doi )
48
58
fields . unshift ( {
49
59
label : { en : [ 'More At' ] } ,
50
- value : { en : [ "<a href=\" #{ more_at_url } \" target=\" _blank\" rel=\" nofollow, noindex, noreferrer\" >#{ I18n . t ( "blacklight.application_name" ) } </a>" ] }
60
+ value : { en : [ "<a href=\" #{ more_at_url } \" target=\" _blank\" rel=\" nofollow, noindex, noreferrer\" >#{ t ( "blacklight.application_name" ) } </a>" ] }
51
61
} )
52
62
elsif @solr_document . persistent_url
53
63
fields . unshift ( {
@@ -95,11 +105,15 @@ def thumbnail
95
105
end
96
106
97
107
def as_json ( opts = { } )
98
- manifest = { }
99
- manifest [ "@context" ] = [ "http://iiif.io/api/presentation/3/context.json" ] if opts [ :include ] &.include? ( :context )
108
+ manifest = IIIF_TEMPLATES [ 'manifest' ] . deep_dup
109
+ manifest . delete ( "@context" ) unless opts [ :include ] &.include? ( :context )
100
110
manifest [ 'id' ] = @id
101
111
manifest [ 'type' ] = 'Manifest'
102
112
manifest [ 'label' ] = label
113
+ manifest [ 'provider' ] . first &.tap do |provider |
114
+ provider [ 'id' ] = @id . split ( '/' ) [ 0 ..2 ] . join ( '/' )
115
+ provider [ 'label' ] = { en : [ I18n . t ( 'blacklight.application_name' ) ] }
116
+ end
103
117
if opts [ :include ] &.include? ( :metadata )
104
118
manifest [ 'summary' ] = summary
105
119
manifest [ 'metadata' ] = metadata
@@ -122,6 +136,14 @@ def as_json(opts = {})
122
136
"profile" : "https://example.org/profiles/bibliographic"
123
137
}
124
138
end
139
+ if self . archival_collection . present? && self . archival_collection [ :seeAlso ] &.first
140
+ ( manifest [ "seeAlso" ] ||= [ ] ) << self . archival_collection [ :seeAlso ] . first . merge ( {
141
+ "type" : "Text" ,
142
+ "label" : { "en" : [ "Finding Aid" ] } ,
143
+ "format" : "text/html" ,
144
+ "profile" : self . archival_collection [ :profile ]
145
+ } )
146
+ end
125
147
end
126
148
manifest [ 'thumbnail' ] = [ thumbnail ]
127
149
manifest [ 'partOf' ] = Array ( @part_of ) . map { |part | part . as_json } if @part_of . present?
0 commit comments