From b399e4d537fcf3a25fd7e06a573f94d75a8c7ae9 Mon Sep 17 00:00:00 2001
From: vkovtun <vkovtun@ethz.ch>
Date: Wed, 7 Jun 2023 14:28:04 +0200
Subject: [PATCH] SSDM-13693: Added a few missing fields in export.

---
 .../server/xls/export/helper/XLSDataSetExportHelper.java  | 8 +++++---
 .../src/js/components/common/grid/GridExportOptions.js    | 1 +
 .../html/js/views/ArchivingHelper/ArchivingHelperView.js  | 4 ++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/export/helper/XLSDataSetExportHelper.java b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/export/helper/XLSDataSetExportHelper.java
index 5bdeabb7d58..bf7ba57ec82 100644
--- a/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/export/helper/XLSDataSetExportHelper.java
+++ b/server-application-server/source/java/ch/ethz/sis/openbis/generic/server/xls/export/helper/XLSDataSetExportHelper.java
@@ -19,6 +19,7 @@ import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.ARCHIVING_
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.CHILDREN;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.CODE;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.EXPERIMENT;
+import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.IDENTIFIER;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.MODIFICATION_DATE;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.MODIFIER;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.PARENTS;
@@ -27,6 +28,7 @@ import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.PRESENT_IN
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.REGISTRATION_DATE;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.REGISTRATOR;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.SAMPLE;
+import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.SIZE;
 import static ch.ethz.sis.openbis.generic.server.xls.export.Attribute.STORAGE_CONFIRMATION;
 
 import java.util.Collection;
@@ -35,7 +37,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.function.Function;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 import org.apache.poi.ss.usermodel.Workbook;
 
@@ -121,8 +122,8 @@ public class XLSDataSetExportHelper extends AbstractXLSEntityExportHelper<DataSe
     @Override
     protected Attribute[] getAttributes(final Collection<DataSet> dataSets)
     {
-        return new Attribute[] { PERM_ID, CODE, ARCHIVING_STATUS, PRESENT_IN_ARCHIVE, STORAGE_CONFIRMATION, SAMPLE, EXPERIMENT, PARENTS, CHILDREN,
-                REGISTRATOR, REGISTRATION_DATE, MODIFIER, MODIFICATION_DATE };
+        return new Attribute[] { PERM_ID, CODE, IDENTIFIER, ARCHIVING_STATUS, PRESENT_IN_ARCHIVE, STORAGE_CONFIRMATION, SAMPLE, EXPERIMENT, PARENTS,
+                CHILDREN, REGISTRATOR, REGISTRATION_DATE, MODIFIER, MODIFICATION_DATE, SIZE };
     }
 
     @Override
@@ -154,6 +155,7 @@ public class XLSDataSetExportHelper extends AbstractXLSEntityExportHelper<DataSe
                 final PhysicalData physicalData = dataSet.getPhysicalData();
                 return physicalData != null ? physicalData.getSize().toString() : null;
             }
+            case IDENTIFIER:
             case CODE:
             {
                 return dataSet.getCode();
diff --git a/ui-admin/src/js/components/common/grid/GridExportOptions.js b/ui-admin/src/js/components/common/grid/GridExportOptions.js
index 32921db1514..d742ebd5be2 100644
--- a/ui-admin/src/js/components/common/grid/GridExportOptions.js
+++ b/ui-admin/src/js/components/common/grid/GridExportOptions.js
@@ -68,6 +68,7 @@ export default {
     REGISTRATION_DATE: attribute('REGISTRATION_DATE'),
     REGISTRATOR: attribute('REGISTRATOR'),
     SAMPLE: attribute('SAMPLE'),
+    SIZE: attribute('SIZE'),
     SPACE: attribute('SPACE'),
     STORAGE_CONFIRMATION: attribute('STORAGE_CONFIRMATION'),
     UNIQUE_SUBCODES: attribute('UNIQUE_SUBCODES'),
diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js
index 3d72b653247..7cc6d166544 100644
--- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js
+++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js
@@ -73,13 +73,13 @@ function ArchivingHelperView(archivingHelperController, archivingHelperModel) {
         searchView.additionalColumns = [{
             label : ELNDictionary.Sample,
             property : 'sample',
-            isExportable: false,
+            exportableProperty: DataGridExportOptions.EXPORTABLE_FIELD.SAMPLE,
             sortable : false
         }];
         searchView.additionalLastColumns = [{
             label : "Size",
             property : "size",
-            isExportable : false,
+            exportableProperty: DataGridExportOptions.EXPORTABLE_FIELD.SIZE,
             sortable : false,
             render : function(data, grid) {
                 return PrintUtil.renderNumberOfBytes(data.size);
-- 
GitLab