Hi,

My example is like your function. Example from lsc.xml file:
<string>
//this works, but last format is not changed
var bytes = srcBean.getDatasetFirstBinaryValueById("objectGUID");
var hex = new
java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(bytes));
print("Value hex: " + hex);
var guidString =
hex.replace(/^(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)$/,"$4$3$2$1-$6$5-$8$7-$9$10-$11$12$13$14$15$16").toUpperCase();
print("Value guidString: " + guidString);
guidString;
</string>

But as you see the result of print output is always the same value, except
lower or upper case.
Aug 28 15:00:17 - INFO  - Starting sync for LDAPUserCreate
Value hex: 7277143defbfbdefbfbd1b45efbfbd13efbfbd4cefbfbddc9a30
Value guidString: 7277143DEFBFBDEFBFBD1B45EFBFBD13EFBFBD4CEFBFBDDC9A30

Do you see something that I'm doing wrong in the replace function or
something else?

Regards,
Matjaž

V V pet., 28. avg. 2020 ob 14:15 je oseba Soisik Froger <
soisik.fro...@worteks.com> napisala:

> On 28/08/2020 12:09, Matjaz Premerl wrote:
> > Hi,
> >
> > Two days ago you sent me information how to convert AD objectGUID with
> new method getDatasetFirstBinaryValueById and using functionreadUUID to
> convert it to string. Such method return as value for example
> D6708F733AD4064F87B546DBB6C291A4. Do you have maybe also a function that
> returns also in a string, but in a standard format like
> 738f70d6-d43a-4f06-87b5-46dbb6c291a4
> >
> > Thanks in advance,
> > Matjaž
> >
> > _______________________________________________________________
> > Ldap Synchronization Connector (LSC) - http://lsc-project.org
> >
> > lsc-users mailing list
> > lsc-users@lists.lsc-project.org
> > https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users
> >
>
> Hi,
>
> The example function readUUID I've send do this conversion :
>
> var hex = new
> java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(bytes));
>
> hex.replace(/^(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)$/,"$4$3$2$1-$6$5-$8$7-$9$10-$11$12$13$14$15$16").toUpperCase();
>
> --
> Soisik Froger | Software Architect
>
> soisik.fro...@worteks.com
>
> Worteks | https://www.worteks.com
> _______________________________________________________________
> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>
> lsc-users mailing list
> lsc-users@lists.lsc-project.org
> https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
lsc-users@lists.lsc-project.org
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to