Standalone Tool Adapter - Editing adapters

Creating a new adapter or modifying an existing one

The form for creating a new adapter is reused for editing an existing adapter and for duplicating an adapter.

The form is structured into multiple areas:

For details about the operator structure and what is the use of each member, see here.

Descriptor details

This area consists in the following fields:

System variables

System variables are values that must be set when the tools is executed. Such a variable may or may not be a system-wide variable (eg. one set in Environment Variables on Windows OS). If the latter case, the system value will always replace the user-defined value. The value of a system variable (in the context of Standalone Tool Adapter) can be shared across adapters, with the condition it is defined in each such adapter. For example, if two adapters declare the same $VAR variable, it is enough to edit its value in one of the adapters, and it will be automatically reflected in the other adapter.

There are two types of variables:

A new variable can be added by pressing one of the + Add Variable or + Add System-Dependent Variable buttons and an existing one can be deleted by using the delete button (X) in the left of the desired variable. The key and value of an variable can be edited by double-clicking the corresponding cell. Simple variables can be edited in place, while for editing system-dependent variables the following small form is used:

Pre-processing area contains 2 field, each one with a checkbox and a combobox:
Configuration parameters includes:

Note: all the values of the parameters of type File (the tool location, the working directory, and any other File (or File List) type parameter that is marked as 'Not Null' or 'Not Empty' will be checked for pointing to existing files or folders when pressing the OK button.

Tool output patterns

Tool output patterns includes 2 defined patterns for determining the progress of the tool and also the error status. When the tool outputs something, the two patterns are checked and if one of them matches the output, this is registered in the log (in SNAP application, when the Console is active, the log messages will appear in the console view)

Operator parameters

This area consists in a table of parameters necessary for the processing of the velocity template. Each parameter can have the following properties:

The data type of a parameter can be as follows:

TypeDescriptionSpecial use-case
IntegerInteger valuesN/A
DecimalFloat valuesN/A
StringA list of charactersN/A
BooleanThe control of this type is a checkbox, so the accepted values are true and false. N/A
ListThis type represents a list of strings, delimited by comma.N/A
FileThis type represents a file.N/A
FolderThis type represents a folder.N/A
Template Parameter The template parameters are velocity templates that need to be interpreted before the execution of the tool. The interpreted result will be saved on local disk, in the temporary folder of the adapter. The full path of the result file will be saved as this parameter's value, so when the parameter is used in the tool template, it will be replaced with the full path of the interpreted result. N/A
Template Before This is a velocity template which will be interpreted before the execution of the tool. It can be used to create/copy some files necessary for the execution, or to...
Template AfterThis is a velocity template which will be executed after the tool execution. It can be used to delete some temporary files that were used to the actual execution (for example temporary products - see ... parameter type), or to do some operations with the result of the execution (like renaming the file containing the final product)
Product List Represents a product loaded in SNAP application context (or a list of loaded products) This type is not available in the parameter type combobox, instead only the default parameter called 'sourceProduct' has this type (see section Default parameters)
File List Represents a file or a list of files This type is not available in the parameter type combobox, instead only the default parameter called 'sourceProductFile' has this type (see section Default parameters)
Default (read-only) parameters

An adapter must have 3 parameters. If the descriptor of the adapter does not contain one or all of this parameters, they are added when the editing form is launched. Those parameters are:

Regular parameters

All user-defined parameters that are not default parameters or template parameters are considered as regular parameters. The type of those parameters can be: Integer, Decimal, String, Boolean, List. Those parameters can be edited by pressing the corresponding 'Ellipsis' (...) button. This will open a new form, where the following properties of the parameter can be changed:

Template parameters

The template parameters are parameters that represent a velocity template stored in a file on disk. So this is actually a parameter, having the type File, on which you can pass other regular parameters.

When editing this type of parameter, first a file must be chosed, and then the template gets loaded in the form and some new parameters can be defined for this template:

This template will be interpreted in 3 key moments of the execution:

Bundled Binaries

In this tab the user can integrate an installer in the adapter. When the adapter is downloaded/installed, the user can install also manually the tool. In case of a remote installer, installing the tool actually means downloading the installer from the given URL and copying it on a local address. After the tool is installed in the target folder (as configured in the adapter), all the adapter parameters and variables should be valid. The tool can be configured to be install on Windows, Linux and MaxOSX

This area consists in the following fields: