XNAT Cheatsheet
At my workplace I am tasked with getting familiar with and eventually customized XNAT, a Java/Tomcat web-based content management system for the health care industy. As this is the first time I am working with a Jave web application, the learning curve is particularly steep. Here are my running notes as I try to get familiar with Java/JSP/XNAT. I must say though that I think Plone/Zope or even an ASP.Net system would have been a lot easier to understand!
- Top level directory for xnat
- Inside the VM (from NRG):
- /mnt/hgfs/Shared/Workspace/xdat_release
- Also, /usr/local/NRG/Shared/Workspace/xdat_release
- Inside the host OS
- ~/s/prog/xnat_rc1/Virtual-XNAT/Shared/Workspace/xdat_release
- Inside the VM (from NRG):
- Directories @ top level
- bin: Contains maven batch script, quick-deploy.sh and quick-deploy-templates.sh batch scripts to “deploy” XNAT from the top level directory to the tomcat directory (/usr/local/NRG/Applications/tomcat/webapps/xnat)
- With Eclipse set up properly, there is no need to run the batch scripts.
- build.properties: From the xnat.org website:
- SUMMARY: The build.properties file is located in the root directory of the XNAT package. The file contains the location of your Tomcat installation and details about your database connections. The xdat.project.name variable will become the name of the generated project. This will become the name of any generated webapps as well. The xdat.project.template variable specifies whether or not your new project will use a template. To create an XNAT project, this variable must be set to ‘xnat’. Set the db name and connection information to your postgres installation. (This db connection string/name should point to a pre-created empty database of this name). The initial build.properties is set to create an xnat project called ‘xnat’. You simply need to create an empty database called ‘xnat’ (see step 2) and set the appropriate user name and password. Also, the maven.appserver.home variable must be set to reference the root directory of your local Tomcat installation (abslolute path).
- projects: Again from the website: XNAT will generate a folder in this directory for each of your projects. When you make customizations to your XNAT project, you will modify the files in this directory. These modifications will then be processed by the setup or update script.
- deployments: XNAT will generate a folder in this directory for each of your projects. It stores the settings for your command line tools. It will also be used to generate your web application via the setup or update command.
- If I need to modify a template, I have copied the template (a Velocity macro, .vm) from the deployments/xnat/src/xnat-templates/screens folder to the projects/xnat/src/templates/screens folder and edited it in Eclipse. On a deploy-templates operation, the web site is updated with the template content. (Note that for .vm file changes a full rebuild is not necessary.)
- Deploying to Tomcat
- This can be done in several ways, including using Eclipse, but on the command line running bin/update.sh -Ddeploy=true from the root directory works.
- Customizing XNAT
- From the website: Note: The XNAT framework looks for custom code, including additional schemas, in the XNAT_HOME/projects/PROJECT directory.  To make your customizations take effect, run the bin/update process from the XNAT_HOME directory.  This process updates the XNAT_HOME/deployments/PROJECT directory, which will contain your customizations and XNAT-generated code to support these customizations, and deploy it all to your webapp (WAR).
- I am currently on this step, and will update this when I am successful
Comments off