4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'backend/app/lib/oai/oai_gem_patches/list_metadata_formats_response.rb', line 4
def to_xml
formats = provider.formats.values
if options.include?(:identifier)
uri = (options[:identifier])
jsonmodel_type = JSONModel.parse_reference(uri).fetch(:type) { raise OAI::IdException.new }
formats.select! {|f|
format = ArchivesSpaceOAIRepository.available_record_types.fetch(f.prefix)
format.record_types.any? {|jsonmodel_clz|
jsonmodel_clz.my_jsonmodel.record_type == jsonmodel_type
}
}
end
response do |r|
r.ListMetadataFormats do
formats.each do |format|
r.metadataFormat do
r.metadataPrefix format.prefix
r.schema format.schema
r.metadataNamespace format.namespace
end
end
end
end
end
|