{"id":49,"date":"2009-03-27T11:40:59","date_gmt":"2009-03-27T18:40:59","guid":{"rendered":"http:\/\/www.reisun.com\/?p=49"},"modified":"2009-03-27T11:40:59","modified_gmt":"2009-03-27T18:40:59","slug":"xnat-cheatsheet","status":"publish","type":"post","link":"https:\/\/www.reisun.com\/?p=49","title":{"rendered":"XNAT Cheatsheet"},"content":{"rendered":"<p>At my workplace I am tasked with getting familiar with and eventually customized <a href=\"http:\/\/www.xnat.org\">XNAT<\/a>, 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!<\/p>\n<ul>\n<li>Top level directory for xnat\n<ul>\n<li>Inside the VM (from <a href=\"http:\/\/www.neuroinfo.org\">NRG<\/a>):\n<ul>\n<li>\/mnt\/hgfs\/Shared\/Workspace\/xdat_release<\/li>\n<li>Also, \/usr\/local\/NRG\/Shared\/Workspace\/xdat_release<\/li>\n<\/ul>\n<\/li>\n<li>Inside the host OS\n<ul>\n<li>~\/s\/prog\/xnat_rc1\/Virtual-XNAT\/Shared\/Workspace\/xdat_release<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Directories @ top level\n<ul>\n<li>bin: Contains maven batch script, quick-deploy.sh and quick-deploy-templates.sh batch scripts to &#8220;deploy&#8221; XNAT from the top level directory to the tomcat directory (\/usr\/local\/NRG\/Applications\/tomcat\/webapps\/xnat)<\/li>\n<li>With Eclipse set up properly, there is no need to run the batch scripts.<\/li>\n<li>build.properties: From the xnat.org website:\n<ul>\n<li>SUMMARY: The build.properties file is located in the root directory of the XNAT package.\u00c2\u00a0 The file contains the location of your Tomcat installation and details about your database connections.\u00c2\u00a0 The <strong>xdat.project.name<\/strong> variable will become the name of the  generated project.\u00c2\u00a0 This will become the  name of any generated webapps as well.\u00c2\u00a0  The <strong>xdat.project.template<\/strong> variable specifies whether or not your new project will use a template.\u00c2\u00a0 To create an XNAT project, this variable must be set to \u00e2\u20ac\u02dcxnat\u00e2\u20ac\u2122.\u00c2\u00a0 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).\u00c2\u00a0 The initial build.properties is set to create an xnat project called \u00e2\u20ac\u02dcxnat\u00e2\u20ac\u2122.\u00c2\u00a0 You simply need to create an empty database called \u00e2\u20ac\u02dcxnat\u00e2\u20ac\u2122 (see step 2) and set the appropriate user name and password.\u00c2\u00a0 Also, the <strong>maven.appserver.home<\/strong> variable must be set to reference the root directory of your local Tomcat  installation (abslolute path).<\/li>\n<\/ul>\n<\/li>\n<li>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.<\/li>\n<li>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.\n<ul>\n<li>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.)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Deploying to Tomcat\n<ul>\n<li>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.<\/li>\n<\/ul>\n<\/li>\n<li>Customizing XNAT\n<ul>\n<li>From the website: Note: The XNAT framework looks for custom code, including additional schemas,\u00c2\u00a0in     the XNAT_HOME\/projects\/PROJECT\u00c2\u00a0directory. \u00c2\u00a0To make your customizations     take effect, run the bin\/update process from the XNAT_HOME directory.\u00c2\u00a0\u00c2\u00a0This     process updates\u00c2\u00a0the 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).<\/li>\n<li>I am currently on this step, and will update this when I am successful<\/li>\n<li><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,17,21],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-medical","category-web","category-xnat"],"_links":{"self":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49"}],"version-history":[{"count":0,"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}