Skip to content
Snippets Groups Projects
Commit d6d947f7 authored by Swen Vermeul's avatar Swen Vermeul
Browse files

SSDM-8316: optional permId param allows to store new phyiscal dataSet with a predefined permId

parent 444533d3
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@ def process(tr, parameters, tableBuilder):
tr.setUserId(userId);
if method == "insertDataSet":
permId = parameters.get("permId");
sampleIdentifier = parameters.get("sampleIdentifier"); #String
experimentIdentifier = parameters.get("experimentIdentifier"); #String
dataSetType = parameters.get("dataSetType"); #String
......@@ -55,7 +56,7 @@ def process(tr, parameters, tableBuilder):
isZipDirectoryUpload = parameters.get("isZipDirectoryUpload"); #String
metadata = parameters.get("properties"); #java.util.LinkedHashMap<String, String> where the key is the name
parentIdentifiers = parameters.get('parentIdentifiers');
isOk, result = insertDataSet(tr, sampleIdentifier, experimentIdentifier, dataSetType, folderName, fileNames, isZipDirectoryUpload, metadata, parentIdentifiers);
isOk, result = insertDataSet(tr, permId, sampleIdentifier, experimentIdentifier, dataSetType, folderName, fileNames, isZipDirectoryUpload, metadata, parentIdentifiers);
if isOk:
tableBuilder.addHeader("STATUS");
......@@ -82,10 +83,14 @@ def getThreadProperties(transaction):
pass
return threadPropertyDict
def insertDataSet(tr, sampleIdentifier, experimentIdentifier, dataSetType, folderName, fileNames, isZipDirectoryUpload, metadata, parentIds):
def insertDataSet(tr, permId, sampleIdentifier, experimentIdentifier, dataSetType, folderName, fileNames, isZipDirectoryUpload, metadata, parentIds):
#Create Dataset
dataSet = tr.createNewDataSet(dataSetType);
#Create Dataset, either with or without a prior defined permId
if permId is not None:
dataSet = tr.createNewDataSet(dataSetType, permId);
else:
dataSet = tr.createNewDataSet(dataSetType);
dataSet.setParentDatasets(parentIds);
if sampleIdentifier is not None:
dataSetSample = tr.getSampleForUpdate(sampleIdentifier);
......
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