Hey Andrew (and anyone else who might be interested)

I took a deeper dive into this and I think its doable with a few simple mods to 
core. Here's a sample proof of concept plugin that contains the overrides (one 
of which needs to go int the config since its an initializer override) and a 
sample setup: https://github.com/dartmouth-dltg/multiple_subrecords

Be great to hear your thoughts and to have at least another set of eyes before 
I even think about pushing this into core. I have not even looked at tests for 
this (not sure if its even possible at the moment)

jds
________________________________
From: archivesspace_users_group-boun...@lyralists.lyrasis.org 
<archivesspace_users_group-boun...@lyralists.lyrasis.org> on behalf of Andrew 
Morrison <andrew.morri...@bodleian.ox.ac.uk>
Sent: Friday, February 17, 2023 5:43 AM
To: archivesspace_users_group@lyralists.lyrasis.org 
<archivesspace_users_group@lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Plugins add Multiple SubRecord types?


That has been my experience. If there is another way, it'd be really useful if 
someone could write a reference implementation, because picking apart other 
people's plug-ins (or multiple interdependent plugins) for generic techniques 
like this isn't easy.


Andrew.



On 01/02/2023 22:56, Joshua D. Shaw wrote:
Can someone double check me? Just reading the code and it looks like a plugin 
cannot​ add multiple subrecord types. Specifically, the initializer 
(https://github.com/archivesspace/archivesspace/blob/master/frontend/config/initializers/plugin.rb<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Farchivesspace%2Farchivesspace%2Fblob%2Fmaster%2Ffrontend%2Fconfig%2Finitializers%2Fplugin.rb&data=05%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7Ca995594672e34f7ad11a08db10d3c560%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C638122273973428527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=G7%2BfRKNcXQUyG5U4HifkfrHSuuZAo2Xl76brKWb%2BfQc%3D&reserved=0>)
 reads one config.yml file which (since its yaml) precludes duplicate key names 
and hence multiple subrecord types. While I could patch this, there are other 
places where the config.yml keys are used that would also need to be patched 
and I'm not sure how far that patching would extend.

If I'm right about no multiple subrecords in one plugin, guess it'll be a 
separate plugin with a depends_on_plugins entry in the config.yml since I'll be 
referencing a controlled value list created by another plugin and I don't want 
to maintain two cv lists that are duplicates.

Its a bummer since the subrecords are intellectually (though not structurally) 
related.

Thanks!
Joshua

___________________
Joshua Shaw (he, him)
Library Web & Application Developer
Digital Library Technologies Group
Dartmouth College
603.646.0405



_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group@lyralists.lyrasis.org<mailto:Archivesspace_Users_Group@lyralists.lyrasis.org>
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group<https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Flyralists.lyrasis.org%2Fmailman%2Flistinfo%2Farchivesspace_users_group&data=05%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7Ca995594672e34f7ad11a08db10d3c560%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C638122273973428527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=56g3qLLAX8LfcirpRTwxH2G%2BzzGhtnnGwKqJA4TTxOk%3D&reserved=0>

_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group@lyralists.lyrasis.org
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group

Reply via email to