On 25/08/2020 15:08, Matjaz Premerl wrote:
> Hi,
> 
> I want to synchronize Active Directory objectGUID attribute to openLDAP 
> server. Is there any known method which could be use in LSC Sync to convert 
> data to string?
> 
> Regards,
> Matjaž
> 
> _______________________________________________________________
> Ldap Synchronization Connector (LSC) - http://lsc-project.org
> 
> lsc-users mailing list
> [email protected]
> https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users
> 

Hi,

From lastest LSC 2.1.5 you can map binary data with 
getDatasetFirstBinaryValueById().

<dataset>
<name>roomNumber</name>
<forceValues>
<string><![CDATA[js:readUUID(srcBean.getDatasetFirstBinaryValueById("objectGUID"))]></string>
</forceValues>
</dataset>

 readUUID is a function that converts objectGUID to string and decodes it  :

function readUUID(bytes) {
        var hex = new 
java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(bytes));
        return 
hex.replace(/^(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)$/,"$4$3$2$1-$6$5-$8$7-$9$10-$11$12$13$14$15$16").toUpperCase();
}



-- 
Soisik Froger | Software Architect

[email protected]

Worteks | https://www.worteks.com
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to