[midPoint] [Japer Report] How to retrieve info from parentOrfRef

Sébastien MARBRIER smarbrier at positivethinking.tech
Tue Jun 14 10:16:34 CEST 2022


Dear midpojnt community,

I need to create a report on a midpoint 4.0.1

I am able to filter correctly the users related to the metarole using the filter:
<queryString language="mql">
                               <![CDATA[<filter>
    <type>
        <type>UserType</type>
        <filter>
            <and>
               <ref>
                  <path>parentOrgRef/@/roleMembershipRef</path>
                  <value oid="..." />
               </ref>
                <equal>
                    <path>activation/administrativeStatus</path>
                    <expression>
                        <queryInterpretationOfNoValue>filterAll</queryInterpretationOfNoValue>
                        <path>$activation</path>
                    </expression>
                </equal>
            </and>
        </filter>
    </type>
</filter>]]>
                </queryString>

I can also extract normal information such as firstname, fullname or email but I can't extract a piece of information located in the extension and also in the parentOrgRef's name.

The user schema extension has the following structure:
<xsd:complexType name="UserExtensionType">
                               <xsd:annotation>
                                <xsd:appinfo>
                                               <a:extension ref="c:UserType"/>
                                 </xsd:appinfo>
                               </xsd:annotation>
                               <xsd:sequence>
                                               <xsd:element name="company" type="xsd:string" minOccurs="0">
                                                               <xsd:annotation>
                                                                               <xsd:appinfo>
                                                                                              <a:indexed>true</a:indexed>
                                                                                              <a:displayName>Company</a:displayName>
                                                                                              <a:displayOrder>110</a:displayOrder>
                                                                               </xsd:appinfo>
[...]
                                                               </xsd:annotation>
                                               </xsd:element>
[...]
                               </xsd:sequence>
    </xsd:complexType>


With the parentOrgRef field, several variations were tried:
Report Field
Field name /extension/company field class : java.lang.String
<field name="/extension/company" class="java.lang.String"/>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="360" y="0" width="100" height="20" uuid="e7f668f3-9664-4660-8b16-0d25df7d3e2d"/>
                <textFieldExpression><![CDATA[$F{/extension/company}]]></textFieldExpression>
</textField>

Error message : No such property: company for class: report_script in report script

Report Field
Field name parentOrgRef/name field class : java.lang.String
<field name="parentOrgRef/name" class="java.lang.String"/>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="360" y="0" width="100" height="20" uuid="e7f668f3-9664-4660-8b16-0d25df7d3e2d"/>
                <textFieldExpression><![CDATA[$F{parentOrgRef/name}]]></textFieldExpression>
</textField>

Error Message : No such property: name for class: report_script in report script


Report Field
Field name /parentOrgRef/@/name field class : java.lang.String
<field name="/parentOrgRef/@/name" class="java.lang.String"/>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="360" y="0" width="100" height="20" uuid="e7f668f3-9664-4660-8b16-0d25df7d3e2d"/>
                <textFieldExpression><![CDATA[$F{/parentOrgRef/@/name}]]></textFieldExpression>
</textField>

The error message after the tak ran :
Compilation error in report script: startup failed:
report script: 1: unexpected token: @ @ line 1, column 15.
/parentOrgRef/@/name

I was able to get some information rom the parentOrgRef when I directly used the parentOrgRef as a string parameter but it is not usuable.

Can someone would new how to deal with it ?
In very rare occasions the user can have several parentOrgRef tags, how can I handle this case if the extension field cannot be used ?

Thank you very much for your help.


[logo]<https://www.positivethinking.tech/>

Sébastien Marbrier  | Senior IT Consultant
smarbrier at positivethinking.tech<mailto:smarbrier at positivethinking.tech>

Tel. +41 21 601 81 00<tel:+41%2021%20601%2081%2000>

[Teams chat]<https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech>
 <https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech>
Chat with me on Teams<https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech>



[cid:image003.png at 01D87FD7.D173E800]<https://www.linkedin.com/company/the-positive-thinking-company/>  [cid:image004.png at 01D87FD7.D173E800] <https://www.instagram.com/positivethinkingcompany/>   [cid:image005.png at 01D87FD7.D173E800] <https://twitter.com/PTC_Tech>   [cid:image006.png at 01D87FD7.D173E800] <https://youtube.com/channel/UCfaImWa6r0IoZoUYLhbiF7w>
Avenue de cour, 135 - 1007 Lausanne
www.positivethinking.tech<https://www.positivethinking.tech/>





________________________________
Positive Thinking Company puts security at a high priority in its conduct of business. Therefore, we have put our best efforts into ensuring that this email and its attached documents are error and virus-free. Nonetheless, full security of emails/documents cannot be ensured. Therefore, the recipient is responsible for checking the email/documents for threats with its own security measures, prior to opening it. Positive Thinking Company does not accept liability for any damage inflicted by using the content of this email/documents. If you are not the intended recipient, please notify the sender and delete this email/document.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7735 bytes
Desc: image001.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 686 bytes
Desc: image002.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2337 bytes
Desc: image003.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 2756 bytes
Desc: image004.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2358 bytes
Desc: image005.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 2669 bytes
Desc: image006.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220614/75f1706a/attachment-0011.png>


More information about the midPoint mailing list