Skip to content

Commit

Permalink
Add resource URI to 856u
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesd committed Oct 24, 2017
1 parent 6f67de4 commit 870f412
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ArchivesSpace MARC Resource ID Serializer
==========================================
This plugin serializes ArchivesSpace Resource IDs as System Control Number fields (035a) for MARC exports.
This plugin serializes ArchivesSpace Resource IDs as System Control Number fields (035a) and resource URIs as Electronic Location and Access fields (856u) for MARC exports.

**To enable and configure the plugin, add the following after your list of plugins has been initialized**
**To enable and configure the plugin, add the following after your list of plugins has been initialized*
```ruby
AppConfig[:plugins] << 'marc_resource_ids'
AppConfig[:marc_control_number_prefix] = '(SampleSystemIDPrefix)'
Expand Down
6 changes: 6 additions & 0 deletions backend/plugin_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ def handle_uri(uri)
return
end

# Set Control Number
idFromUri = uri.split('/')[-1]
df('035', ' ', ' ').with_sfs(['a', AppConfig[:marc_control_number_prefix] + idFromUri])

# Add resource link
df('856', '4', '2').with_sfs(
['3', "ArchivesSpace Record"],
['u', File.join(AppConfig[:public_proxy_url], uri).to_s])
end

end
Expand Down

0 comments on commit 870f412

Please sign in to comment.