The easiest way to do the description, as you’ve noted, is by setting the Site Description text. However you can set the page by reference as well (i.e. specifying a path to it within the webapp) and that’s just what you need to do with the logo. This requires a very very simple plugin, one that actually doesn’t even need any of the plugin infrastructure. I just built one with these files:
Then ran:
$ jar cf cthulhu-branding.jar *
I copied that jar into the plugins folder on my XNAT installation, restarted Tomcat (which is required unfortunately; the upside is that once the plugin jar has been loaded, you can update those files in the jar and the changes take effect immediately), then changed the Site Description to use a page reference and set that to /screens/cthulhu-site.vm and the Site Logo Path to /images/cthulhu.jpg and voila:
This takes advantage of a feature in the Servlet 3.0 spec where anything in a jar file stored in the folder META-INF/resources is considered to be part of the web application. Basically everything in the root web application folder (i.e. the top level of the XNAT war file or the contents of the extracted folder under the Tomcat webapps folder) is joined with everything that’s stored in a jar file under META-INF/resources. That means that, as far as the web app is concerned, the images folder contains both logo.png (the default XNAT logo) and cthulhu.jpg, even though they’re actually stored in different places.
Just for reference I attached the files I built the jar from. Extract those somewhere then run that jar command above.
--
Rick Herrick
Sr. Programmer/Analyst
Neuroinformatics Research Group
Washington University School of Medicine
Phone: +1 (314) 273-1645
--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
xnat_discussi...@googlegroups.com.
To post to this group, send email to
xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
To view this discussion on the web visit
https://groups.google.com/d/msgid/xnat_discussion/7e61bf57-eff8-49ed-b08f-e9f45aaaf753%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.
siteDescription=PagesiteDescriptionPage=/templates/screens/ncanda/site_description.vmsiteLogoPath=/images/ncanda/logo.pngarchivePath=/fs/storage/XNAT/archiveprearchivePath=/fs/storage/XNAT/prearchivepipelinePath=/usr/local/var/xnat/pipeline
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_di...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/7e61bf57-eff8-49ed-b08f-e9f45aaaf753%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is because of the difference between the xnat-conf.properties and prefs-init.ini/prefs-override.ini files:
$ http --session=admin --pretty=format –body https://xnatdev.xnat.org/xapi/prefs/ini
[siteConfig]
#Settings for tool siteConfig
#Mon Apr 08 07:24:05 CDT 2019
initialized=true
requireEventName=false
uiShowLeftBarBrowse=true
...
Note the initialize qualifier though: if you set a value in prefs-init.ini, e.g. siteConfig -> siteDescription, that value will only be set as long as there’s not already a value for siteDescription. This provides an easy way to initialize a new system without having to go through the setup process. For my Vagrant dev VMs, I usually have a prefs-init.ini with a siteConfig section that specifies values for siteUrl and initialize=true, so when I log in the first time I’m ready to work rather than have to enter values on the setup page.
Try setting your values in prefs-init.ini or prefs-override.ini and starting again:
[siteConfig]
siteDescription=Page
siteDescriptionPage=/templates/screens/ncanda/site_description.vm
siteLogoPath=/images/ncanda/logo.png
archivePath=/fs/storage/XNAT/archive
prearchivePath=/fs/storage/XNAT/prearchive
pipelinePath=/usr/local/var/xnat/pipeline
One caveat: if this is a new system there’s no issue but on a system with any file resources already stored, setting a new value for archivePath can cause XNAT to become very grumpy. Fixing this issue will be one of the big development pushes for 1.8 development but for now just be aware!
--
Rick Herrick
Sr. Programmer/Analyst
Neuroinformatics Research Group
Washington University School of Medicine
Phone: +1 (314) 273-1645
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to
xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/3dc0f03b-0576-45a9-8f29-7a30a4f2746f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.