From dcdd849e52eecbd96dc4d93668cddc209514d71d Mon Sep 17 00:00:00 2001
From: gakin <gakin>
Date: Thu, 9 Feb 2017 12:53:51 +0000
Subject: [PATCH] SSDM-4709 : OpenbisSync integr. master data script for test

SVN: 37724
---
 .../master_data/initialize-master-data.py     | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 integration-tests/templates/test_openbis_sync/master_data/initialize-master-data.py

diff --git a/integration-tests/templates/test_openbis_sync/master_data/initialize-master-data.py b/integration-tests/templates/test_openbis_sync/master_data/initialize-master-data.py
new file mode 100644
index 00000000000..0f252ad1bd1
--- /dev/null
+++ b/integration-tests/templates/test_openbis_sync/master_data/initialize-master-data.py
@@ -0,0 +1,58 @@
+import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.DataType as DataType
+
+tr = service.transaction()
+
+
+vocabulary_GENDER = tr.getOrCreateNewVocabulary('GENDER')
+vocabulary_GENDER.setDescription('Gender of a biological sample.')
+vocabulary_GENDER.setUrlTemplate(None)
+vocabulary_GENDER.setManagedInternally(False)
+vocabulary_GENDER.setInternalNamespace(False)
+vocabulary_GENDER.setChosenFromList(True)
+
+vocabulary_term_GENDER_MALE = tr.createNewVocabularyTerm('MALE')
+vocabulary_term_GENDER_MALE.setDescription(None)
+vocabulary_term_GENDER_MALE.setLabel('MALE')
+vocabulary_term_GENDER_MALE.setOrdinal(1)
+vocabulary_GENDER.addTerm(vocabulary_term_GENDER_MALE)
+
+vocabulary_term_GENDER_FEMALE = tr.createNewVocabularyTerm('FEMALE')
+vocabulary_term_GENDER_FEMALE.setDescription(None)
+vocabulary_term_GENDER_FEMALE.setLabel('FEMALE')
+vocabulary_term_GENDER_FEMALE.setOrdinal(1)
+vocabulary_GENDER.addTerm(vocabulary_term_GENDER_FEMALE)
+
+vocabulary_INTERNAL = tr.getOrCreateNewVocabulary('NTERNAL')
+vocabulary_INTERNAL.setDescription('Internal vocabulary')
+vocabulary_INTERNAL.setUrlTemplate(None)
+vocabulary_INTERNAL.setManagedInternally(False)
+vocabulary_INTERNAL.setInternalNamespace(True)
+vocabulary_INTERNAL.setChosenFromList(True)
+
+vocabulary_INTERNAL_UNKNOWN = tr.createNewVocabularyTerm('UNKNOWN')
+vocabulary_INTERNAL_UNKNOWN.setDescription(None)
+vocabulary_INTERNAL_UNKNOWN.setLabel('UNKNOWN')
+vocabulary_INTERNAL_UNKNOWN.setOrdinal(1)
+vocabulary_INTERNAL.addTerm(vocabulary_INTERNAL_UNKNOWN)
+
+prop_type_TEST = tr.getOrCreateNewPropertyType('GENDER', DataType.CONTROLLEDVOCABULARY)
+prop_type_TEST.setLabel('Gender')
+prop_type_TEST.setManagedInternally(False)
+prop_type_TEST.setInternalNamespace(False)
+prop_type_TEST.setVocabulary(vocabulary_GENDER)
+
+samp_type_MD_TEST = tr.getOrCreateNewSampleType('MD_TEST')
+samp_type_MD_TEST.setDescription('MD_TEST')
+samp_type_MD_TEST.setListable(True)
+samp_type_MD_TEST.setShowContainer(False)
+samp_type_MD_TEST.setShowParents(False)
+samp_type_MD_TEST.setSubcodeUnique(False)
+samp_type_MD_TEST.setAutoGeneratedCode(False)
+samp_type_MD_TEST.setShowParentMetadata(False)
+samp_type_MD_TEST.setGeneratedCodePrefix('MD')
+
+assignment_samp_type_MD_TEST = tr.assignPropertyType(samp_type_MD_TEST, prop_type_TEST)
+assignment_samp_type_MD_TEST.setMandatory(False)
+assignment_samp_type_MD_TEST.setSection(None)
+assignment_samp_type_MD_TEST.setPositionInForms(1)
+assignment_samp_type_MD_TEST.setShownEdit(True)
\ No newline at end of file
-- 
GitLab