aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/siteadmin/commandline-upload.rst
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 14:01:43 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 14:01:43 -0500
commitf6bad0eb26fa7e092570afe1fb7f38b3d1a1941d (patch)
tree0ca05e7a95cfb30d8b286f3ec72e8c95e212511b /docs/source/siteadmin/commandline-upload.rst
parent5b64c92e0816e733c2f88b88ddc0aec070cdc0d3 (diff)
parent1b4e199668ada5c2ec47df7432ab69e315dc0601 (diff)
downloadmediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.tar.lz
mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.tar.xz
mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.zip
Merge branch 'master' into merge-python3-port
Has some issues, will iteratively fix! Conflicts: mediagoblin/gmg_commands/__init__.py mediagoblin/gmg_commands/deletemedia.py mediagoblin/gmg_commands/users.py mediagoblin/oauth/views.py mediagoblin/plugins/api/views.py mediagoblin/tests/test_api.py mediagoblin/tests/test_edit.py mediagoblin/tests/test_oauth1.py mediagoblin/tests/test_util.py mediagoblin/tools/mail.py mediagoblin/webfinger/views.py setup.py
Diffstat (limited to 'docs/source/siteadmin/commandline-upload.rst')
-rw-r--r--docs/source/siteadmin/commandline-upload.rst75
1 files changed, 74 insertions, 1 deletions
diff --git a/docs/source/siteadmin/commandline-upload.rst b/docs/source/siteadmin/commandline-upload.rst
index be19df58..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 <https://github.com/xray7224/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
@@ -39,3 +45,70 @@ 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 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 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
+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 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.
+- **dc:description** sets a description of your media entry.
+
+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'.