Introduction to Plugins and Extensions
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Introduction to Plugins and Extensions

  • Dark
    Light
  • PDF

Article summary

Plugins (or extensions) allow repeatable actions to be added to the Desktop Application as new dialogs under the "Extensions" menus.

Various plugins are shipped by default with DataJet Server.  It is also possible for users to develop new plugins and add them to the system for general use.

Available Plugins

Note: This list is configurable - some or all of these plugins may be provided by the active DataJet Server

  • Analytics
    • RFM
      • Quick RFM
      • RFM (Filtered)
    • Scatter Report
    • Dashboards
      • Daily Dashboard
  • Modelling
    • Clustering
    • Fuzzy String
    • Full Linear Regression
    • Non Linear Regression
    • Helpers
  • Engineering
    • Scan Rank

Plugin File Format and Content

JSON - Plugins are stored in JSON files.   The high-level structure of the file is:

  • Header - contains details of plugin type, location, menu, help text etc
  • uivariables - Specifies the input selectors for the process
  • script - the DataJet script to be executed
  • onView - the report to view when the 

For more details of the required JSON structure, see Plugin Script Structure

{
  "type": "DJPLUGIN",
  "version": 1,
  "name": "Dialog Title",
  "title": "Menu Display Text",
  "classification": "MENU NAME",
  "menuGroup": "Sub Menu Text",
  "help": "Create a daily sales dashboard showing revenue, orders and customers for the day, month, month to date and year to date",
  "uivariables": [],
  "script": [],
  "onView": []
}

Creating a Plugin

To create a plugin, use the following process:

  1. Design the plugin (perhaps through experimentation with Desktop UI, Engineering, report Building etc). Focus on:
    1. Final Report Design/Required Plugin output
    2. Identifying variables that users need to be able to configure
    3. Noting any fields, tables or datasets that need to be engineered by the plugin
  2. Identify essential input variables.  This should include:
    1. All Primary Source tables and fields
    2. All Primary Datasets
    3. Any other variable inputs (numbers, strings, labels etc)
    4. Try to keep the number of inputs to a minimum by developing a process where all required engineered fields are built by the plugin.   For example, Customer.FirstOrder can be generated in script so long as (Sales.CustomerID and/or CustomerTable) and (Sales.OrderDate) have been provided as input variables.
  3. Consider creating a special "Plugin" project, where input objects (objects that are likely to have the same function but different names across databases and projects) are loaded with variable format names.  
    1. For example, name the sales table %SalesTable%, name sales.shipdate as %SalesTable%.%OrderDate%, name the customer table %CustTable%...   
    2. Once the plugin project has been created, save the script to recreate it from scratch
    3. in the plugin project, manually go through all the steps required to create the final plugin report/output (as determined in Step 1)
    4. Use the Project History to add all those actions to a script.
  4. Parameterise all input variables 
    1. i.e., add a DEFINES section and replace all primary source tables and fields with the variable equivalent.
    2. For example, sales.ship date might be replaced with %ForeignTable%.%OrderDate%
    3. NOTE: If a "plugin project" has been created (Step 3) and used to manually create the final plugin output, the methods extracted from the Project History should already have the correct variable names in them
  5. Test the script
    1. Put in test values in the DEFINES section
    2. Run the script in script editor, if possible against multiple projects/databases so that the parameterisation can be tested
    3. Confirm that output is as expected
    4. Save the script
  6. Create a new Plugin JSON file 
    1. Complete the Header section (i.e., type, version, name, title, classification, menuGroup, help)
    2. Add a uivariable element for each required input (see Plugin Script Structure for examples)
    3. Insert the script (as tested in Step 5) into the script section (Make sure that the Defines/Script section matches with the uivariable list)
    4. Save the file

Adding a plugin to the server

Add the plugin to the system and test:

  1. Go to Admin | Remote Files
  2. Upload the new plugin file (xxx.json) into the plugins folder
  3. Download plugins.lst 
  4. Add the new plugin name to the list in plugins.lst (use notepad or some other text editor)
  5. Upload the modified plugins.lst file
  6. Select the Plugins folder, right-click and choose "Refresh Plugins"
  7. The new plugin should now appear in the designated extension menu.

Upload plugin.json to the server

 

refresh plugins

 



Was this article helpful?