From 002677abf898fac2e195a080d5fa6a7a692c54ff Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Mon, 22 Oct 2012 09:11:21 +0000
Subject: [PATCH] Renamed json_encoded_list to json_encoded_value

SVN: 27266
---
 .../ipad-read-service-v1/ipad_read.py            | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py b/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py
index 160a59efd64..7e109f6deb1 100644
--- a/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py
+++ b/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py
@@ -6,7 +6,7 @@ from com.fasterxml.jackson.databind import ObjectMapper
 # BEGIN Infrastructure
 #
 
-def json_encoded_list(coll):
+def json_encoded_value(coll):
 	"""Utility function for converting a list into a json-encoded list"""
 	return ObjectMapper().writeValueAsString(coll)
 
@@ -87,7 +87,7 @@ class RequestHandler:
 		for entry in entities:
 			self.add_row(entry)
 
-	def json_encoded_list(self, coll):
+	def json_encoded_value(self, coll):
 		return ObjectMapper().writeValueAsString(coll)
 
 	def process_request(self):
@@ -122,7 +122,7 @@ def material_to_dict(material):
 	refcon = {}
 	refcon['entityKind'] = 'MATERIAL'
 	refcon['entityType'] = material.getMaterialType()
-	material_dict['REFCON'] = json_encoded_list(refcon)
+	material_dict['REFCON'] = json_encoded_value(refcon)
 	material_dict['CATEGORY'] = material.getMaterialType()
 	if material.getMaterialType() == '5HT_COMPOUND':
 		material_dict['SUMMARY'] = material.getPropertyValue("FORMULA")
@@ -131,11 +131,11 @@ def material_to_dict(material):
 		material_dict['SUMMARY'] = material.getPropertyValue("DESC")
 		material_dict['IMAGE_URL'] = ""
 
-	material_dict['CHILDREN'] = json_encoded_list([])
+	material_dict['CHILDREN'] = json_encoded_value([])
 
 	prop_names = ["NAME", "PROT_NAME", "GENE_NAME", "LENGTH", "CHEMBL", "DESC", "FORMULA", "WEIGHT", "SMILES"]
 	properties = dict((name, material.getPropertyValue(name)) for name in prop_names if material.getPropertyValue(name) is not None)
-	material_dict['PROPERTIES'] = json_encoded_list(properties)
+	material_dict['PROPERTIES'] = json_encoded_value(properties)
 	return material_dict
 
 def sample_to_dict(five_ht_sample, material_by_perm_id):
@@ -147,17 +147,17 @@ def sample_to_dict(five_ht_sample, material_by_perm_id):
 	refcon = {}
 	refcon['entityKind'] = 'SAMPLE'
 	refcon['entityType'] = five_ht_sample.getSampleType()
-	sample_dict['REFCON'] = json_encoded_list(refcon)
+	sample_dict['REFCON'] = json_encoded_value(refcon)
 	sample_dict['CATEGORY'] = five_ht_sample.getSampleType()
 	compound = material_by_perm_id[five_ht_sample.getPropertyValue("COMPOUND")]
 	sample_dict['IMAGE_URL'] = image_url_for_compound(compound)
 
 	children = [five_ht_sample.getPropertyValue("TARGET"), five_ht_sample.getPropertyValue("COMPOUND")]
-	sample_dict['CHILDREN'] = json_encoded_list(children)
+	sample_dict['CHILDREN'] = json_encoded_value(children)
 
 	prop_names = ["DESC"]
 	properties = dict((name, five_ht_sample.getPropertyValue(name)) for name in prop_names if five_ht_sample.getPropertyValue(name) is not None)
-	sample_dict['PROPERTIES'] = json_encoded_list(properties)
+	sample_dict['PROPERTIES'] = json_encoded_value(properties)
 	# Need to handle the material links as entity links: "TARGET", "COMPOUND"
 	return sample_dict
 
-- 
GitLab