<div dir="ltr">Yes, just like good old sql. Each result objects property can be part of the projection. Check RUser type properties in this case. Its standard HQL.<div><br></div><div>arnost</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pá 31. 1. 2020 v 9:28 odesílatel Rainer Herbst <<a href="mailto:rainer.herbst@aip.de">rainer.herbst@aip.de</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Arnošt,<br>
<br>
thank you for the hint!<br>
<br>
To be honest, I did not expect to have to write SQL queries for such a <br>
simple task. :(<br>
<br>
Is it possible to select which attributes a query should return?<br>
<br>
Best regards,<br>
Rainer<br>
<br>
On Thu, 30 Jan 2020 14:14:16 +0100<br>
  Arnošt Starosta - AMI Praha a.s. <<a href="mailto:arnost.starosta@ami.cz" target="_blank">arnost.starosta@ami.cz</a>> wrote:<br>
> Hi Rainer,<br>
> <br>
> if you need to export the list just once or can run the export <br>
>manually<br>
> when needed you can abuse the query playground in gui and hql<br>
> <br>
> select<br>
> u.emailAddress<br>
> from<br>
> RUser u<br>
> <br>
> or for an extension attribute (midpoint 4.0 version)<br>
> <br>
> select<br>
> u.name.orig, us.value<br>
> from<br>
> RUser u<br>
> left join u.strings us with ( us.ownerType = 0)<br>
> join RExtItem usi with ( <a href="http://usi.id" rel="noreferrer" target="_blank">usi.id</a> = us.itemId and <a href="http://usi.name" rel="noreferrer" target="_blank">usi.name</a><br>
> ='your-extension-namespace#your-attribute')<br>
> <br>
> left join with other data types if needed,<br>
> check com.evolveum.midpoint.repo.sql.data.common.RUser source.<br>
> <br>
> It works up to tens of thousands of users only.<br>
> <br>
> arnost<br>
> <br>
> čt 30. 1. 2020 v 13:29 odesílatel Rainer Herbst <br>
><<a href="mailto:rainer.herbst@aip.de" target="_blank">rainer.herbst@aip.de</a>><br>
> napsal:<br>
> <br>
>> Hi Gustav,<br>
>><br>
>> thank you for the hint.<br>
>><br>
>> Unfortunatly, the CSV user export provides only standard attributes. <br>
>>The<br>
>> email address is stored in an custom specific attribute <br>
>>("mainAIPEmail"),<br>
>> which is not included into the CSV. How can I customize the CSV <br>
>>export?<br>
>><br>
>> TIA!<br>
>> Rainer<br>
>><br>
>> On Thu, 30 Jan 2020 11:06:19 +0100<br>
>>   Pálos Gustáv <<a href="mailto:gustav.palos@gmail.com" target="_blank">gustav.palos@gmail.com</a>> wrote:<br>
>> > Hi Viele,<br>
>> ><br>
>> > if you need just one time export, you can use 4. button at the<br>
>> >bottom of<br>
>> > User List page "CSV export". Open it, and delete not needed <br>
>>columns.<br>
>> ><br>
>> > Best regards,<br>
>> ><br>
>> > Gustav<br>
>> ><br>
>> > št 30. 1. 2020 o 10:34 Rainer Herbst <<a href="mailto:rainer.herbst@aip.de" target="_blank">rainer.herbst@aip.de</a>><br>
>> >napísal(a):<br>
>> ><br>
>> >> Dear all,<br>
>> >><br>
>> >> I wanted to solve the following simple problem - export a list of<br>
>> >>email<br>
>> >> addresses from Midpoint into a csv file.<br>
>> >><br>
>> >> So, I defined a CSV resource with only one attribute (email) and <br>
>>set<br>
>> >>a<br>
>> >> synchronisation:<br>
>> >>    <synchronization><br>
>> >>    <objectSynchronization><br>
>> >>    <name>Import</name><br>
>> >>    <enabled>true</enabled><br>
>> >>    <correlation><br>
>> >>    <q:equal><br>
>> >>    <q:path>extension/mainAIPEmail</q:path><br>
>> >>    <expression><br>
>> >>    <path>$projection/attributes/email</path><br>
>> >>    </expression><br>
>> >>    </q:equal><br>
>> >>    </correlation><br>
>> >>    <reconcile>true</reconcile><br>
>> >>    <reaction><br>
>> >>    <situation>linked</situation><br>
>> >>    <synchronize>true</synchronize><br>
>> >>    </reaction><br>
>> >>    <reaction><br>
>> >>    <name>Link</name><br>
>> >>    <situation>unlinked</situation><br>
>> >>    <synchronize>true</synchronize><br>
>> >>    <action><br>
>> >>    <name>Exportieren</name><br>
>> >>    <handlerUri><br>
>> >> <a href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#link" rel="noreferrer" target="_blank">http://midpoint.evolveum.com/xml/ns/public/model/action-3#link</a><br>
>> >> </handlerUri><br>
>> >>    <order>befor</order><br>
>> >>    </action><br>
>> >>    </reaction><br>
>> >>    <reaction><br>
>> >>    <name>Export</name><br>
>> >>    <situation>deleted</situation><br>
>> >>    <synchronize>true</synchronize><br>
>> >>    <action><br>
>> >>    <name>Exportieren</name><br>
>> >>    <handlerUri><br>
>> >> <br>
>><a href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#addShadow" rel="noreferrer" target="_blank">http://midpoint.evolveum.com/xml/ns/public/model/action-3#addShadow</a><br>
>> >> </handlerUri><br>
>> >>    <order>before</order><br>
>> >>    </action><br>
>> >>    </reaction><br>
>> >>    </objectSynchronization><br>
>> >>    </synchronization><br>
>> >><br>
>> >> Now, I am able to connect to the resource and to link existing <br>
>>email<br>
>> >> entries<br>
>> >> to users.<br>
>> >><br>
>> >> But what kind of task should I use to export emails not found in <br>
>>the<br>
>> >>csv<br>
>> >> file yet?<br>
>> >><br>
>> >><br>
>> >> Viele Grüße,<br>
>> >><br>
>> >> Rainer Herbst<br>
>> >> Leiter IT-Service<br>
>> >> Phone: +49 331 7499-257<br>
>> >> e-mail: <a href="mailto:rainer.herbst@aip.de" target="_blank">rainer.herbst@aip.de</a><br>
>> >> <a href="https://www.aip.de" rel="noreferrer" target="_blank">https://www.aip.de</a><br>
>> >><br>
>> >><br>
>> >><br>
>> -----------------------------------------------------------------------------------------------<br>
>> >> Leibniz-Institut für Astrophysik Potsdam (AIP)<br>
>> >> An der Sternwarte 16, 14482 Potsdam<br>
>> >><br>
>> >> Vorstand: Prof. Dr. Matthias Steinmetz, Matthias Winker<br>
>> >> Stiftung bürgerlichen Rechts<br>
>> >> Stiftungsverzeichnis Brandenburg: 26 742-00/7026<br>
>> >><br>
>> >><br>
>> -----------------------------------------------------------------------------------------------<br>
>> >> _______________________________________________<br>
>> >> midPoint mailing list<br>
>> >> <a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
>> >> <a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
>> >><br>
>> ><br>
>> > --<br>
>> > s pozdravom<br>
>> ><br>
>> > Gustáv Pálos<br>
>><br>
>> Viele Grüße,<br>
>><br>
>> Rainer Herbst<br>
>> Leiter IT-Service<br>
>> Phone: +49 331 7499-257<br>
>> e-mail: <a href="mailto:rainer.herbst@aip.de" target="_blank">rainer.herbst@aip.de</a><br>
>> <a href="https://www.aip.de" rel="noreferrer" target="_blank">https://www.aip.de</a><br>
>><br>
>><br>
>> -----------------------------------------------------------------------------------------------<br>
>> Leibniz-Institut für Astrophysik Potsdam (AIP)<br>
>> An der Sternwarte 16, 14482 Potsdam<br>
>><br>
>> Vorstand: Prof. Dr. Matthias Steinmetz, Matthias Winker<br>
>> Stiftung bürgerlichen Rechts<br>
>> Stiftungsverzeichnis Brandenburg: 26 742-00/7026<br>
>><br>
>> -----------------------------------------------------------------------------------------------<br>
>><br>
>> _______________________________________________<br>
>> midPoint mailing list<br>
>> <a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
>> <a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
>><br>
> <br>
> -- <br>
> <br>
> *Arnošt Starosta*<br>
> solution architect<br>
> <br>
> gsm: [+420] 603 794 932<br>
> e‑mail: <a href="mailto:arnost.starosta@ami.cz" target="_blank">arnost.starosta@ami.cz</a><br>
> <br>
> *AMI Praha a.s.*<br>
> Pláničkova 11, 162 00 Praha 6<br>
> <br>
> tel.: [+420] 274 783 239 | web: <a href="http://www.ami.cz" rel="noreferrer" target="_blank">www.ami.cz</a><br>
> <br>
> [image: AMI Praha a.s.]<br>
> <br>
> Textem tohoto e‑mailu podepisující neslibuje uzavřít ani neuzavírá<br>
> za společnost AMI Praha a.s.<br>
> jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít <br>
>výhradně<br>
> písemnou formu.<br>
> <br>
> Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může <br>
>obsahovat<br>
> důvěrné nebo osobní<br>
> informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv<br>
> zveřejňování, zprostředkování<br>
> nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail <br>
>neoprávněně,<br>
> informujte o tom prosím<br>
> odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně<br>
> všech jeho příloh. Nakládáním<br>
> s neoprávněně získanými informacemi se vystavujete riziku právního <br>
>postihu.<br>
<br>
Viele Grüße,<br>
<br>
Rainer Herbst<br>
Leiter IT-Service<br>
Phone: +49 331 7499-257<br>
e-mail: <a href="mailto:rainer.herbst@aip.de" target="_blank">rainer.herbst@aip.de</a><br>
<a href="https://www.aip.de" rel="noreferrer" target="_blank">https://www.aip.de</a><br>
<br>
-----------------------------------------------------------------------------------------------<br>
Leibniz-Institut für Astrophysik Potsdam (AIP)<br>
An der Sternwarte 16, 14482 Potsdam<br>
<br>
Vorstand: Prof. Dr. Matthias Steinmetz, Matthias Winker<br>
Stiftung bürgerlichen Rechts<br>
Stiftungsverzeichnis Brandenburg: 26 742-00/7026<br>
-----------------------------------------------------------------------------------------------<br>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13px"><p><strong>Arnošt Starosta</strong><br><span style="font-size:11px;color:rgb(128,128,128)">solution architect</span></p></div><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px">gsm: [+420] 603 794 932<br>e‑mail: <a href="mailto:arnost.starosta@ami.cz" target="_blank">arnost.starosta@ami.cz</a></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px"><strong>AMI Praha a.s.</strong><br>Pláničkova 11, 162 00 Praha 6</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px">tel.: [+420] 274 783 239 | web: <a href="https://www.ami.cz" target="_blank">www.ami.cz</a></p><p style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;margin-top:20px"><img src="http://www.ami.cz/images/podpis/ami_logo.gif" alt="AMI Praha a.s." style="border: 0px;"></p><p style="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 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>