diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index 4847cc2f5ffc430f59065dc7f4b1e7ae9b22a481..31b9ca50cdfd9e0250bc9e2ac993ae7ea9e41c10 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -895,6 +895,9 @@ function ServerFacade(openbisServer) { case "ATTR": setAttributeCriteria(setOperator(searchCriteria.withSample(),advancedSearchCriteria.logicalOperator), fieldName, fieldValue); break; + case "NULL": + searchCriteria.withoutSample(); + break; } break; case "Experiment": @@ -905,6 +908,9 @@ function ServerFacade(openbisServer) { case "ATTR": setAttributeCriteria(setOperator(searchCriteria.withExperiment(),advancedSearchCriteria.logicalOperator), fieldName, fieldValue); break; + case "NULL": + searchCriteria.withoutExperiment(); + break; } break; case "Parent": diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js index 9153d0d344d35ade42c07dea00e7719e325d0910..c5bfbecae4dfd8a8d1a51d1b355a64b50803fa39 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js @@ -267,6 +267,11 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { }); } + + if(this._experimentFormModel.mode !== FormMode.CREATE) { + //Preview image + this._reloadPreviewImage(); + } } this._paintIdentificationInfo = function($formColumn) { @@ -466,4 +471,49 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { $formColumn.append($fieldset); } + + // + // Preview Image + // + this._reloadPreviewImage = function() { + var _this = this; + var previewCallback = function(data) { + if (data.objects.length == 0) { + _this._updateLoadingToNotAvailableImage(); + } else { + var listFilesForDataSetCallback = function(dataFiles) { + var found = false; + if(!dataFiles.result) { + //DSS Is not running probably + } else { + for(var pathIdx = 0; pathIdx < dataFiles.result.length; pathIdx++) { + if(!dataFiles.result[pathIdx].isDirectory) { + var elementId = 'preview-image'; + var downloadUrl = profile.getDefaultDataStoreURL() + '/' + data.objects[0].code + "/" + dataFiles.result[pathIdx].pathInDataSet + "?sessionID=" + mainController.serverFacade.getSession(); + + var img = $("#" + elementId); + img.attr('src', downloadUrl); + img.attr('data-preview-loaded', 'true'); + img.show(); + break; + } + } + } + }; + mainController.serverFacade.listFilesForDataSet(data.objects[0].code, "/", true, listFilesForDataSetCallback); + } + }; + + var datasetRules = { "UUIDv4.1" : { type : "Experiment", name : "ATTR.PERM_ID", value : this._experimentFormModel.experiment.permId }, + "UUIDv4.2" : { type : "Attribute", name : "DATA_SET_TYPE", value : "ELN_PREVIEW" }, + "UUIDv4.3" : { type : "Sample", name : "NULL.NULL", value : "NULL" } + }; + + mainController.serverFacade.searchForDataSetsAdvanced({ entityKind : "DATASET", logicalOperator : "AND", rules : datasetRules }, null, previewCallback); + } + + this._updateLoadingToNotAvailableImage = function() { + var notLoadedImages = $("[data-preview-loaded='false']"); + notLoadedImages.attr('src', "./img/image_unavailable.png"); + } } \ No newline at end of file