<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)">Hy Glenn, I did something like that:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)"><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">           </span>UserType user = (UserType) objectHolder.value;</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">         </span>ExtensionType et = user.getExtension();</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>for(Object extension : et.getAny())</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">            </span>{</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>Node node = (Node) extension;</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">                  </span>System.out.println(node.getNodeName());</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>System.out.println(node.getTextContent());</div><div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre">             </span>}</div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)">I just wanted to know if this is the only and the right way to access this values. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(68,68,68)">Thank you  !</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="arial, helvetica, sans-serif"><br><br><font color="#444444">Ing Nicolás Rossi</font><br><font color="#999999">Identicum S.A.</font><br><font color="#999999">Jorge Newbery 3226</font><br><font color="#999999">Tel: +54 (11) 4552-3050</font><br><font color="#999999"><a href="http://www.identicum.com" target="_blank">www.identicum.com</a></font></font><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Feb 8, 2017 at 11:29 AM, BOSCHMANS Glenn <span dir="ltr"><<a href="mailto:gboschmans@cibg.brussels" target="_blank">gboschmans@cibg.brussels</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="NL-BE" link="blue" vlink="purple">
<div class="m_5810015759630217648WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif">Hi Nicolas,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif">Perhaps you can try the following.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Calibri",sans-serif">for (Object extension : et.getAny()) {<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Calibri",sans-serif">         System.out.println(((Element) extension).getFirstChild().<wbr>getNodeValue());<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Calibri",sans-serif">}<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif">Element is the dom class org.w3c.dom.Element;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif">Glenn Boschmans<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif"><u></u> <u></u></span></p>
<div lang="FR-BE" vlink="#6c606a" link="#005dba">
<div class="m_5810015759630217648WordSection1">
<table border="0">
<tbody>
<tr>
<td style="BORDER-RIGHT:#fecb00 thin solid;WIDTH:306px" valign="top" width="322">
<img border="0" hspace="0" src="cid:cibg_aee22c14-e9ed-4d7b-8c27-f6c4a26e7736.png" width="300" height="101"></td>
<td valign="top">
<p style="FONT-SIZE:10pt;FONT-FAMILY:Arial;LINE-HEIGHT:normal"><span class="m_5810015759630217648TitreCar"><b><span lang="EN-US" style="FONT-SIZE:15pt;FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#0080bf">Glenn Boschmans</span></b></span><br>
<span class="m_5810015759630217648MsoSubtleReference"><span lang="EN-US" style="FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#0a00be">Consultant</span></span><br>
<span lang="EN-US" style="FONT-SIZE:11pt;FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#164397">Business Integrated Solutions
</span><br>
<span lang="EN-US" style="FONT-SIZE:10pt;FONT-FAMILY:'Calibri Light','sans-serif'">Kunstlaan 21, 1000 Brussel -
</span><span lang="EN-US" style="FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#0080bf"><a href="http://cibg.brussels" target="_blank"><span style="FONT-SIZE:10pt;COLOR:#0080bf">cibg.brussels</span></a></span><span lang="EN-US" style="FONT-SIZE:10pt;FONT-FAMILY:'Calibri Light','sans-serif'">
 - </span><span lang="EN-US" style="FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#0080bf"><a href="http://cibg.brussels/disclaimer-1" target="_blank"><span style="FONT-SIZE:10pt;COLOR:#0080bf">disclaimer</span></a></span><br>
<span lang="EN-US" style="FONT-SIZE:10pt;FONT-FAMILY:'Calibri Light','sans-serif'">+32 2 282 47 70<span style="COLOR:#fecb00"> | </span><span style="FONT-SIZE:10pt;FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#000000"> 
<span style="COLOR:#000000"><br>
<span lang="EN-US" style="FONT-SIZE:9pt;FONT-FAMILY:'Calibri Light','sans-serif';COLOR:#61c250">Be green, leave it on the screen !</span>                             <wbr>                         
</span></span><a href="http://www.linkedin.com/company/cirb_cibg" target="_blank"><img border="0" src="cid:ln_e679eb12-caaa-4d0d-b64d-b39c820c309b.png" width="22" height="19"></a>  <a href="https://twitter.com/CIRB_CIBG" target="_blank"><img border="0" src="cid:tw_20cfb408-d952-4ea7-a757-a8716eaac012.png" width="19" height="19"></a>  <a href="http://www.leefmilieu.brussels/themas/duurzame-stad/label-ecodynamische-onderneming" target="_blank"><img border="0" hspace="0" src="cid:logo_eco_mail_e3e2fbdd-9cbf-4a5b-b0c1-1624e00ef4cd.jpg"></a></span></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> midPoint [mailto:<a href="mailto:midpoint-bounces@lists.evolveum.com" target="_blank">midpoint-bounces@<wbr>lists.evolveum.com</a>]
<b>On Behalf Of </b>Nicolas Rossi<br>
<b>Sent:</b> woensdag 8 februari 2017 0:57<br>
<b>To:</b> midPoint General Discussion<br>
<b>Subject:</b> [midPoint] Access to UserType extensions from model-client<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#444444">Hi guys, we have a customer with a User schema extension and we are trying to access this data using the API of UserType from external Java application. We get the user with the
 model-client example but we couldn't find the way to acces the extension properties. Here is an example:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#444444"><u></u> <u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">ModelPortType modelPort = createModelPort();</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">Holder<ObjectType> objectHolder = new Holder<ObjectType>();</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">SelectorQualifiedGetOptionsTyp<wbr>e options = new SelectorQualifiedGetOptionsTyp<wbr>e();</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span class="m_5810015759630217648gmail-apple-tab-span"><span style="font-family:"Courier New";color:#444444">        
</span></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">modelPort.getObject(<wbr>ModelClientUtil.getTypeQName(<wbr>UserType.class), "2f749a40-d535-470b-ba7d-<wbr>639adc364a52", options, objectHolder, resultHolder);</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span class="m_5810015759630217648gmail-apple-tab-span"><span style="font-family:"Courier New";color:#444444">        
</span></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">UserType user = (UserType) objectHolder.value;</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">ExtensionType et = user.getExtension();</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">for(int i=0; i < et.getAny().size(); i++)</span><span style="color:#444444"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">{</span><span style="color:#444444"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span class="m_5810015759630217648gmail-apple-tab-span"><span style="font-family:"Courier New";color:#444444">    
</span></span><span style="font-family:"Courier New";color:#444444">Object o = et.getAny().get(i);</span><span style="color:#444444"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span class="m_5810015759630217648gmail-apple-tab-span"><span style="font-family:"Courier New";color:#444444">    
</span></span><span style="font-family:"Courier New";color:#444444">System.out.println("Extension --> " + o.toString());</span><span style="color:#444444"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#444444">}</span><span style="color:#444444"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#444444"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#444444">Looking at the email sent from Ana Pereyra to the mailing list last week asking about writing Extension Attributes I guees we should code something like that:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#444444"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:9.5pt;font-family:"Courier New";color:#222222">QName relationQName = new QName("</span><span style="font-family:"Courier New";color:#444444"><a href="http://midpoint.identicum.com/xml/ns/metaAssignment" target="_blank"><span style="font-size:9.5pt">http://midpoint.<wbr>identicum.com/xml/ns/metaP</span></a>erso<wbr>n</span><span style="font-size:9.5pt;font-family:"Courier New";color:#222222">",
 "extensionAttribute");<br>
ExtensionType ext = new ExtensionType();<br>
ext.asPrismContainerValue().<wbr>getPropertyRealValue(<wbr>relationQName);</span><span style="color:#444444"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">But I don't have access to "asPrismContainerValue" method on the extension type. I have been looking on github examples but there is no reference to access this values. Has anyone tried this before ?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">Thranks in advance,</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><br>
<br>
<span style="color:#444444">Ing Nicolás Rossi</span><br>
<span style="color:#999999">Identicum S.A.</span><br>
<span style="color:#999999">Jorge Newbery 3226</span><br>
<span style="color:#999999">Tel: +54 (11) 4552-3050</span><br>
<span style="color:#999999"><a href="http://www.identicum.com" target="_blank">www.identicum.com</a></span></span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</div>

<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br></div>