<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" 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:url('https://r4.res.outlook.com/owa/prem/16.0.245.9/resources/styles/office365icons.ie8.eot?#iefix') format('embedded-opentype'),         url('https://r4.res.outlook.com/owa/prem/16.0.245.9/resources/styles/office365icons.ie8.woff') format('woff'),         url('https://r4.res.outlook.com/owa/prem/16.0.245.9/resources/styles/office365icons.ie8.ttf') format('truetype');  font-weight:normal;  font-style:normal;}@font-face {  font-family:'o365IconsMouse';  src:url('https://r4.res.outlook.com/owa/prem/16.0.245.9/resources/styles/office365icons.mouse.eot?#iefix') format('embedded-opentype'),         url('https://r4.res.outlook.com/owa/prem/16.0.245.9/resources/styles/office365icons.mouse.woff') format('woff'),         url('https://r4.res.outlook.com/owa/prem/16.0.245.9/resources/styles/office365icons.mouse.ttf') format('truetype');  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/*$WFWhiteColor*/;}.notIE8 .wf-owa-play-large {border-color:#FFFFFF/*$WFWhiteColor*/; 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/*$WFWhiteColor*/;}.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/*$WFGreyColor*/;}.wf-size-x20 {font-size: 20px!important;}--></style>
</head>
<body dir="ltr">
<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 name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">Chris Fitzpatrick | <font size="2">Developer, ArchivesSpace</font><br>
Skype: chrisfitzpat  | Phone: 918.236.6048<br>
http://archivesspace.org/<br>
</div>
</font></div>
</div>
</div>
<div style="color: rgb(40, 40, 40);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" 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</font>
<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>
</body>
</html>