[Top] | [Contents] | [Index] | [ ? ] |
This manual documents EUDC v1.28, the Emacs Unified Directory Client.
A common interface interface to directory servers using various protocols such as LDAP or the CCSO white pages directory system (PH/QI)
1. Overview Summary of EUDC features 2. Installation How to install EUDC 3. Usage The various usage possibilities explained 4. Credits Who's done what Variables Index
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC, the Emacs Unified Directory Client, provides a common user interface to access directory servers using different directory protocols.
Currently supported back-ends are:
The main features of the EUDC interface are:
1.1 LDAP What is LDAP ? 1.2 CCSO PH/QI What is CCSO, PH, QI ? 1.3 BBDB What is BBDB ?
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
LDAP, Lightweight Directory Access Protocol, is a communication protocol for directory applications defined in RFC 1777.
Quoted from RFC 1777:
[LDAP] is designed to provide access to the X.500 Directory while not incurring the resource requirements of the Directory Access Protocol (DAP). This protocol is specifically targeted at simple management applications and browser applications that provide simple read/write interactive access to the X.500 Directory, and is intended to be a complement to the DAP itself.
LDAP servers usually store (but are not limited to) information about people such as their name, phone number, e-mail address, office location, etc.... More information about LDAP can be found at http://www.umich.edu/~dirsvcs/ldap/
EUDC requires external support to access LDAP directory servers (see section 2.1 LDAP Requirements)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Central Computing Services Office (CCSO) of the University of Illinois at Urbana Champaign (UIUC) created and freely distributes a directory system that is currently in use in more than 300 organizations around the world. The system records information about people such as their address, phone number, e-mail, academic information or any other details it was configured to.
The system consists of two parts: a database server traditionally called
qi
and a command-line client called
ph
. ftp://uiarchive.cso.uiuc.edu/pub/packages/ph is the
main distribution site.
http://www.uiuc.edu/cgi-bin/ph/lookup?Query=. provides a listing
of the active qi
servers.
The original command-line ph
client that comes with the
ph/qi
distribution provides additional features like the
possibility to communicate with the server in login mode which makes it
possible to change records in the database. This is not implemented in
EUDC.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
BBDB is the Big Brother's Insiduous Database, a package for Emacs originally written by Jamie Zawinski and which provides rolodex-like database functionality with tight integration with the Emacs mail and news readers.
It is often used as an enhanced e-mail address book.
EUDC considers BBDB as a directory server backend just like LDAP or PH/QI servers though BBDB has no client/server protocol and thus always resides locally on your machine. The point in this is not to offer an alternate way to query your BBDB database (BBDB itself provides much more flexible ways to do that) but rather to offer an interface to your local directory that is consistent with the interface to external directories (LDAP, PH/QI). This is particularly interesting to perform queries on multiple servers.
EUDC also offers a means to insert results from directory queries into your own local BBDB (see section 3.6 Creating BBDB Records)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The installation procedure depends on the Emacs flavor you are running.
On XEmacs, EUDC is distributed as an XEmacs package. Follow the rules for the installation of XEmacs packages (see section `XEmacs Packages' in XEmacs Manual).
On GNU Emacs simply copy the *.el
files to some directory in your
load-path
. Add the following to your .emacs
init file:
(require 'eudc) |
After installing EUDC you will find (the next time you launch Emacs) a
new Directory Search
submenu in the Tools
menu that will give you
access to EUDC.
You may also find useful to add the following to your .emacs
initialization file to add a shortcut for e-mail address expansion in
e-mail composition buffers (see section 3.3 Inline Query Expansion)
(eval-after-load "message" '(define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) (eval-after-load "mail" '(define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) |
2.1 LDAP Requirements EUDC needs external support for LDAP
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC needs external support to query LDAP servers. If LDAP support is not available you will get that error message: `Cannot open load file: ldap'
In XEmacs LDAP support can be compiled into the XEmacs binary. LDAP support is automatically compiled in when you build XEmacs provided appropriate LDAP libraries are installed on your system. As of this writing you can use either (URLs are subject to change):
In GNU Emacs, LDAP support is added by means of ldap.el
available
from the same place you downloaded EUDC. ldap.el
needs an
external command line utility named ldapsearch
which is available
in the LDAP toolkits mentioned above.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes the usage of EUDC. Most functions and
customization options are available through the Directory Search
sub-menu of the Tools
sub-menu.
3.1 Querying Servers How queries are performed and handled 3.2 Query Form How to use and customize the query form 3.3 Inline Query Expansion How to use and customize inline queries 3.4 The Server Hotlist How to use and manage the server hotlist 3.5 Multi-server Queries How to query multiple servers sucessively 3.6 Creating BBDB Records How to insert query results into your BBDB 3.7 Server/Protocol Locals Customizing on a per server/protocol basis
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC's basic functionality is to let you query a directory server and return the results back to you. There are several things you may want to customize in this process.
3.1.1 Selecting a Server The first thing to do 3.1.2 Return Attributes Configuring what the server should return 3.1.3 Duplicate Attributes What to do when records have duplicate attributes
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Before doing any query you will need to set the directory server. You need to specify the name of the host machine running the server software and the protocol to use. If you do not set the server in any fashion, EUDC will ask you for one when you make your first query.
You can set the server by selecting one from your hotlist of servers (see section 3.4 The Server Hotlist) available in the `Server' submenu or by selecting `New Server' in that same menu.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Directory servers may be configured to return a default set of attributes for
each record matching a query if the query specifies none. The variable
eudc-default-return-attributes
controls the return attributes you want to
see, if different from the server defaults.
all
then all available attributes are returned. nil
returns the default attributes as configured in the server. Default is
nil
The server may return several matching records to a query. Some of the records may however not contain all the attributes you requested. You can discard those records.
nil
, entries that do not contain all the requested return
attributes are ignored. Default is t
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Directory standards may authorize different instances of the same attribute in a record. For instance the record of a person may contain several e-mail fields containing different e-mail addresses. When using a QI directory server this is difficult to distinguish from attributes having multi-line values such as the postal address that may contain a line for the street and another one for the zip code and city name. In both cases, EUDC will consider the attribute be duplicated.
EUDC has several methods to deal with duplicated attributes. The available methods are:
list
first
concat
\n
as a separator. The
record keeps only one instance of the field the value of which is a
single multi-line string.
duplicate
select
as the method to
handle multiple matches in inline expansion queries (see section 3.3 Inline Query Expansion) because you are presented with the 3 addresses in a
selection buffer
Because a method may not be applicable to all fields, the variable
eudc-duplicate-attribute-handling-method
lets you specify either a
default method for all fields or a method for each individual field.
list
, first
, concat
,
duplicate
(see above). Defaults to list
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The simplest way to query your directory server is to use the query
form. You display the query form with the Query with Form
menu
item or by invoking the command eudc-query-form. The attribute
names presented in this form are defined by the
eudc-query-form-attributes
variable (unless a non-nil
argument is supplied to eudc-query-form
).
Since the different directory protocols to which eudc interfaces may
have different names for equivalent attributes, EUDC defines its own set
of attribute names and a mapping between these names and their
protocol-specific equivalent through the variable
eudc-protocol-attributes-translation-alist
. Names currently
defined by EUDC are `name', `firstname', `email' and
`phone'.
List Valid Attribute Names
menu item or the
eudc-get-attribute-list command. Defaults to name
,
email
and phone
.
nil
argument the function first queries the server for the existing fields
and displays a corresponding form. All protocols may not support a
non-nil
argument here.
Since the names of the fields may not be explicit enough or adapted to
be directly displayed as prompt strings in the form, the variable
eudc-user-attribute-names-alist
lets you define more explicit
names for directory attribute names. This variable is ignored if
eudc-use-raw-directory-names
is non-nil
.
nil
, use attributes names as defined in the directory.
Otherwise, directory query/response forms display the user attribute
names defined in eudc-user-attribute-names-alist
.
Upon successful completion the command will display a buffer containing
the results of the query. The fields that are returned for each record
are controlled by eudc-default-return-attributes
(see section 3.1.2 Return Attributes)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Inline query expansion is a powerful method to get completion from your
directory server. The most common usage is for expanding names to e-mail
addresses in mail message buffers. The expansion is performed by the
command eudc-expand-inline
which is available from the
`Directory Search' menu but can also be conveniently bound to a key
shortcut (see section 2. Installation) The operation is controlled by the
variables eudc-inline-expansion-format
,
eudc-inline-query-format
,
eudc-expanding-overwrites-query
and
eudc-multiple-match-handling-method
.
If the query fails for a server, other servers may be tried successively until one of them finds a match (see section 3.5 Multi-server Queries).
eudc-inline-query-format
controls how individual words
are mapped onto directory attribute names. After querying the server
for the given string, the expansion specified by
eudc-inline-expansion-format
is inserted in the buffer at
point. If replace-p is t
then this expansion replaces the
query string in the buffer. If eudc-expanding-overwrites-query
is non-nil
then the meaning of replace-p is negated.
nil
all the words will be mapped onto the default
server/protocol attribute name (generally name
).
For instance, use the following
(setq eudc-inline-query-format '((name) (firstname) (firstname name))) |
format
. Remaining elements are symbols
corresponding to directory attribute names.
The corresponding attribute values
are passed as additional arguments to format. Default is ("%s"
email)
but you may want to consider a value like ("%s <%s>" name
email)
first
select
all
abort
Defaults to select
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC lets you maintain a list of frequently used servers so that you
can easily switch from one to another. This hotlist appears in the
Server
sub-menu. You select a server in this list by clicking on
its name. You can add the current server to the list with the command
eudc-bookmark-current-server
. The list is contained in the variable
eudc-server-hotlist
which is stored in and retrieved from the file
designated by eudc-options-file
. EUDC also provides a facility to
edit the hotlist interactively (see section 3.4.1 The Hotlist Edit Buffer).
The hotlist is also used to make queries on multiple servers successively (see section 3.5 Multi-server Queries). The order in which the servers are tried is the order they appear in the hotlist, therefore it is important to sort the hotlist appropriately.
3.4.1 The Hotlist Edit Buffer An interactive hotlist editing facility
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The hotlist edit buffer offers a means to manage a list of frequently used servers. Commands are available in the context pop-up menu generally bound to the right mouse button. Those commands also have equivalent keybindings.
kill-buffer
to exit without saving.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When using inline query expansion (see section 3.3 Inline Query Expansion), EUDC can try to query successively a sequence of directory servers until one of them successfully finds a match for the query.
current-server
hotlist
server-then-hotlist
nil
, indicates
that all available servers should be tried.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
With EUDC, you can automatically create BBDB records
(see section `BBDB' in BBDB Manual) from records you get from a
directory server. You do this by moving the point to the appropriate
record in a query result display buffer and invoking the command
eudc-insert-record-at-point-into-bbdb
with the
keyboard binding b (1), or with the menu. EUDC
cannot update an existing BBDB record and will signal an error if you
try to insert a record matching an existing one.
Because directory systems may not enforce a strict record format, local server installations may use different attribute names and have different ways to organize the information. Furthermore BBDB has its own record structure. For these reasons converting a record from its external directory format to the BBDB format is a highly customizable process.
(
bbdb-field . spec-or-list)
.
bbdb-field is the name of a field
that must be defined in your BBDB environment (standard field names are
name
, company
, net
, phone
, address
and notes
).
spec-or-list is either a single mapping specification or a list of
mapping specifications. Lists of mapping specifications are valid for
the phone
and address
BBDB fields only. specs are
actually s-expressions which are evaluated as follows:
bbdb-create-internal
).
eudc-bbdbify-phone
and eudc-bbdbify-address
are provided as
convenience functions to parse phones and addresses.
The default value of the PH-specific value of that variable is
eudc-ph-bbdb-conversion-alist
:
((name . name) (net . email) (address . (eudc-bbdbify-address address "Address")) (phone . ((eudc-bbdbify-phone phone "Phone") (eudc-bbdbify-phone office_phone "Office Phone")))) |
This means that:
name
field of the BBDB record gets its value
from the name
attribute of the directory record
net
field of the BBDB record gets its value
from the email
attribute of the directory record
address
field of the BBDB record is obtained by parsing the
address
attribute of the directory record with the function
eudc-bbdbify-address
phone
fields are created (when possible) in the BBDB record.
The first one has "Phone" for location and its value is obtained by
parsing the phone
attribute of the PH/QI record with the function
eudc-bbdbify-phone
. The second one has "Office Phone" for location
its value is obtained by parsing the office_phone
attribute of the
PH/QI record with the function eudc-bbdbify-phone
.
eudc-bbdb-conversion-alist
. It parses phone into a vector
compatible with bbdb-create-internal
. phone is either a string
supposedly containing a phone number or a list of such strings which are
concatenated. location is used as the phone location for BBDB.
eudc-bbdb-conversion-alist
. It parses addr into a vector
compatible with bbdb-create-internal
. addr should be an
address string of no more than four lines or a list of lines. The last
line is searched for the zip code, city and state name. location
is used as the phone location for BBDB.
Note that only a subset of the attributes you selected with
eudc-default-return-attributes
and that are actually displayed may
actually be inserted as part of the newly created BBDB record.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC can be customized independently for each server or directory protocol. All variables can be given local bindings that are activated when a particular server and/or protocol becomes active. This is much like buffer-local bindings but on a per server or per protocol basis.
3.7.1 Manipulating local bindings Functions to set and query local bindings 3.7.2 LDAP Locals Built-in LDAP Local Variables 3.7.3 PH Locals Built-in PH/QI Local Variables
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC offers functions that let you set and query variables on a per server or per protocol basis.
The following predicates allow to test for the existence of server/protocol local bindings for a particular variable.
The following functions allow to set the value of a variable with various degrees of localness.
eudc-protocol
.
The current binding of var is changed only if protocol is
omitted.
eudc-server
.
The current binding of var is changed only if server is
omitted.
The following variables allow you to query for the various bindings of a variable (local or non-local).
unbound
if var has no EUDC default value.
eudc-protocol
.
eudc-server
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
EUDC was written by Oscar Figueiredo based on ph.el
by the
same author.
Thanks to Soren Dayton for his suggestions, his enthusiasm and his help
in testing and proofreading the code and docs of ph.el
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | E |
---|
Jump to: | E |
---|
[Top] | [Contents] | [Index] | [ ? ] |
This keybinding does not actually
call eudc-insert-record-at-point-into-bbdb
but uses
eudc-try-bbdb-insert
instead.
[Top] | [Contents] | [Index] | [ ? ] |
1. Overview
1.1 LDAP2. Installation
1.2 CCSO PH/QI
1.3 BBDB
2.1 LDAP Requirements3. Usage
3.1 Querying Servers4. Credits
3.1.1 Selecting a Server3.2 Query Form
3.1.2 Return Attributes
3.1.3 Duplicate Attributes
3.3 Inline Query Expansion
3.4 The Server Hotlist
3.4.1 The Hotlist Edit Buffer3.5 Multi-server Queries
3.6 Creating BBDB Records
3.7 Server/Protocol Locals
3.7.1 Manipulating local bindings
3.7.2 LDAP Locals
3.7.3 PH Locals
Variables Index
[Top] | [Contents] | [Index] | [ ? ] |
1. Overview
2. Installation
3. Usage
4. Credits
Variables Index
[Top] | [Contents] | [Index] | [ ? ] |
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | previous or up-and-previous section | 1.1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next or up-and-next section | 1.3 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | concept index | |
[ ? ] | About | this page |