<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Bridger,<br>
<br>
I had to unpublish a host of records before. You can use the update a resource API endpoint (<a href="https://archivesspace.github.io/archivesspace/api/#update-a-resource">https://archivesspace.github.io/archivesspace/api/#update-a-resource</a>) to do that.
Just grab the resource first (<a href="https://archivesspace.github.io/archivesspace/api/#get-a-resource">https://archivesspace.github.io/archivesspace/api/#get-a-resource</a>), then in the returned json, set publish = False. Then use that update a resource
endpoint to push that change to ASpace. That <i>should </i>trigger Solr to update that in the index to not show up in the PUI.<br>
<br>
I wrote a <a href="https://github.com/uga-libraries/aspace_scripts/blob/master/unpublish_records.py" title="https://github.com/uga-libraries/aspace_scripts/blob/master/unpublish_records.py">
script</a> that unpublishes a resource and all its archival objects if the identifier contains "[CLOSED]". It's not as elegant as some other scripts you'll see out there, but it may be helpful.<br>
<br>
Sincerely,<br>
<br>
Corey<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Verdana, Geneva, sans-serif; color: rgb(0, 0, 0);">Corey Schmidt</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(51, 51, 51);">ArchivesSpace Project Manager</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Verdana, Geneva, sans-serif; font-size: 11pt; color: rgb(51, 51, 51);">University of Georgia Special Collections Libraries</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Verdana, Geneva, sans-serif; font-size: 10pt; color: rgb(102, 102, 102);"><i>Email:</i></span><span style="font-family: Verdana, Geneva, sans-serif; font-size: 10pt; color: rgb(102, 102, 102);"> Corey.Schmidt@uga.edu</span><br>
</div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Dyson-Smith,
Bridger <bdysonsm@utk.edu><br>
<b>Sent:</b> Thursday, May 27, 2021 1:05 PM<br>
<b>To:</b> archivesspace_users_group@lyralists.lyrasis.org <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> [Archivesspace_Users_Group] Publishing, Suppressing, or Unpublishing?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[EXTERNAL SENDER - PROCEED CAUTIOUSLY]<br>
<br>
<br>
Hi all -<br>
<br>
I have a set of resources that need to be removed from the PUI - they<br>
were published in error. Initially I had thought that setting their<br>
`published` status in the database from `1` to `0` (and updating the<br>
`system_mtime` would be sufficient for a reindex (where these resources<br>
would be removed from Solr and not reindexed).<br>
<br>
Is there a programmatic way to handle this, or something through the<br>
API? I have an idea, but it feels hacky and wrong, and the alternative<br>
seems to be something along the lines of:<br>
1. visit each resource in the staff UI<br>
2. select 'Publish?' at the Basic Information level<br>
3. save<br>
4. deselect 'Publish?'<br>
5. save<br>
<br>
Thanks in advance for your thoughts!<br>
Best,<br>
Bridger<br>
--<br>
Bridger Dyson-Smith<br>
University of Tennessee Libraries<br>
<br>
_______________________________________________<br>
Archivesspace_Users_Group mailing list<br>
Archivesspace_Users_Group@lyralists.lyrasis.org<br>
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br>
</div>
</span></font></div>
</body>
</html>