unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* eudc / ldap / mail duplicates.
@ 2005-04-30 23:18 Bruno Hertz
  2005-05-02 15:14 ` Kevin Rodgers
       [not found] ` <mailman.251.1115047233.2819.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Bruno Hertz @ 2005-04-30 23:18 UTC (permalink / raw)



Hi

has anybody working code for correct duplicate ldap mail attribute
handling? 

Apparently, with Emacs CVS the eudc-filter-duplicate-attributes
function expects a different kind of list than the ldap backend
actually delivers.

That is, a list like
((mail . "a@b") (mail . "c@d"))
coming back from the ldap query is not recognized as duplicate list,
and the whole thing just doesn't work.

I've been debugging the stuff for two hours, but it's still not clear
where to cut into the code without breaking something.

Hints appreciated.

Regards, Bruno.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eudc / ldap / mail duplicates.
  2005-04-30 23:18 eudc / ldap / mail duplicates Bruno Hertz
@ 2005-05-02 15:14 ` Kevin Rodgers
       [not found] ` <mailman.251.1115047233.2819.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2005-05-02 15:14 UTC (permalink / raw)


Bruno Hertz wrote:
 > Apparently, with Emacs CVS the eudc-filter-duplicate-attributes
 > function expects a different kind of list than the ldap backend
 > actually delivers.
 >
 > That is, a list like
 > ((mail . "a@b") (mail . "c@d"))
 > coming back from the ldap query is not recognized as duplicate list,
 > and the whole thing just doesn't work.
 >
 > I've been debugging the stuff for two hours, but it's still not clear
 > where to cut into the code without breaking something.

Don't you just need to frob the eudc-duplicate-attribute-handling-method
variable?

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eudc / ldap / mail duplicates.
       [not found] ` <mailman.251.1115047233.2819.help-gnu-emacs@gnu.org>
@ 2005-05-02 16:23   ` Bruno Hertz
  2005-05-02 18:57     ` Kevin Rodgers
       [not found]     ` <mailman.803.1115060533.2819.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Bruno Hertz @ 2005-05-02 16:23 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Bruno Hertz wrote:
>> Apparently, with Emacs CVS the eudc-filter-duplicate-attributes
>> function expects a different kind of list than the ldap backend
>> actually delivers.
>>
>> That is, a list like
>> ((mail . "a@b") (mail . "c@d"))
>> coming back from the ldap query is not recognized as duplicate list,
>> and the whole thing just doesn't work.
>>
>> I've been debugging the stuff for two hours, but it's still not clear
>> where to cut into the code without breaking something.
>
> Don't you just need to frob the eudc-duplicate-attribute-handling-method
> variable?

Nope. As of Emacs CVS the whole thing seems to be broken. Maybe I
should file a bug or something.

Some detail anyway: ldap returns lists of records, like
( ((mail . john@a) (mail . john@b)) ((mail . carla@c)) )

In this example, I have two ldap records, one for john and one for
carla, where the record of john contains two mail addresses. So his
record would be a candidate for duplicate handling.

Unfortunately, eudc-filter-duplicate-attributes doesn't even recognize
those duplicates and hence doesn't even come so far as to apply
eudc-duplicate-attribute-handling-method. So whatever you specify for
the latter (concat, duplicate, whatever) has no effect.

As a temporary workaround, I advised eudc-query to transform duplicate
mail addresses into individual records. So the example above would
become
( ((mail . john@a)) ((mail . john@b)) ((mail . carla@c)) )
and inline expansion/select works OK again.

The advice code is something like

(let ((result ad-do-it))

  (if (equal return-attributes '(mail)) ; inline query ?
     ; fix mail duplicate handling
     (setq result
        (let (z)
          (mapcar
            '(lambda (x)
               (mapcar
                 '(lambda (y)
                     (push (list y) z)) x)) result) z)))
     (setq ad-return-value result)) ; override return value

just in case anybody cares.

Regards, Bruno.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eudc / ldap / mail duplicates.
  2005-05-02 16:23   ` Bruno Hertz
@ 2005-05-02 18:57     ` Kevin Rodgers
       [not found]     ` <mailman.803.1115060533.2819.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2005-05-02 18:57 UTC (permalink / raw)


Bruno Hertz wrote:
 > Kevin Rodgers <ihs_4664@yahoo.com> writes:
 >>Don't you just need to frob the eudc-duplicate-attribute-handling-method
 >>variable?
 >
 > Nope. As of Emacs CVS the whole thing seems to be broken. Maybe I
 > should file a bug or something.
 >
 > Some detail anyway: ldap returns lists of records, like
 > ( ((mail . john@a) (mail . john@b)) ((mail . carla@c)) )
 >
 > In this example, I have two ldap records, one for john and one for
 > carla, where the record of john contains two mail addresses. So his
 > record would be a candidate for duplicate handling.
 >
 > Unfortunately, eudc-filter-duplicate-attributes doesn't even recognize
 > those duplicates and hence doesn't even come so far as to apply
 > eudc-duplicate-attribute-handling-method. So whatever you specify for
 > the latter (concat, duplicate, whatever) has no effect.

I was making a guess regarding the ATTR component of an (ATTR . METHOD)
element of eudc-duplicate-attribute-handling-method, because its default
value is ((email . duplicate)) but your example has mail as an
attribute.  Thus:

(setq eudc-duplicate-attribute-handling-method
       (cons '(mail . duplicate) eudc-duplicate-attribute-handling-method))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eudc / ldap / mail duplicates.
       [not found]     ` <mailman.803.1115060533.2819.help-gnu-emacs@gnu.org>
@ 2005-05-02 19:29       ` Bruno Hertz
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Hertz @ 2005-05-02 19:29 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Bruno Hertz wrote:
>> Kevin Rodgers <ihs_4664@yahoo.com> writes:
>>>Don't you just need to frob the eudc-duplicate-attribute-handling-method
>>>variable?
>>
>> Nope. As of Emacs CVS the whole thing seems to be broken. Maybe I
>> should file a bug or something.
>>
>> Some detail anyway: ldap returns lists of records, like
>> ( ((mail . john@a) (mail . john@b)) ((mail . carla@c)) )
>>
>> In this example, I have two ldap records, one for john and one for
>> carla, where the record of john contains two mail addresses. So his
>> record would be a candidate for duplicate handling.
>>
>> Unfortunately, eudc-filter-duplicate-attributes doesn't even recognize
>> those duplicates and hence doesn't even come so far as to apply
>> eudc-duplicate-attribute-handling-method. So whatever you specify for
>> the latter (concat, duplicate, whatever) has no effect.
>
> I was making a guess regarding the ATTR component of an (ATTR . METHOD)
> element of eudc-duplicate-attribute-handling-method, because its default
> value is ((email . duplicate)) but your example has mail as an
> attribute.  Thus:
>
> (setq eudc-duplicate-attribute-handling-method
>       (cons '(mail . duplicate) eudc-duplicate-attribute-handling-method))

That was one of my first attempts either, but 'email' is actually the
correct default since for some attributes a name translation is in
effect.

Cf. 

 (defvar eudc-ldap-attributes-translation-alist
  '((name . sn)
    (firstname . givenname)
    (email . mail)
    (phone . telephonenumber))
  "Alist mapping EUDC attribute names to LDAP names.")

in eudcb-ldap.el

So no, that isn't it. Again, mentioned function apparently is broken.

Regards, Bruno.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-02 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-30 23:18 eudc / ldap / mail duplicates Bruno Hertz
2005-05-02 15:14 ` Kevin Rodgers
     [not found] ` <mailman.251.1115047233.2819.help-gnu-emacs@gnu.org>
2005-05-02 16:23   ` Bruno Hertz
2005-05-02 18:57     ` Kevin Rodgers
     [not found]     ` <mailman.803.1115060533.2819.help-gnu-emacs@gnu.org>
2005-05-02 19:29       ` Bruno Hertz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).