From 307d8f9fe5710ea23d190fbacc191c1a5823c94c Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 22 Mar 2018 15:52:45 +0000 Subject: [PATCH] Fixed Category to support DMPoolManager git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@165352 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/StatAlgoImporterServiceImpl.java | 2 +- .../server/poolmanager/DataMinerPoolManager.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/StatAlgoImporterServiceImpl.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/StatAlgoImporterServiceImpl.java index 52fcd40..33b7fd4 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/StatAlgoImporterServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/StatAlgoImporterServiceImpl.java @@ -731,7 +731,7 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements logger.info("Deploy On PoolManager"); logger.debug("CodeJarAdminCopy for PoolManager: " + deploySave.getCodeJarAdminCopy()); DataMinerPoolManager poolManager = new DataMinerPoolManager(serviceCredentials); - String operationId = poolManager.deployAlgorithm(deploySave.getInfoData(), + String operationId = poolManager.deployAlgorithm(project, deploySave.getInfoData(), deploySave.getCodeJarAdminCopy()); logger.info("Deploy operationId: " + operationId); return operationId; diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/poolmanager/DataMinerPoolManager.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/poolmanager/DataMinerPoolManager.java index 7f81aa6..bda20fc 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/poolmanager/DataMinerPoolManager.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/poolmanager/DataMinerPoolManager.java @@ -12,6 +12,7 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.server.is.Informati import org.gcube.portlets.user.statisticalalgorithmsimporter.server.util.ServiceCredentials; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.info.InfoData; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,9 +33,9 @@ public class DataMinerPoolManager { serverUrl = InformationSystemUtils.retrieveDataMinerPoolManager(serviceCredentials.getScope()); } - public String deployAlgorithm(InfoData infoData, ItemDescription codeJarAdminCopy) + public String deployAlgorithm(Project project, InfoData infoData, ItemDescription codeJarAdminCopy) throws StatAlgoImporterServiceException { - String operationId = sendRequest(infoData, codeJarAdminCopy); + String operationId = sendRequest(project, infoData, codeJarAdminCopy); return operationId; } @@ -53,7 +54,7 @@ public class DataMinerPoolManager { return deployStatus; } - private String sendRequest(InfoData infoData, ItemDescription codeJarAdminCopy) + private String sendRequest(Project project, InfoData infoData, ItemDescription codeJarAdminCopy) throws StatAlgoImporterServiceException { logger.info("Send request to DataMinerPoolManager: " + serverUrl); /* @@ -68,7 +69,8 @@ public class DataMinerPoolManager { try { String requestUrl = serverUrl + "/algorithm/stage?gcube-token=" + serviceCredentials.getToken() + "&algorithmPackageURL=" + codeJarAdminCopy.getPublicLink() + "&algorithm_type=transducerers" - + "&category=" + infoData.getAlgorithmCategory() + "&targetVRE=" + serviceCredentials.getScope(); + + "&category=" + project.getInputData().getProjectInfo().getAlgorithmCategory() + "&targetVRE=" + + serviceCredentials.getScope(); logger.debug("DataMinerPoolManager request=" + requestUrl); // String authString = user + ":" + password;