Download presentation
Presentation is loading. Please wait.
Published byMelvyn Tucker Modified over 9 years ago
1
Extending & Customizing XNAT with Modules Rick Herrick rick.herrick@wustl.edu
2
Customizing XNAT Previous versions of XNAT used overlays in the projects folder of the XNAT builder: Schemas referenced in instance settings Velocity templates CSS/JavaScript Java classes This worked but was kind of messy.
3
Modules package XNAT extensions Instead of overlaying files, you package your code into jar or zip archives. No need to reference schemas in the instance settings file. Hooks provide convenient means of extending the user interface, data handling, and even the REST API.
4
Oh but it gets better... XNAT Marketplace! Soon-to-be home of many useful XNAT extensions, including: User interface customizations Common data elements REST services Reporting and analysis tools
5
Let's have a look... 1.Set the module repository location in your build.properties. 2.Copy a module into the module repository. 3.Update XNAT: sudo service tomcat6 stop bin/update.sh -Ddeploy=true cd deployments/xnat psql –U xnat –d xnat –f sql/xnat-update.sql sudo service tomcat6 start
6
What hasn’t changed… yet New data types require updating SQL and administrative intervention Java classes are inserted as Java text files, not compiled classes Hooks are provided for extending the UI, but this is still fairly limited No inherent scoping of components
7
Modules are not plugins! Still requires a rebuild and redeployment of the application Can’t be de-activated or removed Must be unpackaged and slip-streamed instead of remaining in its little package No versioning or dependency management (cf. OSGi)
8
Creating custom modules A module is: A jar or zip archive Files are placed in folders similar to the folder structure under the projects folder The module archive is placed into the module repository and processed on the next update.
9
Creating custom modules A word about Maven… Maven is an open-source build tool available from Apache ( http://maven.apache.org) http://maven.apache.org NRG will provide module development templates for Maven (AKA archetypes) Sort of goofy if you’re not familiar with it, but don’t let that distract you: for our purposes it’s really just an archiving tool
10
Creating custom modules Easy steps: 1.Create a data-type schema. EgoMaster! 2.Put the schema into a module and go. 3.Once the code builder has completed, you have a good start on Velocity templates, Java classes, JavaScript, and so on.
11
Creating custom modules A little more complex: 1.Add Velocity templates to your module and make the user interface work better. 2.Add some code to automate object creation, e.g. item label. 3.Add some validation code to a JavaScript file and reference it through the VM.
12
Creating custom modules Let's get crazy: 1.Add a REST service by annotating a class with the @XnatRestlet annotation. 2.Call the service from an interface component. 3.Add a project configuration tab.
13
Questions? Email: rick.herrick@wustl.edurick.herrick@wustl.edu xnat_discussion on Google Groups
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.