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

Re: vcard



daniel.kaplan@infraswitch.com wrote:
> 
> I know someone said that you can do something like ldapmodify -b -f
> ldif.file
> 
> But what does this allow you to do?

Almost nothing.

>  How do you view that information?
> I know that web2ldap has a little button for viewing vcards, what
> attribute do I put the vcard in to view it from this button?

No need to add an extra attribute holding the vCard. Just push the
button when viewing a person's entry (try the demo on
http://sites.inka.de/ms/cgi-bin/web2ldap.py).

web2ldap (and also web500gw) just convert the entry's attributes to
a text and send it with MIME type text/x-vcard to a WWW client.
Depending on the WWW client it's displayed or just saved to disk.
It's *very* simple - no magic.

In the current web2ldap snapshot you can customize which attributes
of an entry are sent in which form by simply defining a template
file for a complete vCard like this:

--------------------------- snip --------------------------
begin:vcard
fn:%(cn)s
org:%(o)s
note:%(description)s
n:%(sn)s
email;internet:%(mail)s
tel;work:%(telephonenumber)s
tel;home:%(homephonenumber)s
tel;fax:%(facsimiletelephonenumber)s
tel;fax:%(mobile)s
title:%(title)s
role:%(role)s
url:%(labeleduri)s
adr:%(streetaddress)s, %(postalcode)s %(l)s
end:vcard
--------------------------- snip --------------------------

%(attribute type)s are format parameters for a string-keyed Python
dictionary holding the LDAP entry data.

> I've never
> added a binary entry before, my main question is about binary 
> entries and how they are used.

It depends simply on the attribute type and the LDAP client. IMHO it
does not make much sense to put a vCard in a binary attribute.

web2ldap as LDAP client sends some known binary attributes with
appropriate MIME type (configurable) to the WWW client. E.g.
jpegPhoto is mapped to MIME type image/jpeg which browsers
understand and display as image.

Ciao, Michael.