[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Attribute Syntax



But I need to mix them. I need to search in the base "ou=People,..." and mix the attributes of the two bases, for searching i.e. all the Smith that are policemen or firemen, and get the attributes of the two bases.

That's why I need composed attributes, each one of that works have their own phone number and another possible atributes. (Police/911, Fire/555, etc)

Thanks anyway.

David Smith wrote:

Don't mix the searches. Use the *search base* as cn=Dave Smith,ou=People... and the *search filter* as (Phone=911)

Like this:

ldapsearch -b "cn=Dave Smith, ou=People, dc=example, dc=com" -s sub -h ldap.example.com -x (Phone=911)

--Dave

Daniel Merino wrote:

Hi. Thanks for your response, David.

This was my first choice, and I implemented it, but there was a problem with the searches, because if you want to search with a filter composed by an attribute of cn=Dave Smith,... and another of cn=address1, cn=Dave Smith,...you can't mix the two attributes. I.e. if I want to search all the People that have sn=Smith and phone=911 (&(sn=Dave)(phone=911)) I can't get the data with this filter.

I think I can't, maybe I'm wrong?

David Smith wrote:

You could create a new objectClass that stores attributes that you are
interested in: address, phone, state, etc. Then, create several entries
based on that objectClass as *children* of the desired entry. So, to use
your vernacular, each child entry is like a struct, hashable based on one
(or more) of its attributes.


So, like this:

dc=example,dc=com
  ou=People
     cn=Dave Smith
        cn=address1
        cn=address2
        cn=address3
     cn=Bob Jones
        cn=address1
        cn=address2
    ...

The sub-entries would look like this:

dn: cn=address1,cn=Dave Smith,ou=People,dc=example,dc=com
name: police
phone: 911

dn: cn=address2,cn=Dave Smith,ou=People,dc=example,dc=com
name: fire
phone: 555-1234

etc...

The search filter would be easy too. Just use

(name=fire) with a search base of cn=Dave Smith,ou=People,dc=example,dc=com

This may be slightly unorthodox, but similar to the nsliProfileName idea.
I think it would be pretty cool. Let us know what you decide to do.


Just my 2 cents

--Dave

<quote who="Craig Dunigan">


We do this that way in some places (ordered values separated by '$'). In
others, we do it by writing the "sub-attributes," if you will, in XML,
then Perl DataDump (you could Java serialize, if you prefer) the XML
string to the actual attribute value. Or you could just dump/serialize a
hash into the value.


All these require custom programming - I don't know of any pure LDAP way
to do it. What you're really looking for is *ordered* multi-value
attributes, or an attribute "hash," neither of which exist in OpenLDAP.
They might in some commercial LDAP product, I can't say.


Craig Dunigan
IS Network Services Specialist
UW-Madison, DoIT, Middleware

On Thu, 25 Sep 2003, Daniel Merino wrote:



Yes, but I want to have several values in each multi-value, like this:

Attribute value 1: Name-->John, Phone-->5556789, City: Boston
Attribute value 2: Name-->Phil, Phone-->5559876, City: Chicago

I think I could write them like this: John$5556789$Boston,
Phil$5559876$Chicago  and filter the values before use them.

But I want to know if there is an attribute type similar to a struct.
Thanks for your answer.

Eliezer E Chavez wrote:



Normally the attribute value is mult-valuei, you have to specify if


its


value is single-value

suomi hasler wrote:



description:     ???

suomi

Daniel Merino wrote:



Hi everybody.

Does it exist a multi-valued attribute's sintax where I can insert
two or more separated strings in each attribute's value?

I want to insert in an attribute value two data, i.e. "Police" &
"911". I know I can unify the two strings like "Police@911", but I
wonder if I can't put this in an attribute without using my own
filters to insert and get the data.

Sorry if the question is stupid, but I'm a newbie in LDAP.
Thanks for your help.













-- Daniel Merino daniel.merino@unavarra.es Sección de Gestión - Servicio Informático Universidad Pública de Navarra.