Select Local OS Resource

Function:

The "Select Local OS Resource" tool opens a native file selection dialog from the operating system to enable the user to select one or multiple local files, or an Eclipse folder selection dialog to select a local folder:


Eclipse folder selection

Attributes:

Attribute Type Description
Resource Type Selection Specifies whether the selection dialog should prompt for a folder or file. If the value is “Local OS File”, the dialog does not allow the user to select a folder and vice versa.  

Possible values:

  • Local OS File (default)
  • Local OS Folder
File Dialog Behavior Selection Specifies whether you can select multiple files or use the “Selection for Save” mode, which has a slightly different appearance. For example, the confirm button is labelled “Save” instead of “Open”.  

The attribute is only visible if the Resource Type attribute is “Local OS File”, since multi-selection and “Selection for Save” are currently not supported for folders.

Possible values:

  • Single-selection
  • Multi-selection
  • Selection for Save
Title String Specifies the dialog title. If empty, the operating system default title is used, for example, “Open” or “Save”.
Message String Sets a user message for the folder selection dialog.  

Only visible if the Resource Type attribute is set to “Local OS Folder”, since the file selection dialog does not have a message field.

Remember Last Selection Boolean Specifies whether the dialog reuses the last selection.

If a pre-set file has been specified as an input parameter the value of this argument is not used. See Input Parameters for more information.

Only visible if the File Dialog Behavior attribute is not set to “Multi-selection” and the Resource Type attribute is “Local OS File".

Parameters:

Parameter No I/O Type Description
1 [O] I String The pre-set path of the selection dialog.
2 [O] I String The pre-set file name of the file selection dialog.

Usage of this parameter overrides the behavior of the "Remember Last Selection" tool attribute.

Only available if the Resource Type attribute is set to “Local OS File”.

3 [O] I String File extension filters for the file selection dialog. While a file extension filter is active, the dialog only shows files matching the filter.

It is possible to define several filters and several extensions for each filter. While the first defined filter is always the default filter on opening the dialog, users can select different filters, if more than one are specified.

Each filter is separated by “/”, while every extension must be separated by “;”.

For example, *.txt;*.text/*.doc;*.docx

Defines two filters with two extensions each.

Only available if the Resource Type attribute is set to “Local OS File”.

Default value: *.* (show all files)

1 [M] O String/File Used to return the selected OS resources

All input parameters of the tool are optional. They can be enabled by setting the attribute “Show Optional Parameters” to “true”.

Output parameter:

Selected files are always returned by a single output parameter (both for single and multi-selection). Depending on the scenario where the tool should be used, it is possible to return file names in two different ways:

  1. As a property value (default).
    1. Useful for:
      1. Using selected file name(s) as input parameter for a subsequent tool.
      2. Using selected file name as “Name Physical” reference for a local file descriptor.
    2. Modeled by:
      1. Setting file output parameter type to “String”.
      2. Referencing a property as target ID.
    3. Multi selection:
      1. File names are all written as the value of the referenced property, separated by the “Out Parm Separator” of the tool descriptor.
  2. As contents of an input stream file descriptor.
    1. Useful for using the tool within a “Retrieve All Values” action. See Retrieve All Values for more information. Users can then select a file or folder for an input field.
    2. Modeled by:
      1. Setting file output parameter type to “File”.
      2. Referencing a file descriptor of the type “Input Stream” as target ID.
    3. Multi selection:
      1. Each selected file is added as a separate row of the input stream.