diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js index f26288cdb381460da7d8129862e7b2324b617ea3..d64396c5753b9f427f1eade3a494f8c00a40ca39 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js @@ -21,15 +21,29 @@ function DataSetFormController(parentController, mode, entity, dataSet, isMini) this.init = function(views) { var _this = this; - mainController.serverFacade.listDataSetTypes( - function(data) { + + mainController.serverFacade.listDataSetTypes(function(data) { _this._dataSetFormModel.dataSetTypes = data.result; mainController.serverFacade.getSetting("DataSetFormModel.isAutoUpload", function(value) { _this._dataSetFormModel.isAutoUpload = (value === "true"); - _this._dataSetFormView.repaint(views); + + if(mode !== FormMode.CREATE) { + var datasetPermId = dataSet.code; + require([ "as/dto/dataset/id/DataSetPermId", "as/dto/dataset/fetchoptions/DataSetFetchOptions" ], + function(DataSetPermId, DataSetFetchOptions) { + var ids = [new DataSetPermId(datasetPermId)]; + var fetchOptions = new DataSetFetchOptions(); + fetchOptions.withLinkedData().withExternalDms(); + mainController.openbisV3.getDataSets(ids, fetchOptions).done(function(map) { + _this._dataSetFormModel.linkedData = map[datasetPermId].linkedData; + _this._dataSetFormView.repaint(views); + }); + }); + } else { + _this._dataSetFormView.repaint(views); + } }); - } - ); + }); } this.isDirty = function() { diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormModel.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormModel.js index 96703daf9f94efe15fb42eae079791994cdde134..bf613ee4dee523eee1e803cf3b03487192b341fc 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormModel.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormModel.js @@ -31,6 +31,7 @@ function DataSetFormModel(mode, entity, dataSet, isMini) { } else { this.dataSet = dataSet; } + this.linkedData = null; this.dataSetTypes = null; this.files = []; diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js index ac80a96958f45315a66925f0a9e8686a9b89adb7..791e4ec3b6235f36aec7d733aadd81b823a8d037 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js @@ -201,6 +201,20 @@ function DataSetFormView(dataSetFormController, dataSetFormModel) { $dataSetTypeFieldSet.append(FormUtil.getFieldForLabelWithText(ownerName, owner)); } + // + // Content copies info + // + if(this._dataSetFormModel.linkedData && this._dataSetFormModel.linkedData.contentCopies) { + var $ccn = FormUtil.getFieldForLabelWithText("Number of content copies", "" + this._dataSetFormModel.linkedData.contentCopies.length); + $dataSetTypeFieldSet.append($ccn); + for(var cIdx = 0; cIdx < this._dataSetFormModel.linkedData.contentCopies.length; cIdx++) { + var cc = this._dataSetFormModel.linkedData.contentCopies[cIdx]; + var $cc = FormUtil.getFieldForLabelWithText("Content Copy", "" + "External DMS: " + cc.externalDms + " Path:" + cc.path); + $dataSetTypeFieldSet.append($cc); + } + + } + // // Registration and modification info // diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js index 32404d9aa08c12cbaadad8009eea30f7f075389c..eb59fc477738e3df8199e35502ef1d6480b4fb20 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js @@ -80,9 +80,20 @@ function DataSetViewerModel(containerId, profile, entity, serverFacade, datastor return false; } + this.isLinkDataset = function(datasetCode) { + for(var idx = 0; idx < this.datasets.length; idx++) { + if(this.datasets[idx].code === datasetCode && this.datasets[idx].linkDataSet) { + return true; + } + } + return false; + } + this.getDirectDirectoryLink = function(datasetCode, pathInDataSet) { var directLinkComponent = null; - if(profile.directLinkEnabled && (profile.cifsFileServer || profile.sftpFileServer)) { + if(this.isLinkDataset(datasetCode)) { + directLinkComponent = "<span class='glyphicon glyphicon-link'></span>"; + } else if(profile.directLinkEnabled && (profile.cifsFileServer || profile.sftpFileServer)) { var path = null; if(this.isExperiment()) {