Content Hub documentation is missing various pieces

Bug #1407753 reported by Stuart Langridge on 2015-01-05
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Client Developer Experience
Undecided
Unassigned
Ubuntu Developer Portal
Medium
Ken VanDine

Bug Description

https://developer.ubuntu.com/en/apps/platform/guides/content-hub-guide/ is where one starts with learning how to use the Content Hub. However, it does not cover all ways of using it, and does not link to anywhere that does (and sometimes there isn't anywhere that does).

Most of these issues are found in the "App registration as source or destination" section, which I will dissect below. Things which need clarification are in between ---8<--- sections.

-----------------------------------8<------------------------------------

It’s done with Click package hooks. These are declared in a Click package’s manifest.json file. Specially, the json object has a “Hooks” item that carries the needed info. It may look like like this:

{
[...]
    "hooks": {
        "APPONE": {
            "apparmor": "APPONE.json",
            "content-hub": "APPONE.json",
            "desktop": "APPNAME.desktop"
        },
        "APPTWO": {
            "apparmor": "APPTWO.json",
            "content-hub": "APPTWO.json",
            "desktop": "APPTWO.desktop"
        }

    },
[...]
}
Each app that wants to declare itself as a source or destination sets the content-hub hook to equal the filename of the json file (in the app source tree) that contains the required information.
-----------------------------------8<------------------------------------

What should the content-hub click hook json file be called? It obviously can't be named <myapp>.json; the apparmor click hook is already called that. Can it be named anything I like as long as it's correctly linked from the manifest, or does it have to be named something relevant? Can I combine the apparmor and content-hub json files into one single file?

-----------------------------------8<------------------------------------

Let’s look at one of these, APPONE.json:

{
    "source": [
        "pictures"
    ]
}
With this, when the click package is installed, Content Hub learns that APPONE is registered as a source (an exporter) of pictures.
-----------------------------------8<------------------------------------

What's the opposite of "source", if I want to be an *importer* of pictures? What are the allowed content-types? https://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Content.ContentType/ lists some content types (and could be linked to from this guide), but "pictures" isn't on that list; "Pictures" is, though. Is this case-sensitive? Can I register for an Unknown type? How do I know which type of content an app asks for, and therefore what my app should register to provide?

Stuart Langridge (sil) wrote :

Also, there is a "share" option in my content-hub json file; in addition to "source" and "destination", there's "share"! http://bazaar.launchpad.net/~ken-vandine/+junk/hub-importer/view/head:/content-hub/hub-importer.json makes this clear, but the docs don't mention it at all.

Daniel Holbach (dholbach) wrote :

Ken: do you think you can help with this or do you know anyone else who might?

David Planella (dpm) on 2015-01-13
Changed in developer-ubuntu-com:
assignee: nobody → Ken VanDine (ken-vandine)
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers