Table of Contents | ||
---|---|---|
|
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
If you have already completed the installation steps below and are just trying to run the importer, follow the steps below. Otherwise skip ahead to "What You'll Need" and proceed from there.
|
What You'll Need
First:
- brew
- python
- pip
...
A folder called mandala-bii will show up in bhutan-import once the code is cloned.
For Images Cataloged with Media Pro
If your images have embedded metadata generated with Adobe Bridge, skip to the next step (7). If the images were managed using Mediap Pro, contact Veronica KuhnContact Sam Chrisinger, who will link you to an .xml file from Box. Download the file.
Put the downloaded file inside the mandala-bii folder that you created in the previous step. You can use the good ol' click and drag method, no need to use the Terminal!
...
Code Block |
---|
pip install -r requirements.txt |
9. Create a collection
In Mandala, create a collection or subcollection to house the images you're importing. As you do this, check the URL in the collections editor. This lets you find the collection id, which you'll need to direct the import to that collection. For example, for the Chuma Laptse collection, I can go into the editor and see the URL is https://images.shanti.virginia.edu/node/1419391/edit, so the collection id is 1419391.
Info | ||||
---|---|---|---|---|
| ||||
The collection id. |
10. Run the importer
For Images Cataloged Using Adobe Bridge
Use the following code, with some substitutions:
- KEY and VALUE are codes you obtained in step 2.
- YOUR_BOX_USER is your box username, which should be your UVa email address
- YOUR_BOX_PASS is the password you created in step 1.
- /IMAGE/FILE/PATH needs to be replaced with the path to the files in UVaBox.
- COLLECTION_ID is the id of the collection where you're importing the images.
Code Block | ||
---|---|---|
| ||
python import.py -s Encoded -c KEY=VALUE -i "/IMAGE/FILE/PATH" -u https://images.shanti.virginia.edu/admin/content/bulk_image_import/api -v -cid COLLECTION_ID -cv -cw ImageMagick --ftp --ftp_user YOUR_BOX_USER --ftp_pass YOUR_BOX_PASS |
For Images Cataloged Using MediaPro
Use the following code, with some substitutions:
- XML_FILE_NAME is the name of the file you downloaded in step 6. Please make sure you've moved this file to the mandala-bii folder, or the importation will fail!
- KEY and VALUE are codes you obtained in step 2.
- YOUR_BOX_USER is your box username, which should be your UVa email address
- YOUR_BOX_PASS is the password you created in step 1.
- Bhutan Year X needs /IMAGE/FILE/PATH needs to be replaced with the year the path to the files in UVaBox.
- COLLECTION_ID is the id of the collection where you're importing (ex: Bhutan Year 4). This should match the xml file. The folder structure needs to be identical to what's on Box, so refer back to the original folder to check this. the images.
Code Block | ||
---|---|---|
| ||
python import.py -s MediaPro -x "XML_FILE_NAME.xml" -c KEY=VALUE -i "/Image UploadsIMAGE/Bhutan/Bhutan Year X/XML_FILE_NAMEFILE/PATH" -u https://images.shanti.virginia.edu/admin/content/bulk_image_import/api -v -cid 619101COLLECTION_ID -cv -cw ImageMagick --ftp --ftp_user YOUR_BOX_USER --ftp_pass YOUR_BOX_PASS |
...
You can ignore any other messages as long as the importation is still running. Any imported images should be immediately visible at https://images.shanti.virginia.edu/collection/oral-cultures-bhutan. at your collection on Mandala.
Troubleshooting
Fixing broken images (that have already been imported)
...
Code Block |
---|
cd /var/www/html/shanti.prod/docroot/sites/images/ |
...
You are about to run some commands in MySQL. Please proceed with caution. Updates and deletes are committed to the Production database immediately.
...
Code Block |
---|
drush sqlq "select distinct(catalog) from bulk_image_import_task;" |
...
Then run:
Code Block |
---|
drush sqlq "select node_id, tid, filename from bulk_image_import_task where catalog = 'YOUR CATALOG NAME';" > /home/shanti/import.tsv |
Enter CTRL-d to exit the SSH session
...
Code Block |
---|
scp shanti.prod@ded-18858.prod.hosting.acquia.com:/home/shanti/import.tsv ~/Downloads/import.tsv |
Then run:
Code Block |
---|
cat ~/Downloads/import.tsv | tr "\\t" "," > ~/Downloads/import.csv |
...
You now have a file (import.csv) that contains a list of node id, task ids, and filenames for each entry in your catalog. You can now run the importer's repair script:
...