[midPoint] Username generation Question

Jason Everling jeverling at bshp.edu
Thu Nov 20 18:20:27 CET 2014


I decided to make this seperate,

So the username gets generated with the following

        <expression>
            <script>
                <code>
                    tmpGivenNameInitial =
basic.stringify(tmpGivenName)?.size() > 0 ?
                    (basic.stringify(tmpGivenName)).substring(0,2) : ''
                    if (iteration == 0) {
                    basic.norm(basic.stringify(tmpGivenNameInitial +
tmpFamilyName))
                    }
                    else {
                    basic.norm(basic.stringify(tmpGivenNameInitial +
tmpFamilyName)) + iterationToken
                    }
                </code>
            </script>
        </expression>

Would there be a way, instead of using the iterationToken to use another
script if the username is already taken.

Try filastname and if not try firlastname ?

I was thinking maybe this which is probably not correct but easier to
visualize.

        <expression>
            <script>
                <code>
                    tmpGivenNameInitial =
basic.stringify(tmpGivenName)?.size() > 0 ?
                    (basic.stringify(tmpGivenName)).substring(0,2) : ''
                    if (iteration == 0) {
                    basic.norm(basic.stringify(tmpGivenNameInitial +
tmpFamilyName))
                    }
                    else {
                    tmpGivenNameInitial =
basic.stringify(tmpGivenName)?.size() > 0 ?
                    (basic.stringify(tmpGivenName)).substring(0,3) : ''
                    basic.norm(basic.stringify(tmpGivenNameInitial +
tmpFamilyName))
                    }
                </code>
            </script>
        </expression>

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. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141120/2270541d/attachment.htm>


More information about the midPoint mailing list