<div style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#00000">Thanks Roman,‌<br>
your solution is working (I didn't see it before, your mail was in my SPAM folder)<br>
<br>
Philippe<br>
 </div>
 

<div class="gl_quote" style="margin-top: 20px; padding-top: 5px;">De : "Roman Pudil"<br>
A : "midPoint General Discussion" ,"philippebriffod@laposte.net" ,"Gustavo J Gallardo"<br>
Envoyé: jeudi 2 Novembre 2023 14:08<br>
Objet : Re[2]: [midPoint] Script expression in mapping & LDAP baseContext<br>
 
<div class="gl_quoted"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style id="signatureStyle" type="text/css"><!--#x0609ecc5e48d4be #x1f5def6457d14b1382ebca278d1ea825, #x0609ecc5e48d4be
{font-family: Tahoma; font-size: 12pt;}
-->
</style>
<style id="css_styles" type="text/css"><!--blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] {  list-style-position: inside;}
body { font-family: 'Segoe UI'; font-size: 12pt; }
.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }
-->
</style>
<div>Hi Philippe,</div>

<div>try this:</div>

<div><span><em><strong>basic.getResourceIcfConfigurationPropertyValue(resource, 'baseContext');</strong></em></span></div>

<div> </div>

<div>Docs:</div>

<div><a href="https://download.evolveum.com/midpoint/4.8/midpoint-4.8-javadoc/com/evolveum/midpoint/model/common/expression/functions/BasicExpressionFunctions.html#getResourceIcfConfigurationPropertyValue(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType,java.lang.String)">https://download.evolveum.com/midpoint/4.8/midpoint-4.8-javadoc/com/evolveum/midpoint/model/common/expression/functions/BasicExpressionFunctions.html#getResourceIcfConfigurationPropertyValue(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType,java.lang.String)</a></div>

<div id="signature_old" style="clear:both">
<div id="x0609ecc5e48d4be">
<div>
<div id="x1f5def6457d14b1382ebca278d1ea825"> </div>

<div id="x1f5def6457d14b1382ebca278d1ea825">Regards</div>

<div>
<div data-mce-style="font-family: Arial, sans-serif; font-size: 13px;" style="font-variant-ligatures: normal; orphans: 2; widows: 2; font-family: Arial, sans-serif; font-size: 13px;">
<p><strong>Roman Pudil</strong><br>
<span data-mce-style="font-family: Arial, sans-serif; font-size: 11px; color: #808080;" style="color:rgb(128, 128, 128); font-size:11px">solution architect</span></p>
</div>

<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px;" style="font-variant-ligatures: normal; orphans: 2; widows: 2; font-family: Arial, sans-serif; font-size: 11px;">gsm: [+420] 775 663 666<br>
e‑mail: <a href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</a></p>

<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px;" style="font-variant-ligatures: normal; font-size: 11px; font-family: Arial, sans-serif; widows: 2; orphans: 2;"><strong>AMI Praha a.s.</strong><br>
Pernerova 697/35, 186 00 Praha 8</p>

<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px;" style="font-variant-ligatures: normal; font-size: 11px; font-family: Arial, sans-serif; widows: 2; orphans: 2;">recepce: [+420] 604 444 848 | web: <a data-mce-href="https://www.ami.cz" href="https://www.ami.cz/">www.ami.cz</a></p>

<p data-mce-style="margin-top: 20px;" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-variant-ligatures: normal; orphans: 2; widows: 2; margin-top: 20px;"><img alt="AMI Praha a.s." data-mce-src="https://www.ami.cz/images/podpis/ami-logo.png" src="https://www.ami.cz/images/podpis/ami-logo.png" style="border: 0px; cursor: default;"></p>

<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px; color: #aaaaaa;" style="font-variant-ligatures: normal; orphans: 2; widows: 2; font-family: Arial, sans-serif; font-size: 11px; color: rgb(170, 170, 170);">Textem tohoto e‑mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<br>
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.<br>
<span data-mce-style="font-size: 6px;" style="font-size:6px"> </span><br>
Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může obsahovat důvěrné nebo osobní<br>
informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv zveřejňování, zprostředkování<br>
nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail neoprávněně, informujte o tom prosím<br>
odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně všech jeho příloh. Nakládáním<br>
s neoprávněně získanými informacemi se vystavujete riziku právního postihu.</p>
</div>
</div>
</div>
</div>

<div style="clear:both"> </div>

<div> </div>

<div>
<div>------ Původní zpráva ------</div>

<div>Od "Gustavo J Gallardo via midPoint" <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>></div>

<div>Komu "<a href="mailto:philippebriffod@laposte.net">philippebriffod@laposte.net</a>" <<a href="mailto:philippebriffod@laposte.net">philippebriffod@laposte.net</a>>; "midPoint General Discussion" <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>></div>

<div>Kopie "Gustavo J Gallardo" <<a href="mailto:ggallard@identicum.com">ggallard@identicum.com</a>></div>

<div>Datum 02.11.2023 13:48:54</div>

<div>Předmět Re: [midPoint] Script expression in mapping & LDAP baseContext</div>
</div>

<div> </div>

<div id="xe04bb395195c455">
<blockquote cite="CAA68kP-b1i8PgMe=4WE___oJ393+pmGcav4Ygh5AH4UVahauDw@mail.gmail.com" class="cite2" type="cite">
<div dir="ltr">Hi Philippe,
<div>I think the right syntax would be:</div>

<div> </div>

<div>
<div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre">
<div><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">expression</span><span style="color:rgb(128,128,128)">></span></div>

<div><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">script</span><span style="color:rgb(128,128,128)">></span></div>

<div><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">code</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(212,212,212)">'cn=' + employeeNumber + ',OU=Users,' + <strong>$resource/connectorConfiguration/configurationProperties/baseContext</strong></span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">code</span><span style="color:rgb(128,128,128)">></span></div>

<div><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">script</span><span style="color:rgb(128,128,128)">></span></div>

<div><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">expression</span><span style="color:rgb(128,128,128)">></span></div>
</div>
</div>

<div> </div>

<div> </div>

<div>Regards,</div>

<div> </div>

<div>Gustavo</div>
</div>
 

<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Thu, Nov 2, 2023 at 8:26 AM Philippe via midPoint <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>> wrote:</div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="font-family:Arial,Helvetica,sans-serif;font-size:12px">‌Hello,<br>
<br>
when configuring an LDAP resource we enter an LDAP DN in the parameter "baseContext"<br>
    <connectorConfiguration ><br>
        <icfc:configurationProperties ><br>
...<br>
            <gen629:baseContext>O=app21</gen629:baseContext><br>
...<br>
        </icfc:configurationProperties><br>
    </connectorConfiguration><br>
<br>
when defining the mapping of the account, I would like to reuse this information for building the DN of the account<br>
<br>
    <attribute id="9"><br>
                <ref>ri:dn</ref><br>
                <outbound><br>
                    <strength>strong</strength><br>
                    <source><br>
                        <path>$focus/employeeNumber</path><br>
                    </source><br>
                    <expression><br>
                        <script><br>
                            <code>'cn=' + employeeNumber + ',OU=Users,' + resource.getBaseContext()</code><br>
                        </script><br>
                    </expression><br>
                </outbound><br>
    </attribute><br>
<br>
what is the correct expression to get the "baseContext" attribute of the resource ?<br>
<br>
Thanks in advance<br>
Philippe</div>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer">https://lists.evolveum.com/mailman/listinfo/midpoint</a></blockquote>
</div>
</blockquote>
</div>
</div>
</div>