[Archivesspace_Users_Group] ref_ID plug-in
Chris Fitzpatrick
Chris.Fitzpatrick at lyrasis.org
Wed Jun 18 05:47:02 EDT 2014
Hi Ben,
Hm, this is working for me, but I bet there's something ( like a space? ) in your repo_code?
Try this:
AppConfig[:refid_rule] = "<%= ( repository['repo_code'] + '_' + resource['formatted_id'] + '_' + SecureRandom.hex).gsub(/[^a-zA-Z0-9\-_:\.]/, '_') %>"
This should convert all the bad characters ( like spaces) into _'s.
I think all the ref_ids should be generated using this rule, even those imported from AT. The archival_object model has the auto_generate hook added to it, so anything that is created via the backend will have this hook executed on create...however, I could be wrong about this...
b,chris.
Chris Fitzpatrick | Developer, ArchivesSpace
Skype: chrisfitzpat | Phone: 918.236.6048
http://archivesspace.org/
________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Ben Goldman <bmg17 at psu.edu>
Sent: Monday, June 16, 2014 10:42 PM
To: Archivesspace Users Group
Subject: [Archivesspace_Users_Group] ref_ID plug-in
Hi All,
We installed the ref_ID plug-in that was included (I believe) in the 1.07 release of ASpace, and we're currently running 1.09. We configured the plug-in like this:
AppConfig[:plugins] = ['refid_rules','local', 'aspace_feedback', 'lcnaf']
AppConfig[:refid_rule] = "<%= repository['repo_code'] %>_<%= resource['formatted_id'] %>_<%= SecureRandom.hex %>"
And I was just testing out some things in ASpace and noticed that when I tried to add a new component in a resource record, I was getting this error:
Ref ID - Did not match regular expression \A[a-zA-Z0-9\-_:\.]*\z
Looks like the plug-in is causing this error. Any ideas?
On a related note, can someone clarify whether this plug-in only applies the custom refID format to new components created in the admin interface? In other words, components migrated into ASpace using the migration tools, or imported from EAD files won't have the custom refID format applied?
Thanks,
Ben
Ben Goldman
Digital Records Archivist
Penn State University Libraries
University Park, PA
814-863-8333
http://www.libraries.psu.edu/psul/speccolls.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20140618/720eae93/attachment.html>
More information about the Archivesspace_Users_Group
mailing list