diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/DatasetTypeImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/DatasetTypeImportHelper.java index 2ad599f83540e53493b1b77f40eebd4b31afc673..914541fef358653c7fe62d1140837e5ac68a7e68 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/DatasetTypeImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/DatasetTypeImportHelper.java @@ -129,8 +129,16 @@ public class DatasetTypeImportHelper extends BasicImportHelper DataSetTypeUpdate update = new DataSetTypeUpdate(); EntityTypePermId permId = new EntityTypePermId(code); update.setTypeId(permId); - update.setDescription(description); - + if (description != null) + { + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } + } if (validationScript != null && !validationScript.isEmpty()) { update.setValidationPluginId(new PluginPermId(ImportUtils.getScriptName(code, validationScript))); diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ExperimentTypeImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ExperimentTypeImportHelper.java index b13bee4e6955ee3d225f2679e1224b88d719691e..fd353909a61f4646c935c3f79213c5656096f216 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ExperimentTypeImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ExperimentTypeImportHelper.java @@ -130,7 +130,17 @@ public class ExperimentTypeImportHelper extends BasicImportHelper ExperimentTypeUpdate update = new ExperimentTypeUpdate(); EntityTypePermId permId = new EntityTypePermId(code); update.setTypeId(permId); - update.setDescription(description); + + if (description != null) + { + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } + } if (validationScript != null && !validationScript.isEmpty()) { diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ProjectImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ProjectImportHelper.java index e86300d275a0bebff3ddc91b70bb44281bd122d8..0f6c65b4a6509de239b6a0a1a80fde66e0fa000c 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ProjectImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/ProjectImportHelper.java @@ -119,7 +119,13 @@ public class ProjectImportHelper extends BasicImportHelper update.setProjectId(projectIdentifier); if (description != null) { - update.setDescription(description); + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } } // Space is only needed to "MOVE" the project diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/PropertyTypeImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/PropertyTypeImportHelper.java index 5eae9b65c2b0251d1e953505378b293e567e8e70..4ba863ad085f6a08d6fc89cd3e28b55d0d24f8c3 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/PropertyTypeImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/PropertyTypeImportHelper.java @@ -204,8 +204,26 @@ public class PropertyTypeImportHelper extends BasicImportHelper PropertyTypeUpdate update = new PropertyTypeUpdate(); update.setTypeId(propertyTypePermId); - update.setLabel(propertyLabel); - update.setDescription(description); + if (propertyLabel != null) + { + if (propertyLabel.equals("--DELETE--") || propertyLabel.equals("__DELETE__")) + { + update.setLabel(""); + } else if (!propertyLabel.isEmpty()) + { + update.setLabel(propertyLabel); + } + } + if (description != null) + { + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } + } PropertyTypeFetchOptions propertyTypeFetchOptions = new PropertyTypeFetchOptions(); propertyTypeFetchOptions.withVocabulary(); diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SampleTypeImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SampleTypeImportHelper.java index 19f82d0f67d47787695158e10fdf6d2df18d16b6..7b85b96f7dfcf57258f08db3dfc06019145a99ef 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SampleTypeImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SampleTypeImportHelper.java @@ -141,7 +141,16 @@ public class SampleTypeImportHelper extends BasicImportHelper SampleTypeUpdate update = new SampleTypeUpdate(); EntityTypePermId permId = new EntityTypePermId(code); update.setTypeId(permId); - update.setDescription(description); + if (description != null) + { + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } + } update.setAutoGeneratedCode(Boolean.parseBoolean(autoGenerateCodes)); if (validationScript != null && !validationScript.isEmpty()) { diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SpaceImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SpaceImportHelper.java index 23bc56078d496fba555d37e6fe0b985b6d8bc8a7..4bb071b894f816e5c9f9cf4e9defeeb19983ce85 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SpaceImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/SpaceImportHelper.java @@ -97,7 +97,13 @@ public class SpaceImportHelper extends BasicImportHelper update.setSpaceId(new SpacePermId(code)); if (description != null) { - update.setDescription(description); + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } } delayedExecutor.updateSpace(update); diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyImportHelper.java index b9b8664c969974bcd7868e2b03ee6d5ebd50d3e2..306fcdcfcbd45388ffc191ec9c35174922582e04 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyImportHelper.java @@ -121,7 +121,16 @@ public class VocabularyImportHelper extends BasicImportHelper VocabularyUpdate update = new VocabularyUpdate(); update.setVocabularyId(vocabularyPermId); - update.setDescription(description); + if (description != null) + { + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } + } delayedExecutor.updateVocabulary(update); } diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyTermImportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyTermImportHelper.java index a7548cc204fb21b8e9ea637ded45145b1a677af4..3c1b1bc05cfd56518fe8e60647f00c48f559444b 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyTermImportHelper.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/importer/helper/VocabularyTermImportHelper.java @@ -141,9 +141,26 @@ public class VocabularyTermImportHelper extends BasicImportHelper VocabularyTermUpdate update = new VocabularyTermUpdate(); update.setVocabularyTermId(termId); - update.setLabel(label); - update.setDescription(description); - + if (label != null) + { + if (label.equals("--DELETE--") || label.equals("__DELETE__")) + { + update.setLabel(""); + } else if (!label.isEmpty()) + { + update.setLabel(label); + } + } + if (description != null) + { + if (description.equals("--DELETE--") || description.equals("__DELETE__")) + { + update.setDescription(""); + } else if (!description.isEmpty()) + { + update.setDescription(description); + } + } this.delayedExecutor.updateVocabularyTerm(update); } diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js index c936af9e377967a380fc0760e5c429bdcea5c48f..4f2fe3995959b0973533ea65617e6ba7eaf8102a 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js @@ -888,7 +888,8 @@ var FormUtil = new function() { var vocabulary = propertyType.vocabulary; if(vocabulary) { for(var tIdx = 0; tIdx < vocabulary.terms.length; tIdx++) { - if(vocabulary.terms[tIdx].code === termCode) { + if(vocabulary.terms[tIdx].code === termCode && + vocabulary.terms[tIdx].label) { return vocabulary.terms[tIdx].label; } }