From 9cf3ac2bb839dd2684c9ad1817a0f92eca4caf51 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Tue, 4 Nov 2014 14:47:34 +0000
Subject: [PATCH] SSDM-1078 : PAPER - Provide sensible defaults -
 Implementation

SVN: 32721
---
 .../newbrowser/1/as/initialize-master-data.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py b/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py
index 343e596858e..1e107b4d5bd 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py
+++ b/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py
@@ -18,12 +18,15 @@
 import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.DataType as DataType
 
 ##
-## Help Methods
+## Globals
 ##
 vocabulariesCache = {};
 propertiesCache = {};
 tr = service.transaction()
 
+##
+## API Facade
+##
 def createVocabularyWithTerms(vocabularyCode, terms):
 	vocabulary = tr.createNewVocabulary(vocabularyCode);
 	addTerms(vocabulary, terms);
@@ -77,9 +80,8 @@ def addProperty(entity, propertyCode, section, propertyLabel, dataType, vocabula
 	propertyAssignment.setSection(section);
 
 ##
-## Vocabularies
+## Vocabulary Types
 ##
-
 createVocabularyWithTerms("HOST", [
 										["MOUSE", "mouse"],
 										["RAT", "rat"],
@@ -347,7 +349,6 @@ createVocabularyWithTerms("MACHINE", [
 ##
 ## DataSet Types
 ##
-
 createDataSetTypeWithProperties("ELN_PREVIEW", "PHYSICAL", "ELN Preview image", []);
 
 createDataSetTypeWithProperties("SEQ_FILE", "PHYSICAL", "", [
@@ -391,7 +392,6 @@ createExperimentTypeWithProperties("DEFAULT_EXPERIMENT", "Default Experiment", [
 ##
 ## Sample Types
 ##
-
 createSampleTypeWithProperties("ANTIBODY", "", [
 	["NAME", 				"General", 				"Name", 				DataType.VARCHAR,				None,		"Name"],
 	["HOST", 				"General", 				"Host", 				DataType.CONTROLLEDVOCABULARY,	"HOST", 	"Host used to produce the antibody"],
@@ -408,3 +408,12 @@ createSampleTypeWithProperties("ANTIBODY", "", [
 	["NOTES", 				"Comments", 			"Notes", 				DataType.MULTILINE_VARCHAR,		None, 		"Notes"],
 	["XMLCOMMENTS",			"Comments",				"Comments List",		DataType.XML,					None,		"Several comments can be added by different users"]
 ]);
+
+createSampleTypeWithProperties("CHEMICAL", "", [
+	["NAME", 				"General", 				"Name", 				DataType.MULTILINE_VARCHAR,		None,		"Name"],
+	["SUPPLIER", 			"Supplier and storage", "Supplier", 			DataType.MULTILINE_VARCHAR,		None,		"Supplier of the product"],
+	["ARTICLE_NUMBER", 		"Supplier and storage", "Art. Number",			DataType.MULTILINE_VARCHAR,		None,		"Article number of the product"],
+	["STORAGE", 			"Supplier and storage", "Storage", 				DataType.CONTROLLEDVOCABULARY,	"STORAGE",	"Storage conditions of the product"],
+	["XMLCOMMENTS", 		"Comments", 			"Comments List", 		DataType.VARCHAR,				None,		"Several comments can be added by different users"],
+]);
+
-- 
GitLab