36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/dor/datastreams/role_metadata_ds.rb', line 36
def to_solr(solr_doc = {}, *args)
find_by_xpath('/roleMetadata/role/*').each do |actor|
role_type = actor.parent['type']
val = [actor.at_xpath('identifier/@type'), actor.at_xpath('identifier/text()')].join ':'
add_solr_value(solr_doc, "apo_role_#{actor.name}_#{role_type}", val, :string, [:symbol])
add_solr_value(solr_doc, "apo_role_#{role_type}", val, :string, [:symbol])
if ['dor-apo-manager', 'dor-apo-depositor'].include? role_type
add_solr_value(solr_doc, 'apo_register_permissions', val, :string, [:symbol, :stored_searchable])
end
end
solr_doc
end
|