diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index a9f7408bd3415ddfe623d34d1aa7b5c33dd6ef60..4910bb7bda0f1456202773ea028d2e32b2931c1b 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -1023,6 +1023,25 @@ function MainController(profile) { FormUtil.downloadMetadataTemplateDialog(); }, "Download metadata.json template"); $header.append(FormUtil.getToolbar([{ component : $downloadMetadataTemplateButton }])); + if (profile.extraToolActions) { + profile.extraToolActions.forEach(function(actionDefinition) { + var $actionButton = FormUtil.getButtonWithText(actionDefinition.label, actionDefinition.action); + $header.append(FormUtil.getToolbar([{ component : $actionButton }])); + }); + } + } + + this.createReport = function(reportDefinition) { + var parameters = reportDefinition.parameters ? reportDefinition.parameters : {}; + mainController.serverFacade.customASService(parameters, function(result){ + var link = document.createElement('a'); + var mimeType = reportDefinition.mimeType ? reportDefinition.mimeType : "text/plain"; + link.href = "data:" + mimeType + ";" + (reportDefinition.binary ? "base64," : ",") + result; + link.download = reportDefinition.filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }, reportDefinition.service); }