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') 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') 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 ac7f3b17bf9912352b74ba65f44ee3e4d774d164 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 2 Jun 2014 10:31:49 -0500 Subject: git submodule fetch -> git submodule update --- docs/source/siteadmin/deploying.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 0dde3b6a..3ff2b9ea 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -244,7 +244,7 @@ This concludes the initial configuration of the development environment. In the future, when you update your codebase, you should also run:: - ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate && git submodule fetch + ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate && git submodule update Note: If you are running an active site, depending on your server configuration, you may need to stop it first or the dbupdate command -- cgit v1.2.3 From e99431cc05dd6282f55d1e4cf18248e9d282455c Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 12 Jul 2014 08:59:55 -0500 Subject: As Elrond points out, git submodule should come first! This commit sponsored by Sebastien Hut. Thanks Sebastien! --- docs/source/siteadmin/deploying.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 3ff2b9ea..3f4a59cd 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -244,7 +244,7 @@ This concludes the initial configuration of the development environment. In the future, when you update your codebase, you should also run:: - ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate && git submodule update + git submodule update && ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate Note: If you are running an active site, depending on your server configuration, you may need to stop it first or the dbupdate command -- cgit v1.2.3 From ffbf9c8b438ef8d203da54807b6ff5db3cc4d334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20H=C3=B8rthe=20Omdal?= Date: Mon, 12 May 2014 23:41:03 +0200 Subject: Implement Raw Image media type plugin --- docs/source/siteadmin/media-types.rst | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 3e8a94e9..44ad02bb 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -1,6 +1,6 @@ .. MediaGoblin Documentation - Written in 2011, 2012 by MediaGoblin contributors + Written in 2011, 2012, 2014 by MediaGoblin contributors To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to @@ -18,8 +18,8 @@ Media Types ==================== In the future, there will be all sorts of media types you can enable, -but in the meanwhile there are five additional media types: video, audio, -ascii art, STL/3d models, PDF and Document. +but in the meanwhile there are six additional media types: video, audio, +raw image, ascii art, STL/3d models, PDF and Document. First, you should probably read ":doc:`configuration`" to make sure you know how to modify the mediagoblin config file. @@ -149,6 +149,28 @@ Run You should now be able to upload and listen to audio files! +Raw image +========= + +To enable raw image you need to install pyexiv2. On Debianoid systems + +.. code-block:: bash + + sudo apt-get install python-pyexiv2 + +Add ``[[mediagoblin.media_types.raw_image]]`` under the ``[plugins]`` +section in your ``mediagoblin_local.ini`` and restart MediaGoblin. + +Run + +.. code-block:: bash + + ./bin/gmg dbupdate + +Now you should be able to submit raw images, and mediagoblin should +extract the JPEG preview from them. + + Ascii art ========= -- cgit v1.2.3 From 247a3b788f3deea120c3f272eda7f7ce9ff54764 Mon Sep 17 00:00:00 2001 From: xray7224 Date: Thu, 14 Nov 2013 22:42:07 +0000 Subject: Adds the unit-tests for API and cleans up API --- docs/source/api/images.rst | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/source/api/images.rst (limited to 'docs') diff --git a/docs/source/api/images.rst b/docs/source/api/images.rst new file mode 100644 index 00000000..6e4d3d48 --- /dev/null +++ b/docs/source/api/images.rst @@ -0,0 +1,41 @@ +.. MediaGoblin Documentation + + Written in 2011, 2012 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + +================== +Uploading an Image +================== + +You must have fully authenticated with oauth to upload an image. + +The endpoint is: ``/api/user//uploads/`` (POST endpoint) + +There are four GET parameters available to use, if they're not specified the defaults (listed below) will be used, the parameters are: + ++-------------+-----------+---------------------+--------------------+ +| Parameter | Required | Default | Example | ++=============+===========+=====================+====================+ +| qqfile | No | unknown | my_picture.jpg | ++-------------+-----------+---------------------+--------------------+ +| title | No | | My Picture! | ++-------------+-----------+---------------------+--------------------+ +| description | No | None | My awesome picture | ++-------------+-----------+---------------------+--------------------+ +| licence | No | All rights reserved | CC BY-SA 3.0 | ++-------------+-----------+---------------------+--------------------+ + +*Note: licence is not part of the pump.io spec and is a GNU MediaGoblin specific parameter* + +Example URL (with parameters): /api/user/tsyesika/uploads/?qqfile=river.jpg&title=The%20River&description=The%20river%20that%20I%20use%20to%20visit%20as%20a%20child%20licence=CC%20BY-SA%203.0 + +Submit the binary image data in the POST parameter. + -- cgit v1.2.3 From 3d869e82b0d6ebe6a1a2f991a9efb76458704095 Mon Sep 17 00:00:00 2001 From: xray7224 Date: Sun, 12 Jan 2014 18:19:37 +0000 Subject: Improve the documentation --- docs/source/api/images.rst | 127 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 110 insertions(+), 17 deletions(-) (limited to 'docs') diff --git a/docs/source/api/images.rst b/docs/source/api/images.rst index 6e4d3d48..8c2653d4 100644 --- a/docs/source/api/images.rst +++ b/docs/source/api/images.rst @@ -15,27 +15,120 @@ Uploading an Image ================== -You must have fully authenticated with oauth to upload an image. +To use any the APIs mentioned in this document you will required :doc:`oauth` -The endpoint is: ``/api/user//uploads/`` (POST endpoint) +Uploading and posting an image requiest you to make two requests, one of which +submits the image to the server, the other of which will post the meta data. -There are four GET parameters available to use, if they're not specified the defaults (listed below) will be used, the parameters are: +To upload an image you should use the URI `/api/user//uploads`. -+-------------+-----------+---------------------+--------------------+ -| Parameter | Required | Default | Example | -+=============+===========+=====================+====================+ -| qqfile | No | unknown | my_picture.jpg | -+-------------+-----------+---------------------+--------------------+ -| title | No | | My Picture! | -+-------------+-----------+---------------------+--------------------+ -| description | No | None | My awesome picture | -+-------------+-----------+---------------------+--------------------+ -| licence | No | All rights reserved | CC BY-SA 3.0 | -+-------------+-----------+---------------------+--------------------+ +A POST request should be made to the image upload URI submitting at least two header: -*Note: licence is not part of the pump.io spec and is a GNU MediaGoblin specific parameter* +* `Content-Type` - This being a valid mimetype for the image. +* `Content-Length` - size in bytes of the image. -Example URL (with parameters): /api/user/tsyesika/uploads/?qqfile=river.jpg&title=The%20River&description=The%20river%20that%20I%20use%20to%20visit%20as%20a%20child%20licence=CC%20BY-SA%203.0 +The binary image data should be submitted as POST data to the image upload URI. +You will get back a JSON encoded response which will look similiar to:: -Submit the binary image data in the POST parameter. + { + "updated": "2014-01-11T09:45:48Z", + "links": { + "self": { + "href": "https:///image/4wiBUV1HT8GRqseyvX8m-w" + } + }, + "fullImage": { + "url": "https:////uploads//2014/1/11/V3cBMw.jpg", + "width": 505, + "height": 600 + }, + "replies": { + "url": "https:////api/image/4wiBUV1HT8GRqseyvX8m-w/replies" + }, + "image": { + "url": "https:///uploads//2014/1/11/V3cBMw_thumb.jpg", + "width": 269, + "height": 320 + }, + "author": { + "preferredUsername": "", + "displayName": "", + "links": { + "activity-outbox": { + "href": "https:///api/user//feed" + }, + "self": { + "href": "https:///api/user//profile" + }, + "activity-inbox": { + "href": "https:///api/user//inbox" + } + }, + "url": "https:///", + "updated": "2013-08-14T10:01:21Z", + "id": "acct:@", + "objectType": "person" + }, + "url": "https:////image/4wiBUV1HT8GRqseyvX8m-w", + "published": "2014-01-11T09:45:48Z", + "id": "https:///api/image/4wiBUV1HT8GRqseyvX8m-w", + "objectType": "image" + } +The main things in this response is `fullImage` which contains `url` (the URL +of the original image - i.e. fullsize) and `image` which contains `url` (the URL +of a thumbnail version). + +Submit to feed +============== + +The next request you will probably wish to make is to post the image to your +feed, this currently in GNU MediaGoblin will just show it visably on the website. +In the future it will allow you to specify whom should see this image. + +The URL you will want to make a POST request to to is `/api/user//feed` + +You first should do a post to the feed URI with some of the information you got +back from the above request (which uploaded the image). The request should look +something like:: + + { + "verb": "post", + "object": { + "id": "https:///api/image/6_K9m-2NQFi37je845c83w", + "objectType": "image" + } + } + +(Any other data submitted **will** be ignored) + +Finally if you wish to set a title, description and licence you will need to do +and update request to the endpoint, the following attributes can be submitted: + ++--------------+---------------------------------------+-------------------+ +| Name | Description | Required/Optional | ++==============+=======================================+===================+ +| displayName | This is the title for the image | Optional | ++--------------+---------------------------------------+-------------------+ +| content | This is the description for the image | Optional | ++--------------+---------------------------------------+-------------------+ +| license | This is the licence to be used | Optional | ++--------------+---------------------------------------+-------------------+ + +.. note:: license attribute is mediagoblin specific, pump.io does not support this attribute + + +The update request should look something similiar to:: + + { + "verb": "update", + "object": { + "displayName": "My super awesome image!", + "content": "The awesome image I took while backpacking to modor", + "license": "creativecommons.org/licenses/by-sa/3.0/", + "id": "https:///api/image/6_K9m-2NQFi37je845c83w", + "objectType": "image" + } + } + +(Again, any other data submitted **will** be ignored). -- cgit v1.2.3 From 128af9533ffa60c356a187d0f98c370f65876893 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Tue, 8 Jul 2014 17:27:38 +0100 Subject: Update documentation on uploading media via API --- docs/source/api/images.rst | 134 --------------------------------------- docs/source/api/media.rst | 155 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 134 deletions(-) delete mode 100644 docs/source/api/images.rst create mode 100644 docs/source/api/media.rst (limited to 'docs') diff --git a/docs/source/api/images.rst b/docs/source/api/images.rst deleted file mode 100644 index 8c2653d4..00000000 --- a/docs/source/api/images.rst +++ /dev/null @@ -1,134 +0,0 @@ -.. MediaGoblin Documentation - - Written in 2011, 2012 by MediaGoblin contributors - - To the extent possible under law, the author(s) have dedicated all - copyright and related and neighboring rights to this software to - the public domain worldwide. This software is distributed without - any warranty. - - You should have received a copy of the CC0 Public Domain - Dedication along with this software. If not, see - . - -================== -Uploading an Image -================== - -To use any the APIs mentioned in this document you will required :doc:`oauth` - -Uploading and posting an image requiest you to make two requests, one of which -submits the image to the server, the other of which will post the meta data. - -To upload an image you should use the URI `/api/user//uploads`. - -A POST request should be made to the image upload URI submitting at least two header: - -* `Content-Type` - This being a valid mimetype for the image. -* `Content-Length` - size in bytes of the image. - -The binary image data should be submitted as POST data to the image upload URI. -You will get back a JSON encoded response which will look similiar to:: - - { - "updated": "2014-01-11T09:45:48Z", - "links": { - "self": { - "href": "https:///image/4wiBUV1HT8GRqseyvX8m-w" - } - }, - "fullImage": { - "url": "https:////uploads//2014/1/11/V3cBMw.jpg", - "width": 505, - "height": 600 - }, - "replies": { - "url": "https:////api/image/4wiBUV1HT8GRqseyvX8m-w/replies" - }, - "image": { - "url": "https:///uploads//2014/1/11/V3cBMw_thumb.jpg", - "width": 269, - "height": 320 - }, - "author": { - "preferredUsername": "", - "displayName": "", - "links": { - "activity-outbox": { - "href": "https:///api/user//feed" - }, - "self": { - "href": "https:///api/user//profile" - }, - "activity-inbox": { - "href": "https:///api/user//inbox" - } - }, - "url": "https:///", - "updated": "2013-08-14T10:01:21Z", - "id": "acct:@", - "objectType": "person" - }, - "url": "https:////image/4wiBUV1HT8GRqseyvX8m-w", - "published": "2014-01-11T09:45:48Z", - "id": "https:///api/image/4wiBUV1HT8GRqseyvX8m-w", - "objectType": "image" - } - -The main things in this response is `fullImage` which contains `url` (the URL -of the original image - i.e. fullsize) and `image` which contains `url` (the URL -of a thumbnail version). - -Submit to feed -============== - -The next request you will probably wish to make is to post the image to your -feed, this currently in GNU MediaGoblin will just show it visably on the website. -In the future it will allow you to specify whom should see this image. - -The URL you will want to make a POST request to to is `/api/user//feed` - -You first should do a post to the feed URI with some of the information you got -back from the above request (which uploaded the image). The request should look -something like:: - - { - "verb": "post", - "object": { - "id": "https:///api/image/6_K9m-2NQFi37je845c83w", - "objectType": "image" - } - } - -(Any other data submitted **will** be ignored) - -Finally if you wish to set a title, description and licence you will need to do -and update request to the endpoint, the following attributes can be submitted: - -+--------------+---------------------------------------+-------------------+ -| Name | Description | Required/Optional | -+==============+=======================================+===================+ -| displayName | This is the title for the image | Optional | -+--------------+---------------------------------------+-------------------+ -| content | This is the description for the image | Optional | -+--------------+---------------------------------------+-------------------+ -| license | This is the licence to be used | Optional | -+--------------+---------------------------------------+-------------------+ - -.. note:: license attribute is mediagoblin specific, pump.io does not support this attribute - - -The update request should look something similiar to:: - - { - "verb": "update", - "object": { - "displayName": "My super awesome image!", - "content": "The awesome image I took while backpacking to modor", - "license": "creativecommons.org/licenses/by-sa/3.0/", - "id": "https:///api/image/6_K9m-2NQFi37je845c83w", - "objectType": "image" - } - } - -(Again, any other data submitted **will** be ignored). diff --git a/docs/source/api/media.rst b/docs/source/api/media.rst new file mode 100644 index 00000000..bafe43d3 --- /dev/null +++ b/docs/source/api/media.rst @@ -0,0 +1,155 @@ +.. MediaGoblin Documentation + + Written in 2011, 2012 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + +.. info:: Currently only image uploading is supported. + +=============== +Uploading Media +=============== + +To use any the APIs mentioned in this document you will required :doc:`oauth` + +Uploading and posting an media requiest you to make two to three requests: + +1) Uploads the data to the server +2) Post media to feed +3) Update media to have title, description, license, etc. (optional) + +These steps could be condenced in the future however currently this is how the +pump.io API works. There is currently an issue open, if you would like to change +how this works please contribute upstream: https://github.com/e14n/pump.io/issues/657 + +---------------------- +Upload Media to Server +---------------------- + +To upload media you should use the URI `/api/user//uploads`. + +A POST request should be made to the media upload URI submitting at least two header: + +* `Content-Type` - This being a valid mimetype for the media. +* `Content-Length` - size in bytes of the media. + +The media data should be submitted as POST data to the image upload URI. +You will get back a JSON encoded response which will look similiar to:: + + { + "updated": "2014-01-11T09:45:48Z", + "links": { + "self": { + "href": "https:///image/4wiBUV1HT8GRqseyvX8m-w" + } + }, + "fullImage": { + "url": "https:////uploads//2014/1/11/V3cBMw.jpg", + "width": 505, + "height": 600 + }, + "replies": { + "url": "https:////api/image/4wiBUV1HT8GRqseyvX8m-w/replies" + }, + "image": { + "url": "https:///uploads//2014/1/11/V3cBMw_thumb.jpg", + "width": 269, + "height": 320 + }, + "author": { + "preferredUsername": "", + "displayName": "", + "links": { + "activity-outbox": { + "href": "https:///api/user//feed" + }, + "self": { + "href": "https:///api/user//profile" + }, + "activity-inbox": { + "href": "https:///api/user//inbox" + } + }, + "url": "https:///", + "updated": "2013-08-14T10:01:21Z", + "id": "acct:@", + "objectType": "person" + }, + "url": "https:////image/4wiBUV1HT8GRqseyvX8m-w", + "published": "2014-01-11T09:45:48Z", + "id": "https:///api/image/4wiBUV1HT8GRqseyvX8m-w", + "objectType": "image" + } + +The main things in this response is `fullImage` which contains `url` (the URL +of the original image - i.e. fullsize) and `image` which contains `url` (the URL +of a thumbnail version). + +.. warning:: Media which have been uploaded but not submitted to a feed will + periodically be deleted. + +-------------- +Submit to feed +-------------- + +This is submitting the media to appear on the website. This will create an +object in your feed which will then appear on the GNU MediaGoblin website so the +user and others can view and interact with the media. + +The URL you need to POST to is `/api/user//feed` + +You first should do a post to the feed URI with some of the information you got +back from the above request (which uploaded the media). The request should look +something like:: + + { + "verb": "post", + "object": { + "id": "https:///api/image/6_K9m-2NQFi37je845c83w", + "objectType": "image" + } + } + +.. warning:: Any other data submitted **will** be ignored + +------------------- +Submitting Metadata +------------------- + +Finally if you wish to set a title, description and license you will need to do +and update request to the endpoint, the following attributes can be submitted: + ++--------------+---------------------------------------+-------------------+ +| Name | Description | Required/Optional | ++==============+=======================================+===================+ +| displayName | This is the title for the media | Optional | ++--------------+---------------------------------------+-------------------+ +| content | This is the description for the media | Optional | ++--------------+---------------------------------------+-------------------+ +| license | This is the license to be used | Optional | ++--------------+---------------------------------------+-------------------+ + +.. note:: license attribute is mediagoblin specific, pump.io does not support this attribute + + +The update request should look something similiar to:: + + { + "verb": "update", + "object": { + "displayName": "My super awesome image!", + "content": "The awesome image I took while backpacking to modor", + "license": "creativecommons.org/licenses/by-sa/3.0/", + "id": "https:///api/image/6_K9m-2NQFi37je845c83w", + "objectType": "image" + } + } + +.. warning:: Any other data submitted **will** be ignored. -- cgit v1.2.3 From 161cf125f06ae6e0f7f1f1b719ce708dbc70ab4c Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Sat, 12 Jul 2014 09:04:40 +0100 Subject: Add documentation for interacting with media entires --- docs/source/api/media_interaction.rst | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 docs/source/api/media_interaction.rst (limited to 'docs') diff --git a/docs/source/api/media_interaction.rst b/docs/source/api/media_interaction.rst new file mode 100644 index 00000000..41114a71 --- /dev/null +++ b/docs/source/api/media_interaction.rst @@ -0,0 +1,65 @@ +.. MediaGoblin Documentation + + Written in 2011, 2012 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + +Pump.io supports a number of different interactions that can happen against +media. Theser are commenting, liking/favoriting and (re-)sharing. Currently +MediaGoblin supports just commenting although other interactions will come at +a later date. + +-------------- +How to comment +-------------- + +.. warning:: Commenting on a comment currently is NOT supported. + +Commenting is done by posting a comment activity to the users feed. The +activity should look similiar to:: + + { + "verb": "post", + "object": { + "objectType": "comment", + "inReplyTo": + } + } + +This is where `` is the media object you have got with from the server. + +---------------- +Getting comments +---------------- + +The media object you get back should have a `replies` section. This should +be an object which contains the number of replies and if there are any (i.e. +number of replies > 0) then `items` will include an array of every item:: + + { + "totalItems": 2, + "items: [ + { + "id": 1, + "objectType": "comment", + "content": "I'm a comment ^_^", + "author": + }, + { + "id": 4, + "objectType": "comment", + "content": "Another comment! Blimey!", + "author": + } + ], + "url": "http://some.server/api/images/1/comments/" + } + + -- cgit v1.2.3 From 138d934f014d2c9c54e247298318832e88dceadb Mon Sep 17 00:00:00 2001 From: Elrond Date: Wed, 30 Jul 2014 19:51:23 +0200 Subject: Make chown more generic. Some distributions (ubuntu 14.04 maybe?) don't create a group for a new user. So change the "chown" to use the primary group of the user instead of forcing the group. This should do the right thing in more cases. Old: chown mediagoblin:mediagoblin New: chown mediagoblin: --- docs/source/siteadmin/deploying.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 3f4a59cd..9dea239f 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -165,11 +165,11 @@ to the unpriviledged system account. To do this, enter either of the following commands, changing the defaults to suit your particular requirements:: - sudo mkdir -p /srv/mediagoblin.example.org && sudo chown -hR mediagoblin:mediagoblin /srv/mediagoblin.example.org + sudo mkdir -p /srv/mediagoblin.example.org && sudo chown -hR mediagoblin: /srv/mediagoblin.example.org or (as the root user):: - mkdir -p /srv/mediagoblin.example.org && chown -hR mediagoblin:mediagoblin /srv/mediagoblin.example.org + mkdir -p /srv/mediagoblin.example.org && chown -hR mediagoblin: /srv/mediagoblin.example.org Install MediaGoblin and Virtualenv -- cgit v1.2.3 From 23002ee77f742f3b00fbee64def0dea5de0f5e51 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Aug 2014 14:09:31 -0500 Subject: Set up virtualenv to use py2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sponsored by Jonas Öberg. Thanks Jonas! --- docs/source/siteadmin/deploying.rst | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'docs') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 9dea239f..741e9655 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -200,7 +200,7 @@ Clone the MediaGoblin repository and set up the git submodules:: And set up the in-package virtualenv:: - (virtualenv --system-site-packages . || virtualenv .) && ./bin/python setup.py develop + (virtualenv --python=python2 --system-site-packages . || virtualenv --python=python22 .) && ./bin/python setup.py develop .. note:: @@ -214,16 +214,6 @@ And set up the in-package virtualenv:: Note: this is liable to break. Use this method with caution. -.. :: - - (NOTE: Is this still relevant?) - - If you have problems here, consider trying to install virtualenv - with the ``--distribute`` or ``--no-site-packages`` options. If - your system's default Python is in the 3.x series you may need to - run ``virtualenv`` with the ``--python=python2.7`` or - ``--python=python2.6`` options. - The above provides an in-package install of ``virtualenv``. While this is counter to the conventional ``virtualenv`` configuration, it is more reliable and considerably easier to configure and illustrate. If -- cgit v1.2.3 From bf92ac6d7c26be82864176b76be9119461411071 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Aug 2014 11:55:05 -0500 Subject: Adding Pump API stuff to the docs index. This commit sponsored by Joel Luellwitz. Thanks! --- docs/source/index.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs') diff --git a/docs/source/index.rst b/docs/source/index.rst index 3ead6136..6260a595 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -96,6 +96,26 @@ This chapter contains various information for developers. devel/migrations +Part 5: Pump API +================ + +This chapter covers MediaGoblin's `Pump API +`_ support. (A +work in progress; full federation is not supported at the moment, but +media uploading works! You can use something like +`PyPump `_ +to write MediaGoblin uploadable applications.) + +.. toctree:: + :maxdepth: 1 + + api/client_register + api/oauth + api/media + api/media_interaction + + + Indices and tables ================== -- 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') 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 From 7610eb231e065ae59d07391b36717b79d4e58250 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 19 Aug 2014 00:39:33 +0200 Subject: Start for documenting core hooks. This is basicly a start by Chris Webber, I'm just commiting it for him. --- docs/source/index.rst | 1 + docs/source/pluginwriter/hooks.rst | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 docs/source/pluginwriter/hooks.rst (limited to 'docs') diff --git a/docs/source/index.rst b/docs/source/index.rst index 6260a595..8e49d1d1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -78,6 +78,7 @@ This guide covers writing new GNU MediaGoblin plugins. pluginwriter/database pluginwriter/api pluginwriter/tests + pluginwriter/hooks pluginwriter/media_type_hooks pluginwriter/authhooks diff --git a/docs/source/pluginwriter/hooks.rst b/docs/source/pluginwriter/hooks.rst new file mode 100644 index 00000000..5272266c --- /dev/null +++ b/docs/source/pluginwriter/hooks.rst @@ -0,0 +1,19 @@ +.. MediaGoblin Documentation + + Written in 2014 by MediaGoblin contributors + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + You should have received a copy of the CC0 Public Domain + Dedication along with this software. If not, see + . + + +=============================== +Documentation on Built-in Hooks +=============================== + +This section explains built-in hooks to MediaGoblin. -- cgit v1.2.3 From 3322a63df41f1b58d830aad0156160e6b532b5d7 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 19 Aug 2014 00:56:37 +0200 Subject: Add docs on collection_add_media hook. --- docs/source/pluginwriter/hooks.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs') diff --git a/docs/source/pluginwriter/hooks.rst b/docs/source/pluginwriter/hooks.rst index 5272266c..4aa062e8 100644 --- a/docs/source/pluginwriter/hooks.rst +++ b/docs/source/pluginwriter/hooks.rst @@ -17,3 +17,19 @@ Documentation on Built-in Hooks =============================== This section explains built-in hooks to MediaGoblin. + + +What hooks are available? +========================= + +'collection_add_media' +---------------------- + +This hook is used by ``add_media_to_collection`` +in ``mediagoblin.user_pages.lib``. +It gets a ``CollectionItem`` as its argument. +It's the newly created item just before getting commited. +So the item can be modified by the hook, if needed. +Changing the session regarding this item is currently +undefined behaviour, as the SQL Session might contain other +things. -- cgit v1.2.3 From d60d686a14d10af3f58867569622735ff9ecd068 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 22 Aug 2014 09:54:55 -0500 Subject: eek, should be python2 not python22 --- docs/source/siteadmin/deploying.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 741e9655..ad68c897 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -200,7 +200,7 @@ Clone the MediaGoblin repository and set up the git submodules:: And set up the in-package virtualenv:: - (virtualenv --python=python2 --system-site-packages . || virtualenv --python=python22 .) && ./bin/python setup.py develop + (virtualenv --python=python2 --system-site-packages . || virtualenv --python=python2 .) && ./bin/python setup.py develop .. note:: -- cgit v1.2.3 From b7d854bfe1474cb52d4f3cc322a97abb5943dc4b Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 22 Aug 2014 16:13:09 -0500 Subject: Blog media type doc --- docs/source/siteadmin/media-types.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index 44ad02bb..ef842baf 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -264,3 +264,13 @@ Run ./bin/gmg dbupdate +Blog (HIGHLY EXPERIMENTAL) +========================== + +MediaGoblin has a blog media type, which you might notice by looking +through the docs! However, it is *highly experimental*. We have not +security reviewed this, and it acts in a way that is not like normal +blogs (the blogposts are themselves media types!). + +So you can play with this, but it is not necessarily recommended for +production use! :) -- cgit v1.2.3 From 2352f7c86218c448c673ae80c50efd2388ab0abf Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 22 Aug 2014 16:21:48 -0500 Subject: not yet, anyway. --- docs/source/siteadmin/media-types.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/source/siteadmin/media-types.rst b/docs/source/siteadmin/media-types.rst index ef842baf..f8030081 100644 --- a/docs/source/siteadmin/media-types.rst +++ b/docs/source/siteadmin/media-types.rst @@ -272,5 +272,5 @@ through the docs! However, it is *highly experimental*. We have not security reviewed this, and it acts in a way that is not like normal blogs (the blogposts are themselves media types!). -So you can play with this, but it is not necessarily recommended for -production use! :) +So you can play with this, but it is not necessarily recommended yet +for production use! :) -- cgit v1.2.3 From 3b56b277d16c481883d4e184ac35d02ce44df196 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 25 Aug 2014 11:43:17 -0500 Subject: Updating release notes. --- docs/source/siteadmin/relnotes.rst | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'docs') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 3542bdcb..6892e71e 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -21,6 +21,78 @@ This chapter has important information for releases in it. If you're upgrading from a previous release, please read it carefully, or at least skim over it. +0.7.0 +==== + +**Do this to upgrade** + +1. Update to the latest release. If checked out from git, run: + ``git fetch && git checkout -q v0.7.0 && git submodule update`` +2. Make sure to run + ``./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate`` + +That's it, probably! If you run into problems, don't hesitate to +`contact us `_ +(IRC is often best). + +**New features:** + +- New mobile upload API making use of the + `Pump API `_ + (which will be the foundation for MediaGoblin's federation) +- New theme: Sandy 70s Speedboat! + +- Metadata features! We also now have a json-ld context. + +- Many improvements for archival institutions, including metadata + support and featuring items on the homepage. With the (new!) + archivalook plugin enabled, featuring media is possible. + Additionally, metadata about the particular media item will show up + in the sidebar. + + In the future these plugins may be separated, but for now they have + come together as part of the same plugin. + +- There is a new gmg subcommand called batchaddmedia that allows for + uploading many files at once. This is aimed to be useful for + archival institutions and groups where there is an already existing + and large set of available media that needs to be included. +- Speaking of, the call to postgres in the makefile is fixed. +- We have a new, generic media-page context hook that allows for + adding context depending on the type of media. +- Tired of video thumbnails breaking during processing all the time? + Good news, everyone! Video thumbnail generation should not fail + frequently anymore. (We think...) +- You can now set default permissions for new users in the config. + +- bootstrap.sh / gnu configuration stuff still exists, but moves to be + experimental-bootstrap.sh so as to not confuse newcomers. There are + some problems currently with the autoconf stuff that we need to work + out... we still have interest in supporting it, though help is + welcome. + +- MediaGoblin now checks whether or not the database is up to date + when starting. +- Switched to `Skeleton `_ as a system for + graphic design. +- New gmg subcommands for administrators: + - A "deletemedia" command + - A "deleteuser" command +- We now have a blogging media type... it's very experimental, + however. Use with caution! +- We have switched to exifread as an external library for reading EXIF + data. It's basically the same thing as before, but packaged + separately from MediaGoblin. +- Many improvements to internationalization. Also (still rudimentary, + but existant!) RTL language support! + +**Known issues:** + - Webfinger is now json by default; in the spec it should be xml by + default. We have done this because of compatibility with the pump + API. We are checking with upstream to see if there is a way to + resolve this discrepancy. + + 0.6.1 ===== -- cgit v1.2.3 From c7690151cc2e3ca4c955b98263a07d3769589f3d Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 26 Aug 2014 12:31:29 -0500 Subject: Also add git submodule init to the release docs --- docs/source/siteadmin/relnotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 6892e71e..a2a5645e 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -27,7 +27,7 @@ carefully, or at least skim over it. **Do this to upgrade** 1. Update to the latest release. If checked out from git, run: - ``git fetch && git checkout -q v0.7.0 && git submodule update`` + ``git fetch && git checkout -q v0.7.0 && git submodule init && git submodule update`` 2. Make sure to run ``./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate`` -- cgit v1.2.3 From fcee02a776c7ff0c5d2bbe1bf9c5c7d13a83710c Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 27 Aug 2014 12:26:23 -0500 Subject: Run the following to fix the missing git submodule init step --- docs/source/siteadmin/relnotes.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index a2a5645e..26e001cc 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -31,6 +31,13 @@ carefully, or at least skim over it. 2. Make sure to run ``./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate`` +(NOTE: earlier versions of the 0.7.0 release instructions left out the +``git submodule init`` step! If you did an upgrade earlier based on +these instructions and your theme looks weirdly aligned, try running +the following:) + + ``git submodule init && git submodule update`` + That's it, probably! If you run into problems, don't hesitate to `contact us `_ (IRC is often best). -- cgit v1.2.3 From cb9f5570f9f8e1a5283f8ce4432d00a9cc01228e Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 27 Aug 2014 12:27:04 -0500 Subject: Correcting, host-meta not webfinger. --- docs/source/siteadmin/relnotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 26e001cc..ff701b1f 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -94,7 +94,7 @@ That's it, probably! If you run into problems, don't hesitate to but existant!) RTL language support! **Known issues:** - - Webfinger is now json by default; in the spec it should be xml by + - The host-meta is now json by default; in the spec it should be xml by default. We have done this because of compatibility with the pump API. We are checking with upstream to see if there is a way to resolve this discrepancy. -- cgit v1.2.3