Spreadsheet upload templates

Every time someone uses the spreadsheet upload feature (available from the Upload > Spreadsheet menu item) a template is created that can be re-used by that user.

Screenshot from 2016-05-10 16-11-16
The list of spreadsheet upload templates is shown to users at the bottom of the Spreadsheet Upload page.

There are two tasks associated with these templates that sysadmins must do for you:

  1. Add the dpuk subject id field to a subject spreadsheet upload template
  2. Delete unwanted spreadsheet upload templates

This page contains instructions to help sysadmins to perform these tasks.

How to find the spreadsheet upload template files

The spreadsheet upload templates are XML files found in a sub-directory of the xnat cache directory which in the vagrant build is /data/xnat/cache.  Each user with templates will have their own subdirectory which corresponds to their user id.  You’ll need to lookup the user id in the users list in order to identify the correct directory.  Below their user directory will be a csv directory with templates in.  The template filenames are timestamps (common epoch milliseconds).  An example subject upload template is shown below:

<FieldMapping data-type="xnat:subjectData" create-date="Wed May 04 12:12:49 UTC 2016" title="dfp subjects" ID="1462363969360">
 <field>xnat:subjectData/ID</field>
 <field>xnat:subjectData/demographics[@xsi:type=&apos;xnat:demographicData&apos;]/dob</field>
 <field>xnat:subjectData/demographics[@xsi:type=&apos;xnat:demographicData&apos;]/gender</field>
</FieldMapping>

This file defines a template that will upload a spreadsheet with subject ID, date of birth and gender fields.

How to add the dpuk subject id field to a template

DPUK XNAT node instances have a custom field added to the subject form which must be manually added to a spreadsheet upload template.  The following template shows the above example with the dpuk subject ID added as the second field:

<FieldMapping data-type="xnat:subjectData" create-date="Wed May 04 12:12:49 UTC 2016" title="dfp subjects" ID="1462363969360">
 <field>xnat:subjectData/ID</field>
 <field>xnat:subjectData/fields/field[name=dpuk_id]/field</field>
 <field>xnat:subjectData/demographics[@xsi:type=&apos;xnat:demographicData&apos;]/dob</field>
 <field>xnat:subjectData/demographics[@xsi:type=&apos;xnat:demographicData&apos;]/gender</field>
</FieldMapping>

How to delete an unwanted template

This is simply a matter of deleting the correct file.  Your changes will show up immediately.

More details of customising spreadsheet uploads can be found in this xnat user group posting: https://groups.google.com/forum/#!topic/xnat_discussion/7n4mqa5bEXk