Getting started : Plugin

What is it?

A MIDATA plugin is web content that runs as part of the MIDATA portal. It may provide visualizations for existing data, offer forms for data input or connect to an external service to collect information.

How do I start?

MIDATA runs multiple instances of the MIDATA platform for different purposes. At test.midata.coop you find the development and testing instance.

  • Submit your request for a developer account on the test platform. Please note that the issuing of a developer account is conditioned to the pre-existence of a contract and/or a partnership agreement between MIDATA and the requesting party.
  • Then register your application on the test platform.
  • To have access to some data configure the access filter for your plugin.
  • Download the example plugin.
  • In the API debugger you can test all your queries and ideas before you implement them.
  • Run the plugin on your local computer and test it inside the portal running at the server.
  • Provide your code in a GIT repository and deploy it to the test server so that everybody may use it.
  • Look at statistics to improve your application and track errors.
  • If everything runs fine contact MIDATA and send your code to deploy it to the productive system.

Libraries

A MIDATA plugin is a combination of HTML and javascript.

It is strongly recommended to use Vue JS.

A VueJs connector with MIDATA for plugins may be found at:

https://github.com/MIDATAcooperative/midata-plugin-vue-library

An example plugin may be found at:

https://github.com/MIDATAcooperative/midata-plugin-vue-template

Authentication

Your plugin will receive an authentication token with the access rights of your plugin by the MIDATA portal.

After initialization of the library you can have access to the token, if required:

import midataPortal from 'vue-midata/midataPortal.js';
import midata from 'vue-midata/midata.js';

const app = createApp({    
    created() {        
      midataPortal.init(this.$route);
      
      const language = midataPortal.language;
      const token = midata.authToken;       
      
    }
});

URL for direct use of a plugin

Each MIDATA plugin has a URL that allows to use the plugin as standalone without the rest of the portal. The URL is

https://test.midata.coop/#/public/apps/your-internal-plugin-name

(Replace “your-internal-plugin-name” with the internal name of your plugin)

The user will be presented a login screen (registration is also possible).

Plugin Login

After login the user will be taken directly to your plugin. The normal menu will not be shown to the user, only the user profile is available.

No menu

After using the user profile the user may return to your plugin by clicking on the MIDATA logo.

Linking with research projects

The use of your plugin may be recommended by research projects. You may mark your plugin as only useable if the user participates with a research project.