[Archivesspace_Users_Group] batch re-ordering of controlled value lists; script/plugin, anyone?

Majewski, Steven (sdm7g) sdm7g at virginia.edu
Wed Oct 18 15:29:34 EDT 2017


It looks like the positioning would be very simple to do in mysql as you only have to modify the position value in the table — no complicated joins required. You could do it interactively with a GUI frontend like Sequel Pro or MySQLWorkbench. Just make sure you don’t leave any duplicate positions. 

If you already have a table of enum values and new positions, and you want to do it programmatically, then you can load those pairs as a temporary table, and create a function return position given value string, and use that function in your update statement rather than try to explicitly iterate over the tables. 

Merging enumeration values, on the other hand, is more complicated, and I would leave it to the frontend/backend, and not try MySQL surgery. 

We are doing a similar controlled value cleanup. 
The issue we’re having is that we have several repositories, and the frontend view and list of number of related items and links are repository based, so cleanup requires tediously switching between repositories trying to find the resources that are still linked to those values. 

Does the merge operation also only merge enumeration_values for the current repository ?  
( I *think* that is the case, but I’m not sure. ) 

Perhaps, if you’re logged in on an admin account, it should have an option for searching across repositories. 


— Steve Majewski


> On Oct 18, 2017, at 2:06 PM, Fox, Bobbi <bobbi_fox at harvard.edu> wrote:
> 
> In the course of adapting ArchivesSpace to Harvard’s needs, we’ve ended up with some very weedy controlled values lists (extent type > 200 values! -- of course, some of them need to be removed) with arbitrary positioning.  Our support team is tasked with the job of wrangling the lists with a defined order, and the interactive “move up/down one position at a time, wait for the server to refresh, etc.” is really tedious.
>  
> Has anyone written a script/created a plugin that would do this with less effort?  I’m inclined to do it at the mysql level, rather than write an extension to the backend/controller/enumeration.rb, but maybe someone has done this already?
>  
> Thanks,
> Bobbi
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20171018/3eb9ed91/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4943 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20171018/3eb9ed91/attachment.bin>


More information about the Archivesspace_Users_Group mailing list