[midPoint] Proper handling of multivalued extension property to single string
Pálos Gustáv
gustav.palos at gmail.com
Tue Jun 27 10:06:03 CEST 2017
Hi Kari,
please see also:
https://wiki.evolveum.com/display/midPoint/Script+Expression#ScriptExpression-AbsoluteandRelativeScriptExpressions
Best regards
Gustav
2017-06-27 10:00 GMT+02:00 Kari Heikkilä <kari.heikkila at qvantel.com>:
> Hi,
>
>
>
> I have email aliases handling for a user inspired from
> https://wiki.evolveum.com/display/midPoint/Unique+property+value+HOWTO
>
>
>
> Now I need to get this multivalued property concatenated into single
> string into CSV resource (outbound only).
>
> Problem is that outbound script expression is called separately for each
> value in multivalued property (visible on log as multiple log lines for one
> user if there more than one value on property).
>
>
>
> Definition snippets:
>
>
>
> Schema extension:
>
>
>
> <xsd:element name="emailAddresses" type="xsd:string" minOccurs="0"
> maxOccurs="unbounded">
>
> <xsd:annotation>
>
> <xsd:appinfo>
>
> <a:indexed>true</a:indexed> <!-- this is
> important! -->
>
> <a:displayName>Email aliases</a:displayName>
>
> <a:displayOrder>170</a:displayOrder>
>
> </xsd:appinfo>
>
> <xsd:documentation>
>
> ...
>
> </xsd:documentation>
>
> </xsd:annotation>
>
> </xsd:element>
>
>
>
> CSV resource schema:
>
>
>
> <xsd:element minOccurs="0" name="proxyAddresses" type="xsd:string">
>
> <xsd:annotation>
>
> <xsd:appinfo>
>
> <a:displayOrder>120</a:displayOrder>
>
> <ra:frameworkAttributeName>proxyAddresses</ra:
> frameworkAttributeName>
>
> </xsd:appinfo>
>
> </xsd:annotation>
>
> </xsd:element>
>
>
>
> CSV resource schema handling:
>
>
>
> <attribute>
>
> <c:ref>ri:proxyAddresses</c:ref>
>
> <displayName>E-mail proxyAddresses</displayName>
>
> <outbound>
>
> <strength>strong</strength>
>
> <source>
>
> <c:path>$user/extension/emailAddresses</c:path>
>
> </source>
>
> <expression>
>
> <script>
>
> <code>
>
> log.error("emailAddresses: " + emailAddresses)
>
> if (emailAddresses != null &&
> emailAddresses.size() > 0) {
>
> emailAddresses.join(',')
>
> } else {
>
> "no aliases"
>
> }
>
> </code>
>
> </script>
>
> </expression>
>
> </outbound>
>
> </attribute>
>
>
>
> Which is proper way to handle this?
>
>
>
>
>
> Best regards,
>
> Kari
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
--
s pozdravom
Gustáv Pálos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170627/fd846848/attachment.htm>
More information about the midPoint
mailing list