Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CSV Reconciliation - Multi-Value Attribute

337 views
Skip to first unread message

Rodrigo Almeida

unread,
Dec 18, 2009, 2:39:01 PM12/18/09
to
Hi all,

We developed a web services adapter with some operations, add, modify
and delete using TDI and ADT. But the reconciliation will be done
manually, with CSV file.

But this service has a multi-value attribute, named "groups". I'd
like to know how should I implement this in TDI.
I tried a lot of options, but without success. I can't reconciliate
an account with its groups (multi-value).

Thanks,
Rodrigo

JasonW

unread,
Dec 18, 2009, 3:47:52 PM12/18/09
to


I am going to assume your trying to create a multi-value attribute in
the CSV output, if so..have a look at this..
The following Advanced Attribute script could be used to accomplish
this.

------------ Example Script ------------
//Attribute is multivalue. We will pipe the values
var Array = work.getAttribute("objectclass");
var String = "";

if (Array !=null && Array.size()>0)
{
String = Array.getValue(0);
for (i=1;i<Array.size();i++)
{
var role = Array.getValue(i);
String = String + "," + role;
}
}
ret.value = String;
----------------------------------

Rodrigo Almeida

unread,
Dec 21, 2009, 7:04:41 AM12/21/09
to

Hi,

Actually, I'm reading a multi-value attribute separated by "|" from a
CSV file and the output is a LDAP
conector to ITIM account schema. How will be the script?

Sorry, I'm not very good in TDI (yet)! :-)

Thanks,
Rodrigo

Eddie Hartman

unread,
Dec 22, 2009, 6:03:52 AM12/22/09
to
Hi Rodrigo,

Here is an example map in JavaScript:

---
// for example, the "mail" attribute here
mail = system.newAttribute("mail");
mailField = conn.getString("Email");
values = system.splitString(mailField, "|");
for (mailVal in values)
mail.addValue(mailVal);
ret.value = mail;
---

Hope this helps!
-Eddie

Rodrigo Almeida

unread,
Dec 22, 2009, 7:56:35 AM12/22/09
to

Hi Eddie,

It works, but I have to implement some modifications:

mail = system.newAttribute("mail");

mailField = work.getAttribute("Email").getValue(0);


values = system.splitString(mailField, "|");
for (mailVal in values)
mail.addValue(mailVal);
ret.value = mail;

Thanks you!
Rodrigo

Eddie Hartman

unread,
Dec 23, 2009, 5:35:03 AM12/23/09
to
D'oh!! :)

nowack...@gmail.com

unread,
Nov 19, 2013, 12:41:32 PM11/19/13
to
Thanks for posting your script, Jason. It was exactly what I needed to return all erroles for a person from TIM LDAP.
0 new messages