From 694a96473709e0fb3c5821d5de0e85b51f20a1f5 Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:20:53 +0200 Subject: [PATCH 01/11] Update BoutiquesApplication.java --- .../boutiquesTools/BoutiquesApplication.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java index d2624347a..f5282496b 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java @@ -1,5 +1,6 @@ package fr.insalyon.creatis.vip.application.client.bean.boutiquesTools; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -10,6 +11,8 @@ import com.google.gwt.user.client.rpc.IsSerializable; +import fr.insalyon.creatis.vip.application.client.bean.boutiquesTools.BoutiquesInput.InputType; + /** * Representation of an application Boutiques descriptor * @@ -38,6 +41,7 @@ public class BoutiquesApplication implements IsSerializable { private Set outputFiles = new HashSet<>(); private Map tags = new HashMap<>(); private String jsonFile; + private Set vipDotInputIds; private BoutiquesApplicationExtensions boutiquesExtensions; @@ -229,6 +233,20 @@ public String getVipContainer() { return vipContainer; } + public Set getVipDotInputIds() { + if (vipDotInputIds == null) { + return Collections.emptySet(); + } + return vipDotInputIds; + } + + public Set getCommandLineFlag() { + return inputs.stream() + .filter(i -> InputType.FLAG.equals(i.getType())) + .map(BoutiquesInput::getId) + .collect(Collectors.toSet()); + } + public void addInput(BoutiquesInput input){ this.inputs.add(input); } @@ -280,4 +298,8 @@ public void addTag(String key, String value) { public void setVipContainer(String vipContainer) { this.vipContainer = vipContainer; } -} \ No newline at end of file + + public void setVipDotInputIds(Set inputIds) { + this.vipDotInputIds = inputIds; + } +} From 26440b8e8b39680480b3c8a3b4a76c8043b23ccc Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:22:02 +0200 Subject: [PATCH 02/11] Update BoutiquesParser.java --- .../client/view/boutiquesParsing/BoutiquesParser.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java index f46f0e8c4..826f27fb1 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java @@ -114,8 +114,8 @@ public BoutiquesApplication parseApplication(String descriptor) throws InvalidBo // Custom property JSONObject customObject = getObjectValue(parsedDescriptor, "custom", true); if (customObject != null) { - String vipImagePath = getStringValue(customObject, "vip:imagepath", true); - application.setVipContainer(vipImagePath); + application.setVipContainer(getStringValue(customObject, "vip:imagepath", true)); + application.setVipDotInputIds(getArrayValueAsStringSet(customObject, "vip:dot", true)); } // Json descriptor application.setJsonFile(parsedDescriptor.toString()); @@ -241,6 +241,4 @@ private BoutiquesOutputFile parseBoutiquesOutputFile(JSONObject outputFile) bof.setCommandLineFlag(commandLineFlag); return bof; } - - } From ac94b7280f1ba13d6e88bca872cdcaa948e88013 Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:23:05 +0200 Subject: [PATCH 03/11] Update DisplayTab.java --- .../view/applicationdisplay/DisplayTab.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java index fab59f9e9..87356e6a6 100644 --- a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java +++ b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java @@ -31,6 +31,9 @@ */ package fr.insalyon.creatis.vip.applicationimporter.client.view.applicationdisplay; +import java.util.HashSet; +import java.util.Set; + import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.IButton; @@ -39,6 +42,7 @@ import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; + import fr.insalyon.creatis.vip.application.client.bean.boutiquesTools.BoutiquesApplication; import fr.insalyon.creatis.vip.application.client.view.boutiquesParsing.BoutiquesParser; import fr.insalyon.creatis.vip.application.client.view.boutiquesParsing.InvalidBoutiquesDescriptorException; @@ -49,6 +53,7 @@ import fr.insalyon.creatis.vip.core.client.view.layout.Layout; import fr.insalyon.creatis.vip.core.client.view.util.WidgetUtil; + public class DisplayTab extends Tab { // Layouts @@ -158,6 +163,24 @@ private static void verifyBoutiquesTool(BoutiquesApplication boutiquesTool) if (boutiquesTool.getAuthor() == null) { throw new ApplicationImporterException("Boutiques file must have an author"); } + checkvipdot(boutiquesTool); + } + + /** + * display warning message if any. + * + * @param application BoutiquesApplication object to cehck warning message + * **/ + private static void checkvipdot(BoutiquesApplication application) { + Set commandLineFlags = application.getCommandLineFlag(); + + Set commonValues = new HashSet<>(application.getVipDotInputIds()); + commonValues.retainAll(commandLineFlags); + + if (!commonValues.isEmpty()) { + String warningMessage = "" + String.join(", ", commonValues) + " appears as command-line flag input(s), it should not be included in Dot iteration. Importing it may cause functionality issues, although the application will still be imported."; + Layout.getInstance().setWarningMessage(warningMessage); + } } /** From f7619a26660219dc9b702deaf3f7ffe94dcd455a Mon Sep 17 00:00:00 2001 From: patil Date: Wed, 26 Jun 2024 02:52:06 +0200 Subject: [PATCH 04/11] Update 1. Added intelligence to gwendia.vm for vip:dot inputs 2. Display vip:dot inputs during import --- .../client/view/applicationdisplay/GeneralLayout.java | 7 +++++-- vip-portal/src/main/resources/vm/gwendia-standalone.vm | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java index eeb7a190a..441808528 100644 --- a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java +++ b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java @@ -46,7 +46,8 @@ public class GeneralLayout extends AbstractFormLayout { version, schemaVersion, description, - vipContainer; + vipContainer, + dotInputs; public GeneralLayout(String width, String height) { super(width, height); @@ -63,8 +64,9 @@ public GeneralLayout(String width, String height) { schemaVersion = new LocalTextField("Schema Version", false, false); description = new LocalTextField("Description", false, false); vipContainer = new LocalTextField("VIP Container", false, false); + dotInputs = new LocalTextField("DOT Inputs", false, false); - this.addMembers(name, commandLine, dockerImage, dockerIndex, version, schemaVersion, description, vipContainer); + this.addMembers(name, commandLine, dockerImage, dockerIndex, version, schemaVersion, description, vipContainer, dotInputs); } public void setTool(BoutiquesApplication bt) { @@ -76,5 +78,6 @@ public void setTool(BoutiquesApplication bt) { dockerIndex.setValue(bt.getContainerIndex()); schemaVersion.setValue(bt.getSchemaVersion()); vipContainer.setValue(bt.getVipContainer()); + dotInputs.setValue(String.join(", ", bt.getVipDotInputIds())); } } diff --git a/vip-portal/src/main/resources/vm/gwendia-standalone.vm b/vip-portal/src/main/resources/vm/gwendia-standalone.vm index 98400e423..ce289c99d 100644 --- a/vip-portal/src/main/resources/vm/gwendia-standalone.vm +++ b/vip-portal/src/main/resources/vm/gwendia-standalone.vm @@ -75,7 +75,16 @@ if ( result.startsWith("/") || result.startsWith("lfn:") ) { #foreach($input in $tool.getInputs()) + #if(!$tool.getVipDotInputIds().contains($input.getId())) + #end +#end +#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty()) + +#foreach($dotInput in $tool.getVipDotInputIds()) + +#end + #end From f78e43e8a752b6d00816517bcc11b165b771dbe4 Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:53:19 +0200 Subject: [PATCH 05/11] Update DisplayTab.java verify if vip:dot values are one of the inputs --- .../client/view/applicationdisplay/DisplayTab.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java index 87356e6a6..6a6958fd7 100644 --- a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java +++ b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java @@ -173,14 +173,25 @@ private static void verifyBoutiquesTool(BoutiquesApplication boutiquesTool) * **/ private static void checkvipdot(BoutiquesApplication application) { Set commandLineFlags = application.getCommandLineFlag(); - + Set vipDotInputIds = application.getVipDotInputIds(); Set commonValues = new HashSet<>(application.getVipDotInputIds()); + commonValues.retainAll(commandLineFlags); if (!commonValues.isEmpty()) { String warningMessage = "" + String.join(", ", commonValues) + " appears as command-line flag input(s), it should not be included in Dot iteration. Importing it may cause functionality issues, although the application will still be imported."; Layout.getInstance().setWarningMessage(warningMessage); } + + // Extract the IDs from inputs + Set inputIds = application.getInputs().stream().map(BoutiquesInput::getId).collect(Collectors.toSet()); + // Check if all vipDotInputIds are in inputs + if (!inputIds.containsAll(vipDotInputIds)) { + Set incorrectInputs = new HashSet<>(vipDotInputIds); + incorrectInputs.removeAll(inputIds); + String warningMessage = "" + String.join(", ", incorrectInputs) + " appears in vipDotInputIds but not in inputs. Please ensure all ids are correct."; + Layout.getInstance().setWarningMessage(warningMessage); + } } /** From 301a78b594adebdee979c2e1f27cee88ae191a4d Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:55:10 +0200 Subject: [PATCH 06/11] Update BoutiquesApplication.java getter-setter for VipDotResultDir --- .../client/bean/boutiquesTools/BoutiquesApplication.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java index f5282496b..3325cc292 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java @@ -42,6 +42,7 @@ public class BoutiquesApplication implements IsSerializable { private Map tags = new HashMap<>(); private String jsonFile; private Set vipDotInputIds; + private String resultDirs; private BoutiquesApplicationExtensions boutiquesExtensions; @@ -247,6 +248,10 @@ public Set getCommandLineFlag() { .collect(Collectors.toSet()); } + public String getVipDotResultDirs() { + return resultDirs; + } + public void addInput(BoutiquesInput input){ this.inputs.add(input); } @@ -302,4 +307,8 @@ public void setVipContainer(String vipContainer) { public void setVipDotInputIds(Set inputIds) { this.vipDotInputIds = inputIds; } + + public void setVipDotResultDirs(String resultDirs) { + this.resultDirs = resultDirs; + } } From 72795d4e018b932a831b4ef6b82aea77fef0382c Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:55:37 +0200 Subject: [PATCH 07/11] Update gwendia-standalone.vm intelligence to put result dir in dot or cross --- .../main/resources/vm/gwendia-standalone.vm | 158 ++++++++++-------- 1 file changed, 85 insertions(+), 73 deletions(-) diff --git a/vip-portal/src/main/resources/vm/gwendia-standalone.vm b/vip-portal/src/main/resources/vm/gwendia-standalone.vm index ce289c99d..36c49bbfa 100644 --- a/vip-portal/src/main/resources/vm/gwendia-standalone.vm +++ b/vip-portal/src/main/resources/vm/gwendia-standalone.vm @@ -5,87 +5,99 @@ Directory where the results will be stored. -#foreach( $input in $tool.getInputs() ) - #set($type="string") - #if($input.getType().getCamelName()=="File") - #set($type="URI") - #end - #if($input.getType().getCamelName()=="Flag") - #if($input.getDefaultValue() && $input.getDefaultValue()!="") - - #else - + #foreach( $input in $tool.getInputs() ) + #set($type="string") + #if($input.getType().getCamelName()=="File") + #set($type="URI") + #end + #if($input.getType().getCamelName()=="Flag") + #if($input.getDefaultValue() && $input.getDefaultValue()!="") + + #else + + #end + #else + #if($input.getDefaultValue() && $input.getDefaultValue()!="") + #if($input.getType().getCamelName()=="Number" && $input.isInteger()) + + #else + + #end + #else + #if($input.isOptional()==true) + + #else + + #end + #end + #end + #if($input.getDescription()) + $esc.xml($input.getDescription()) + #else + + #end + #end - #else - #if($input.getDefaultValue() && $input.getDefaultValue()!="") - #if($input.getType().getCamelName()=="Number" && $input.isInteger()) - - #else - - #end - #else - #if($input.isOptional()==true) - - #else - - #end + #foreach($output in $tool.getOutputFiles()) + #end - #end - #if($input.getDescription()) - $esc.xml($input.getDescription()) - #else - - #end - -#end -#foreach($output in $tool.getOutputFiles()) - -#end - /*----------Beginning of Beanshell------------*/ -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; + + /*----------Beginning of Beanshell------------*/ + import java.text.DateFormat; + import java.text.SimpleDateFormat; + import java.util.Date; -String result = dir.toString(); -if ( result.startsWith("/") || result.startsWith("lfn:") ) { - DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); - result = result + "/" + (dateFormat.format(System.currentTimeMillis())); -} -/*------------End of Beanshell------------*/ + String result = dir.toString(); + if ( result.startsWith("/") || result.startsWith("lfn:") ) { + DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); + result = result + "/" + (dateFormat.format(System.currentTimeMillis())); + } + /*------------End of Beanshell------------*/ -#foreach($input in $tool.getInputs()) - #if($input.getType().getCamelName()=="File" ) - - #else - - #end -#end -#foreach( $output in $tool.getOutputFiles() ) - -#end + #foreach($input in $tool.getInputs()) + #if($input.getType().getCamelName()=="File" ) + + #else + + #end + #end + #foreach( $output in $tool.getOutputFiles() ) + + #end - -#foreach($input in $tool.getInputs()) - #if(!$tool.getVipDotInputIds().contains($input.getId())) - - #end -#end -#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty()) - -#foreach($dotInput in $tool.getVipDotInputIds()) - -#end - -#end + #if($tools.getVipDotResultDirs) + + + #foreach($input in $tool.getInputs()) + #if($tool.getVipDotInputIds().contains($input.getId())) + + #end + #end + + #else + + #foreach($input in $tool.getInputs()) + #if(!$tool.getVipDotInputIds().contains($input.getId())) + + #end + #end + #end + #if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty() && !$tools.getVipDotResultDirs) + + #foreach($dotInput in $tool.getVipDotInputIds()) + + #end + + #end @@ -94,11 +106,11 @@ if ( result.startsWith("/") || result.startsWith("lfn:") ) { -#foreach( $input in $tool.getInputs() ) - -#end -#foreach($output in $tool.getOutputFiles()) - -#end + #foreach( $input in $tool.getInputs() ) + + #end + #foreach($output in $tool.getOutputFiles()) + + #end From 357563fceb6d0e1c76cef925605b2c75fa693638 Mon Sep 17 00:00:00 2001 From: Sandesh Patil <99490622+sandepat@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:56:15 +0200 Subject: [PATCH 08/11] Update BoutiquesParser.java parse vip:dot-result-directory --- .../client/view/boutiquesParsing/BoutiquesParser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java index 826f27fb1..ef3ecbdbd 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java @@ -116,6 +116,7 @@ public BoutiquesApplication parseApplication(String descriptor) throws InvalidBo if (customObject != null) { application.setVipContainer(getStringValue(customObject, "vip:imagepath", true)); application.setVipDotInputIds(getArrayValueAsStringSet(customObject, "vip:dot", true)); + application.setVipDotResultDirs(getStringValue(customObject, "vip:dot-result-directory", true)); } // Json descriptor application.setJsonFile(parsedDescriptor.toString()); From a2c7841e6480b0ad058cbe5b6040a3e7a5a9c484 Mon Sep 17 00:00:00 2001 From: patil Date: Mon, 1 Jul 2024 17:05:47 +0200 Subject: [PATCH 09/11] Resolution of review comment and display of results-directory --- coverage/src/test/java/Coverage/Coverage.java | 2 +- .../view/applicationdisplay/DisplayTab.java | 13 +- .../applicationdisplay/GeneralLayout.java | 3 +- .../boutiquesTools/BoutiquesApplication.java | 17 +- .../boutiquesParsing/BoutiquesParser.java | 2 +- .../main/resources/vm/gwendia-standalone.vm | 179 +++++++++--------- 6 files changed, 111 insertions(+), 105 deletions(-) diff --git a/coverage/src/test/java/Coverage/Coverage.java b/coverage/src/test/java/Coverage/Coverage.java index 06d65d3a8..86f1b0ac8 100644 --- a/coverage/src/test/java/Coverage/Coverage.java +++ b/coverage/src/test/java/Coverage/Coverage.java @@ -1,4 +1,4 @@ -package coverage; +package Coverage; import org.junit.jupiter.api.Test; diff --git a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java index 6a6958fd7..b8490a287 100644 --- a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java +++ b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/DisplayTab.java @@ -170,11 +170,13 @@ private static void verifyBoutiquesTool(BoutiquesApplication boutiquesTool) * display warning message if any. * * @param application BoutiquesApplication object to cehck warning message + * @throws ApplicationImporterException * **/ - private static void checkvipdot(BoutiquesApplication application) { + private static void checkvipdot(BoutiquesApplication application) throws ApplicationImporterException { Set commandLineFlags = application.getCommandLineFlag(); Set vipDotInputIds = application.getVipDotInputIds(); - Set commonValues = new HashSet<>(application.getVipDotInputIds()); + Set inputIds = application.getinputIds(); + Set commonValues = new HashSet<>(vipDotInputIds); commonValues.retainAll(commandLineFlags); @@ -182,15 +184,12 @@ private static void checkvipdot(BoutiquesApplication application) { String warningMessage = "" + String.join(", ", commonValues) + " appears as command-line flag input(s), it should not be included in Dot iteration. Importing it may cause functionality issues, although the application will still be imported."; Layout.getInstance().setWarningMessage(warningMessage); } - - // Extract the IDs from inputs - Set inputIds = application.getInputs().stream().map(BoutiquesInput::getId).collect(Collectors.toSet()); // Check if all vipDotInputIds are in inputs if (!inputIds.containsAll(vipDotInputIds)) { Set incorrectInputs = new HashSet<>(vipDotInputIds); incorrectInputs.removeAll(inputIds); - String warningMessage = "" + String.join(", ", incorrectInputs) + " appears in vipDotInputIds but not in inputs. Please ensure all ids are correct."; - Layout.getInstance().setWarningMessage(warningMessage); + String errorMessage = "" + String.join(", ", incorrectInputs) + " appears in vipDotInputIds but not in inputs. Please ensure all ids are correct."; + throw new ApplicationImporterException(errorMessage); } } diff --git a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java index 441808528..22f44a5d9 100644 --- a/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java +++ b/vip-application-importer/src/main/java/fr/insalyon/creatis/vip/applicationimporter/client/view/applicationdisplay/GeneralLayout.java @@ -78,6 +78,7 @@ public void setTool(BoutiquesApplication bt) { dockerIndex.setValue(bt.getContainerIndex()); schemaVersion.setValue(bt.getSchemaVersion()); vipContainer.setValue(bt.getVipContainer()); - dotInputs.setValue(String.join(", ", bt.getVipDotInputIds())); + String dotInputsValue = String.join(", ", bt.getVipDotInputIds()); + dotInputs.setValue(dotInputsValue + (bt.getVipDotIncludesResultsDir() ? (dotInputsValue.isEmpty() ? "results-directory" : ", results-directory") : "")); } } diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java index 3325cc292..7ed6be189 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java @@ -42,7 +42,8 @@ public class BoutiquesApplication implements IsSerializable { private Map tags = new HashMap<>(); private String jsonFile; private Set vipDotInputIds; - private String resultDirs; + private Set inputIds; + private boolean vipDotIncludesResultsDir; private BoutiquesApplicationExtensions boutiquesExtensions; @@ -248,8 +249,14 @@ public Set getCommandLineFlag() { .collect(Collectors.toSet()); } - public String getVipDotResultDirs() { - return resultDirs; + public Set getinputIds() { + return this.getInputs().stream() + .map(BoutiquesInput::getId) + .collect(Collectors.toSet()); + } + + public boolean getVipDotIncludesResultsDir() { + return vipDotIncludesResultsDir; } public void addInput(BoutiquesInput input){ @@ -308,7 +315,7 @@ public void setVipDotInputIds(Set inputIds) { this.vipDotInputIds = inputIds; } - public void setVipDotResultDirs(String resultDirs) { - this.resultDirs = resultDirs; + public void setVipDotIncludesResultsDir(boolean vipDotIncludesResultsDir) { + this.vipDotIncludesResultsDir = vipDotIncludesResultsDir; } } diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java index ef3ecbdbd..400d40956 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/boutiquesParsing/BoutiquesParser.java @@ -116,7 +116,7 @@ public BoutiquesApplication parseApplication(String descriptor) throws InvalidBo if (customObject != null) { application.setVipContainer(getStringValue(customObject, "vip:imagepath", true)); application.setVipDotInputIds(getArrayValueAsStringSet(customObject, "vip:dot", true)); - application.setVipDotResultDirs(getStringValue(customObject, "vip:dot-result-directory", true)); + application.setVipDotIncludesResultsDir(getBooleanValue(customObject, "vip:dot-with-results-directory", true)); } // Json descriptor application.setJsonFile(parsedDescriptor.toString()); diff --git a/vip-portal/src/main/resources/vm/gwendia-standalone.vm b/vip-portal/src/main/resources/vm/gwendia-standalone.vm index 36c49bbfa..e57a24789 100644 --- a/vip-portal/src/main/resources/vm/gwendia-standalone.vm +++ b/vip-portal/src/main/resources/vm/gwendia-standalone.vm @@ -5,112 +5,111 @@ Directory where the results will be stored. - #foreach( $input in $tool.getInputs() ) - #set($type="string") - #if($input.getType().getCamelName()=="File") - #set($type="URI") - #end - #if($input.getType().getCamelName()=="Flag") - #if($input.getDefaultValue() && $input.getDefaultValue()!="") - - #else - - #end - #else - #if($input.getDefaultValue() && $input.getDefaultValue()!="") - #if($input.getType().getCamelName()=="Number" && $input.isInteger()) - - #else - - #end - #else - #if($input.isOptional()==true) - - #else - - #end - #end - #end - #if($input.getDescription()) - $esc.xml($input.getDescription()) - #else - - #end - +#foreach( $input in $tool.getInputs() ) + #set($type="string") + #if($input.getType().getCamelName()=="File") + #set($type="URI") + #end + #if($input.getType().getCamelName()=="Flag") + #if($input.getDefaultValue() && $input.getDefaultValue()!="") + + #else + #end - #foreach($output in $tool.getOutputFiles()) - + #else + #if($input.getDefaultValue() && $input.getDefaultValue()!="") + #if($input.getType().getCamelName()=="Number" && $input.isInteger()) + + #else + + #end + #else + #if($input.isOptional()==true) + + #else + + #end #end + #end + #if($input.getDescription()) + $esc.xml($input.getDescription()) + #else + + #end + +#end +#foreach($output in $tool.getOutputFiles()) + +#end - - /*----------Beginning of Beanshell------------*/ - import java.text.DateFormat; - import java.text.SimpleDateFormat; - import java.util.Date; + /*----------Beginning of Beanshell------------*/ +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; - String result = dir.toString(); - if ( result.startsWith("/") || result.startsWith("lfn:") ) { - DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); - result = result + "/" + (dateFormat.format(System.currentTimeMillis())); - } - /*------------End of Beanshell------------*/ +String result = dir.toString(); +if ( result.startsWith("/") || result.startsWith("lfn:") ) { + DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); + result = result + "/" + (dateFormat.format(System.currentTimeMillis())); +} +/*------------End of Beanshell------------*/ - #foreach($input in $tool.getInputs()) - #if($input.getType().getCamelName()=="File" ) - - #else - - #end - #end - #foreach( $output in $tool.getOutputFiles() ) - - #end - - - #if($tools.getVipDotResultDirs) - - - #foreach($input in $tool.getInputs()) - #if($tool.getVipDotInputIds().contains($input.getId())) - - #end - #end - - #else - - #foreach($input in $tool.getInputs()) - #if(!$tool.getVipDotInputIds().contains($input.getId())) - - #end - #end - #end - #if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty() && !$tools.getVipDotResultDirs) - - #foreach($dotInput in $tool.getVipDotInputIds()) - - #end - - #end - - +#foreach($input in $tool.getInputs()) + #if($input.getType().getCamelName()=="File" ) + + #else + + #end +#end +#foreach( $output in $tool.getOutputFiles() ) + +#end + + +#if($tools.getVipDotResultDirs) + + +#foreach($input in $tool.getInputs()) + #if($tool.getVipDotInputIds().contains($input.getId())) + + #end +#end + +#else + +#foreach($input in $tool.getInputs()) + #if(!$tool.getVipDotInputIds().contains($input.getId())) + + #end +#end +#end +#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty() && !$tools.getVipDotResultDirs) + +#foreach($dotInput in $tool.getVipDotInputIds()) + +#end + +#end + + - #foreach( $input in $tool.getInputs() ) - - #end - #foreach($output in $tool.getOutputFiles()) - - #end +#foreach( $input in $tool.getInputs() ) + +#end +#foreach($output in $tool.getOutputFiles()) + +#end - + \ No newline at end of file From 11992a0c22aa6f09af3f5032b3f092bc2544c21f Mon Sep 17 00:00:00 2001 From: patil Date: Wed, 3 Jul 2024 13:51:58 +0200 Subject: [PATCH 10/11] removed unused field - inputIds --- .../bean/boutiquesTools/BoutiquesApplication.java | 1 - .../src/main/resources/vm/gwendia-standalone.vm | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java index 7ed6be189..9f23c3723 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/bean/boutiquesTools/BoutiquesApplication.java @@ -42,7 +42,6 @@ public class BoutiquesApplication implements IsSerializable { private Map tags = new HashMap<>(); private String jsonFile; private Set vipDotInputIds; - private Set inputIds; private boolean vipDotIncludesResultsDir; private BoutiquesApplicationExtensions boutiquesExtensions; diff --git a/vip-portal/src/main/resources/vm/gwendia-standalone.vm b/vip-portal/src/main/resources/vm/gwendia-standalone.vm index e57a24789..a3bee1cd7 100644 --- a/vip-portal/src/main/resources/vm/gwendia-standalone.vm +++ b/vip-portal/src/main/resources/vm/gwendia-standalone.vm @@ -76,18 +76,18 @@ if ( result.startsWith("/") || result.startsWith("lfn:") ) { #if($tools.getVipDotResultDirs) -#foreach($input in $tool.getInputs()) - #if($tool.getVipDotInputIds().contains($input.getId())) + #foreach($input in $tool.getInputs()) + #if($tool.getVipDotInputIds().contains($input.getId())) - #end -#end + #end + #end #else #foreach($input in $tool.getInputs()) - #if(!$tool.getVipDotInputIds().contains($input.getId())) + #if(!$tool.getVipDotInputIds().contains($input.getId())) - #end + #end #end #end #if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty() && !$tools.getVipDotResultDirs) From 9a9297c3ef307c1deb8bdf1f4f63bd0e02db6e20 Mon Sep 17 00:00:00 2001 From: patil Date: Mon, 8 Jul 2024 16:34:49 +0200 Subject: [PATCH 11/11] update gwendia.vm --- .../main/resources/vm/gwendia-standalone.vm | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/vip-portal/src/main/resources/vm/gwendia-standalone.vm b/vip-portal/src/main/resources/vm/gwendia-standalone.vm index a3bee1cd7..603ea5e0f 100644 --- a/vip-portal/src/main/resources/vm/gwendia-standalone.vm +++ b/vip-portal/src/main/resources/vm/gwendia-standalone.vm @@ -73,29 +73,25 @@ if ( result.startsWith("/") || result.startsWith("lfn:") ) { #end -#if($tools.getVipDotResultDirs) +#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty()) + #if($tools.getVipDotResultDirs) - #foreach($input in $tool.getInputs()) - #if($tool.getVipDotInputIds().contains($input.getId())) - - #end + #end + #foreach($dotInput in $tool.getVipDotInputIds()) + #end + #if( ! $tools.getVipDotResultDirs) + + #end #else +#end #foreach($input in $tool.getInputs()) #if(!$tool.getVipDotInputIds().contains($input.getId())) - + #end -#end -#end -#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty() && !$tools.getVipDotResultDirs) - -#foreach($dotInput in $tool.getVipDotInputIds()) - -#end - #end