<html><body><div style="font-family: georgia,serif; font-size: 10pt; color: #000000"><div>Hi Chris,<br></div><div><br></div><div>Thanks for this. Looks like we missed that space, and it's working as expected now. </div><div><br></div><div>We used the ASpace-provided migration tools to migrate our data prior to implementing the refID plugin, so we won't be able to answer on our end whether the plugin auto-generates these values during migration until we attempt our next migration later this summer. If you could verify this, it would be extremely helpful to know in advance whether this is an option. </div><div><br></div><div>In case this helps answer the question, I did test the EAD import function, and so long as <c0X> tags do not contain id attributes, the plugin will assign them. But it could be problematic to institutions that plan to make ample use of the importer to populate ASpace. It might be nice to have the option to override these on import if the plugin is enabled. </div><div><br></div><div>Thanks,</div><div>Ben</div><div><br></div><div><br></div><div><span name="x"></span><span data-mce-style="color: #000000; font-size: small;" style="color: #000000; font-size: small;" size="2"><span style="font-family: georgia,serif; font-weight: bold;">Ben Goldman</span><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">Digital Records Archivist</span><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">Penn State University Libraries</span><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">University Park, PA</span><br style="font-family: georgia,serif;"><span style="font-family: georgia,serif;">814-863-8333<br><a href="http://www.libraries.psu.edu/psul/speccolls.html">http://www.libraries.psu.edu/psul/speccolls.html</a><br></span></span><span name="x"></span><br></div><br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Chris Fitzpatrick" <Chris.Fitzpatrick@lyrasis.org><br><b>To: </b>"Archivesspace Users Group" <archivesspace_users_group@lyralists.lyrasis.org><br><b>Sent: </b>Wednesday, June 18, 2014 5:47:02 AM<br><b>Subject: </b>Re: [Archivesspace_Users_Group] ref_ID plug-in<br><div><br></div>


<style style="display:none"><!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(171, 171, 171) solid;font-family:'Segoe UI WPC','Segoe UI',Tahoma,'Microsoft Sans Serif',Verdana,sans-serif;font-size:10pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(223, 237, 250);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 0px 6px 0px 6px;vertical-align:middle!important;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(223, 237, 250) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}.wf {speak:none; font-weight:normal; font-variant:normal; text-transform:none; -webkit-font-smoothing:antialiased; vertical-align:middle; display:inline-block;}.wf-family-owa {font-family:'o365Icons'}@font-face {  font-family:'o365IconsIE8';  src:;  font-weight:normal;  font-style:normal;}.wf-family-owa {font-family:'o365IconsMouse'}.ie8 .wf-family-owa {font-family:'o365IconsIE8'}.ie8 .wf-owa-play-large:before {content:'\e254';}.notIE8 .wf-owa-play-large:before {content:'\e054';}.ie8 .wf-owa-play-large {color:#FFFFFF;}.notIE8 .wf-owa-play-large {border-color:#FFFFFF; width:1.4em; height:1.4em; border-width:.1em; border-style:solid; border-radius:.8em; text-align:center; box-sizing:border-box; -moz-box-sizing:border-box; padding:0.1em; color:#FFFFFF;}.ie8 .wf-size-play-large {width:40px; height:40px; font-size:30px}.notIE8 .wf-size-play-large {width:40px; height:40px; font-size:30px}.notIE8 .wf-owa-triangle-down-small:before {content:'\e052';}.ie8 .wf-owa-triangle-down-small:before { content:'\e052';}.ie8 .wf-owa-triangle-down-small {color:#666666;}.wf-size-x20 {font-size: 20px!important;}--></style>


<div id="OWAFontStyleDivID" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Ben,</p>
<p><br>
</p>
<p>Hm, this is working for me, but I bet there's something ( like a space? ) in your repo_code?
<br>
</p>
<div>
<p><br>
</p>
<p>Try this: </p>
<p>AppConfig[:refid_rule] = "<%= ( repository['repo_code'] + '_' +  resource['formatted_id'] + '_' +  SecureRandom.hex).gsub(/[^a-zA-Z0-9\-_:\.]/, '_') %>"      
<br>
</p>
<p><br>
</p>
<p>This should convert all the bad characters ( like spaces) into _'s. </p>
<p><br>
</p>
<p>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...</p>
<p><br>
</p>
<p>b,chris. <br>
</p>
<p><br>
</p>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><span size="2" data-mce-style="font-size: small;" style="font-size: small;">
<div class="PlainText">Chris Fitzpatrick | <span size="2" data-mce-style="font-size: small;" style="font-size: small;">Developer, ArchivesSpace</span><br>
Skype: chrisfitzpat  | Phone: 918.236.6048<br>
http://archivesspace.org/<br>
</div>
</span></div>
</div>
</div>
<div style="color: rgb(40, 40, 40);">
<hr style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><span data-mce-style="font-size: 11pt; color: #000000; font-family: Calibri, sans-serif;" style="font-size: 11pt; color: #000000; font-family: Calibri, sans-serif;" color="#000000" face="Calibri, sans-serif"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Ben Goldman
 <bmg17@psu.edu><br>
<b>Sent:</b> Monday, June 16, 2014 10:42 PM<br>
<b>To:</b> Archivesspace Users Group<br>
<b>Subject:</b> [Archivesspace_Users_Group] ref_ID plug-in</span>
<div> </div>
</div>
<div>
<div style="font-family:georgia,serif; font-size:10pt; color:#000000">
<div>Hi All,</div>
<div><br>
</div>
<div>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:</div>
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div><br>
</div>
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<p style="margin:0px">AppConfig[:plugins] = ['refid_rules','local', 'aspace_feedback', 'lcnaf']<br>
AppConfig[:refid_rule] = "<%= repository['repo_code'] %>_<%= resource['formatted_id'] %>_<%= SecureRandom.hex %>"</p>
<p style="margin:0px"><br>
</p>
<p style="margin:0px"><span style="font-family:georgia,serif; font-size:10pt">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:</span></p>
<div style="color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div style="font-family:georgia,serif; font-size:10pt; color:#000000">
<div><br>
</div>
<div><span style="color:#b94a48; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; line-height:20px; background-color:#f2dede">Ref ID - Did not match regular expression \A[a-zA-Z0-9\-_:\.]*\z</span></div>
<div><br>
</div>
<div>Looks like the plug-in is causing this error. Any ideas?</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Ben</div>
<div><br>
</div>
<div><span style="color:#000000; font-size:small"><span style="font-family:georgia,serif; font-weight:bold">Ben Goldman</span><br style="font-family:georgia,serif">
<span style="font-family:georgia,serif">Digital Records Archivist</span><br style="font-family:georgia,serif">
<span style="font-family:georgia,serif">Penn State University Libraries</span><br style="font-family:georgia,serif">
<span style="font-family:georgia,serif">University Park, PA</span><br style="font-family:georgia,serif">
<span style="font-family:georgia,serif">814-863-8333<br>
<a href="http://www.libraries.psu.edu/psul/speccolls.html" target="_blank">http://www.libraries.psu.edu/psul/speccolls.html</a><br>
</span></span><br>
</div>
</div>
</div>
<br>
</div>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>


<br>_______________________________________________<br>Archivesspace_Users_Group mailing list<br>Archivesspace_Users_Group@lyralists.lyrasis.org<br>http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group<br></div><div><br></div></div></body></html>