From 8524a6bdc575312b35df6e6aa3118ed139303d72 Mon Sep 17 00:00:00 2001 From: tilly-Q Date: Mon, 12 May 2014 17:02:12 -0400 Subject: Added documentation for the batchaddmedia gmg tool to the mediagoblin docs. --- docs/source/siteadmin/commandline-upload.rst | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'docs/source/siteadmin/commandline-upload.rst') diff --git a/docs/source/siteadmin/commandline-upload.rst b/docs/source/siteadmin/commandline-upload.rst index be19df58..d67c19dd 100644 --- a/docs/source/siteadmin/commandline-upload.rst +++ b/docs/source/siteadmin/commandline-upload.rst @@ -39,3 +39,54 @@ You can also pass in the `--celery` option if you would prefer that your media be passed over to celery to be processed rather than be processed immediately. +============================ +Command-line batch uploading +============================ + +There's another way to submit media, and it can be much more powerful, although +it is a bit more complex. + + ./bin/gmg batchaddmedia admin /path/to/your/metadata.csv + +This is an example of what a script may look like. The important part here is +that you have to create the 'metadata.csv' file.:: + + media:location,dcterms:title,dcterms:creator,dcterms:type + "http://www.example.net/path/to/nap.png","Goblin taking a nap",,"Image" + "http://www.example.net/path/to/snore.ogg","Goblin Snoring","Me","Audio" + +The above is an example of a very simple metadata.csv file. The batchaddmedia +script would read this and attempt to upload only two pieces of media, and would +be able to automatically name them appropriately. + +The csv file +============ +The media:location column +------------------------- +The media:location column is the one column that is absolutely necessary for +uploading your media. This gives a path to each piece of media you upload. This +can either a path to a local file or a direct link to remote media (with the +link in http format). As you can see in the example above the (fake) media was +stored remotely on "www.example.net". + +Other columns +------------- +Other columns can be used to provide detailed metadata about each media entry. +Our metadata system accepts any information provided for in the +`RDFa Core Initial Context`_, and the batchupload script recognizes all of the +resources provided within it. + +.. _RDFa Core Initial Context: http://www.w3.org/2011/rdfa-context/rdfa-1.1 + +The uploader may include the metadata for each piece of media, or +leave them blank if they want to. A few columns from `Dublin Core`_ are +notable because the batchaddmedia script uses them to set the default +information of uploaded media entries. + +.. _Dublin Core: http://wiki.dublincore.org/index.php/User_Guide + +- **dc:title** sets a title for your media entry. If this is left blank, the media entry will be named according to the filename of the file being uploaded. +- **dc:description** sets a description of your media entry. If this is left blank the media entry's description will not be filled in. +- **dc:rights** will set a license for your media entry `if` the data provided is a valid URI. If this is left blank 'All Rights Reserved' will be selected. + +You can of course, change these values later. -- cgit v1.2.3 From 65f5714118f5b59bc7f51c67ffc6ef23f2c603cc Mon Sep 17 00:00:00 2001 From: tilly-Q Date: Tue, 13 May 2014 18:15:28 -0400 Subject: Adjusted batchaddmedia to make use of more internal nodes. Added to the docs. --- docs/source/siteadmin/commandline-upload.rst | 36 ++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'docs/source/siteadmin/commandline-upload.rst') diff --git a/docs/source/siteadmin/commandline-upload.rst b/docs/source/siteadmin/commandline-upload.rst index 742c0cb2..5ec0bb12 100644 --- a/docs/source/siteadmin/commandline-upload.rst +++ b/docs/source/siteadmin/commandline-upload.rst @@ -61,16 +61,28 @@ be able to automatically name them appropriately. The csv file ============ -The media:location column -------------------------- -The media:location column is the one column that is absolutely necessary for +The location column +------------------- +The location column is the one column that is absolutely necessary for uploading your media. This gives a path to each piece of media you upload. This can either a path to a local file or a direct link to remote media (with the link in http format). As you can see in the example above the (fake) media was stored remotely on "www.example.net". -Other columns -------------- +Other internal nodes +-------------------- +There are other columns which can be used by the script to provide information. +These are not stored as part of the media's metadata. You can use these columns to +provide default information for your media entry, but as you'll see below, it's +just as easy to provide this information through the correct metadata columns. + +- **id** is used to identify the media entry to the user in case of an error in the batchaddmedia script. +- **license** is used to set a license for your piece a media for mediagoblin's use. This must be a URI. +- **title** will set the title displayed to mediagoblin users. +- **description** will set a description of your media. + +Metadata columns +---------------- Other columns can be used to provide detailed metadata about each media entry. Our metadata system accepts any information provided for in the `RDFa Core Initial Context`_, and the batchupload script recognizes all of the @@ -80,13 +92,17 @@ resources provided within it. The uploader may include the metadata for each piece of media, or leave them blank if they want to. A few columns from `Dublin Core`_ are -notable because the batchaddmedia script uses them to set the default +notable because the batchaddmedia script also uses them to set the default information of uploaded media entries. .. _Dublin Core: http://wiki.dublincore.org/index.php/User_Guide -- **dc:title** sets a title for your media entry. If this is left blank, the media entry will be named according to the filename of the file being uploaded. -- **dc:description** sets a description of your media entry. If this is left blank the media entry's description will not be filled in. -- **dc:rights** will set a license for your media entry `if` the data provided is a valid URI. If this is left blank 'All Rights Reserved' will be selected. +- **dc:title** sets a title for your media entry. +- **dc:description** sets a description of your media entry. -You can of course, change these values later. +If both a metadata column and an internal node for the title are provided, mediagoblin +will use the internal node as the media entry's display name. This makes it so +that if you want to display a piece of media with a different title +than the one provided in its metadata, you can just provide different data for +the 'dc:title' and 'title' columns. The same is true of the 'description' and +'dc:description'. -- cgit v1.2.3 From 9246a6ba89ab22a07e06b673e9eb0f135d2079a6 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Tue, 5 Aug 2014 22:04:50 +0100 Subject: Tidy up federation code and add tests to cover more of the APIs --- docs/source/siteadmin/commandline-upload.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs/source/siteadmin/commandline-upload.rst') diff --git a/docs/source/siteadmin/commandline-upload.rst b/docs/source/siteadmin/commandline-upload.rst index 5ec0bb12..69098312 100644 --- a/docs/source/siteadmin/commandline-upload.rst +++ b/docs/source/siteadmin/commandline-upload.rst @@ -15,7 +15,13 @@ Command-line uploading ====================== -Want to submit media via the command line? It's fairly easy to do:: +If you're a site administrator and have access to the server then you +can use the 'addmedia' task. If you're just a user and want to upload +media by the command line you can. This can be done with the pump.io +API. There is `p `_, which will allow you +to easily upload media from the command line, follow p's docs to do that. + +To use the addmedia command:: ./bin/gmg addmedia username your_media.jpg -- cgit v1.2.3