Child pages
  • Adding parameters and launch requirements for the upload applet
Skip to end of metadata
Go to start of metadata

You can configure parameters that are passed to the upload applet, as well as require users to enter in dates or times before launching the applet. To do this, you need to specify a configuration for the applet at either the site-wide or project-specific level.

Step-by-step guide

Configuring the applet at the site-wide level affects all upload operations using the applet for the entire site, unless overridden at the project level, so be careful with this configuration.

  1. Log into XNAT as a site administrator.
  2. Click on the Administer->Configuration menu command.
  3. Click on the Applets tab in the Configuration dialog.
  4. Enter your applet configuration in the Script text area.
  5. Click the Save button.

You can also set an applet configuration at the project level. This will affect only upload operations for the specific project.

The applet configuration for a particular project completely overrides any site-wide applet configuration: there is no joining or adding together of parameters or launch settings.

  1. Go to the project for which you want to set the applet script.
  2. Click on the Manage tab.
  3. Click the Enable Applet Script checkbox.
  4. Enter your script into the Script text area.
  5. Click the Save button.


If the Applet Configuration Script panel doesn't appear in your project's Manage tab, go to the site-wide Applets configuration tab as described above. There's a checkbox there labeled Project-Specific Applet Scripts? Enable that checkbox and click the Save button.

The applet configuration script is not really a script in the standard sense: it doesn't consist of executable steps. Instead, it specifies a few known launch options and allows you to specify arbitrary parameters for the applet launch. The script should be in JSON format that looks something like this:

Sample applet configuration script
    "parameters": {"dummy":"1234", "dummy2":"5678"},
    "launch":{"requireDate":"true", "requireTime":"true"}

For the parameters line, you can input anything you want. These parameters will be passed onto the applet launch parameters. Anything that is of no significance to the applet will be ignored (obviously this requires a knowledge of the parameters recognized by the applet itself: you can browse the code in the NRG upload applet repository or view the applet parameter documentation).

The launch options are limited to the ones shown above:

  • requireDate can be trueoptional, or false. Setting this to true means that users will be required to enter a date before they can begin to upload image data. Setting it to optional means that they can enter a date, but can also select a checkbox indicating that they don't have a date. Setting it to false removes the option to enter a date altogether.
  • requireTime can be true or false. Unlike requireDate, when requireTime is true, the user doesn't have to enter a time, but does have the option. This will change in future releases to support trueoptional, and false in the same way that requireDate does.