Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

XNAT 1.7 has made changes to some of the methods that were in XNAT 1.6 (and in most cases were also in even earlier versions of XNAT). These changes are particularly important to those with pre-1.7 versions of XNAT who want to upgrade to 1.7 while preserving whatever customizations they made. There are also a few changes that have been made since the very first version of 1.7, so if you are upgrading from an earlier version of XNAT 1.7 to a later one, you should take a look at these changes. If you are coming from a pre-1.7 version of XNAT, please consult the following sections to see what changes, if any, you will need to make to your custom code. If you see a snippet of code, followed by an arrow, followed by more code, that means that before XNAT 1.7, your syntax might have looked like what is on the left of the arrow, but it is now suggested that your code look more like the code to the right of the arrow (and in most cases your code will not work right unless you make the change).

User Object and Permissions Changes

  • There have been extensive changes to how user permissions should be checked. The methods of the Permissions class should now be used.

    • For example

...

    • user.canRead(project)

...

    • Permissions.canReadProject(user, project)

...

      • Or $data.getSession().getAttribute("userHelper").canRead($item) to check permissions from a Velocity page
    • Another example is that now XNATUtils.getAllProjectIds(template)

...

    •  → Permissions.getAllProjectIds(template)

  • Some of the XNAT code was changed so it would work with UserI objects rather than XDATUser objects.
    • For example: TurbineUtils.getUser(data) → XDAT.getUserDetails()

      • In earlier versions of XNAT, the user object returned was a XDATUser. It now returns a UserI object, so you should modify your code as needed.

...

TurbineUtils.getUser(data)

...

XDAT.getUserDetails()

  • In Velocity: $user.getDisplayManager()

...

  • $data.getSession().getAttribute("userHelper").getDisplayManager()

...

  • (Or you can simply do $displayManager if page is a SecureScreen.)

  • You used to be able to access the user object directly in classes that extend SecureResource. So user → getUser()

...

  • user.isSiteAdmin()

...

  • Roles.isSiteAdmin(user

...

In Velocity: $turbineUtils.isSiteAdmin($user)

DICOM Changes

There have also been extensive changes to DICOM SCP classes, so any customizations related to this may need to be refactored. Classes that implement DicomProjectIdentifier should be modified. For example:

...

Anchor
Changes since XNAT 1.7.0
Changes since XNAT 1.7.0

Changes since XNAT 1.7.0

XNAT 1.7.0 - 1.7.2XNAT 1.7.3 +
org.nrg.dicom.mizer.service.MizerExceptionorg.nrg.dicom.mizer.exceptions.MizerException
RestFileUtils.isFileRepresentationOfDirectory(file)RestFileUtils.isFileRepresentationOfDirectoryOrEmpty(file)
XNAT.dom → XNAT.appXNAT.app
XNAT.dom.addFormCSRF()XNAT.app.addFormCSRF()