Issues with Custom Datatype

41 views
Skip to first unread message

Duncan Smith

unread,
Jan 25, 2023, 11:13:45 AM1/25/23
to xnat_discussion
Hi all,

I've recently been trying to create a custom datatype (extension base="xnat:imageAssessorData"), targeting XNAT 1.8.6.1. I have been following this guide XNAT Data Type Development. I have created a basic datatype plugin, and successfully installed it into XNAT. This shows up under Site Administration > Installed Plugins, and the datatype is setup correctly in Administer > Data Types. By POSTing an XML file to the right end point, I am able to create instances of this new datatype, attached to MR experiments.

However, the report page does not appear as the above documentation suggests it would, and trying to use the Edit button shows an error page with "Please create an edit page for custom:BrukerData". The documentation says a default/basic edit and report page would be created for a new datatype, but this does not seem to be happening. After creating multiple instances of the custom datatype, it does not appear in Browse > Data, and trying to add a new tab for this datatype at the project level shows "Failed to create search results", with errors seen in xdat.log when I try:

2023-01-25 15:41:07,857 [http-nio-8080-exec-1] ERROR org.nrg.xdat.search.DisplaySearch -
java.lang.NullPointerException: null

I found this thread that seems to explain a similar issue. Using "jar tf plugin_name.jar" shows there is no file with any mention of *display.xml (and no .xml files in general). I'm not sure if that is supposed to be automatically generated or not, but I haven't seen it mentioned in the documentation.

Is there something that might explain the lack of default edit/report screens, and search functionality? I'm testing this on a clean XNAT with no other plugins.

Thanks,
Duncan

Rick Herrick

unread,
Jan 25, 2023, 11:51:48 AM1/25/23
to xnat_di...@googlegroups.com
Does your build.gradle file include something like this?

sourceSets {
    main {
        java {
            srcDir "build/xnat-generated/src/main/java”
        }
        resources {
            srcDir "build/xnat-generated/src/main/resources”
        }
    }
}

This is what directs Gradle (and specifically the jar task) to include the automatically generated templates and display documents (amongst other things).

Rick Herrick
Senior Software Developer


------ Original Message ------
From "Duncan Smith" <duno...@gmail.com>
To "xnat_discussion" <xnat_di...@googlegroups.com>
Date 1/25/2023 10:13:45 AM
Subject [XNAT Discussion] Issues with Custom Datatype

--
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/465ab127-a376-4d56-8620-07c4c9f575e8n%40googlegroups.com.

Duncan Smith

unread,
Jan 27, 2023, 10:04:10 AM1/27/23
to xnat_discussion
Hi Rick,

That seemed to be missing from the build.gradle file, after adding it this has resolved the majority of the issues with the custom data plugin.

One last thing I've not been able to get to work is allowing for the Custom Data Type to be deleted. I've installed the Rad Read Plugin (as my custom data type is based on it) on a new XNAT 1.8.6.1 instance, and after creating an instance of it, the Delete button in the Actions menu (on the report page) does not work, it seems to refresh the page rather than delete, with no entries in the log. I assume this is because the Rad Read plugin has not been updated past XNAT 1.7. Do you have any suggestions for a fix, or the best place to start looking into it?

Thanks for your help,
Duncan
Reply all
Reply to author
Forward
0 new messages