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

Dallas Pillen djpillen at umich.edu
Wed Mar 25 12:07:01 EDT 2015


Hi Brian,

Thanks for the reply. With the help of your suggestions we were able to
figure out a way to get this to work, and did it in such a way that digital
objects will import with the title as either the <dao>'s title attribute
(if it exists), or as a string formed from the digital object's parent
archival object's title and date (if both exist), or just its title or date
(if only one or the other exists).

Here's what we worked out in case anyone is interested or has been having
similar issues when importing EADs with digital objects lacking title
attributes:

https://github.com/bentley-historical-library/bhl-ead-importer/blob/master/backend/model/bhl_ead_converter.rb#L134-194

We also realize that this is probably not the most elegant solution (none
of us has much experience with Ruby), and would welcome any additional
suggestions/additions/modifications/etc.

Thanks again!

Dallas


On Sun, Mar 22, 2015 at 4:39 PM, Brian Hoffman <brianjhoffman at gmail.com>
wrote:

> 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
> <https://github.com/archivesspace/archivesspace/blob/master/backend/app/converters/ead_converter.rb#L632-678>
> 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
> <https://github.com/cfitz/archivesspace/blob/master/backend/app/model/archival_object.rb#L37-56>
> 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 <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
>
>
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>
>


-- 

*Dallas Pillen*Project Archivist


  Bentley Historical Library <http://bentley.umich.edu/>
  1150 Beal Avenue
  Ann Arbor, Michigan 48109-2113
  734.647.3559
  Twitter <https://twitter.com/umichBentley> Facebook
<https://www.facebook.com/bentleyhistoricallibrary>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150325/5dec2b28/attachment.html>


More information about the Archivesspace_Users_Group mailing list