Community App Developer Guide

Version 29.1 by mmorgan on 2020/06/19 16:22

Developers can extend the Collaboratory capabilities by providing applications to its community of users.

This guide describes the steps to make this possible.

Becoming a contributor

The first step is for you to get the developer accreditation. Contributors can register and manage applications within the Community Apps Catalogue.

Send an email to support@ebrains.eu with a short summary of your intentions.

The support team will apply the permissions to your user: your account will be upgraded with developers privileges the next time you will login.

Only SGA2 accredited users will be automatically granted the developer accreditation.

Making your app available to users

In order for you application to be installable by users, it needs to be registered within the Community Apps Catalogue.

Once this simple step is complete, users will be able to install your app within their collabs.

If you are dealing with private data, or your users need to be authenticated, see authentication and authorisation in the Collaboratory.

Registering an application in the Catalogue

Navigate to the catalogue and click on +Create App in the top right corner. Enter a name for your app and click on Create.

Fill the form with the following information:

  • main URL: the URL of the homepage of your app. This is where user will be directed when then open your app in a collab.
  • settings URL: the URL of the your settings management page if you have one.
  • description: a description of what your app does to help users select it.
  • under development?: should be checked if you don't want your app to be available by default by other users.
  • category: a category to help structuring the applications.
  • maintainers: a list of users who maintain the app. The users need to have logged in the wiki at least once to be found. Maintainers are granted the right to modify an app registration.
  • documentation URL: if your app has online user documentation, a link will be provided to users when they use your app.
  • repository: a URL to a public repository so users can check the sources of your app.

Click on Save. Your app is now registered and waiting for users to install it!

Installing your app in a collab

  1. In order to install your app, you need to navigate to a collab where you have either the editor or administrator role.
  2. Click on Create. Enter a title for this instance of your app and select Community App in the right selector.
  3. Click on Create. You will be presented with the Community App Catalogue. The app you will see are the public apps and the ones your a maintainer of.
  4. Select your app and click on Save and View.

You should now see how your app looks like within a collab.

Getting your app instance context

Instances of your applications will be installed by collab authors in many different collabs. In order to let you customise the user experience based on its context, the Collaboratory will automatically pass query parameters to your app:

  • clb-collab-id: the unique, human-readable identifier of the collab.
  • clb-doc-path: the path of your app instance within the collab. If your app is at the root of a collab, this value will be empty.
  • clb-doc-name: the name of the document where your app instance is installed.
  • clb-drive-id: the unique identifier of the drive of the collab. This id is required if you want to fetch or store documents within the drive of the collab.

App settings

The app settings are the values the collab author can modify to change the behaviour of your application within her collab.

Writing settings

The Collaboratory comes with a mechanism to let your app store these settings directly in the Collaboratory.

In order to do that, your app needs to use the postMessage javascript API to send the settings to store to the Collaboratory:

window.parent.postMessage({
    topic: '/clb/community-app/settings',
    data: {
        setting1: 'setting 1 value',
        setting2: 'setting 2 value',
       // ...
       // reload: false // avoid page reload on settings change
   }}, 'https://wiki.ebrains.eu');

Fetching settings

The Collaboratory will get the settings from its key/value store and pass them to your app through query parameters.

Creating your OpenID Connect client

See the instructions here.