Although not particularly useful in itself, the files URI becomes more interesting when we filter it to only include files uploaded after a specified date-time, and also only those files that have a published status of 'true'.
This outcome is much more manageable. Because they are uploaded via the Collaborations Interface, they inherently have a published status of 'true'. We use this status to exclude regular files uploaded to the LIMS via other methods and interfaces.
Step 3. Retrieve the XML Representations of the Files
By following the URIs to retrieve the full XML representations of these files, the output is similar to the following:
Retrieve the associated project/sample, and extract the names and/or IDs to embed into the notification, by following the URI in the 'attached-to' elements.
A script must be run periodically (hourly/daily) that queries the files resource for files that have a published status of true, and are last modified in the period of interest.
After this list of files is retrieved, the following pseudocode can be applied:
For each URI in files list:
Retrieve the file object
STORE the contents of the 'original-location' element
IF the contents of the 'attached-to' element contains EITHER 'projects' OR 'samples':
Retrieve the object pointed to by the 'attached-to' element
STORE the contents of the 'name' element
Compile the stored elements into a notification
Publish all notifications produced in an atomic or molecular fashion, as required
An example derived from the above XML could lead to the following notifications:
FILE: GLims.csv was recently uploaded to PROJECT: Scaffold POC
FILE: image001.png was recently uploaded to SAMPLE: -1