<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by James Ferreira on Medium]]></title>
        <description><![CDATA[Stories by James Ferreira on Medium]]></description>
        <link>https://medium.com/@james.ferreira.software?source=rss-554b6589b225------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yLwW7Rq1IuihplXVwjLc6w.png</url>
            <title>Stories by James Ferreira on Medium</title>
            <link>https://medium.com/@james.ferreira.software?source=rss-554b6589b225------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 23:00:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@james.ferreira.software/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ExLibris Rosetta Java API — IE File Refresh]]></title>
            <link>https://medium.com/@james.ferreira.software/exlibris-rosetta-java-api-ie-file-refresh-e491996f1367?source=rss-554b6589b225------2</link>
            <guid isPermaLink="false">https://medium.com/p/e491996f1367</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[digital-preservation]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[ex-libris]]></category>
            <dc:creator><![CDATA[James Ferreira]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 04:36:04 GMT</pubDate>
            <atom:updated>2025-06-03T04:40:14.588Z</atom:updated>
            <content:encoded><![CDATA[<h3>ExLibris Rosetta Java API — IE File Refresh</h3><p>G’day!</p><p>Today lets look at bulk refreshing the files of existing Intellectual Entities through a Java web API. This follows on from <a href="https://developers.exlibrisgroup.com/blog/bootstrapping-the-rosetta-java-sdk-iewebservices/?preview=true">my previous blog post</a> about bootstrapping the SDK and the GitHub repository may be found <a href="https://github.com/James-Ferreira/digipres-rosetta-api">here</a>.</p><p>The problem context is as follows:<br>- A series of OCR txt files have been improved by community after their initial ingest<br>- These txt files are under various directories, and relate to different IEs<br>- The improved files are in the same file location as the originals, i.e. they have replaced the originals<br>- Provided a large amount of these file paths (10,000+), refresh their representations.</p><p>This approach exposes a POST endpoint which expects a file of newline separated file filepaths, and returns the successes and failures as JSON.</p><pre># example.txt<br>/operational_storage/foo/bar/baz/file1.txt<br>/operational_storage/foo/bar/baz/file2.zip<br>/operational_storage/foo/bar/baz/something_wrong.xml<br><br># request<br>curl -X POST -F &quot;file=@./example.txt&quot; localhost:8080/file/refresh &gt;&gt; output.json<br><br># output.json<br>{<br>&quot;success&quot;: [<br>&quot;/operational_storage/foo/bar/baz/file1.txt&quot;,<br>&quot;/operational_storage/foo/bar/baz/file1.zip&quot;<br>],<br>&quot;failures&quot;: {<br>&quot;/operational_storage/foo/bar/baz/something_wrong.xml&quot;: &quot;There is no IE with PID &quot;<br>}<br>}<br></pre><p>The approach has two main components</p><p><strong>1.</strong> <strong>Provided a Filepath, retrieve the PIDs for the associated IE, REP, &amp; FL</strong></p><p>a. Via an SRU request, retrieve an XML document containing the IEPID based on the file label and extract the IEPID</p><p>b. Via the Rosetta SDK <a href="https://exlibrisgroup.github.io/Rosetta.dps-sdk-projects/current/javadoc/com/exlibris/digitool/repository/ifc/IEWebServices.html#getIE-java.lang.String-java.lang.String-java.lang.Long-">IEWebServices getIE</a> method, retrieve the METS file for the IE using the IEPID</p><p>c. Parse the METS to extract the FL PID and REP PID</p><p>d. Return the result as JSON</p><p><strong>2.</strong> <strong>For a provided file of newline separated filepaths, perform an in-place refresh of the file within its existing IE</strong></p><p>a. Create a text file with the filepath of files to be re-added to existing IEs</p><p>b. Reads each line from the input file and retrieve the IE, REP, and FL PIDS for each file</p><p>c. Utilise the <a href="https://exlibrisgroup.github.io/Rosetta.dps-sdk-projects/current/javadoc/com/exlibris/digitool/repository/ifc/IEWebServices.html#updateRepresentation-java.lang.String-java.lang.String-java.lang.String-java.lang.String-com.exlibris.digitool.repository.ifc.RepresentationContent:A-com.exlibris.digitool.repository.ifc.MetaData:A-java.lang.Boolean-">IEWebservices updateRepresentation()</a> method, setting both the currentFilepath and newFilepath to the same value (as this is an in-place refresh)</p><p>d. In the case of an error, record the filepath along with the exception message to response[“failures”]. If there are no issues, the filepath is appended to response[“success”]</p><p>e. Between submissions, a naive delay of 20 seconds occurs to reduce IE locking issues preventing successful updates (update: experimenting with multi-threading to improve throughput while still being able to estimate time)</p><p>f. Return the result as JSON</p><p><strong>References</strong></p><p><a href="https://developers.exlibrisgroup.com/blog/how-to-replace-a-file-in-an-existing-ie/">Josh Weisman’s blog post</a> is a valuable resource for this topic.</p><p><a href="https://exlibrisgroup.github.io/Rosetta.dps-sdk-projects/current/javadoc/">Rosetta DPS SDK Docs</a></p><p><a href="https://developers.exlibrisgroup.com/rosetta/integrations/standards/sru/"><strong>https://developers.exlibrisgroup.com/rosetta/integrations/standards/sru/</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e491996f1367" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>