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 e88e5d31ea48423c03f27b3c20e5e17bdf52b5aa..d32321f15924d67e45e2d9818878db6456189161 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 @@ -45,7 +45,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Serializable; -import java.net.MalformedURLException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -150,6 +149,7 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.ethz.sis.openbis.generic.server.sharedapi.v3.json.ObjectMapperResource; import ch.ethz.sis.openbis.generic.server.xls.export.ExportableKind; import ch.ethz.sis.openbis.generic.server.xls.export.ExportablePermId; +import ch.ethz.sis.openbis.generic.server.xls.export.FieldType; import ch.ethz.sis.openbis.generic.server.xls.export.XLSExport; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.common.logging.LogCategory; @@ -234,6 +234,8 @@ public class ExportExecutor implements IExportExecutor private static final String KIND_DOCUMENT_PROPERTY_ID = "Kind"; + private static final String TYPE_DOCUMENT_PROPERTY_ID = "Type"; + private static final Logger OPERATION_LOG = LogFactory.getLogger(LogCategory.OPERATION, ExportExecutor.class); /** All characters except the ones we consider safe as a directory name. */ @@ -383,7 +385,7 @@ public class ExportExecutor implements IExportExecutor } zipDirectory(exportWorkspaceDirectoryPathString, targetZipFile); - exportResult = new ExportResult(getDownloadPath(api, sessionToken, zipFileName), warnings); + exportResult = new ExportResult(getDownloadPath(sessionToken, zipFileName), warnings); } else { final Path filePath = file.toPath(); @@ -391,7 +393,7 @@ public class ExportExecutor implements IExportExecutor StandardCopyOption.REPLACE_EXISTING); final String fileName = targetFilePath.getFileName().toString(); - exportResult = new ExportResult(getDownloadPath(api, sessionToken, fileName), warnings); + exportResult = new ExportResult(getDownloadPath(sessionToken, fileName), warnings); } deleteDirectory(exportWorkspaceDirectoryPathString); @@ -399,8 +401,7 @@ public class ExportExecutor implements IExportExecutor return exportResult; } - private String getDownloadPath(final IApplicationServerApi api, final String sessionToken, final String fileName) - throws MalformedURLException + private String getDownloadPath(final String sessionToken, final String fileName) { final String protocolWithDomain = configurer.getResolvedProps().getProperty(DOWNLOAD_URL); if (protocolWithDomain == null || protocolWithDomain.isBlank()) @@ -1074,14 +1075,29 @@ public class ExportExecutor implements IExportExecutor entryBuilder.append('/'); addFullEntityName(entryBuilder, null, experimentCode, experimentName); - if (sampleCode == null && dataSetCode != null) + if (sampleCode == null) { - // Experiment data set - entryBuilder.append('/').append(dataSetCode); + if (dataSetCode != null) + { + // Experiment data set + entryBuilder.append('/').append(dataSetCode); + } else if (extension != null) + { + entryBuilder.append('/'); + addFullEntityName(entryBuilder, null, experimentCode, experimentName); + } } - } else if (sampleCode == null && dataSetCode != null) + } else if (sampleCode == null) { - throw new IllegalArgumentException(); + if (dataSetCode != null) + { + throw new IllegalArgumentException(); + } + + if (extension != null) + { + entryBuilder.append('/').append(projectCode); + } } } else if (experimentCode != null || (dataSetCode != null && sampleCode == null)) { @@ -1100,6 +1116,10 @@ public class ExportExecutor implements IExportExecutor { // Sample data set entryBuilder.append('/').append(dataSetCode); + } else if (extension != null) + { + entryBuilder.append('/'); + addFullEntityName(entryBuilder, containerCode, sampleCode, sampleName); } } @@ -1258,6 +1278,17 @@ public class ExportExecutor implements IExportExecutor } } + private static String getBareEntityName(final IPropertiesHolder entity) + { + try + { + return entity.getStringProperty(NAME_PROPERTY_NAME); + } catch (final NotFetchedException e) + { + return null; + } + } + static String escapeUnsafeCharacters(final String name) { return name != null ? name.replaceAll(UNSAFE_CHARACTERS_REGEXP, "_") : null; @@ -1267,83 +1298,138 @@ public class ExportExecutor implements IExportExecutor final Map<String, List<Map<String, String>>> entityTypeExportFieldsMap) throws IOException { final IApplicationServerInternalApi v3 = CommonServiceProvider.getApplicationServerApi(); - final DocumentBuilder documentBuilder = new DocumentBuilder(); - documentBuilder.addTitle(entityObj.getCode()); - documentBuilder.addHeader("Identification Info"); + final String kindOrType = getKindOrType(entityObj); + final StringBuilder titleStringBuilder = new StringBuilder(); - final IEntityType typeObj; - if (entityObj instanceof Experiment) - { - documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "Experiment"); - final ExperimentTypeSearchCriteria searchCriteria = new ExperimentTypeSearchCriteria(); - searchCriteria.withCode().thatEquals(((Experiment) entityObj).getType().getCode()); - final ExperimentTypeFetchOptions fetchOptions = new ExperimentTypeFetchOptions(); - fetchOptions.withPropertyAssignments().withPropertyType(); - final SearchResult<ExperimentType> results = v3.searchExperimentTypes(sessionToken, searchCriteria, fetchOptions); - typeObj = results.getObjects().get(0); - } else if (entityObj instanceof Sample) - { - documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "Sample"); - final SampleTypeSearchCriteria searchCriteria = new SampleTypeSearchCriteria(); - searchCriteria.withCode().thatEquals(((Sample) entityObj).getType().getCode()); - final SampleTypeFetchOptions fetchOptions = new SampleTypeFetchOptions(); - fetchOptions.withPropertyAssignments().withPropertyType(); - final SearchResult<SampleType> results = v3.searchSampleTypes(sessionToken, searchCriteria, fetchOptions); - typeObj = results.getObjects().get(0); - } else if (entityObj instanceof DataSet) + if (kindOrType != null) { - final DataSet dataSet = (DataSet) entityObj; - documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "DataSet"); - final DataSetTypeSearchCriteria searchCriteria = new DataSetTypeSearchCriteria(); - searchCriteria.withCode().thatEquals(dataSet.getType().getCode()); - final DataSetTypeFetchOptions fetchOptions = new DataSetTypeFetchOptions(); - fetchOptions.withPropertyAssignments().withPropertyType(); - final SearchResult<DataSetType> results = v3.searchDataSetTypes(sessionToken, searchCriteria, fetchOptions); - typeObj = results.getObjects().get(0); - } else - { - typeObj = null; + titleStringBuilder.append(codeToDisplayName(kindOrType)).append(": "); } - if (entityObj instanceof Project) - { - documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "Project"); - } else if (entityObj instanceof Space) + final String bareEntityName = entityObj instanceof IPropertiesHolder ? getBareEntityName((IPropertiesHolder) entityObj) : null; + if (bareEntityName != null) { - documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "Space"); + titleStringBuilder.append(bareEntityName).append(" (").append(entityObj.getCode()).append(")"); } else { - documentBuilder.addProperty("Type", ((IEntityTypeHolder) entityObj).getType().getCode()); + titleStringBuilder.append(entityObj.getCode()); } - final List<Map<String, String>> selectedExportFields; - if (entityTypeExportFieldsMap == null || entityTypeExportFieldsMap.isEmpty()) + documentBuilder.addTitle(titleStringBuilder.toString()); + + final IEntityType typeObj = getEntityType(v3, sessionToken, entityObj); + + final List<Map<String, String>> selectedExportFields = getSelectedExportFields(entityObj, entityTypeExportFieldsMap, typeObj); + final Set<String> selectedExportAttributes = filterFields(selectedExportFields, ATTRIBUTE); + final Set<String> selectedExportProperties = filterFields(selectedExportFields, PROPERTY); + + // Properties + + if (entityObj instanceof IPropertiesHolder && typeObj != null) { - selectedExportFields = null; - } else if (typeObj != null) + final List<PropertyAssignment> propertyAssignments = typeObj.getPropertyAssignments(); + if (propertyAssignments != null) + { + final Map<String, Serializable> properties = ((IPropertiesHolder) entityObj).getProperties(); + for (final PropertyAssignment propertyAssignment : propertyAssignments) + { + System.out.println(selectedExportFields); + + final PropertyType propertyType = propertyAssignment.getPropertyType(); + final String propertyTypeCode = propertyType.getCode(); + final Object rawPropertyValue = properties.get(propertyTypeCode); + + if (rawPropertyValue != null && allowsValue(selectedExportProperties, propertyTypeCode)) + { + final String initialPropertyValue = String.valueOf(rawPropertyValue); + final String propertyValue; + + if (propertyType.getDataType() == DataType.MULTILINE_VARCHAR && + Objects.equals(propertyType.getMetaData().get("custom_widget"), "Word Processor")) + { + final StringBuilder propertyValueBuilder = new StringBuilder(initialPropertyValue); + final Document doc = Jsoup.parse(initialPropertyValue); + final Elements imageElements = doc.select("img"); + for (final Element imageElement : imageElements) + { + final String imageSrc = imageElement.attr("src"); + replaceAll(propertyValueBuilder, imageSrc, encodeImageContentToString(imageSrc)); + } + propertyValue = propertyValueBuilder.toString(); + } else if (propertyType.getDataType() == DataType.XML + && Objects.equals(propertyType.getMetaData().get("custom_widget"), "Spreadsheet") + && initialPropertyValue.toUpperCase().startsWith(DATA_TAG_START) && initialPropertyValue.toUpperCase() + .endsWith(DATA_TAG_END)) + { + final String subString = initialPropertyValue.substring(DATA_TAG_START_LENGTH, + initialPropertyValue.length() - DATA_TAG_END_LENGTH); + final String decodedString = new String(Base64.getDecoder().decode(subString), StandardCharsets.UTF_8); + final ObjectMapper objectMapper = new ObjectMapper(); + final JsonNode jsonNode = objectMapper.readTree(decodedString); + propertyValue = convertJsonToHtml(jsonNode); + } else + { + propertyValue = initialPropertyValue; + } + + if (!Objects.equals(propertyValue, "\uFFFD(undefined)")) + { + documentBuilder.addProperty(propertyType.getLabel(), propertyValue); + } + } + } + } + } + + // Parents / Children + + if (entityObj instanceof IParentChildrenHolder<?>) { - selectedExportFields = entityTypeExportFieldsMap.get(typeObj.getCode()); - } else if (entityObj instanceof Space) + final IParentChildrenHolder<?> parentChildrenHolder = (IParentChildrenHolder<?>) entityObj; + if (allowsValue(selectedExportAttributes, Attribute.PARENTS.name())) + { + documentBuilder.addHeader("Parents"); + final List<?> parents = parentChildrenHolder.getParents(); + for (final Object parent : parents) + { + final String relCodeName = ((ICodeHolder) parent).getCode(); + final String name = getEntityName((IPropertiesHolder) parent); + documentBuilder.addParagraph(relCodeName + (name != null ? " (" + name + ")" : "")); + } + } + + if (allowsValue(selectedExportAttributes, Attribute.CHILDREN.name())) + { + documentBuilder.addHeader("Children"); + final List<?> children = parentChildrenHolder.getChildren(); + for (final Object child : children) + { + final String relCodeName = ((ICodeHolder) child).getCode(); + final String name = getEntityName((IPropertiesHolder) child); + documentBuilder.addParagraph(relCodeName + (name != null ? " (" + name + ")" : "")); + } + } + } + + // Identification Info + + documentBuilder.addHeader("Identification Info"); + + if (entityObj instanceof Experiment) { - selectedExportFields = entityTypeExportFieldsMap.get(SPACE.name()); - } else if (entityObj instanceof Project) + documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "Experiment"); + } else if (entityObj instanceof Sample) { - selectedExportFields = entityTypeExportFieldsMap.get(PROJECT.name()); - } else + documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "Sample"); + } else if (entityObj instanceof DataSet) { - selectedExportFields = null; + documentBuilder.addProperty(KIND_DOCUMENT_PROPERTY_ID, "DataSet"); } - final Set<String> selectedExportAttributes = selectedExportFields != null - ? selectedExportFields.stream().filter(map -> Objects.equals(map.get(FIELD_TYPE_KEY), ATTRIBUTE.name())) - .map(map -> map.get(FIELD_ID_KEY)).collect(Collectors.toSet()) - : null; - - final Set<String> selectedExportProperties = selectedExportFields != null - ? selectedExportFields.stream().filter(map -> Objects.equals(map.get(FIELD_TYPE_KEY), PROPERTY.name())) - .map(map -> map.get(FIELD_ID_KEY)).collect(Collectors.toSet()) - : null; + documentBuilder.addProperty(entityObj instanceof Project || entityObj instanceof Space + ? KIND_DOCUMENT_PROPERTY_ID : TYPE_DOCUMENT_PROPERTY_ID, + kindOrType); if (allowsValue(selectedExportAttributes, Attribute.CODE.name())) { @@ -1410,97 +1496,95 @@ public class ExportExecutor implements IExportExecutor } } - if (entityObj instanceof IParentChildrenHolder<?>) - { - final IParentChildrenHolder<?> parentChildrenHolder = (IParentChildrenHolder<?>) entityObj; - if (allowsValue(selectedExportAttributes, Attribute.PARENTS.name())) - { - documentBuilder.addHeader("Parents"); - final List<?> parents = parentChildrenHolder.getParents(); - for (final Object parent : parents) - { - final String relCodeName = ((ICodeHolder) parent).getCode(); - final Map<String, Serializable> properties = ((IPropertiesHolder) parent).getProperties(); - final String name = getEntityName((IPropertiesHolder) parent); - documentBuilder.addParagraph(relCodeName + (name != null ? " (" + properties.get("NAME") + ")" : "")); - } - } + return documentBuilder.getHtml(); + } - if (allowsValue(selectedExportAttributes, Attribute.CHILDREN.name())) - { - documentBuilder.addHeader("Children"); - final List<?> children = parentChildrenHolder.getChildren(); - for (final Object child : children) - { - final String relCodeName = ((ICodeHolder) child).getCode(); - final Map<String, Serializable> properties = ((IPropertiesHolder) child).getProperties(); - final String name = getEntityName((IPropertiesHolder) child); - documentBuilder.addParagraph(relCodeName + (name != null ? " (" + properties.get("NAME") + ")" : "")); - } - } + private static IEntityType getEntityType(final IApplicationServerInternalApi v3, final String sessionToken, final ICodeHolder entityObj) + { + if (entityObj instanceof Experiment) + { + final ExperimentTypeSearchCriteria searchCriteria = new ExperimentTypeSearchCriteria(); + searchCriteria.withCode().thatEquals(((Experiment) entityObj).getType().getCode()); + final ExperimentTypeFetchOptions fetchOptions = new ExperimentTypeFetchOptions(); + fetchOptions.withPropertyAssignments().withPropertyType(); + final SearchResult<ExperimentType> results = v3.searchExperimentTypes(sessionToken, searchCriteria, fetchOptions); + return results.getObjects().get(0); + } else if (entityObj instanceof Sample) + { + final SampleTypeSearchCriteria searchCriteria = new SampleTypeSearchCriteria(); + searchCriteria.withCode().thatEquals(((Sample) entityObj).getType().getCode()); + final SampleTypeFetchOptions fetchOptions = new SampleTypeFetchOptions(); + fetchOptions.withPropertyAssignments().withPropertyType(); + final SearchResult<SampleType> results = v3.searchSampleTypes(sessionToken, searchCriteria, fetchOptions); + return results.getObjects().get(0); + } else if (entityObj instanceof DataSet) + { + final DataSetTypeSearchCriteria searchCriteria = new DataSetTypeSearchCriteria(); + searchCriteria.withCode().thatEquals(((DataSet) entityObj).getType().getCode()); + final DataSetTypeFetchOptions fetchOptions = new DataSetTypeFetchOptions(); + fetchOptions.withPropertyAssignments().withPropertyType(); + final SearchResult<DataSetType> results = v3.searchDataSetTypes(sessionToken, searchCriteria, fetchOptions); + return results.getObjects().get(0); + } else + { + return null; } + } - if (entityObj instanceof IPropertiesHolder) - { - documentBuilder.addHeader("Properties"); - if (typeObj != null) - { - final List<PropertyAssignment> propertyAssignments = typeObj.getPropertyAssignments(); - if (propertyAssignments != null) - { - final Map<String, Serializable> properties = ((IPropertiesHolder) entityObj).getProperties(); - for (final PropertyAssignment propertyAssignment : propertyAssignments) - { - System.out.println(selectedExportFields); + private static Set<String> filterFields(final List<Map<String, String>> selectedExportFields, final FieldType fieldType) + { + return selectedExportFields != null + ? selectedExportFields.stream().filter(map -> Objects.equals(map.get(FIELD_TYPE_KEY), fieldType.name())) + .map(map -> map.get(FIELD_ID_KEY)).collect(Collectors.toSet()) + : null; + } - final PropertyType propertyType = propertyAssignment.getPropertyType(); - final String propertyTypeCode = propertyType.getCode(); - final Object rawPropertyValue = properties.get(propertyTypeCode); + private static List<Map<String, String>> getSelectedExportFields(final ICodeHolder entityObj, + final Map<String, List<Map<String, String>>> entityTypeExportFieldsMap, final IEntityType typeObj) + { + if (entityTypeExportFieldsMap == null || entityTypeExportFieldsMap.isEmpty()) + { + return null; + } else if (typeObj != null) + { + return entityTypeExportFieldsMap.get(typeObj.getCode()); + } else if (entityObj instanceof Space) + { + return entityTypeExportFieldsMap.get(SPACE.name()); + } else if (entityObj instanceof Project) + { + return entityTypeExportFieldsMap.get(PROJECT.name()); + } else + { + return null; + } + } - if (rawPropertyValue != null && allowsValue(selectedExportProperties, propertyTypeCode)) - { - final String initialPropertyValue = String.valueOf(rawPropertyValue); - final String propertyValue; + private static String getKindOrType(final Object entity) + { + if (entity instanceof Project) + { + return "Project"; + } else if (entity instanceof Space) + { + return "Space"; + } else + { + return entity instanceof IEntityTypeHolder ? ((IEntityTypeHolder) entity).getType().getCode() : null; + } + } - if (propertyType.getDataType() == DataType.MULTILINE_VARCHAR && - Objects.equals(propertyType.getMetaData().get("custom_widget"), "Word Processor")) - { - final StringBuilder propertyValueBuilder = new StringBuilder(initialPropertyValue); - final Document doc = Jsoup.parse(initialPropertyValue); - final Elements imageElements = doc.select("img"); - for (final Element imageElement : imageElements) - { - final String imageSrc = imageElement.attr("src"); - replaceAll(propertyValueBuilder, imageSrc, encodeImageContentToString(imageSrc)); - } - propertyValue = propertyValueBuilder.toString(); - } else if (propertyType.getDataType() == DataType.XML - && Objects.equals(propertyType.getMetaData().get("custom_widget"), "Spreadsheet") - && initialPropertyValue.toUpperCase().startsWith(DATA_TAG_START) && initialPropertyValue.toUpperCase() - .endsWith(DATA_TAG_END)) - { - final String subString = initialPropertyValue.substring(DATA_TAG_START_LENGTH, - initialPropertyValue.length() - DATA_TAG_END_LENGTH); - final String decodedString = new String(Base64.getDecoder().decode(subString), StandardCharsets.UTF_8); - final ObjectMapper objectMapper = new ObjectMapper(); - final JsonNode jsonNode = objectMapper.readTree(decodedString); - propertyValue = convertJsonToHtml(jsonNode); - } else - { - propertyValue = initialPropertyValue; - } + private static String codeToDisplayName(final String code) + { + return Arrays.stream(code.toLowerCase().split("_")).map(ExportExecutor::capitalizeFirstLetter).collect(Collectors.joining(" ")); + } - if (!Objects.equals(propertyValue, "\uFFFD(undefined)")) - { - documentBuilder.addProperty(propertyType.getLabel(), propertyValue); - } - } - } - } - } + private static String capitalizeFirstLetter(final String str) { + if (str.isEmpty()) + { + return str; } - - return documentBuilder.getHtml(); + return str.substring(0, 1).toUpperCase() + str.substring(1); } private String encodeImageContentToString(final String imageSrc) throws IOException diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutorTest.java b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutorTest.java index 016aa4035fe826207d11760de9d4f14c8a38ca02..2c146fb43f00c9366df17e2c787d62ed8efcecad 100644 --- a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutorTest.java +++ b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/exporter/ExportExecutorTest.java @@ -67,7 +67,7 @@ public class ExportExecutorTest }, { SPACE_CODE, null, null, null, null, SAMPLE_CODE, null, null, EXTENSION, - String.format("%s/%s%s", SPACE_CODE, SAMPLE_CODE, EXTENSION) + String.format("%s/%s/%s%s", SPACE_CODE, SAMPLE_CODE, SAMPLE_CODE, EXTENSION) }, { SPACE_CODE, null, null, null, null, SAMPLE_CODE, SAMPLE_NAME, null, null, @@ -75,7 +75,7 @@ public class ExportExecutorTest }, { SPACE_CODE, null, null, null, null, SAMPLE_CODE, SAMPLE_NAME, null, EXTENSION, - String.format("%s/%s (%s)%s", SPACE_CODE, SAMPLE_NAME, SAMPLE_CODE, EXTENSION) + String.format("%s/%s (%s)/%s (%s)%s", SPACE_CODE, SAMPLE_NAME, SAMPLE_CODE, SAMPLE_NAME, SAMPLE_CODE, EXTENSION) }, { SPACE_CODE, null, null, null, null, SAMPLE_CODE, null, DATA_SET_CODE, null, @@ -99,7 +99,7 @@ public class ExportExecutorTest }, { SPACE_CODE, PROJECT_CODE, null, null, null, null, null, null, EXTENSION, - String.format("%s/%s%s", SPACE_CODE, PROJECT_CODE, EXTENSION) + String.format("%s/%s/%s%s", SPACE_CODE, PROJECT_CODE, PROJECT_CODE, EXTENSION) }, { SPACE_CODE, PROJECT_CODE, null, null, null, SAMPLE_CODE, SAMPLE_NAME, null, null, @@ -107,7 +107,8 @@ public class ExportExecutorTest }, { SPACE_CODE, PROJECT_CODE, null, null, null, SAMPLE_CODE, SAMPLE_NAME, null, EXTENSION, - String.format("%s/%s/%s (%s)%s", SPACE_CODE, PROJECT_CODE, SAMPLE_NAME, SAMPLE_CODE, EXTENSION) + String.format("%s/%s/%s (%s)/%s (%s)%s", SPACE_CODE, PROJECT_CODE, SAMPLE_NAME, SAMPLE_CODE, SAMPLE_NAME, SAMPLE_CODE, + EXTENSION) }, { SPACE_CODE, PROJECT_CODE, null, null, null, SAMPLE_CODE, null, null, null, @@ -115,7 +116,7 @@ public class ExportExecutorTest }, { SPACE_CODE, PROJECT_CODE, null, null, null, SAMPLE_CODE, null, null, EXTENSION, - String.format("%s/%s/%s%s", SPACE_CODE, PROJECT_CODE, SAMPLE_CODE, EXTENSION) + String.format("%s/%s/%s/%s%s", SPACE_CODE, PROJECT_CODE, SAMPLE_CODE, SAMPLE_CODE, EXTENSION) }, { SPACE_CODE, PROJECT_CODE, null, null, null, SAMPLE_CODE, SAMPLE_NAME, DATA_SET_CODE, null, @@ -140,7 +141,7 @@ public class ExportExecutorTest }, { SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, null, null, null, null, null, EXTENSION, - String.format("%s/%s/%s%s", SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXTENSION) + String.format("%s/%s/%s/%s%s", SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXPERIMENT_CODE, EXTENSION) }, { SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXPERIMENT_NAME, null, null, null, null, null, @@ -148,7 +149,8 @@ public class ExportExecutorTest }, { SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXPERIMENT_NAME, null, null, null, null, EXTENSION, - String.format("%s/%s/%s (%s)%s", SPACE_CODE, PROJECT_CODE, EXPERIMENT_NAME, EXPERIMENT_CODE, EXTENSION) + String.format("%s/%s/%s (%s)/%s (%s)%s", SPACE_CODE, PROJECT_CODE, EXPERIMENT_NAME, EXPERIMENT_CODE, + EXPERIMENT_NAME, EXPERIMENT_CODE, EXTENSION) }, { SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXPERIMENT_NAME, null, null, null, DATA_SET_CODE, null, @@ -166,8 +168,8 @@ public class ExportExecutorTest }, { SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXPERIMENT_NAME, null, SAMPLE_CODE, SAMPLE_NAME, null, EXTENSION, - String.format("%s/%s/%s (%s)/%s (%s)%s", SPACE_CODE, PROJECT_CODE, EXPERIMENT_NAME, EXPERIMENT_CODE, - SAMPLE_NAME, SAMPLE_CODE, EXTENSION) + String.format("%s/%s/%s (%s)/%s (%s)/%s (%s)%s", SPACE_CODE, PROJECT_CODE, EXPERIMENT_NAME, EXPERIMENT_CODE, + SAMPLE_NAME, SAMPLE_CODE, SAMPLE_NAME, SAMPLE_CODE, EXTENSION) }, { SPACE_CODE, PROJECT_CODE, EXPERIMENT_CODE, EXPERIMENT_NAME, null, SAMPLE_CODE, SAMPLE_NAME, DATA_SET_CODE, null, @@ -189,11 +191,11 @@ public class ExportExecutorTest }, { null, null, null, null, null, SAMPLE_CODE, null, null, EXTENSION, - String.format("%s%s", SAMPLE_CODE, EXTENSION) + String.format("%s/%s%s", SAMPLE_CODE, SAMPLE_CODE, EXTENSION) }, { null, null, null, null, null, SAMPLE_CODE, SAMPLE_NAME, null, EXTENSION, - String.format("%s (%s)%s", SAMPLE_NAME, SAMPLE_CODE, EXTENSION) + String.format("%s (%s)/%s (%s)%s", SAMPLE_NAME, SAMPLE_CODE, SAMPLE_NAME, SAMPLE_CODE, EXTENSION) }, }; diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/TEST-SPACE.html b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/TEST-SPACE.html index bb8eb9faa3a66e004ca63f6a42a6040539e0f18e..5dff6517376b0914fc1eb354f65284e0133302a1 100644 --- a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/TEST-SPACE.html +++ b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/TEST-SPACE.html @@ -2,7 +2,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> - <h1>TEST-SPACE</h1> + <h1>Space: TEST-SPACE</h1> <h2>Identification Info</h2> <p><b>Kind: </b></p> <p>Space</p> diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-data-set-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-data-set-html.zip index 88bb91f7fb876ed6aecfa0d449c1a5dce2842706..f157b4e4e3c6e55f3d9f459b6048e2cc3abda0e1 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-data-set-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-data-set-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-filtered-fields-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-filtered-fields-html.zip index 8155966ebc63b949ecf163e7f9f118147ea31d95..aec5bdbb1784e13bb90fac03ee566c6fa34c01db 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-filtered-fields-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-filtered-fields-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-html.zip index 39a819d75b01f07af55de21fcfdca71c3ce32ac7..d0f0943d818a1100b234f79f159133eb18a0650f 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-pdf.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-pdf.zip index 267997ec96ccd3f3df76a8dfba8df4b7a8c4c7f1..7c9ff23e6658a99e5f142fb4a5d2af6035e3fc71 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-pdf.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-experiment-pdf.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-filtered-fields-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-filtered-fields-html.zip index f7b9ccb791f8019a236d39c0ecae42fdfa8bb3bc..64178addc6340fa05c1805dae71702baf9ac1527 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-filtered-fields-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-filtered-fields-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-html.zip index 96b3f35341b24573cd1d5f0915a26466830f050a..1f10bfae7e60126c4d5d1bca47eaa069e66ea424 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-pdf.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-pdf.zip index dc53ff1ef3a7e539608ef52f1bbbe77618837e80..d3239e553f2e0b51e94fa9630e63ea6b983e8b37 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-pdf.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-project-pdf.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all-compatible-with-import.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all-compatible-with-import.zip index 7b5daf81244d5855082430752085d2139f6f8784..88a4aa1f6677d34575b9c391bd9137f9537475ce 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all-compatible-with-import.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all-compatible-with-import.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all.zip index 27bf064de2523e8e71de599760955276855c77ad..c33958a7833717a3a7c54ac25fef0946fb7381ac 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-all.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-filtered-fields-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-filtered-fields-html.zip index 3e71569b98c7d0eeda3d1b57e8d0fccf0a4627d4..00909c837eda7bfc0361ffe14be11c04c9433ddd 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-filtered-fields-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-filtered-fields-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-html.zip index d397bb57847bf3eaf8629e82c591dc41e6a6c2b3..943f19aab36ce5774986c1355245b1a9489b1c2e 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-pdf.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-pdf.zip index 1065fbb0a5a29fdb80cf6931513bae7cb11cd469..2e9d78babf9a148b7b752dbf6402ebe72e670e91 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-pdf.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-pdf.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-plain-text-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-plain-text-html.zip index 07bf5660bc1f82a67115c8f5c23512dfaee5c812..c5b5f28ac2d23142ac83064a64e69208a742a3af 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-plain-text-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-plain-text-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-rich-text-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-rich-text-html.zip index 988ef8d034c1071536e80de00d6a026f8533cdf5..eb0d330aec637f03db56809d104decedd01f2ab4 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-rich-text-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-rich-text-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-html.zip index c76342bb9438259a7005d1aaf23c6fcade233a37..4d718d5a695c6d6709e735aad8a212a1b7edd2e2 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-pdf.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-pdf.zip index 06ee930ca42544209afc87f2e5f3ed87980c2115..e70bcdcfffb78cc80f13f8960050912395b3e49c 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-pdf.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-shared-pdf.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-image-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-image-html.zip index ec93b872b55e9afa164ec53b03d1de597a6a1a69..899696211a01dd72e2b21a62901001611aeec47e 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-image-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-image-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-spreadsheet-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-spreadsheet-html.zip index 895a921480f8b7c9f844335092007cf175a4a8f9..364d98a556df164ecf827d9b5f0b9358ee583f06 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-spreadsheet-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-sample-with-spreadsheet-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-filtered-fields-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-filtered-fields-html.zip index 4633bed1615a5c35ac117c184939b66872931f91..eb20692693b15d90ddbe5d44fbca7dbcc56cb433 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-filtered-fields-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-filtered-fields-html.zip differ diff --git a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-html.zip b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-html.zip index 4d6b3c38aee8c7e372cbd2114ded855fae61c89d..647492c5cdada087f8efa01f66ecfc679a4b7ca5 100644 Binary files a/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-html.zip and b/server-application-server/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/test_files/export/export-space-html.zip differ