since I'm not an TDI expert, I decided to ask a basic question, hoping
to save time in investigating the topic by myself:
I did develop a TDI assembly line using the LDAP changelog connector.
It basically listens to the changelog, reads the entries and repeats
some of the changes at another subtree. This works nice, and I did not
have to use the attribute "changes" at all.
In addition, I would like to be able to read the backup of the
changelog, written by db2ldif, and process it analogously. However,
the db2ldif output looks different to the work object changelog
returns. Now, I am forced to use the attribute "changes". But then I
can not use my already existing solution for processing the db2ldif
backup. Any hint, any advice?
Example:
1) changelog connector:
dn: changenumber=5,cn=changelog
changetype: add
targetdn: cn=sshgroupA,ou=Group,o=db.com,ou=userman
changetime: 20091012133345
ibm-changeInitiatorsName: CN=LDAPROOT
member: uid=dummyGroupMember
member: uid=abcd1000,ou=People,o=db.com,ou=userman
member: uid=qpu100,ou=People,o=db.com,ou=userman
member: uid=xtrnamrd,ou=People,o=db.com,ou=userman
ibm-entryuuid: d83c33c0-4b6e-102e-9502-9255fbfe9cb1
objectclass: groupOfNames
objectclass: top
changenumber: 5
changetype: add
businessCategory: ssh-group
cn: sshgroupA
changes::
b2JqZWN0Y2xhc3M6IGdyb3VwT2ZOYW1lcwpvYmplY3RjbGFzczogdG9wCmNuOiByb290QGRia3BpbnN0MS5yemUuZGUuZGIuY29tQFNMUwpjbjogc3NoZ3JvdXBBCmJ1c2luZXNzQ2F0ZWdvcnk6IHNzaC1ncm91cAptZW1iZXI6IHVpZD1kdW1teUdyb3VwTWVtYmVyCm1lbWJlcjogdWlkPWFiY2QxMDAwLG91PVBlb3BsZSxvPWRiLmNvbSxvdT11c2VybWFuCm1lbWJlcjogdWlkPXFwdTEwMCxvdT1QZW9wbGUsbz1kYi5jb20sb3U9dXNlcm1hbgptZW1iZXI6IHVpZD14dHJuYW1yZCxvdT1QZW9wbGUsbz1kYi5jb20sb3U9dXNlcm1hbgppYm0tZW50cnl1dWlkOiBkODNjMzNjMC00YjZlLTEwMmUtOTUwMi05MjU1ZmJmZTljYjEK
2) db2ldif for cn=changelog:
dn: changenumber=5,cn=changelog
objectclass: top
objectclass: changelogentry
objectclass: ibm-changelog
changenumber: 5
targetdn: cn=sshgroupA,ou=Group,o=db.com,ou=userman
changetype: add
changetime: 20091012133345
ibm-changeInitiatorsName: CN=LDAPROOT
changes::
b2JqZWN0Y2xhc3M6IGdyb3VwT2ZOYW1lcwpvYmplY3RjbGFzczogdG9wCmNuOiByb29
0QGRia3BpbnN0MS5yemUuZGUuZGIuY29tQFNMUwpjbjogc3NoZ3JvdXBBCmJ1c2luZXNzQ2F0ZWd
vcnk6IHNzaC1ncm91cAptZW1iZXI6IHVpZD1kdW1teUdyb3VwTWVtYmVyCm1lbWJlcjogdWlkPWF
iY2QxMDAwLG91PVBlb3BsZSxvPWRiLmNvbSxvdT11c2VybWFuCm1lbWJlcjogdWlkPXFwdTEwMCx
vdT1QZW9wbGUsbz1kYi5jb20sb3U9dXNlcm1hbgptZW1iZXI6IHVpZD14dHJuYW1yZCxvdT1QZW9
wbGUsbz1kYi5jb20sb3U9dXNlcm1hbgppYm0tZW50cnl1dWlkOiBkODNjMzNjMC00YjZlLTEwMmU
tOTUwMi05MjU1ZmJmZTljYjEK
ibm-entryuuid: d83c33c0-4b6e-102e-9503-9255fbfe9cb1
control: 1.3.18.0.2.10.19 false::
MIQAAADdMIQAAAAqCgEAMIQAAAAhBAxjcmVhdG9yc05hbWUxhAAAAA0EC0NOPUxEQVBST09UMI
QAAAA4CgEAMIQAAAAvBA9jcmVhdGVUaW1lc3RhbXAxhAAAABgEFjIwMDkxMDEyMTEzMzQ1LjAwMD
AwMFowhAAAACsKAQAwhAAAACIEDW1vZGlmaWVyc05hbWUxhAAAAA0EC0NOPUxEQVBST09UMIQAAA
A4CgEAMIQAAAAvBA9tb2RpZnlUaW1lc3RhbXAxhAAAABgEFjIwMDkxMDEyMTEzMzQ1LjAwMDAwMF
o=
Sonja
I think the root issue here is that the first set of attributes
are those returned by the Changelog Connector, which include
both attributes from the changelog entry AND the changed entry.
The db2ldif dump looks like just the changelog entry.
Unless you can modify the db2ldif output then I am not sure
how to proceed here.
I am no LDAP expert, but in my experience the changes attribute
you get from the Changelog Connector should contain an LDIF
formatted string - the one the Connector parses with the LDIF
parser to get the actual changed attributes. The dump above
looks like the changes value is base 64 encoded, so you should
be able to read this either in your db2ldif reading AL to get the
changed attributes, or you could just write your own ldif files
using what you get back from the Connector.
Note that there are methods for decoding/encoding base 64
in the UserFunctions library (the "system" script object) as
well as in the util class. I have not done this myself, but a little
interactive trial-and-error in the Debugger (using the JavaScript
evaluator which lets you throw snippets to test at a running AL)
should get you going.
Hope this helps!
-Eddie