Skip to content
Snippets Groups Projects
Commit 42921a23 authored by jakubs's avatar jakubs
Browse files

SSDM-3162: fix a problem when javascript uploader was using dss to call dss via apache

SVN: 35656
parent a28ca886
No related branches found
No related tags found
No related merge requests found
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
# #
# IDataSetRegistrationTransactionV2 Class # IDataSetRegistrationTransactionV2 Class
from ch.systemsx.cisd.openbis.dss.client.api.v1 import DssComponentFactory
from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria
from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria import MatchClause, SearchOperator, MatchClauseAttribute from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria import MatchClause, SearchOperator, MatchClauseAttribute
from ch.systemsx.cisd.openbis.dss.generic.shared import ServiceProvider
from org.apache.commons.io import IOUtils from org.apache.commons.io import IOUtils
from java.io import File from java.io import File
...@@ -122,13 +122,14 @@ def insertDataSet(tr, parameters, tableBuilder): ...@@ -122,13 +122,14 @@ def insertDataSet(tr, parameters, tableBuilder):
tempDirFile.mkdirs(); tempDirFile.mkdirs();
#tempDir = System.getProperty("java.io.tmpdir"); #tempDir = System.getProperty("java.io.tmpdir");
dss_component = DssComponentFactory.tryCreate(parameters.get("sessionID"), parameters.get("openBISURL")); session_token = parameters.get("sessionID");
dss_service = ServiceProvider.getDssServiceRpcGeneric().getService();
for fileName in fileNames: for fileName in fileNames:
folderFile = File(tempDir + "/" + folderName); folderFile = File(tempDir + "/" + folderName);
folderFile.mkdir(); folderFile.mkdir();
temFile = File(tempDir + "/" + folderName + "/" + fileName); temFile = File(tempDir + "/" + folderName + "/" + fileName);
inputStream = dss_component.getFileFromSessionWorkspace(fileName); inputStream = dss_service.getFileFromSessionWorkspace(session_token, fileName);
outputStream = FileOutputStream(temFile); outputStream = FileOutputStream(temFile);
IOUtils.copyLarge(inputStream, outputStream); IOUtils.copyLarge(inputStream, outputStream);
IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(inputStream);
...@@ -151,7 +152,7 @@ def insertDataSet(tr, parameters, tableBuilder): ...@@ -151,7 +152,7 @@ def insertDataSet(tr, parameters, tableBuilder):
#Clean Files from workspace #Clean Files from workspace
for fileName in fileNames: for fileName in fileNames:
dss_component.deleteSessionWorkspaceFile(fileName); dss_service.deleteSessionWorkspaceFile(session_token, fileName);
#Return from the call #Return from the call
return True; return True;
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