Adding existing fields to MR Session create/edit screens

32 views
Skip to first unread message

timok

unread,
Jan 3, 2023, 4:13:51 PM1/3/23
to xnat_discussion
Hi all,

Couple of quick questions:
  1. I'd like to add a field to the MR Session create/edit screen(s) that would allow users to edit existing (but hidden) fields e.g., xnat:mrSessionData/age. I found a way to add Custom Variable Sets, which is close to what I'm looking for, but here I'm looking for exposing default fields that XNAT is already aware of.
  2. Similar to the question above, is it possible to re-configure existing fields on the Subject create/edit screens to present the user with a dropdown list instead of freeform text?
My gut tells me this is all doable with a plugin that would override those screens with my own customized versions. Maybe that's the recommended way to go for better reproducibility (i.e., redeploying XNAT with all customizations) but I figured I should check here first.

Cheers,
Tim

Rick Herrick

unread,
Jan 4, 2023, 1:13:41 PM1/4/23
to xnat_di...@googlegroups.com
Your gut is semi-correct. You definitely want to do this without modifying the VM templates in XNAT itself, which means a plugin with your own customized screens. That said, you may not want to override the screen templates themselves if you can avoid it, or at least not the top-level templates like XDATScreen_edit_xnat_mrSessionData.vm. Instead you may be able to override some component templates that are included by the top-level templates or add templates to folders that XNAT references to load files dynamically. You can identify extension points in XNAT a couple of ways:
  • Set the uiDebugExtensionPoints site configuration setting to true then view the page in the browser. This is described in the XNAT customization documentation.
  • For overriding smaller component templates, you can have a look at the HTML source of the session edit page. Look for HTML comments similar to this: <!-- BEGIN xnat-templates/screens/xnat_mrSessionData/edit/scans.vm -->. You can then override just the template with the UI components you want to modify. For example, if you wanted to override the template in that comment, you would want to create a file in your plugin named src/main/resources/META-INF/resources/templates/screens/xnat_mrSessionData/edit/scans.vm
HTH...

Rick Herrick
Senior Software Developer


------ Original Message ------
From "timok" <timothy...@gmail.com>
To "xnat_discussion" <xnat_di...@googlegroups.com>
Date 1/3/2023 3:13:51 PM
Subject [XNAT Discussion] Adding existing fields to MR Session create/edit screens

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/4fc7e69b-ccf2-4a26-9ece-8682987e4e58n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages