diff --git a/api-openbis-javascript/src/v3/as/dto/exporter/data/ExportablePermId.js b/api-openbis-javascript/src/v3/as/dto/exporter/data/ExportablePermId.js index df6affab0faf7dadc9e7ad9cedf8c80e2e3bd6d6..4a0569dca3d067f42745c9960ed48fb5cf2b4991 100644 --- a/api-openbis-javascript/src/v3/as/dto/exporter/data/ExportablePermId.js +++ b/api-openbis-javascript/src/v3/as/dto/exporter/data/ExportablePermId.js @@ -16,7 +16,9 @@ */ define(["stjs"], function (stjs) { - var ExportablePermId = function() { + var ExportablePermId = function(exportableKind, permId) { + this.exportableKind = exportableKind; + this.permId = permId; } stjs.extend( diff --git a/api-openbis-javascript/src/v3/as/dto/exporter/options/ExportOptions.js b/api-openbis-javascript/src/v3/as/dto/exporter/options/ExportOptions.js index 005f53ddb45bb934b447fbe55375891f8ecefdcd..586119a7948febdeca546ed852b8efd6419d7bff 100644 --- a/api-openbis-javascript/src/v3/as/dto/exporter/options/ExportOptions.js +++ b/api-openbis-javascript/src/v3/as/dto/exporter/options/ExportOptions.js @@ -16,7 +16,11 @@ */ define(["stjs"], function (stjs) { - var ExportOptions = function() { + var ExportOptions = function(formats, xlsTextFormat, withReferredTypes, withImportCompatibility) { + this.formats = formats; + this.xlsTextFormat = xlsTextFormat; + this.withReferredTypes = withReferredTypes; + this.withImportCompatibility = withImportCompatibility; } stjs.extend( 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 6cde131c55f7de9717b4c32cf8d970ef6de31e1a..2627a2e07b82bc0cab21078bd1496f0972ab611d 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 @@ -346,19 +346,6 @@ public class ExportTest extends AbstractTest } } - private static ObjectInputStream objectToStream(final Object object) throws IOException - { - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(baos)) - { - oos.writeObject(object); - } - final byte[] objectBytes = baos.toByteArray(); - - final ByteArrayInputStream bais = new ByteArrayInputStream(objectBytes); - return new ObjectInputStream(bais); - } - /** * Searches for ExportablePermIds with null perm IDs, which should indicate that it should be replaced with {@link #samplePermId}. * diff --git a/test-api-openbis-javascript/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-import-export.js b/test-api-openbis-javascript/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-import-export.js index 2c60f834252345106a39dc061108bad3f453f2ac..e97858ba8cfba7825464ae2a9a6a53358146ad14 100644 --- a/test-api-openbis-javascript/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-import-export.js +++ b/test-api-openbis-javascript/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-import-export.js @@ -151,6 +151,30 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' testAction(c, fAction, fCheck); }); + + QUnit.test("executeExport()", function(assert) { + var c = new common(assert, dtos); + + var fAction = function(facade) { + var exportablePermId = new ExportablePermId( + ExportableKind.SAMPLE, new SamplePermId("200902091225616-1027")); + var exportData = new dtos.ExportData(exportablePermId, + new AllFields()); + + var exportOptions = new dtos.ExportOptions( + [ExportFormat.XLSX, ExportFormat.HTML, ExportFormat.PDF, ExportFormat.DATA], + XlsTextFormat.RICH, true, false); + + return facade.executeExport(exportData, exportOptions); + } + + var fCheck = function(facade, result) { + // Simple smoke test in this case. + c.assertNotNull(result); + } + + testAction(c, fAction, fCheck); + }); } return function() {