Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom properties vip:dot #480

Merged

Conversation

sandepat
Copy link
Contributor

@sandepat sandepat commented Jun 21, 2024

Changes in VIP-portal regarding custom properties

Custom dot inputs

  • Parse custom properties of Boutiques descriptor and read the dot inputs

Handling of Command Line Flag Inputs

  • Implemented a feature to detect command-line-flag inputs included in the Boutiques custom properties as dot inputs.
  • Display a warning message at application import time, ensuring better user awareness and error prevention.

@sandepat sandepat mentioned this pull request Jun 21, 2024
Copy link
Contributor

@axlbonnet axlbonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to me.
@camarasu do you want to review ?

1. Added intelligence to gwendia.vm for vip:dot inputs
2. Display vip:dot inputs during import
@camarasu
Copy link
Member

Fine for me, too, thank you.
Waiting for the last updates discussed earlier (handling of results-directory and checking of dot inputs) before merging the PR.

sandepat added 4 commits July 1, 2024 14:53
verify if vip:dot values are one of the inputs
getter-setter for VipDotResultDir
intelligence to put result dir in dot or cross
parse vip:dot-result-directory
@@ -38,6 +41,8 @@ public class BoutiquesApplication implements IsSerializable {
private Set<BoutiquesOutputFile> outputFiles = new HashSet<>();
private Map<String, String> tags = new HashMap<>();
private String jsonFile;
private Set<String> vipDotInputIds;
private String resultDirs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename field and getter/setter with vipDotIncludesResultsDir, and change type to boolean.

Copy link
Contributor Author

@sandepat sandepat Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to boolean vipDotIncludesResultsDir

application.setVipContainer(vipImagePath);
application.setVipContainer(getStringValue(customObject, "vip:imagepath", true));
application.setVipDotInputIds(getArrayValueAsStringSet(customObject, "vip:dot", true));
application.setVipDotResultDirs(getStringValue(customObject, "vip:dot-result-directory", true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to vip:dot-with-results-directory.
Adapt to vip:dot-result-directory being a boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to vip:dot-with-results-directory and adapt to the method getBooleanValue

Set<String> incorrectInputs = new HashSet<>(vipDotInputIds);
incorrectInputs.removeAll(inputIds);
String warningMessage = "<b>" + String.join(", ", incorrectInputs) + "</b> appears in vipDotInputIds but not in inputs. Please ensure all ids are correct.";
Layout.getInstance().setWarningMessage(warningMessage);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case, it should be a error with an exception thrown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throwing ApplicationImporterException

}

// Extract the IDs from inputs
Set<String> inputIds = application.getInputs().stream().map(BoutiquesInput::getId).collect(Collectors.toSet());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may add this as a BoutiquesApplication method. (optionally)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the getinputIds method to BoutiquesApplication

<source name="$input.getId()" type="string" optional="$input.isOptional()" default="$input.getDefaultValue()" vip-type-restriction="flag" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="string" optional="$input.isOptional()" default="false" vip-type-restriction="flag" pretty-name="$input.getName()">
#foreach( $input in $tool.getInputs() )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thnk VS or something else changed the indentation of velocity code and it generetad a lot of diff.
Could it be possible to keep the original indentation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, restore original indentation.

@axlbonnet axlbonnet merged commit 25f77f8 into virtual-imaging-platform:develop Jul 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants