Design Hub export plugins add new report file format or report storage locations. These plugins are NodeJS modules, stored in a folder set by Design Hub's configuration file.
{info} We recommend checking these basic introduction materials to get familiar with NodeJS NodeJS beginner guide, Youtube (78m), Getting started with NodeJS, Youtube (19m), Intro to NodeJS, Youtube (48m) NodeJS module description: https://nodejs.org/api/modules.html Promise introduction: https://web.dev/articles/promises?hl=en
This plugin type is intended to save important information from a discussion room, to files such as a powerpoint document saved to the local machine.
Design Hub scans the services directory to find all export plugins and generates a GUI element to execute them. There is 1 instance of a plugin per domain.
 
Export plugins are NodeJS modules, denoted by their filename: *.export.js and the location in the services directory as configured during installation.
An export plugin exports the following required properties:
| Name | Type | Description | 
|---|---|---|
| generate | async function | The main function of the plugin, called when the sketcher is used, once for each change. The function must return a Promise of the results / be declared as an async function. The results are broadcasted by the application Arguments: meetingData (Object)data structure containing structures and comments. See specification below.thisincludes domainReturn value: PromiseThe fulfillment value of the promise must be aBuffer,StreamorStringwhenreturnTypeequalsfile. | 
| name | string | Unique identifier of the plugin, used by Design Hub for identification and internal communication. If multiple plugins use the same identifier, the last one to be loaded overrides the others. | 
| label | string | Human readable name of the plugin, used by Design Hub to display GUI elements related to this plugin. | 
| domains | array of strings | List of domains where this plugin may be used, when authentication is enabled in Design Hub. Use *to allow any domain. If no authentication is setup, this option has no effect. To query the configured domains, send aGETrequest to/domainsor open/domainsin your browser. | 
| returnType | string | Configures the application to expect a file or a text message when the generate() promise is resolved. Files are downloaded to the client browser, text messages are displayed in a dialog. Values: fileormessageDefault: file | 
| templateFile | string | Relative path to an HTML template, when returnTypeequalsmessage. The template is injected into the room’s interface as a dialog. The templating language is Angular JS, which should allow interpolating formatted numbers or easily enumerating a list. The result of thegeneratecall is made available as theclientvariable inside the template fragment. | 
Below is an example of the meeting data object, with inline description of the individual attributes for structures and comments.
{
 //Array of objects of all snapshots saved in this room
 "snapshots": [
   {
     //String, mrv source of the chemical structure
     "structure": "<cml><MDocument>...</MDocument></cml>",
     //String, base64 encoded PNG image at 500x400
     "image": "data:image/png;base64,iVBORw0KG...5CYII=",
     //String, display name of the author of this structure
     "author": "Susan",
     //Number, millisecond resolution UNIX timestamp of the authoring
     //of this structure
     "timestamp": 1436786661609,
     //Object, key-value data provided by users for the configured "snapshotFields"
     "additionalFields": {
       "Task": "check IP by Friday",
       "Status": "On hold"
     },
     //Array of objects, comments assigned to this snapshot
     //undefined for non-snapshots
     "comments": [
       {
         "message": "this looks like an interesting compound",
         "author": "Wilhelm",
         "timestamp": 1436879124086
       },
       ...
     ],
     //Object, key-value data returned by real time plugins for "reports"
     "data": {
       //key: String, label of real time plugin
       //value: Object, key-value pairs of data returned
       "Calculated Properties": {
         "Mass": 344.43,
         "cLogP": 1.74
       }
     }
   },
   ...
 ],
 //Array of objects, all comments made in this room
 "comments": [
   {
     //String, text content of this message
     "message": "this looks like an interesting compound",
     //String, display name of the author of this message
     "author": "Michael",
     //Number, millisecond resolution UNIX timestamp of this message
     "timestamp": 1436879124086
   },
   ...
 ]
}You can find a brief selection of plugins in our Github repository: CSV exporter, SMILES, SDF v3000 and IDBS E-workbook exporter.