#!/bin/bash HOST=localhost PORT=8686 CONTEXT=f4 # Create image resources for x in 0 1 2 3 4 5; do curl -i -XPOST -H"slug: image${x}" -H"Content-Type: image/jpeg" -H"Content-Disposition: attachment; filename=\"image${x}\"" --data-binary @resources/image${x}.jpg $HOST:$PORT/$CONTEXT/rest/ done # Create external content resources for x in a b c d e f; do curl -i -XPOST -H"slug: image${x}" -H"Content-Type: message/external-body; access-type=URL; URL=\"http://www.drodd.com/html7/${x}.html\"" -H"Content-Disposition: attachment; filename=\"image${x}\"" $HOST:$PORT/$CONTEXT/rest/ done # Create empty container resources for x in collection0 collection1 book0 book1 book2 bookA bookB bookC; do curl -i -XPOST -H"slug: ${x}" $HOST:$PORT/$CONTEXT/rest/ done # Add properties to container resources for x in collection0 collection1 book0 book1 book2 bookA bookB bookC; do curl -i -XPUT -H"Prefer: handling=lenient; received=\"minimal\"" -H"Content-Type: text/turtle" --data-binary @resources/${x}.rdf $HOST:$PORT/$CONTEXT/rest/${x} done