From a6469f746ac062b263c1bfc695e68a8bc2171aa5 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Mon, 30 Mar 2015 14:16:03 +0000
Subject: [PATCH] SSDM-1648 : Better support for openbis imports (Ongoing
 work).

SVN: 33764
---
 .../newbrowser/html/js/server/ServerFacade.js  |  2 +-
 .../views/SampleTable/SampleTableController.js | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/server/ServerFacade.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/server/ServerFacade.js
index 4363731d9af..8584269f6d8 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/server/ServerFacade.js
+++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/server/ServerFacade.js
@@ -721,7 +721,7 @@ function ServerFacade(openbisServer) {
 		};
 		
 		var localReference = this;
-		this.openbisServer.searchForSamplesWithFetchOptions(sampleCriteria, ["PROPERTIES"], function(data) {
+		this.openbisServer.searchForSamplesWithFetchOptions(sampleCriteria, ["PROPERTIES", "PARENTS"], function(data) {
 			callbackFunction(localReference.getInitializedSamples(data.result));
 		});
 	}
diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js
index 3f70e06ae9c..b899ba345e7 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js
+++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js
@@ -92,6 +92,11 @@ function SampleTableController(parentController, title, experimentIdentifier) {
 				property : 'default_space',
 				isExportable: true,
 				sortable : true
+			}, {
+				label : 'Parents',
+				property : 'parents',
+				isExportable: true,
+				sortable : true
 			}, {
 				label : 'Experiment',
 				property : 'experiment',
@@ -244,6 +249,19 @@ function SampleTableController(parentController, title, experimentIdentifier) {
 						var propertyCode = propertyCodes[pIdx];
 						sampleModel[propertyCode] = sample.properties[propertyCode];
 					}
+					
+					var parents = "";
+					if(sample.parents) {
+						for (var paIdx = 0; paIdx < sample.parents.length; paIdx++) {
+							if(paIdx !== 0) {
+								", ";
+							}
+							parents += sample.parents[paIdx].identifier;
+						}
+					}
+					
+					sampleModel['parents'] = parents;
+					
 					dataList.push(sampleModel);
 				}
 				callback(dataList);
-- 
GitLab