diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/EntitiesFinder.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/EntitiesFinder.java index 253cb28aeb8aa2d2fe61b9ed4628a3765c99803d..93599afa034a8b8e014915160bfbb9b7db76b29e 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/EntitiesFinder.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/EntitiesFinder.java @@ -162,6 +162,7 @@ class EntitiesFinder fetchOptions.withProperties(); fetchOptions.withRegistrator(); fetchOptions.withModifier(); + fetchOptions.withDataSets(); return api.getExperiments(sessionToken, experimentPermIds, fetchOptions).values(); } @@ -212,6 +213,7 @@ class EntitiesFinder fetchOptions.withProperties(); fetchOptions.withRegistrator(); fetchOptions.withModifier(); + fetchOptions.withDataSets(); return api.getSamples(sessionToken, samplePermIds, fetchOptions).values(); } diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutor.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutor.java index f4beb39fbeb0038b01f877de11128c91d81f0fd4..ab2aff3d40ac306d408c367448c2d987ac62a974 100644 --- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutor.java +++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutor.java @@ -361,7 +361,7 @@ public class ExportExecutor implements IExportExecutor { final IApplicationServerInternalApi v3 = CommonServiceProvider.getApplicationServerApi(); - final IDataStoreServerApi v3Dss = CommonServiceProvider.getOriginalDataStoreServer(); + final IDataStoreServerApi v3Dss = CommonServiceProvider.getDataStoreServerApi(); // final Collection<DataSet> dataSets = entitiesVo.getDataSets(); final Collection<Sample> samples = entitiesVo.getSamples(); diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportData.java b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportData.java index 63ff92beb22d82df8b0a660c606ec55994836e68..5d3f1c4d1efd6eab27c81ae0af51ac284fb17f47 100644 --- a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportData.java +++ b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportData.java @@ -17,46 +17,17 @@ package ch.ethz.sis.openbis.systemtest.asapi.v3; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.AUTO_GENERATE_CODES; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.CHILDREN; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.CODE; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.DESCRIPTION; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.DISALLOW_DELETION; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.EXPERIMENT; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.GENERATED_CODE_PREFIX; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.IDENTIFIER; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.MODIFICATION_DATE; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.MODIFIER; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.PARENTS; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.PERM_ID; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.PRESENT_IN_ARCHIVE; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.PROJECT; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.REGISTRATION_DATE; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.REGISTRATOR; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.SAMPLE; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.SPACE; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.STORAGE_CONFIRMATION; -import static ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.Attribute.UNIQUE_SUBCODES; - import java.util.EnumSet; import java.util.List; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.DataSetPermId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype.EntityKind; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype.id.EntityTypePermId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.id.ExperimentPermId; import ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.AllFields; import ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.ExportableKind; import ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.ExportablePermId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.data.SelectedFields; import ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.options.ExportFormat; import ch.ethz.sis.openbis.generic.asapi.v3.dto.exporter.options.XlsTextFormat; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.project.id.ProjectPermId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.id.PropertyTypePermId; import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SamplePermId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.SpacePermId; -public class ExportData +class ExportData { static final String RICH_TEXT_PROPERTY_NAME = "MULTILINE"; @@ -65,462 +36,474 @@ public class ExportData static final String RICH_TEXT_WITH_SPREADSHEET_PROPERTY_NAME = "MULTILINE_WITH_SPREADSHEET"; static final Object[][] EXPORT_DATA = { - // XLS: All fields - { - // Non-existing sample - "empty-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("WrongPermId"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Space: TEST-SPACE - "export-space-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Project: TEST-PROJECT - "export-project-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment: EXP-SPACE-TEST - "export-experiment-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-compatible-with-import-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - true // withImportCompatibility - }, - { - // Sample: /MP - "export-sample-shared-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-652"))), - new AllFields(), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, +// // XLS: All fields // { -// // Sample: /MP:A03 -// "export-sample-contained-xlsx.zip", +// // Non-existing sample +// "empty-xlsx.zip", // EnumSet.of(ExportFormat.XLSX), -// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-653"))), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("WrongPermId"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Space: TEST-SPACE +// "export-space-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Project: TEST-PROJECT +// "export-project-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment: EXP-SPACE-TEST +// "export-experiment-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-compatible-with-import-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// true // withImportCompatibility +// }, +// { +// // Sample: /MP +// "export-sample-shared-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-652"))), // new AllFields(), // XlsTextFormat.RICH, // true, // withReferredTypes // false // withImportCompatibility // }, - { - // Data set: "ROOT_CONTAINER" - "export-data-set-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("ROOT_CONTAINER"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample Type: CELL_PLATE - "export-sample-type-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE_TYPE, new EntityTypePermId("CELL_PLATE", EntityKind.SAMPLE))), - new AllFields(), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample Type: CELL_PLATE - "export-sample-type-with-referred-types-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE_TYPE, new EntityTypePermId("CELL_PLATE", EntityKind.SAMPLE))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment Type: SIRNA_HCS - "export-experiment-type-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT_TYPE, new EntityTypePermId("SIRNA_HCS", EntityKind.EXPERIMENT))), - new AllFields(), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Dataset Type: HCS_IMAGE - "export-data-set-type-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.DATASET_TYPE, new EntityTypePermId("HCS_IMAGE", EntityKind.DATA_SET))), - new AllFields(), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - - // XLS: Selected fields - { - // Space: TEST-SPACE - "export-space-filtered-attributes-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), - new SelectedFields(List.of(CODE, REGISTRATOR, DESCRIPTION), List.of()), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Project: TEST-PROJECT - "export-project-filtered-fields-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), - new SelectedFields( - List.of(REGISTRATOR, REGISTRATION_DATE, CODE, IDENTIFIER, SPACE, DESCRIPTION), - List.of()), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment: EXP-SPACE-TEST - "export-experiment-filtered-fields-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), - new SelectedFields( - List.of(CODE, PERM_ID, IDENTIFIER, PROJECT, REGISTRATOR, MODIFIER), - List.of(new PropertyTypePermId("GENDER"), new PropertyTypePermId("DESCRIPTION"))), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-filtered-fields-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), - new SelectedFields( - List.of(CODE, PERM_ID, IDENTIFIER, SPACE, PARENTS, CHILDREN, REGISTRATOR, REGISTRATION_DATE, MODIFIER, MODIFICATION_DATE), - List.of(new PropertyTypePermId("BACTERIUM"), new PropertyTypePermId("COMMENT"), new PropertyTypePermId("ORGANISM"))), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Data set: "20081105092159188-3", type: "HCS_IMAGE" - "export-data-set-filtered-fields-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("20081105092159188-3"))), - new SelectedFields( - List.of(REGISTRATOR, REGISTRATION_DATE, CODE, IDENTIFIER, PARENTS, CHILDREN, STORAGE_CONFIRMATION, PRESENT_IN_ARCHIVE, - SAMPLE, EXPERIMENT), - List.of(new PropertyTypePermId("COMMENT"), new PropertyTypePermId("GENDER"))), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample Type: CELL_PLATE - "export-sample-type-filtered-attributes-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE_TYPE, new EntityTypePermId("CELL_PLATE", EntityKind.SAMPLE))), - new SelectedFields(List.of(CODE, AUTO_GENERATE_CODES, DESCRIPTION, GENERATED_CODE_PREFIX, UNIQUE_SUBCODES), List.of()), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment Type: SIRNA_HCS - "export-experiment-type-filtered-attributes-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT_TYPE, new EntityTypePermId("SIRNA_HCS", EntityKind.EXPERIMENT))), - new SelectedFields(List.of(DESCRIPTION, CODE, MODIFICATION_DATE), List.of()), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Dataset Type: HCS_IMAGE - "export-data-set-type-filtered-attributes-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.DATASET_TYPE, new EntityTypePermId("HCS_IMAGE", EntityKind.DATA_SET))), - new SelectedFields(List.of(CODE, DISALLOW_DELETION, DESCRIPTION), List.of()), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-plain-text-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. - new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-rich-text-xlsx.zip", - EnumSet.of(ExportFormat.XLSX), - List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. - new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, - - // HTML: All fields - { - // Space: TEST-SPACE - "export-space-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Project: TEST-PROJECT - "export-project-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment: EXP-SPACE-TEST - "export-experiment-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /MP - "export-sample-shared-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-652"))), - new AllFields(), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, +//// { +//// // Sample: /MP:A03 +//// "export-sample-contained-xlsx.zip", +//// EnumSet.of(ExportFormat.XLSX), +//// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-653"))), +//// new AllFields(), +//// XlsTextFormat.RICH, +//// true, // withReferredTypes +//// false // withImportCompatibility +//// }, +// { +// // Data set: "ROOT_CONTAINER" +// "export-data-set-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("ROOT_CONTAINER"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample Type: CELL_PLATE +// "export-sample-type-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE_TYPE, new EntityTypePermId("CELL_PLATE", EntityKind.SAMPLE))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample Type: CELL_PLATE +// "export-sample-type-with-referred-types-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE_TYPE, new EntityTypePermId("CELL_PLATE", EntityKind.SAMPLE))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment Type: SIRNA_HCS +// "export-experiment-type-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT_TYPE, new EntityTypePermId("SIRNA_HCS", EntityKind.EXPERIMENT))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Dataset Type: HCS_IMAGE +// "export-data-set-type-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.DATASET_TYPE, new EntityTypePermId("HCS_IMAGE", EntityKind.DATA_SET))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// +// // XLS: Selected fields +// { +// // Space: TEST-SPACE +// "export-space-filtered-attributes-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), +// new SelectedFields(List.of(CODE, REGISTRATOR, DESCRIPTION), List.of()), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Project: TEST-PROJECT +// "export-project-filtered-fields-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), +// new SelectedFields( +// List.of(REGISTRATOR, REGISTRATION_DATE, CODE, IDENTIFIER, SPACE, DESCRIPTION), +// List.of()), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment: EXP-SPACE-TEST +// "export-experiment-filtered-fields-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), +// new SelectedFields( +// List.of(CODE, PERM_ID, IDENTIFIER, PROJECT, REGISTRATOR, MODIFIER), +// List.of(new PropertyTypePermId("GENDER"), new PropertyTypePermId("DESCRIPTION"))), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-filtered-fields-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), +// new SelectedFields( +// List.of(CODE, PERM_ID, IDENTIFIER, SPACE, PARENTS, CHILDREN, REGISTRATOR, REGISTRATION_DATE, MODIFIER, MODIFICATION_DATE), +// List.of(new PropertyTypePermId("BACTERIUM"), new PropertyTypePermId("COMMENT"), new PropertyTypePermId("ORGANISM"))), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Data set: "20081105092159188-3", type: "HCS_IMAGE" +// "export-data-set-filtered-fields-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("20081105092159188-3"))), +// new SelectedFields( +// List.of(REGISTRATOR, REGISTRATION_DATE, CODE, IDENTIFIER, PARENTS, CHILDREN, STORAGE_CONFIRMATION, PRESENT_IN_ARCHIVE, +// SAMPLE, EXPERIMENT), +// List.of(new PropertyTypePermId("COMMENT"), new PropertyTypePermId("GENDER"))), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample Type: CELL_PLATE +// "export-sample-type-filtered-attributes-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE_TYPE, new EntityTypePermId("CELL_PLATE", EntityKind.SAMPLE))), +// new SelectedFields(List.of(CODE, AUTO_GENERATE_CODES, DESCRIPTION, GENERATED_CODE_PREFIX, UNIQUE_SUBCODES), List.of()), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment Type: SIRNA_HCS +// "export-experiment-type-filtered-attributes-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT_TYPE, new EntityTypePermId("SIRNA_HCS", EntityKind.EXPERIMENT))), +// new SelectedFields(List.of(DESCRIPTION, CODE, MODIFICATION_DATE), List.of()), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Dataset Type: HCS_IMAGE +// "export-data-set-type-filtered-attributes-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.DATASET_TYPE, new EntityTypePermId("HCS_IMAGE", EntityKind.DATA_SET))), +// new SelectedFields(List.of(CODE, DISALLOW_DELETION, DESCRIPTION), List.of()), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, // { -// // Sample: /MP:A03 -// "export-sample-contained-html.zip", +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-plain-text-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. +// new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-rich-text-xlsx.zip", +// EnumSet.of(ExportFormat.XLSX), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. +// new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), +// XlsTextFormat.RICH, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// +// // HTML: All fields +// { +// // Space: TEST-SPACE +// "export-space-html.zip", // EnumSet.of(ExportFormat.HTML), -// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-653"))), +// List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Project: TEST-PROJECT +// "export-project-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment: EXP-SPACE-TEST +// "export-experiment-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /MP +// "export-sample-shared-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-652"))), // new AllFields(), // XlsTextFormat.RICH, // true, // withReferredTypes // false // withImportCompatibility // }, - { - // Data set: "ROOT_CONTAINER" - "export-data-set-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("ROOT_CONTAINER"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - - // HTML: Selected fields - { - // Space: TEST-SPACE - "export-space-filtered-fields-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), - new SelectedFields(List.of(CODE, PERM_ID, MODIFICATION_DATE), List.of()), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Project: TEST-PROJECT - "export-project-filtered-fields-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), - new SelectedFields(List.of(PERM_ID, IDENTIFIER, REGISTRATOR, REGISTRATION_DATE), List.of()), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment: EXP-SPACE-TEST - "export-experiment-filtered-fields-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), - new SelectedFields(List.of(CODE, PARENTS, CHILDREN, REGISTRATOR, REGISTRATION_DATE), - List.of(new PropertyTypePermId("DESCRIPTION"))), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-filtered-fields-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), - new SelectedFields( - List.of(CODE, PARENTS, CHILDREN, MODIFIER, MODIFICATION_DATE), - List.of(new PropertyTypePermId("BACTERIUM"), new PropertyTypePermId("COMMENT"), new PropertyTypePermId("ORGANISM"))), - XlsTextFormat.PLAIN, - false, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-plain-text-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. - new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-rich-text-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. - new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-with-image-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. - new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_WITH_IMAGE_PROPERTY_NAME))), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-with-spreadsheet-html.zip", - EnumSet.of(ExportFormat.HTML), - List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. - new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_WITH_SPREADSHEET_PROPERTY_NAME))), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, +//// { +//// // Sample: /MP:A03 +//// "export-sample-contained-html.zip", +//// EnumSet.of(ExportFormat.HTML), +//// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-653"))), +//// new AllFields(), +//// XlsTextFormat.RICH, +//// true, // withReferredTypes +//// false // withImportCompatibility +//// }, +// { +// // Data set: "ROOT_CONTAINER" +// "export-data-set-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("ROOT_CONTAINER"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// +// // HTML: Selected fields +// { +// // Space: TEST-SPACE +// "export-space-filtered-fields-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), +// new SelectedFields(List.of(CODE, PERM_ID, MODIFICATION_DATE), List.of()), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Project: TEST-PROJECT +// "export-project-filtered-fields-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), +// new SelectedFields(List.of(PERM_ID, IDENTIFIER, REGISTRATOR, REGISTRATION_DATE), List.of()), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment: EXP-SPACE-TEST +// "export-experiment-filtered-fields-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), +// new SelectedFields(List.of(CODE, PARENTS, CHILDREN, REGISTRATOR, REGISTRATION_DATE), +// List.of(new PropertyTypePermId("DESCRIPTION"))), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-filtered-fields-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), +// new SelectedFields( +// List.of(CODE, PARENTS, CHILDREN, MODIFIER, MODIFICATION_DATE), +// List.of(new PropertyTypePermId("BACTERIUM"), new PropertyTypePermId("COMMENT"), new PropertyTypePermId("ORGANISM"))), +// XlsTextFormat.PLAIN, +// false, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-plain-text-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. +// new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-rich-text-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. +// new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_PROPERTY_NAME))), +// XlsTextFormat.RICH, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-with-image-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. +// new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_WITH_IMAGE_PROPERTY_NAME))), +// XlsTextFormat.RICH, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-with-spreadsheet-html.zip", +// EnumSet.of(ExportFormat.HTML), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, null)), // null perm ID indicates that the newly created value in the setup of the test should be used. +// new SelectedFields(List.of(IDENTIFIER, CODE), List.of(new PropertyTypePermId(RICH_TEXT_WITH_SPREADSHEET_PROPERTY_NAME))), +// XlsTextFormat.RICH, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// +// // PDF: All fields +// { +// // Space: TEST-SPACE +// "export-space-pdf.zip", +// EnumSet.of(ExportFormat.PDF), +// List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Project: TEST-PROJECT +// "export-project-pdf.zip", +// EnumSet.of(ExportFormat.PDF), +// List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Experiment: EXP-SPACE-TEST +// "export-experiment-pdf.zip", +// EnumSet.of(ExportFormat.PDF), +// List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST +// "export-sample-pdf.zip", +// EnumSet.of(ExportFormat.PDF), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Sample: /MP +// "export-sample-shared-pdf.zip", +// EnumSet.of(ExportFormat.PDF), +// List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-652"))), +// new AllFields(), +// XlsTextFormat.RICH, +// true, // withReferredTypes +// false // withImportCompatibility +// }, +// { +// // Data set: "ROOT_CONTAINER" +// "export-data-set-pdf.zip", +// EnumSet.of(ExportFormat.PDF), +// List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("ROOT_CONTAINER"))), +// new AllFields(), +// XlsTextFormat.PLAIN, +// true, // withReferredTypes +// false // withImportCompatibility +// }, - // PDF: All fields - { - // Space: TEST-SPACE - "export-space-pdf.zip", - EnumSet.of(ExportFormat.PDF), - List.of(new ExportablePermId(ExportableKind.SPACE, new SpacePermId("TEST-SPACE"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Project: TEST-PROJECT - "export-project-pdf.zip", - EnumSet.of(ExportFormat.PDF), - List.of(new ExportablePermId(ExportableKind.PROJECT, new ProjectPermId("20120814110011738-105"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Experiment: EXP-SPACE-TEST - "export-experiment-pdf.zip", - EnumSet.of(ExportFormat.PDF), - List.of(new ExportablePermId(ExportableKind.EXPERIMENT, new ExperimentPermId("201206190940555-1032"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /TEST-SPACE/TEST-PROJECT/FV-TEST - "export-sample-pdf.zip", - EnumSet.of(ExportFormat.PDF), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("201206191219327-1054"))), - new AllFields(), - XlsTextFormat.PLAIN, - true, // withReferredTypes - false // withImportCompatibility - }, - { - // Sample: /MP - "export-sample-shared-pdf.zip", - EnumSet.of(ExportFormat.PDF), - List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200811050947161-652"))), - new AllFields(), - XlsTextFormat.RICH, - true, // withReferredTypes - false // withImportCompatibility - }, + // Data { - // Data set: "ROOT_CONTAINER" - "export-data-set-pdf.zip", - EnumSet.of(ExportFormat.PDF), - List.of(new ExportablePermId(ExportableKind.DATASET, new DataSetPermId("ROOT_CONTAINER"))), + // Sample: /CISD/NEMO/CP-TEST-3 + "export-data.zip", + EnumSet.of(ExportFormat.DATA), + List.of(new ExportablePermId(ExportableKind.SAMPLE, new SamplePermId("200902091225616-1027"))), new AllFields(), XlsTextFormat.PLAIN, true, // withReferredTypes diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportTest.java b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportTest.java index cc7e0da1f582d693c5d3566ec2daac91395e5b0c..73a564caca5757c4bb09d0aa9624098bdf822e30 100644 --- a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportTest.java +++ b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExportTest.java @@ -41,6 +41,7 @@ import java.io.InputStreamReader; import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; @@ -85,6 +86,11 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SamplePermId; import ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.SpacePermId; import ch.ethz.sis.openbis.generic.server.xls.export.XLSExportTest; import ch.systemsx.cisd.common.spring.ExposablePropertyPlaceholderConfigurer; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ReportingPluginType; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataSourceDefinition; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServerInfo; +import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions; public class ExportTest extends AbstractTest { @@ -104,6 +110,12 @@ public class ExportTest extends AbstractTest private static final String JAVA_FOLDER_PATH = "./sourceTest/java/"; + private static final String DOWNLOAD_URL = "blabla"; + + private static final String SESSION_TOKEN = "123"; + + private static final String DATASTORE_CODE = "ABC"; + protected String sessionToken; private PropertyTypePermId richTextPropertyTypePermId; @@ -185,9 +197,31 @@ public class ExportTest extends AbstractTest samplePermId = v3api.createSamples(sessionToken, List.of(richTextSampleCreation)).get(0); + // TODO: mock DSS or start an actual one. + registerDss(); + v3api.logout(sessionToken); } + private void registerDss() + { + final DataStoreServerInfo dataStoreServerInfo = new DataStoreServerInfo(); + dataStoreServerInfo.setDataStoreCode(DATASTORE_CODE); + dataStoreServerInfo.setSessionToken(SESSION_TOKEN); + dataStoreServerInfo.setDownloadUrl(DOWNLOAD_URL); + final DatastoreServiceDescription r1 = + DatastoreServiceDescription.reporting("R1", "r1", new String[] + { "H.*", "UNKNOWN" }, DATASTORE_CODE, ReportingPluginType.TABLE_MODEL); + final DatastoreServiceDescription p1 = + DatastoreServiceDescription.processing("P1", "p1", new String[] + { "H.*", "C.*" }, DATASTORE_CODE); + dataStoreServerInfo.setServicesDescriptions(new DatastoreServiceDescriptions(Arrays + .asList(r1), Arrays.asList(p1))); + dataStoreServerInfo.setDataSourceDefinitions(Arrays.<DataSourceDefinition> asList()); + + etlService.registerDataStoreServer(systemSessionToken, dataStoreServerInfo); + } + @AfterClass public void afterClass() {