Hello,
I'm currently programming a connector between a CardDAV server and a LDAP server in php.
I'm using the schema inetOrgPerson which is good for most of the data but I have a problem with multiple equal data. The VCard data is set like this :
ADR;TYPE=HOME:;;123 1st av;Montreal;QC;GGG RT3;CA
which is translated into :
street:: 123 1st av l: Montreal st:QC postalcode: GGG RT3
By default in the inetOrgPerson schema, the country code is not added, so I add a personalized schema with 2 fields : - countryCode ('c') - VCardUnassigned ('vcardunassigned') The second one is when a vcard field has no correspondance in the ldap schema
Problem is, when you have multiple fields with the same value, you get an error 0x14 - LDAP_TYPE_OR_VALUE_EXISTS. Which is logical but kinda annoying if you want for example to add a second address in the same state or country, like : ADR;TYPE=HOME:;;321 42nd st;Montreal;QC;GGG RT1;CA
Is there a way to save multiple equal values for an entry for some fields ?
Bonjour,
The countryCode can't have multiple values:
attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' ) DESC 'RFC2256: ISO-3166 country 2-letter code' SUP name SINGLE-VALUE )
Can't you use the postalAddress attribute? With your examples, it should be something like: postalAddress: 123 1st av$Montreal$QC$GGG RT3$CA postalAddress: 321 42nd st$Montreal$QC$GGG RT1$CA
Address elements are separated by a "$" character, and you can't have empty elements (which means that in your example, you would lose the 2 first empty elements).
Anyway, I don't think multiple values stored in an attribute are given back strictly in the same order.
2013/5/3 Nicolas Mora nicolas@babelouest.org
Hello,
I'm currently programming a connector between a CardDAV server and a LDAP server in php.
I'm using the schema inetOrgPerson which is good for most of the data but I have a problem with multiple equal data. The VCard data is set like this :
ADR;TYPE=HOME:;;123 1st av;Montreal;QC;GGG RT3;CA
which is translated into :
street:: 123 1st av l: Montreal st:QC postalcode: GGG RT3
By default in the inetOrgPerson schema, the country code is not added, so I add a personalized schema with 2 fields :
- countryCode ('c')
- VCardUnassigned ('vcardunassigned')
The second one is when a vcard field has no correspondance in the ldap schema
Problem is, when you have multiple fields with the same value, you get an error 0x14 - LDAP_TYPE_OR_VALUE_EXISTS. Which is logical but kinda annoying if you want for example to add a second address in the same state or country, like : ADR;TYPE=HOME:;;321 42nd st;Montreal;QC;GGG RT1;CA
Is there a way to save multiple equal values for an entry for some fields ?
--On Friday, May 03, 2013 6:24 PM +0200 Erwann Abalea eabalea@gmail.com wrote:
Bonjour,
The countryCode can't have multiple values:
attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' ) DESC 'RFC2256: ISO-3166 country 2-letter code' SUP name SINGLE-VALUE )
Can't you use the postalAddress attribute? With your examples, it should be something like: postalAddress: 123 1st av$Montreal$QC$GGG RT3$CA
postalAddress: 321 42nd st$Montreal$QC$GGG RT1$CA
This is almost the correct way to format it... it should be:
postalAddress: 123 1st av $ Montreal $ QC $ GGG RT3 $ CA
I would also note that there is no guaranteed return order for values unless you use weighted attributes. Generally the best thing to do if you are going to have multiple addresses (say home, work, business, mailing, etc) is to have custom attributes specifically for those addresses
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Quanah Gibson-Mount wrote:
Generally the best thing to do if you are going to have multiple addresses (say home, work, business, mailing, etc) is to have custom attributes specifically for those addresses
IMO this is the worst approach since you need support for such a custom schema in e-mail clients etc.
My approach usually is to model that with a single person entry and several contact entries associated with the person entry. For maintainenance those contact entries are tied to a person entry by 'seeAlso' (or a another custom attribute SUP 'seeAlso').
Ciao, Michael.
openldap-technical@openldap.org