-
Notifications
You must be signed in to change notification settings - Fork 0
Process EPUB Resource References
This monograph processing step can be completed by using the following project script:
bundle exec ruby script/process_monograph [-e] [-p <publisher_directory>] <action> <monograph_noid> [<monograph_noid>...]
- action
- Specified default resource action, either embed_resources|link_resources. The action for each resource is assigned in the monograph resource_map.xml file.
- -e
- Execute the specified resource actions. Otherwise, actions are identified and displayed, but not executed.
- publisher_directory
- Directory that contains a specific publisher monographs.
- monograph_noid
- Monograph NOID
The script will perform the following:
Download the manifest for the specified monograph NOID.
Use the monograph manifest to locate the monograph directory (MONOGRAPH_DIR=FULCRUM_DRIVE/<publisher>/<ebook_isbn>_<author_last_name>) found in the publisher directory which is specified either by the
-p <publisher_directory>
option, or by the current working directory.Locate the monograph EPUB file (EPUB_FILE=MONOGRAPH_DIR/<ebook_isbn>_<author_last_name>.epub.
Assign an action for each resource, either embed a resource viewer or insert a link to the Fulcrum resource page. This is determined by the monograph MONOGRAPH_DIR/resource_processing/resource_map.xml with the default action determined by the command line argument
action
, either embed_resources or link_resources.Scan EPUB_FILE and for each resource reference encountered, report the action assigned. If the
-e
option has been specified, then execute the action and save the file in the MONOGRAPH_DIR/resource_processing/epub directory.Create a new EPUB file (NEW_EPUB_FILE=MONOGRAPH_DIR/resource_processing/<ebook_isbn>_<author_last_name>.epub) that is a copy of the original except for replacing any modified files with the ones found in the MONOGRAPH_DIR/resource_processing/epub directory.
After successful completion of the script execution, perform the following manual steps:
The original EPUB_FILE file can be copied to the MONOGRAPH_DIR/Archive directory.
The new NEW_EPUB_FILE file can be moved into the MONOGRAPH_DIR. Overnight, this file will be uploaded to Fulcrum, replacing the existing monograph EPUB representative.