[Archivesspace_Users_Group] We're working on an ArchivesSpace plugin...

Brian Hoffman brianjhoffman at gmail.com
Sun Mar 22 16:39:54 EDT 2015


I haven’t tested this - but maybe something along these lines?

https://gist.github.com/quoideneuf/f8596249aaf344f82f44



On Mar 18, 2015, at 3:49 PM, Max Eckard <eckardm at umich.edu> wrote:

> Dear ArchivesSpace community,
> 
> Inspired by the recent post on customizing ASpace EAD importers and exporters, we decided to write our own!
> 
> We have a lot of EADs with dao tags that have no title attributes. Like this:
> 
> <c02 level="file"><did><container type="folder" label="Folder">1</container><unittitle>Letters, <unitdate type="inclusive">October 19, 1918-May 13, 1919</unitdate></unittitle><physdesc><extent>5 letters</extent></physdesc><dao href="andrewse0001" show="new" actuate="onrequest"><daodesc><p>[view items]</p></daodesc></dao></did></c02>
> 
> Using the out-of-the-box EAD importer, we get an error when we try to import EADs like this because ASpace uses the title attribute to form the digital object's title.
> 
> We wanted to use the content from unittitle, so we wrote a simple ASpace plugin to use the parent archival object title as the digital object title. We used the existing ead_converter.rb code starting with "with 'dao' do," and then snagged some code from further down after daogrp. Here's what it looks like:
> 
> with 'dao' do
>   # new stuff, borrowed from daogrp in the ead_converter.rb file...
>   title = ''
>   ancestor(:resource, :archival_object ) { |ao| title << ao.title }
>   
>   make :instance, {
> 	  :instance_type => 'digital_object'
> 	} do |instance|
> 	  set ancestor(:resource, :archival_object), :instances, instance
>   end
> 
>   
>   make :digital_object, {
> 	:digital_object_id => SecureRandom.uuid,
> 	# more new stuff...
> 	:title => title,
>    } do |obj|
> 	 obj.file_versions <<  {   
> 		 :use_statement => att('role'),
> 		 :file_uri => att('href'),
> 		 :xlink_actuate_attribute => att('actuate'),
> 		 :xlink_show_attribute => att('show')
> 	 }
> 	 set ancestor(:instance), :digital_object, obj 
>   end
> 
> end
> 
> That works (and we were excited about that!), but now we'd like add some code to handle cases when the parent archival object only has a date, not a title, or title and date. 
> 
> Specifically, what we're having trouble figuring out is how to form a string similar to the one that gets created for archival object titles, something like:
> If the archival object has a title and date, form a string using the title and the date.
> Else if the archival object only has a title, use the title.
> Else if the archival object only has a date, use the date as the title.
> We're pretty sure that something here in the archival_object.rb code could help, but we're not sure how to translate that for the EAD Converter.
> 
> Any help we could get on or off list would be greatly appreciated!
> 
> Thanks,
> Max and Dallas
> 
> -- 
> Max Eckard
> Assistant Archivist for Digital Curation
> 
> 
> Bentley Historical Library
> 1150 Beal Ave.
> Ann Arbor, MI 48109-2113
> 734/763-7518
> http://bentley.umich.edu/ 
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150322/7c46bfd0/attachment.html>


More information about the Archivesspace_Users_Group mailing list