<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">I remember running into something like this where the problem was Rails lazy loading of classes.</div><div class="">The base classes were not actually defined when the plugins were loaded, so what was supposed to be additional methods extending an existing class became the entire replacement class definition. I had to add a reference to the class to force lazy loading before trying to extend the class. </div><div class="">This might be what you are running into. </div><div class="">I will look and see if I still have any notes with more details from that experiment. </div><div class=""><br class=""></div><div class="">— Steve. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2017, at 4:18 PM, Flanagan, Patrick <<a href="mailto:PJFlanagan@ship.edu" class="">PJFlanagan@ship.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Hi Bobbi,</div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><br class=""></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Thank you for this! I'll give it a try this way and see if I can make some progress.<br class=""></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><br class=""></div><div id="Signature" class=""><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">~Patrick Flanagan</div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><i class="">KLN Applications Administrator</i></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><i class="">Keystone Library Network Hub</i><br class=""></div></div></div></div><hr tabindex="-1" style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline-block; width: 743.8125px;" class=""><span style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" class="">archivesspace_users_group-bounces@lyralists.lyrasis.org</a> <<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" class="">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>> on behalf of Fox, Bobbi <<a href="mailto:bobbi_fox@harvard.edu" class="">bobbi_fox@harvard.edu</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, December 21, 2017 3:47:18 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Archivesspace Users Group<br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [Archivesspace_Users_Group] Overriding/Extending the new public interface in 2.2.0</font><div class=""> </div></div><div style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Hi, Patrick,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">I’m having to do a lot of extending/overriding of controllers & methods in our new public interface.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">You are correct; you can’t just override by placing your modified controller in the path location; instead, what *<b class="">I’m</b>* doing (and I know there’s a more elegant way of doing it); is put the changes in the plugin/plugin_init.rb ,using the [class|module]_eval method on something.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">For instance, I’m changing what gets faceted in the Searchable concern this way in plugin_init.rb:<o:p class=""></o:p></span></div><table class="MsoNormalTable" border="0" cellpadding="0" style="margin-left: 33.75pt;"><tbody class=""><tr class=""><td style="padding: 0.75pt;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Searchable.module_eval do<o:p class=""></o:p></div></td></tr><tr class=""><td style="padding: 0.75pt;" class=""></td></tr></tbody></table><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">def set_up_and_run_search(default_types = [],default_facets=[],default_search_opts={}, params={})<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> ~ my stuff here ~~<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">end<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> end<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: 'Courier New'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">I’m adding methods to controllers in a somewhat similar way, for instance, in plugin_init.rb, I’ve got:<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><table class="MsoNormalTable" border="0" cellpadding="0" style="margin-left: 33.75pt;"><tbody class=""><tr class=""><td style="padding: 0.75pt;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""># add a digital only action to the resources controller<o:p class=""></o:p></div></td></tr><tr class=""><td style="padding: 0.75pt;" class=""></td></tr></tbody></table><p class="MsoNormal" style="margin: 0in 0in 0.0001pt 33.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;"></p><table class="MsoNormalTable" border="0" cellpadding="0" style="margin-left: 33.75pt;"><tbody class=""><tr class=""><td style="padding: 0.75pt;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">class ResourcesController<span class="Apple-converted-space"> </span><o:p class=""></o:p></div></td></tr><tr class=""><td style="padding: 0.75pt;" class=""></td></tr></tbody></table><p class="MsoNormal" style="margin: 0in 0in 0.0001pt 33.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;"></p><table class="MsoNormalTable" border="0" cellpadding="0" style="margin-left: 33.75pt;"><tbody class=""><tr class=""><td style="padding: 0.75pt;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">def digital_only<o:p class=""></o:p></div></td></tr><tr class=""><td style="padding: 0.75pt;" class=""></td></tr></tbody></table><p class="MsoNormal" style="margin: 0in 0in 0.0001pt 33.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;"></p><table class="MsoNormalTable" border="0" cellpadding="0" style="margin-left: 33.75pt;"><tbody class=""><tr class=""><td style="padding: 0.75pt;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">uri = "/repositories/#{params[:rid]}/resources/#{params[:id]}"<o:p class=""></o:p></div></td></tr><tr class=""><td style="padding: 0.75pt;" class=""></td></tr></tbody></table><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">begin<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">~ etc. ~<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">end<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""> end<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 69.75pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: 'Courier New'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Hope this helps,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Bobbi </span><span style="font-size: 11pt; font-family: 'Courier New'; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span><a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" class="">archivesspace_users_group-bounces@lyralists.lyrasis.org</a> [<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" class="">mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Flanagan, Patrick<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, December 21, 2017 3:27 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" class="">archivesspace_users_group@lyralists.lyrasis.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[Archivesspace_Users_Group] Overriding/Extending the new public interface in 2.2.0<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div id="divtagdefaultwrapper" class=""><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">Hello,<o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">I'm attempting to write a plugin that will modify the way the breadcrumb trail (shown in the new public UI) is generated to include more detail. I decided to try and override one of the files in the controller part of the architecture: resources_controller.rb, since I can see the :crumb being defined there. However, either my path is wrong, or the new UI isn't utilizing it. Following the instructions here:<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__archivesspace.github.io_archivesspace_user_archivesspace-2Dplug-2Dins-2Dreadme_&d=DwMFAw&c=WO-RGvefibhHBZq3fL85hQ&r=5xWUzLrZrVLeTqs3CDoeRpPtLv1fRM04CCu4TDULrSY&m=3DmZ4KyjSuOHTC-7rfq8Dv2MTeEFEBci91sKzca-4YQ&s=is5OAKKChee55MtdTuQYDj2OwuvI8f0Y6lBLS8-ast8&e=" id="LPlnk244985" style="color: purple; text-decoration: underline;" class="">http://archivesspace.github.io/archivesspace/user/archivesspace-plug-ins-readme/</a><span class="Apple-converted-space"> </span>I've placed the file in the following directory:<o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">as220/plugins/local/public/controllers/<b class="">resources_controller.rb</b><o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><i class=""><span style="font-family: Calibri, sans-serif;" class="">( source location: /public/app/controllers/resources_controller.rb )</span></i><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">Plugin Config: AppConfig[:plugins] = ['local', 'lcnaf', 'aspace-public-formats']<o:p class=""></o:p></span></div></div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></p><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">If I'm not mistaken that document indicates that this is something that can be overridden, but I'm suspecting I can't actually override something in the controller from a plugin. <o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">The version is 2.2.0, running on Linux x64, openjdk version "1.8.0_151". Any advice would be appreciated!<o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class="">Thank you,<o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></div><div id="Signature" class=""><div id="divtagdefaultwrapper" class=""><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-family: Calibri, sans-serif;" class="">~Patrick Flanagan<o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><i class=""><span style="font-family: Calibri, sans-serif;" class="">KLN Applications Administrator</span></i><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0px 0in; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><i class=""><span style="font-family: Calibri, sans-serif;" class="">Keystone Library Network Hub</span></i><span style="font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></span></div></div></div></div></div></div><span style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Archivesspace_Users_Group mailing list</span><br style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" class="">Archivesspace_Users_Group@lyralists.lyrasis.org</a></span><br style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" class="">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a></span></div></blockquote></div><br class=""></body></html>