Closed jefferya closed 2 years ago
Added collection object export and an initial prototype directory structure to use as a mechanism to gather feedback. The structure looks like:
${collection_id}
├── collection_object.json
├── MediaObjects
│ ├── one or more directories representing media objects contained in the collection
@anayram @seanluyk
How the ordered sequence of files is recorded in the export package.
The gist of the following, the JSON output of the media object contains an ordered list of files attached to the media object (i.e., the first file in the JSON output will be the first file in UI, the second file in the JSON will be the second in the UI...). If the order changes in the UI, the order change will be reflected in the JSON output by the API endpoint.
The details:
Using the object s7526c93c as an example.
The JSON output via the API s7526c93c.json mirrors what the export package contains in the media_object.json
file. This output JSON contains a top-level key, files
, that contains an ordered list of sections with each representing the metadata about a file (i.e., masterfile) attached to the media object. Note: a warning that the top-level files
key is different from the files
describing the transcodings for an individual masterfile.
The annotated JSON for illustration (...
. means I'm skipping some parts):
{
"id": "s7526c93c",
"title": "\"Four for 4\" Four graduate student compositions for saxophone quartet",
"collection": "Convocation Hall Digital Archive",
...
"read_groups": [
"registered"
],
"files": [
The list of files attached to the media object begins
{
"id": "mp48sd459",
...
"label": "Three Divergent Components: I. Four Stand Giants",
...
"files": [
{
"label": "quality-medium",
...
}
...
]
},
The first masterfile attached to the media object.
{
"id": "5712m714x",
...
"label": "II. Unison",
...
},
{
"id": "3r074v73z",
...
"label": "III. Engine Trouble",
...
},
{
"id": "5712m750s",
...
"label": "In Nomine Innominabillis",
...
},
{
"id": "hq37vp43g",
...
"label": "In Translation",
...
},
{
"id": "gq67jr811",
...
"label": "Fracture 170",
...
}
],
These are the next four masterfiles. If a change is made in the UI to the order of masterfile then the change in order will be reflected in the above section within the files
key.
"fields": {
...
}
}
Next is a listing of descriptive metadata fields before reaching the end of the JSON.
Script to create an export package using a Ruby rake task
Input:
Proposed contents of export
mods.xml
files
: ordered list of attached media files (Avalon MasterFile model) with ID linking to themedia_files
sub-directory and associated derivatives with an ID linking to members in the derivatives sub-directory within each media file sub-directoryvisibility
&read_groups
: object access control (view permissions)"visibility":"restricted","read_groups":["registered"]
<https://era-av.library.ualberta.ca/media_objects/0k225b48r >media_files
directory containing:Proposed structure:
Example
Added collection object export and an initial prototype directory structure to use as a mechanism to gather feedback. The structure looks like:
Logging:
If the master file associated with a media object cannot be found, the event is logged, for example:
If a master file associated with a media object is not found in the location stored with anAvalon/Fedora property but can be found at an alternative directory within the dropbox filesystem, the event is logged, for example:
References:
Working notes:
Prototype:
Execution:
Questions:
Should the order of the media files attached to the media object be retained (in the directory naming not just the
media_object.json
file)?files
key based on the order of items in the array (if one changes the order of media files in the Avalonedit structure
page, the resulting JSON ordering of thefiles
key is changed 2021-06-10). Note: there are 2files
keys at different levels of the JSON structure, one for media files and one at a deeper level for derivatives attached to a media file.An attempt is made to locate the original media file if the dropbox directory structure is changed. This attempt fails on files uploaded via the UI. Also fails if the dropbox originals were renamed.
Where to store extractions?
/srv/avalon/dropbox/
in a subdirectory for example__export
where others have sftp/scp/rsync accessEnhancement: post run check to verify derivatives located.
Notes: