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

Majewski, Steven (sdm7g) sdm7g at virginia.edu
Wed Oct 18 17:39:04 EDT 2017


Yes. I can also get the info by either directly querying Solr via the Solr console with query params I pulled from the staff interface links:

extent_type_enum_s:arbitrary_unit OR processing_total_extent_type_enum_s:arbitrary_unit

( and usually adding field list params to limit the output per hit, and increasing rows to get more hits returned. ) 


It also looks like it works to grab the query params from the staff interface search, append them to the backend host base search URL as params, and append “&page=1” param ( and maybe also &page_size=$whatever ).


Just need to figure out how to add this to the frontend. 

— Steve


> On Oct 18, 2017, at 4:28 PM, Detelich, Alicia <alicia.detelich at yale.edu> wrote:
> 
> Hi Steve,
>  
> I agree that being able to search across repositories would be a very useful option for admin users. As a workaround, I have some queries that will find all resource or archival object records (can also be extended to digital objects, accessions, etc.) that are linked to a certain enumeration. I have one for extent types here - https://github.com/ucancallmealicia/archivesspace-sql/blob/master/extent_type_rec_links.sql <https://github.com/ucancallmealicia/archivesspace-sql/blob/master/extent_type_rec_links.sql>. I can also try to dig up the one I have for container profiles if you’d like - it generally follows the same process, just using different tables.
>  
> Alicia
>  
> Alicia Detelich
> Archivist
> Manuscripts and Archives
> Yale University Libraries
> alicia.detelich at yale.edu <mailto:alicia.detelich at yale.edu>
>  
> From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org]On Behalf Of Majewski, Steven (sdm7g)
> Sent: Wednesday, October 18, 2017 3:30 PM
> To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
> Subject: Re: [Archivesspace_Users_Group] batch re-ordering of controlled value lists; script/plugin, anyone?
>  
>  
> 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 <mailto: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>
>  
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> 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/83851fb6/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/83851fb6/attachment.bin>


More information about the Archivesspace_Users_Group mailing list