Tivoli Directory Integrator, Version 7.1.1

Using binary values in scripting

Binary values can be retrieved from Attributes by using the getObject() function of the entry. The binary Attribute value itself is returned as a byte array. Here is a JavaScript example:

var x = conn.getObject("objectGUID");
for ( i = 0; i < x.length; i++ )
{
   task.logmsg ("GUID[" + i + "]: " + x[i]);
}
This example writes some numbers varying between -128 and 127 into the log file. You might want to do something else with your data. If you have read a password from a Connector, which stored it as a ByteArray, you can convert it to a string with this code:
password = system.arrayToString(conn.getObject("userpassword"));

[ Terms of use | Feedback ]
(C) Copyright IBM Corporation, 2003, 2012. All Rights Reserved.
IBM Tivoli Directory Integrator 7.1.1