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.
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.
- Log into XNAT as a site administrator.
- Click on the Administer->Configuration menu command.
- Click on the Applets tab in the Configuration dialog.
- Enter your applet configuration in the Script text area.
- 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.
- Go to the project for which you want to set the applet script.
- Click on the Manage tab.
- Click the Enable Applet Script checkbox.
- Enter your script into the Script text area.
- 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:
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 true, optional, 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 true, optional, and false in the same way that requireDate does.