First of all, thanks David for sharing this script.  Before you go too much
further, though, I would recommend replacing the form login approach with
digest auth.  Form login is really just a convenience for testing.  It's
intended to be replaced by CAS or some other single sign on solution, or to
be put behind Apache HTTPD since form login without SSL isn't secure.  See
[1] for some more info on digest auth in Matterhorn.

Now to answer your question with a question (sorry!): is there a reason to
use these endpoints rather than simply uploading zipped mediapackages?  You
can certainly go either way, but building the zip file locally will require
a lot less back-and-forth with the server.

[1] http://opencast.jira.com/wiki/display/MH/Remote+Services

Josh

On Thu, Mar 10, 2011 at 1:22 PM, David Gilbert <[email protected]> wrote:

> Hello All,
>
> I am trying to write a script to bulk ingest media unto a Matterhorn
> server.
> So far i got this...
>
> #!/bin/bash
> url='http://localhost:8080/'
> filename='line.mp4'
> echo "Step 1: Logging In"
> curl -c cookies.txt $url"j_spring_security_check" \
> -d j_username=admin \
>  -d j_password=opencast;
>
> echo "Step 2: Generating File Location"
> videoid=$(curl -v -b cookies.txt $url"ingest/filechooser-local.html" \
>  | grep action \
> | sed 's/.*action\=\"addElementMonitored\/\([0-9a-zA-Z\/\-]*\)\".*/\1/');
> mediaPackage=$(curl -b cookies.txt $url"ingest/createMediaPackage");
>
> echo "Step 3: Upload descriptor"
> curl -b cookies.txt -o /dev/null $url"ingest/addMediaPackage" \
> --form-string "title=DavesTest" \
>  --form-string "creator=TestScript" \
> --form-string "fileLocation=local" \
>  --form-string "track=" \
> --form-string "workflowSelector=full"\
> --form-string "distribution=checked"\
>  --form-string "fileChooserAjax=$videoid";
>
> echo "Step 4:"
> curl -b cookies.txt $url"ingest/addElementMonitored/$videoid" \
>  --form-string "elementType=track" \
> --form-string "flavor=presenter/source" \
>  --form-string "mediaPackage=$mediaPackage" \
> --form [email protected] ;
>
>
> The files appear in the admin page but the media is not processing
> correctly. I am relatively sure I need to do something to create
> a DublinCore entry but I am not sure what the process for that is done by
> the server/client interactions.
>
> Thanks
>
> Dave Gilbert
>
> _______________________________________________
> Matterhorn mailing list
> [email protected]
> http://lists.opencastproject.org/mailman/listinfo/matterhorn
>
>
> To unsubscribe please email
> [email protected]
> _______________________________________________
>
_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn


To unsubscribe please email
[email protected]
_______________________________________________

Reply via email to