Issue 8148 - No Maximum Records set when using Mozilla LDAP Address Book
Summary: No Maximum Records set when using Mozilla LDAP Address Book
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: john.marmion
QA Contact: issues@dba
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2002-10-08 11:17 UTC by john.marmion
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch to fix this (2.08 KB, patch)
2002-10-09 18:44 UTC, john.marmion
no flags Details | Diff
Update the patch (2.25 KB, patch)
2002-10-10 11:20 UTC, john.marmion
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description john.marmion 2002-10-08 11:17:13 UTC
OOo is capable of  both creating an LDAP data source  and also accessing an LDAP
data source from the Mozilla Address Book. In the latter case, there is no
option to set the maximum number of records returned. Thus selecting "Last
Record" on the UI could result in many thousands of records returned from a
Corporate LDAP Server. This not only will take a considerable amout of time but
has the
capacity to crash OOo.
Comment 1 Frank Schönheit 2002-10-08 11:51:59 UTC
confirming.
John, do you know anything about the possibility to transfer such a
setting to a Mozilla address book (which is only a "masked" LDAP data
source)?
IOW, when we offer such a setting, can we pass it to Mozilla and leave
it up to Mozilla, or would we need to handle this restriction ourself
in the SDBC driver?
Comment 2 dirk.grobler 2002-10-08 12:48:12 UTC
Ocke,

please have a closer look at this,

thanks,
Dirk
Comment 3 john.marmion 2002-10-08 13:13:50 UTC
I will look after this.
Comment 4 Frank Schönheit 2002-10-08 14:37:32 UTC
in this case, it's better if you are the owner, John :)
Comment 5 john.marmion 2002-10-08 15:25:58 UTC
Quickly looking at this. Mozilla only supports a limit with LDAP
Address Books only. We pass this value over as a parameter to the
DoQuery() method in Mozilla. For LDAP we get the value from our UI.
For all other Address Books (i.e. including Mozilla LDAP Address
Books) we always pass over -1. I presume that -1  results in no limit
getting set or presumably should be set by the setting of the LDAP
Server. 

Mozilla defaults to 100 records for an LDAP Address Book. But it only
writes out this value to its preferences file if this value is
changed. This is a possible hook for us. As we effectively create the
Mozilla Address Books from the mozilla preferences, we could determine
if this is a Mozilla LDAP Address Book and read the corresponding
preference attribute 'maxHits'. If this exists use it, otherwise
default to 100.
 
One other alternative is that we add the UI capability for OOo to
support this for all Address Book types. The only caveats I see is
that we could set it to one value and mozilla to another and this
limit is really only applicable to Corporate LDAP Directory Servers.

I will get Frank's wise counsel on this.
Comment 6 Frank Schönheit 2002-10-08 15:45:32 UTC
ehm, well, I'll try my best wisdom ...

The first way sounds good. If we can
* determine that we're an LDAP source masked as Mozilla address book
* find this value in the preferences
* pass the pref-parameter to the query
(and from what you said it looks we can all of this)

then I probably would prefer this solution.

The second way (an own option) has it's charme, too, but would make us
inconsistent with Mozilla. I'd like to keep the access to Mozilla
address books as similar (in OOo and Mozilla) as possible.
It's not really really strict - if we see that the first solution is
not possible, it will be not too hard for me to lose this restriction
:), but for the moment I suggest going with the preference way.
Comment 7 john.marmion 2002-10-09 18:44:38 UTC
Created attachment 3105 [details]
Patch to fix this
Comment 8 Frank Schönheit 2002-10-10 09:36:01 UTC
Hi John,

your patch looks good - I especially like the extensive comments
explaining what's going on :).

The only thing I am not sure about is that it checks for write
permissions on the book to see if it's an LDAP book. This looks like
it may, by accident, hit other book types as well (e.g. a MORK address
book when the underlying file is write protected).
Don't we have another chance of determining the LDAP type?

Frank
Comment 9 Frank Schönheit 2002-10-10 09:49:47 UTC
filed issue 8210 about accessing readonly address book files for
completeness
Comment 10 john.marmion 2002-10-10 11:15:09 UTC
I take your point Frank that determining whether a Mozilla Address
Book type is "Writeable" may appear open to misinterpretation. But in
mozilla, ldap is only type which overrides the  default attributes of
write|read|search of all other types with 'search' only. This
attribute does not refer to the read-write property of the physical
file, but to the operations that can be carried out on a particular
Address Book type. I will document this is the code, update the patch
and go ahead with the fix.
Comment 11 john.marmion 2002-10-10 11:20:47 UTC
Created attachment 3120 [details]
Update the patch
Comment 12 Frank Schönheit 2002-10-10 13:37:54 UTC
okay, didn't know this difference between the capabilities of the
backend and the flags. It seems the flags are just a "letter of
intent", and the actual capabilities may differ.

An the more when it's the Mozilla way to check for an LDAP book ...I'm
fine with this :)
Comment 13 john.marmion 2002-10-22 13:39:09 UTC
This fix is now in the tree.
Comment 14 seangao 2002-11-04 02:46:56 UTC
Verified
Comment 15 john.marmion 2002-11-08 13:15:18 UTC
Marking this issue closed
Comment 16 hans_werner67 2004-02-02 13:04:53 UTC
change subcomponent to 'none'