[midPoint] Return without white spaces
Ivan Noris
ivan.noris at evolveum.com
Mon Dec 8 22:40:22 CET 2014
Jason,
it's possible to use also Java/Groovy trim methods or anything you wish;
but we have some already handy in midPoint libraries.
The point is to know that during inbound processing, the original
attribute value from resource is in the variable named "input".
Of course you can check the variable for null before calling some string
methods on it etc.
See: https://wiki.evolveum.com/display/midPoint/Script+Expression+Functions
Regards,
Ivan
On 12/08/2014 10:34 PM, Jason Everling wrote:
> You make it look so easy! I google'd forever and tried to do it myself
> and it looked way more complicated than this,
>
> Thanks!
>
> JASON
>
> On Mon, Dec 8, 2014 at 3:23 PM, Ivan Noris <ivan.noris at evolveum.com
> <mailto:ivan.noris at evolveum.com>> wrote:
>
> Jason,
>
> you can use basic.trim(variable).
>
> For inbounds, this could be for example:
>
> . . .
> <attribute>
> <ref>ri:description</ref>
> <inbound>
> <expression>
> <script>
> <code>basic.trim(*input*)</code>
> </script>
> </expression>
> <target>
> <path>$user/description</path>
> </target>
> </inbound>
> </attribute>
> . . .
>
> The *input* variable contains the value from that attribute that
> is being processed.
>
> Regards,
> Ivan
>
>
> On 12/08/2014 09:54 PM, Jason Everling wrote:
>> Within a few of my resources that are sql databases, when the
>> attributes sync into Midpoint it is also returning the extra
>> white spaces for example the attribute could be 8 characters but
>> has an extra 27 spaces. I didn't notice until I was looking at
>> users profile in Midpoint and when I click on the attribute it
>> has the spaces, same in the XML user object like
>>
>> <extension xmlns:gen189="http://whatever.com/my">
>> <gen189:profile>Editors </gen189:profile>
>>
>> All the extra spaces are pulled in,
>>
>> I figured there would be a way in the attribute mapping to import
>> the attribute without.
>>
>> JASON
>>
>>
>>
>> CONFIDENTIALITY NOTICE:
>> This e-mail together with any attachments is proprietary and
>> confidential; intended for only the recipient(s) named above and
>> may contain information that is privileged. You should not
>> retain, copy or use this e-mail or any attachments for any
>> purpose, or disclose all or any part of the contents to any
>> person. Any views or opinions expressed in this e-mail are those
>> of the author and do not represent those of the Baptist School of
>> Health Professions. If you have received this e-mail in error, or
>> are not the named recipient(s), you are hereby notified that any
>> review, dissemination, distribution or copying of this
>> communication is prohibited by the sender and to do so might
>> constitute a violation of the Electronic Communications Privacy
>> Act, 18 U.S.C. section 2510-2521. Please immediately notify the
>> sender and delete this e-mail and any attachments from your
>> computer.
>>
>>
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>> http://lists.evolveum.com/mailman/listinfo/midpoint
>
> --
> Ing. Ivan Noris
> Senior Identity Management Engineer
> evolveum.com <http://evolveum.com> evolveum.com/blog/ <http://evolveum.com/blog/>
> _____________________________________________
> "Semper Id(e)M Vix."
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> This e-mail together with any attachments is proprietary and
> confidential; intended for only the recipient(s) named above and may
> contain information that is privileged. You should not retain, copy or
> use this e-mail or any attachments for any purpose, or disclose all or
> any part of the contents to any person. Any views or opinions
> expressed in this e-mail are those of the author and do not represent
> those of the Baptist School of Health Professions. If you have
> received this e-mail in error, or are not the named recipient(s), you
> are hereby notified that any review, dissemination, distribution or
> copying of this communication is prohibited by the sender and to do so
> might constitute a violation of the Electronic Communications Privacy
> Act, 18 U.S.C. section 2510-2521. Please immediately notify the sender
> and delete this e-mail and any attachments from your computer.
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
--
Ing. Ivan Noris
Senior Identity Management Engineer
evolveum.com evolveum.com/blog/
_____________________________________________
"Semper Id(e)M Vix."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141208/58e88aa0/attachment.htm>
More information about the midPoint
mailing list