Page tree
Skip to end of metadata
Go to start of metadata

Introduction

The current aim of this extensions is to accommodate two groups of modifications:

Pure Configuration, enabling/disabling some features, to clean the interface and make it less confusing for non expert users. Very often also to add type extensions for types specified with another master data extension.

extending the interface to accommodate additional functionality without needing to deal with the internals.

Source structure and plugin structure

plugins folder

Each folder on this folder is a ELN UI extension.

Each extension currently contains a single file with name "plugin.js".

config.js file

Contains a section called  PLUGINS_CONFIGURATION indicating the plugins to be loaded from the plugins folder.

var PLUGINS_CONFIGURATION = {
    extraPlugins : ["life-sciences", "flow", "microscopy"]
}

plugin.js file

An example with only configuration extensions is shown below.

function MyTechnology() {
   this.init();
}

$.extend(MyTechnology.prototype, ELNLIMSPlugin.prototype, {
   init: function() {
   
   },
   forcedDisableRTF : [],
   forceMonospaceFont : [],
   sampleTypeDefinitionsExtension : {
   		"SAMPLE_TYPE" : {
			"TOOLBAR": { CREATE : true, EDIT : true, FREEZE : true, MOVE : true, COPY: true, DELETE : true, PRINT: true, HIERARCHY_GRAPH : true, HIERARCHY_TABLE : true, UPLOAD_DATASET : true, UPLOAD_DATASET_HELPER : true, EXPORT_ALL : true, EXPORT_METADATA : true, TEMPLATES : true, BARCODE : true },
	   		"SHOW" : false,
	    	"SAMPLE_CHILDREN_DISABLED": false,
			"SAMPLE_CHILDREN_ANY_TYPE_DISABLED" : false,
          	"SAMPLE_PARENTS_DISABLED": false,
			"SAMPLE_PARENTS_ANY_TYPE_DISABLED": true,
			"SAMPLE_PARENTS_HINT": [{
    			"LABEL": "Parent Label",
    			"TYPE": "PARENT_TYPE",
    			"ANNOTATION_PROPERTIES": []
			}],
			"SAMPLE_CHILDREN_HINT" : [{
				"LABEL": "Children Label",
    			"TYPE": "CHILDREN_TYPE",
				"MIN_COUNT" : 0,
    			"ANNOTATION_PROPERTIES": [{"TYPE" : "ANNOTATION.SYSTEM.COMMENTS", "MANDATORY" : false }]
			}],
   			"ENABLE_STORAGE" : false,
   			"SHOW_ON_NAV": false,
    		"SHOW_ON_NAV_FOR_PARENT_TYPES": undefined,
			extraToolbar : undefined
		},
   },
   dataSetTypeDefinitionsExtension : {
   		"DATASET_TYPE" : {
			"TOOLBAR": { EDIT : true, FREEZE : true, MOVE : true, ARCHIVE : true, DELETE : true, HIERARCHY_TABLE : true, EXPORT_ALL : true, EXPORT_METADATA : true },
			"DATASET_PARENTS_DISABLED" : false,
			extraToolbar : undefined
		},
   }
});

profile.plugins.push(new MyTechnology());

An example with only code extensions is shown below, variables with a dollar sign '$' indicate they are jquery components:

function MyTechnology() {
   this.init();
}

$.extend(MyTechnology.prototype, ELNLIMSPlugin.prototype, {
   init: function() {
   
   },
   sampleTypeDefinitionsExtension : {
   		"SAMPLE_TYPE" : {
			extraToolbar : function(mode, sample) {
				var toolbarModel = [];
				if(mode === FormMode.VIEW) {
    				var $demoButton = FormUtil.getButtonWithIcon("glyphicon-heart", function () { });
    				toolbarModel.push({ component : $demoButton, tooltip: "Demo" });
				}
				return toolbarModel;
			}
		},
   },
   dataSetTypeDefinitionsExtension : {
   		"DATASET_TYPE" : {
			extraToolbar : function(mode, dataset) {
				var toolbarModel = [];
				if(mode === FormMode.VIEW) {
    				var $demoButton = FormUtil.getButtonWithIcon("glyphicon-heart", function () { });
    				toolbarModel.push({ component : $demoButton, tooltip: "Demo" });
				}
				return toolbarModel;
			}
		},
   },
   sampleFormTop : function($container, model) {
   
   },
   sampleFormBottom : function($container, model) {
   
   },
   onSampleSave : function(sample, changesToDo, success, failed) {
        success();
   },
   dataSetFormTop : function($container, model) {
   
   },
   dataSetFormBottom : function($container, model) {
   
   }
});

profile.plugins.push(new MyTechnology());
  • No labels