Dear Friends,
I have a need to extend an LDAP schema by adding an attribute and copy the value from an existing attribute to it. We need to keep the two copies of the attribute values in synch. It is a kind of replication where it is replicating one attribute into another in the same record.
I appreciate your help.
On Mon, 26 Oct 2009, Ravi Verma wrote:
Dear Friends,
I have a need to extend an LDAP schema by adding an attribute and copy the value from an existing attribute to it. We need to keep the two copies of the attribute values in synch. It is a kind of replication where it is replicating one attribute into another in the same record.
Note, that no matter what kind of mechanism (internal, external, whatever), AFAIK it's not possible to have two variables of the particular attribute with the same value. Anyway, to achieve such functionality, I'd try the following:
Let's say you need to keep copy of three multivalue attributes per-entry,
commonName: john commonName: fitzgerald commonName: kennedy mail: j@whitehouse.gov mail: jfk@pentagon.org uidNumber: 12345
1) customize schema adding e.g. commonNameCopy, mailCopy, uidNumberCopy attributes, with the same attribute properties
2) use some quick&dirty ldapmodify script, called from cron every 5 minutes, applying attribute copying for some cute ldap filter.
This is quite simple and easy to achieve, I don't know whether some other methods like internal overlay doing this, is available. Anyway, the only reason to keep attribute value copy is (probably), to find out what was a previously set value for particular attribute, and possibly restore (?) a previously set value. While copying (synchronizing) attribute value with its copyTwin attribute, actually make previously set value - lost. So the reason and objective of the whole thing would also need some attribute-value-timestamp stored somewhere/somehow per-value, which, actually, makes the whole concept a bit out of sense.
Regards, DT
I have a need to extend an LDAP schema by adding an attribute and copy the value from an existing attribute to it. We need to keep the two copies of the attribute values in synch. It is a kind of replication where it is replicating one attribute into another in the same record.
More - such functionality reminds me Lotus Domino enviroment, which is not object-oriented nor relational database, nor the hybrid of these. In Lotus each Entry stores a collection of Items (attributes), while each Item in the Entry can have arbitral number of independent, same-value or different-value variables. Access to each value of each entry is via iteration over the collection. Quite confusing, AFAIR, and LDAP is, hopefully, far from such ideas ;-)
Regards, DT
Ravi Verma wrote:
Dear Friends,
I have a need to extend an LDAP schema by adding an attribute and copy the value from an existing attribute to it. We need to keep the two copies of the attribute values in synch. It is a kind of replication where it is replicating one attribute into another in the same record.
I appreciate your help.
If I understand you correctly, you need to add an attribute with a different attribute name, and then make sure the values stay synchronized?
E.g. you have an attribute uid=jsmith and you want another attribute nickname=jsmith?
If the above is correct, aliasing and/or rewrites may fit your purpose.
For further assistance I think it would be useful to provide an example or two.
openldap-technical@openldap.org