diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index fc9f1f3966550be00515f29dc451c412fc359216..f10c7d33963fb043a83239cc874ad0dd68b010f0 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -2409,6 +2409,7 @@ function ServerFacade(openbisServer) { v1Sample["experimentIdentifierOrNull"] = (v3Sample.experiment)?v3Sample.experiment.identifier.identifier:null; v1Sample["experimentTypeCode"] = v3Sample.experiment && v3Sample.experiment.type ? v3Sample.experiment.type.code : null; v1Sample["sampleTypeCode"] = (v3Sample.type)?v3Sample.type.code:null; + v1Sample["semanticAnnotations"] = (v3Sample.type)?v3Sample.type.semanticAnnotations:null; v1Sample["properties"] = v3Sample.properties; v1Sample["registrationDetails"] = {}; @@ -2741,7 +2742,7 @@ function ServerFacade(openbisServer) { // var fetchOptions = new SampleFetchOptions(); fetchOptions.withSpace(); - fetchOptions.withType(); + fetchOptions.withType().withSemanticAnnotations(); fetchOptions.withRegistrator(); fetchOptions.withModifier(); fetchOptions.withProject(); diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 2ee13ab8afb6f6de79865d2c5bed4e377ba53606..896e08c16e8feb8ea3634e44c7eddee43e9c7599 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -851,6 +851,7 @@ function SampleFormView(sampleFormController, sampleFormModel) { $fieldset.append(FormUtil.getFieldForComponentWithLabel(entityPath, "Path")); } $fieldset.append(FormUtil.getFieldForLabelWithText("Type", this._sampleFormModel.sample.sampleTypeCode)); + this._appendSemanticAnnotions($fieldset); if(this._sampleFormModel.sample.experimentIdentifierOrNull) { $fieldset.append(FormUtil.getFieldForLabelWithText(ELNDictionary.getExperimentKindName(this._sampleFormModel.sample.experimentTypeCode), this._sampleFormModel.sample.experimentIdentifierOrNull)); } @@ -919,7 +920,32 @@ function SampleFormView(sampleFormController, sampleFormModel) { return $identificationInfo; } - this._createParentsSection = function(hideShowOptionsModel, sampleTypeDefinitionsExtension, sampleTypeCode, loadFromTemplate) { + this._appendSemanticAnnotions = function($fieldset) { + if (this._sampleFormModel.sample.semanticAnnotations && this._sampleFormModel.sample.semanticAnnotations.length > 0) { + var $group = $("<div>", {class : "form-group"}); + $group.append($("<label>", {class : "control-label"}).text("Semantic Annotations:")); + var $controls = $("<div>", {class : "controls" }); + var _this = this; + this._sampleFormModel.sample.semanticAnnotations.forEach(function(annotation) { + var $line = $("<div>"); + $line.append(_this.asHyperLinkOrText(annotation.getDescriptorAccessionId())); + $line.append(" (Ontology: "); + $line.append(_this.asHyperLinkOrText(annotation.getDescriptorOntologyId())); + $line.append(", Version: "); + $line.append(_this.asHyperLinkOrText(annotation.getDescriptorOntologyVersion())); + $line.append(")"); + $controls.append($line); + }); + $group.append($controls); + $fieldset.append($("<div>").append($group)); + } + } + + this.asHyperLinkOrText = function(text) { + return text.startsWith("http") ? FormUtil.asHyperlink(text) : text; + } + + this._createParentsSection = function(hideShowOptionsModel, sampleTypeDefinitionsExtension, sampleTypeCode, loadFromTemplate) { var _this = this; var requiredParents = []; if (sampleTypeDefinitionsExtension && sampleTypeDefinitionsExtension["SAMPLE_PARENTS_HINT"]) {