Cannot edit assessor

137 views
Skip to first unread message

Sarah Hong

unread,
Sep 16, 2021, 3:23:15 PM9/16/21
to xnat_discussion
Dear XNAT group,

I created some datatype with customized edit.vm and report.vm files. 
I can open the forms and read, but when I tries to edit the form, the submission fails after edition with the error message:
    error name: ReferenceError
    error name: SAXException is not defined
    error file: undefined
    error lineNumber: undefined

The log files did not leave anything, so I opened the developer console window, and tried to track down where it causes error, and found that it is looking for generated js file of datatypes' element. 

I'm not sure why XNAT requests to bring those files, and if it has to be generated automatically. I've attached error message and part of schema file and vm file that defines and uses ImgData as reference.

Please advise if you have any thought. 

Thanks,
 

EDIT_VM.jpg
Capture.JPG
Capture2.JPG

Herrick, Rick

unread,
Sep 16, 2021, 4:32:01 PM9/16/21
to xnat_di...@googlegroups.com

Does your plugin have the JavaScript file that’s being requested? You can check for it with something like this:

 

jar tf plugin-1.0.jar | grep -E '.*\.js$'

 

I just ran this on the stroke scale plugin jar:

 

$ jar tf build/libs/xnatx-nihss-plugin-1.1.1-SNAPSHOT-xpl.jar | grep -E '\.js$'

META-INF/resources/scripts/generated/xnatx_nihStrokeScaleData.js

 

If that’s not in there then something’s going wrong with your plugin build.

 

-- 

Rick Herrick

XNAT Architect/Developer

Computational Imaging Laboratory

Washington University School of Medicine

 

 

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Sarah Hong <sarah...@gmail.com>
Date: Thursday, September 16, 2021 at 2:23 PM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] Cannot edit assessor

* External Email - Caution *

--
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/5175450f-e893-42c0-adb6-db3bcbf3b8a3n%40googlegroups.com.

 


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.

Sarah Hong

unread,
Sep 16, 2021, 5:09:02 PM9/16/21
to xnat_discussion
Thank you for reply, Rick.

No, it does not include those js files.
However, the datatype I created is irisqa:NormCat12PCASL, and irisqa_NormCat12PCASL_imgData (which XNAT requires) is just a part of element that the datatype includes.
Does it still need to be created?

Best, 

Herrick, Rick

unread,
Sep 16, 2021, 5:40:17 PM9/16/21
to xnat_di...@googlegroups.com

Could you send me the XSD file for your datatype/plugin?

Sarah Hong

unread,
Sep 21, 2021, 1:48:27 PM9/21/21
to xnat_discussion
Thank you for reply, Rick! 

I have rebuilt the plugin, and deploy them after resetting the database.
However, the edition is still not allowed, and requires the .js file of irisqa:SegCat12_imgData and irisqa:SegCat12_tisData according to the console (ctrl + shift + J).

irisqa:SegCat12 is the custom datatype extending MrAssessorData, and imgData and tisData are one of the elements in it.
Besides this datatype, I could

I have created a repo of my plugin, and I've attached the link:

Please advise. 
Thank you!

Best regards,
Capture.PNG

Herrick, Rick

unread,
Sep 21, 2021, 3:14:03 PM9/21/21
to xnat_di...@googlegroups.com

I think the issue is that XNAT is trying to figure out how to identify and access the objects created by your embedded complex types, which is further complicated by the fact that you have multiple types with the same names, tisData and imgData (each is subordinate to the containing data type, but XNAT might still have trouble disambiguating them).

 

I can suggest a couple things to try.

 

First, your imgData and tisData element definitions all look like this:

 

<xs:element name="imgData" minOccurs="0" maxOccurs="unbounded">

 

Are these really unbounded, i.e. can you have multiple imgData objects per SegCat12Data instance? If not, remove the maxOccurs attribute. Unbounded elements can cause some weird issues and even when working properly are more difficult to work with than single elements.

 

Secondly, these elements don’t have a defined relationship to their containing element. Compare irisqa:SegCat12Data/qcSession/imgData to something like xnat:projectData/aliases/alias:

 

<xs:element name="aliases" minOccurs="0">

    <xs:complexType>

        <xs:sequence minOccurs="0">

            <xs:element name="alias" minOccurs="0" maxOccurs="unbounded">

                <xs:annotation>

                    <xs:appinfo>

                        <xdat:element displayIdentifiers="alias"/>

                        <xdat:field uniqueComposite="VALUE">

                            <xdat:relation uniqueComposite="VALUE"/>

                        </xdat:field>

                    </xs:appinfo>

                </xs:annotation>

                <xs:complexType>

                    <xs:simpleContent>

                        <xs:extension base="xs:string">

                            <xs:attribute name="source" type="xs:string" use="optional"/>

                        </xs:extension>

                    </xs:simpleContent>

                </xs:complexType>

            </xs:element>

        </xs:sequence>

    </xs:complexType>

</xs:element>

 

That highlighted bit causes XNAT to set up a unique composite between the value of alias and the project ID. There are a few other ways of configuring these kinds of relationships. For example, xnat:projectData/fields/field is similar, but there are a lot of others.

 

You may also want to look at xnat:qcManualAssessorData/scans, which is unbounded and references a complex type but doesn’t require a corresponding JavaScript file for those subordinate objects.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Sarah Hong

unread,
Sep 23, 2021, 8:06:40 PM9/23/21
to xnat_discussion
** repost due to attaching wrong file**

Thank you for reply, Rick!

I have tried both of them, and I have some improvements.

The problem I'm facing now is that the datatype does not create "tissue" in js file. 
I have a datatype called SegCat12data. The element tissue is located under  SegCat12data  > qcSession > tisData > tissue.
I found that editing the assessor without the element tissue does not cause error any longer. In other words, any other element in SegCat12 including tisData or imgData works fine now.
However, when I send the xml file with tissue element, I can only view the report, but not able to edit it with the error: 

SAXEventHandler-min.js:300 Uncaught ReferenceError: SAXException is not defined
    at SAXEventHandler.startElement (SAXEventHandler-min.js:300)
    at SAXDriver._fireEvent (xmlsax-min.js:765)
    at SAXDriver._parseLoop (xmlsax-min.js:783)
    at SAXDriver.parse (xmlsax-min.js:633)
    at verifyExptId (xnat_edit_experimentData.js:57)
    at validateExperimentForm (xnat_edit_experimentData.js:191)
    at validateForm (test:6074)
    at HTMLInputElement.onclick (test:6063)

I'm not sure if it's relevant, but I found that the js file created in /build/xnat-generated/src/main/resources/META-INF/resources/scripts/generated/irisqa_SegCat12Data.js does not have any "tissue" element.
I attached new schema file, js file created (please add .js extension to the file), and xml file for reference. Also, I use XNAT 1.8.2.2. 

Please advise.

Thanks,


On Wednesday, September 22, 2021 at 5:18:56 PM UTC-7 Sarah Hong wrote:
Thank you for reply, Rick!

I have tried both of them, and I have some improvements.

The problem I'm facing now is that the datatype does not create "tissue" in js file. 
I have a datatype called SegCat12data. The element tissue is located under  SegCat12data  > qcSession > tisData > tissue.
I found that editing the assessor without the element tissue does not cause error any longer. In other words, any other element in SegCat12 including tisData or imgData works fine now.
However, when I send the xml file with tissue element, I can only view the report, but not able to edit it with the error: 

SAXEventHandler-min.js:300 Uncaught ReferenceError: SAXException is not defined
    at SAXEventHandler.startElement (SAXEventHandler-min.js:300)
    at SAXDriver._fireEvent (xmlsax-min.js:765)
    at SAXDriver._parseLoop (xmlsax-min.js:783)
    at SAXDriver.parse (xmlsax-min.js:633)
    at verifyExptId (xnat_edit_experimentData.js:57)
    at validateExperimentForm (xnat_edit_experimentData.js:191)
    at validateForm (test:6074)
    at HTMLInputElement.onclick (test:6063)

I'm not sure if it's relevant, but I found that the js file created in /build/xnat-generated/src/main/resources/META-INF/resources/scripts/generated/irisqa_SegCat12Data.js does not have any "tissue" element.
I attached new schema file, js file created (please add .js extension to the file), and xml file for reference. Also, I use XNAT 1.8.2.2.

Please advise.

Thanks,



irisqa4_4.xsd
XNAT_E00001.xml
irisqa_SegCat12Data

Sarah Hong

unread,
Dec 2, 2021, 5:05:27 PM12/2/21
to xnat_discussion
I have not checked this issue for a while, but I have some updates about this issue. 
So, the problem is basically about the .js file that was generated by ./gradlew.

I have an assessor with the configuration of
Element (1)-- Element A (2)-- Element a (3) 

When ./gradlew creates the .js file, it did not create the section correctly for the last element (Element a) and attribute under the Element a. 
Therefore, I manually edited .js file after the ./gradlew and inserted the modified one to the .js file with the command:

jar uf plugin.jar META-INF/resources/scripts/generated/MODFIED_FILE.js

I'm not sure where this issue is caused and there could be a better way to resolve this, but this is how I resolved it.

Please let me know if there is any better way or idea! Thank you for your help, Rick!

Best regards,
Reply all
Reply to author
Forward
0 new messages