emory-libraries / aspace

0 stars 0 forks source link

Add "populate from ArchivesSpace" button to Curate #85

Closed abelemlih closed 1 year ago

abelemlih commented 1 year ago

Add a new button to the "add a new collection" page in curate that populates fields in the form from the ASpace API.

Tasks:

erussey commented 1 year ago

ASpace by default uses ISO-639-2b language codes.

tmiles2 commented 1 year ago

Controlled vocabularies required in Curate: https://docs.google.com/spreadsheets/d/1tm7RDYWVcAWEZuA-lB3cbxxGI4qjn8uCn71X2EJPB50/edit#gid=854442392

abelemlih commented 1 year ago

For reference, this is the list I am using to map language, from the Library of Congress: https://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt. It is the list of the ISO-639-2 standard as requested.

CB987 commented 1 year ago

with resource: Screenshot 2023-03-10 at 1.22.45 PM.png with error: Screenshot 2023-03-10 at 1.22.57 PM.png with form populated: Screenshot 2023-03-10 at 1.22.33 PM.png

CB987 commented 1 year ago

per discussion with Elizabeth, I'm going ahead and doing a PR with the work completed so far. All of the ticket requirements have been satisfied, however, currently the fields with mutliple inputs, like subject topics or subject names, are all populating on one line, not triggering multiple line inputs. i will continue to work on that step. Work completed: Added Populate from ArchivesSpace button to New Collection form: Screenshot 2023-03-13 at 11.24.55 AM.png

Added modal for archivesSpace population that includes dropdown with repository select, call number input field, and search in ArchivesSpace button: Screenshot 2023-03-13 at 11.25.05 AM.png

After searching, result from ArchivesSpace is displayed: Screenshot 2023-03-13 at 11.25.16 AM.png

Or error message is displayed: Screenshot 2023-03-13 at 11.25.27 AM.png

Finally, the "Populate from ArchivesSpace" button transfers the data into the form inputs: Screenshot 2023-03-13 at 11.25.45 AM.png

CB987 commented 1 year ago

Screenshot 2023-03-14 at 10.41.04 AM.png

CB987 commented 1 year ago

the PR has been merged, but we need to get the environment variables set to access the api from test and arch.

rotated8 commented 1 year ago

TODO: Get two emails to use for bot users for pre-prod and prod api access.

lisahamlett commented 1 year ago

I cannot set up bot accounts for API access until I have email addresses to link to the accounts.

tmill29 commented 1 year ago

Collin will reach to Elizabeth and Alex to discuss.

rotated8 commented 1 year ago

After conversations with @erussey and @AGCooper we're going to create api users under a different ticket.

erussey commented 1 year ago

API permissions now set by @lisahamlett , so this ticket should be good to go. Curate API user defined as: curate_api

abelemlih commented 1 year ago

I added the ArchivesSpace environment variables to Test and Arch. I also reached out to Lyrasis regarding API authorization for the two instances.

Once Test and Arch are authorized to access the Aspace API, the Aspace/Curate integration will be ready for testing.

jcrompton42 commented 1 year ago

Due to the networking configuration, ec2 instances on test and arch are contacting lyrasis using the nat gateway ip addresses rather than the elastic ips that have been whitelisted. I will work to address this.

jcrompton42 commented 1 year ago

The ec2 instances are currently deployed in a private subnet. The only way to really make this work I can think of is to stop the instances, create images from them, and redeploy in a public subnet, reallocating the IPs and updating all of our loadbalancer rules. This may take until tomorrow to complete.

jcrompton42 commented 1 year ago

I have moved both instances to a public subnet and Ayoub has verified this solved the issue. Reassigning.

abelemlih commented 1 year ago

This ticket is ready for testing on Curate Test.

eporter23 commented 1 year ago

Just created this collection in Curate test, and it worked really well! https://curate-test.library.emory.edu/dashboard/collections/389280gbgj-cor?locale=en One issue: the required holding_repository was not populated and the form prompted me to fill it in. Since this is a required field, we should make sure it gets populated. Screen Shot 2023-04-07 at 10.34.50 AM.png

CB987 commented 1 year ago

Hmmm, that field is included in what's supposed to be pulled over: document.getElementById('collection_holding_repository').value = result_success.repository.holding_repository; I will check into why it isn't.

CB987 commented 1 year ago

For that particular item, Rose Manuscript No. 892, the data object doesn't include a value for the holding repository. {"repository":{"repository_id":"7","name":"Stuart A. Rose Manuscript, Archives, and Rare Book Library\r\n","administrative_unit":"","holding_repository":"","institution":"Emory University","contact_information":"Stuart A. Rose Manuscript, Archives, and Rare Book Library\nEmory University Libraries\n540 Asbury Circle\nAtlanta, Georgia, 30322\nrose.library@emory.edu\n404-727-6887"},"resource":{"resource_id":"3432","title":"William Levi Dawson papers","description":"Papers of William Levi Dawson, African American composer, conductor, and educator from Anniston, Alabama, including correspondence, original scores of Dawson's works, personal and family papers, photographs, audio visual materials, and printed material.","creator":["Dawson, William Levi, 1899-1990."],"uri":"/repositories/7/resources/3432","call_number":"Manuscript Collection No. 892","primary_language":"English","subject_topics":["African American choral conductors.","African American composers.","African American conductors.","African American musicians.","African American students.","African American universities and colleges--Alabama.","African American women.","African Americans--Education (Higher)--Alabama.","African Americans--Music.","Copyright--United States.","Music publishing.","Spirituals (Songs)"],"subject_names":["Dawson, William Levi, 1899-1990.","Ellison, Ralph.","Krasilovsky, M. William.","Spady, James G.","Stokowski, Leopold, 1882-1977.","Fisk University.","Tuskegee Institute.","Tuskegee Institute. Choir.","Tuskegee Normal and Industrial Institute.","Tuskegee University."],"subject_geo":["Africa--Description and travel."],"subject_time_periods":[],"system_of_record_id":"aspace:/repositories/7/resources/3432","finding_aid_link":"https://archives-test.libraries.emory.edu/repositories/7/resources/3432"}} So, that explains why it isn't populating.

eporter23 commented 1 year ago

Thanks @CB987, I'll try another example and see how it goes.

eporter23 commented 1 year ago

@CB987 I tried a different collection and the same thing happened. I'll follow up with @erussey to see what may be happening on the data side.

erussey commented 1 year ago

@eporter23 : We discovered a dependency with whitespaces and mapping tables. The devs are going to go back and change the mapping slightly so ASpace is only sending over an identifier from the repository to map to Curate data rather than pulling over the text to populate the repository fields (and it not matching what Curate expects).

erussey commented 1 year ago

@eporter23 : This ticket should be ready to test again. @abelemlih fixed the missing holding repository information. You can test with Dawson again (Manuscript No. 892) as well as a Health collection (Manuscript Collection No. 027), and an EUA collection with a slightly different call number (Series No. 234).

erussey commented 1 year ago

See bug fix to the above in #127.

eporter23 commented 1 year ago

These appear to have all populated successfully: Dawson: https://curate-test.library.emory.edu/dashboard/collections/5462547dkb-cor?locale=en Health: https://curate-test.library.emory.edu/dashboard/collections/590dv41p3c-cor?locale=en EUA: https://curate-test.library.emory.edu/dashboard/collections/6386hdr84d-cor?locale=en