From ecbf7a137d7d47d1dae22fb19f8089effdc5e803 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 21 Jun 2017 10:01:54 +0000 Subject: [PATCH] ref 8819: Extend The Algorithms Importer to Manage Many Processes as Black Boxes https://support.d4science.org/issues/8819 Updated the support for Processes as Black Boxes git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@150456 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/generator/ProjectBuilder.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java index d4aeee6..686ee98 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java @@ -132,16 +132,19 @@ public class ProjectBuilder { } private void createMainCodeIfRequest() throws StatAlgoImporterServiceException { - if (project.getMainCode() != null && project.getMainCode().getItemDescription() != null) { - ItemDescription mainCodeItemDescription = project.getMainCode().getItemDescription(); - if (mainCodeItemDescription.getId() != null && !mainCodeItemDescription.getId().isEmpty()) { - FilesStorage filesStorage = new FilesStorage(); - filesStorage.deleteItemOnFolder(serviceCredentials.getUserName(), mainCodeItemDescription.getId()); + if (project.getProjectConfig() != null && project.getProjectConfig().getProjectSupport() != null + && project.getProjectConfig().getProjectSupport() instanceof ProjectSupportBlackBox) { + if (project.getMainCode() != null && project.getMainCode().getItemDescription() != null) { + ItemDescription mainCodeItemDescription = project.getMainCode().getItemDescription(); + if (mainCodeItemDescription.getId() != null && !mainCodeItemDescription.getId().isEmpty()) { + FilesStorage filesStorage = new FilesStorage(); + filesStorage.deleteItemOnFolder(serviceCredentials.getUserName(), mainCodeItemDescription.getId()); + } } + MainGenerator mainGenerator = new MainGenerator(); + mainGenerator.createMain(serviceCredentials, project); } - MainGenerator mainGenerator = new MainGenerator(); - mainGenerator.createMain(serviceCredentials, project); } private void repackageProjectPackage() throws StatAlgoImporterServiceException {