Skip to content
Snippets Groups Projects
Commit a061f0ae authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-7081 : openBIS sync: Support project samples

parent a44afbd7
No related branches found
No related tags found
No related merge requests found
...@@ -340,7 +340,16 @@ public class ResourceListParser ...@@ -340,7 +340,16 @@ public class ResourceListParser
SampleIdentifier sampleIdentifier = SampleIdentifierFactory.parse(sampleIdentifierStr); SampleIdentifier sampleIdentifier = SampleIdentifierFactory.parse(sampleIdentifierStr);
SpaceIdentifier spaceLevel = sampleIdentifier.getSpaceLevel(); SpaceIdentifier spaceLevel = sampleIdentifier.getSpaceLevel();
String originalSpaceCode = spaceLevel.getSpaceCode(); String originalSpaceCode = spaceLevel.getSpaceCode();
return new SampleIdentifier(new SpaceIdentifier(nameTranslator.translate(originalSpaceCode)), sampleIdentifier.getSampleCode()); SpaceIdentifier translatedSpaceIdentifier = new SpaceIdentifier(nameTranslator.translate(originalSpaceCode));
if (sampleIdentifier.isProjectLevel())
{
return new SampleIdentifier(new ProjectIdentifier(translatedSpaceIdentifier, sampleIdentifier.getProjectLevel().getProjectCode()),
sampleIdentifier.getSampleCode());
} else
{
return new SampleIdentifier(translatedSpaceIdentifier, sampleIdentifier.getSampleCode());
}
} }
private ExperimentIdentifier getExperimentIdentifier(String experimentIdentifierStr) private ExperimentIdentifier getExperimentIdentifier(String experimentIdentifierStr)
......
...@@ -500,6 +500,9 @@ class OpenbisController(_Controller): ...@@ -500,6 +500,9 @@ class OpenbisController(_Controller):
def setDssMaxHeapSize(self, maxHeapSize): def setDssMaxHeapSize(self, maxHeapSize):
self._setMaxHeapSize("datastore_server/etc/datastore_server.conf", maxHeapSize) self._setMaxHeapSize("datastore_server/etc/datastore_server.conf", maxHeapSize)
def enableProjectSamples(self):
self.asProperties['project-samples-enabled'] = "true"
def assertFileExist(self, pathRelativeToInstallPath): def assertFileExist(self, pathRelativeToInstallPath):
""" """
Asserts that the specified path (relative to the installation path) exists. Asserts that the specified path (relative to the installation path) exists.
......
...@@ -9,9 +9,9 @@ def process(transaction): ...@@ -9,9 +9,9 @@ def process(transaction):
spaceCode = "SYNC" spaceCode = "SYNC"
p1 = transaction.createNewProject("/%s/P1" % spaceCode) p1 = transaction.createNewProject("/%s/P1" % spaceCode)
exp1 = transaction.createNewExperiment(p1.getProjectIdentifier() + "/E1", "UNKNOWN") exp1 = transaction.createNewExperiment(p1.getProjectIdentifier() + "/E1", "UNKNOWN")
container_smp = transaction.createNewSample("/%s/S1" % spaceCode, "UNKNOWN") container_smp = transaction.createNewSample(p1.getProjectIdentifier() + "/S1", "UNKNOWN")
container_smp.setExperiment(exp1) container_smp.setExperiment(exp1)
component_samp = transaction.createNewSample("/%s/S2" % spaceCode, "UNKNOWN") component_samp = transaction.createNewSample(p1.getProjectIdentifier() + "/S2", "UNKNOWN")
component_samp.setContainer(container_smp) component_samp.setContainer(container_smp)
component_samp.setExperiment(exp1) component_samp.setExperiment(exp1)
......
...@@ -38,6 +38,7 @@ class TestCase(systemtest.testcase.TestCase): ...@@ -38,6 +38,7 @@ class TestCase(systemtest.testcase.TestCase):
'''create data source openbis (openbis1)''' '''create data source openbis (openbis1)'''
self.installOpenbis(instanceName ='openbis1', technologies = ['screening']) self.installOpenbis(instanceName ='openbis1', technologies = ['screening'])
openbis1 = self.createOpenbisController('openbis1') openbis1 = self.createOpenbisController('openbis1')
openbis1.enableProjectSamples()
openbis1.setDummyAuthentication() openbis1.setDummyAuthentication()
openbis1.setDataStoreServerUsername('etlserver1') openbis1.setDataStoreServerUsername('etlserver1')
openbis1.setDataStoreServerProperty("host-address", "https://localhost") openbis1.setDataStoreServerProperty("host-address", "https://localhost")
...@@ -63,6 +64,7 @@ class TestCase(systemtest.testcase.TestCase): ...@@ -63,6 +64,7 @@ class TestCase(systemtest.testcase.TestCase):
'''create harvester openbis (openbis2)''' '''create harvester openbis (openbis2)'''
self.installOpenbis(instanceName ='openbis2', technologies = ['screening', 'proteomics']) self.installOpenbis(instanceName ='openbis2', technologies = ['screening', 'proteomics'])
openbis2 = self.createOpenbisController('openbis2', port = openbis2_port) openbis2 = self.createOpenbisController('openbis2', port = openbis2_port)
openbis2.enableProjectSamples()
openbis2.setDummyAuthentication() openbis2.setDummyAuthentication()
openbis2.setDataStoreServerUsername('etlserver2') openbis2.setDataStoreServerUsername('etlserver2')
openbis2.setDataStoreServerPort(openbis2_dss_port) openbis2.setDataStoreServerPort(openbis2_dss_port)
...@@ -113,6 +115,7 @@ class TestCase(systemtest.testcase.TestCase): ...@@ -113,6 +115,7 @@ class TestCase(systemtest.testcase.TestCase):
openbis2_dss_port = '8446' openbis2_dss_port = '8446'
openbis1=self.createOpenbisController(instanceName = 'openbis1', dropDatabases=False) openbis1=self.createOpenbisController(instanceName = 'openbis1', dropDatabases=False)
openbis1.enableProjectSamples()
openbis1.setDummyAuthentication() openbis1.setDummyAuthentication()
self.installDataSourcePlugin(openbis1, openbis1_dss_port) self.installDataSourcePlugin(openbis1, openbis1_dss_port)
...@@ -133,6 +136,7 @@ class TestCase(systemtest.testcase.TestCase): ...@@ -133,6 +136,7 @@ class TestCase(systemtest.testcase.TestCase):
# openbis1.dropAndWait("ENTITY_REGISTRATION", "openbis-sync-entity-reg") # openbis1.dropAndWait("ENTITY_REGISTRATION", "openbis-sync-entity-reg")
openbis2 = self.createOpenbisController(instanceName = 'openbis2', port = openbis2_port, dropDatabases=False) openbis2 = self.createOpenbisController(instanceName = 'openbis2', port = openbis2_port, dropDatabases=False)
openbis2.enableProjectSamples()
openbis2.setDataStoreServerPort(openbis2_dss_port) openbis2.setDataStoreServerPort(openbis2_dss_port)
openbis2.setOpenbisPortDataStoreServer(openbis2_port) openbis2.setOpenbisPortDataStoreServer(openbis2_port)
openbis2.setDataStoreServerProperty("host-address", "https://localhost") openbis2.setDataStoreServerProperty("host-address", "https://localhost")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment