Community App Developer Guide
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 apps within the Community Apps Catalogue.
Send an email to support@ebrains.eu with a short motivation for your request.
The support team will apply the permissions to your user. Your account will be upgraded with developer privileges the next time you login.
Making your app available to users
In order for users to install your app, it needs to be registered in the Community Apps Catalogue.
If you are dealing with private data, or your users need to be authenticated, see authentication and authorization 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 the users will be directed when they open your app in a collab.
- settings URL: the URL of your app's settings management page, if there is one.
- description: a description of what your app does. This helps users choose the apps they install.
- under development?: if checked, your app will not be available to other users.
- category: a category to help structure the list of apps.
- maintainers: a list of users who maintain the app. The users need to have logged in the wiki at least once to appear on the list. Maintainers are granted the right to modify the app's 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 access the source code of your app.
Click on Save. Your app is now registered and waiting for users to install it!
Installing your app in a collab
- In order to install your app, you need to navigate to a collab where you have either the editor or admin role.
- Click on Create at the top right to create a new entry in the navigation pane under the current wiki page. Enter a title for this instance of your app and select Community App in the right selector.
- Click on Create. You will be presented with the Community App Catalogue. The apps you will see are the public apps and the ones for which you are a maintainer.
- Select your app and click on Save and View.
You should now see your app in your collab just as other users will see it.
Getting your app instance context
Instances of your apps will be installed by collab owners 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 (relative) path to 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 owners can modify to change the behaviour of your app within their collabs.
Writing settings
The Collaboratory comes with a mechanism to let your app store its settings directly in the Collaboratory.
In order to do that, your app needs to use the postMessage javascript API to send the settings to be stored in the Collaboratory. The settings are key/value pairs as in the example below. To update the settings, you need to write all the settings fields, as updating a single value only is not implemented.
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');
Reading settings
The Collaboratory will get the settings from its key/value store and pass them to your app through query parameters.
Your app with hash-based URL
The app you are developing might be a single page app that needs to handle some routing between views. This is typically done with a hash-based URL using the fragment at the end to track the view in the page.
URI = scheme:[//authority]path[?query][#fragment]
The Community Apps environment gives you the ability to update the parent frame fragment.
It uses the postMessage() javascript API to communicate from your app's iframe to the wiki (parent) frame.
topic: '/clb/community-app/hashchange',
data: 'the_fragment_value'
}, 'https://wiki.ebrains.eu');
If a fragment is present in the parent frame URL at parent page load time, this fragment is transmitted to your app's iframe.
Creating your OpenID Connect client
See the instructions here.