[Date Prev][Date Next]
booleanPretty (Was: Boolean Syntax not implemented (ITS#612))
- To: Stephan Siano <Stephan.Siano@suse.de>
- Subject: booleanPretty (Was: Boolean Syntax not implemented (ITS#612))
- From: "Kurt D. Zeilenga" <Kurt@OpenLDAP.org>
- Date: Fri, 30 Jun 2000 13:56:34 -0700
- Cc: openldap-devel@OpenLDAP.org
- In-reply-to: <395C7818.C3D67C6E@suse.de>
- References: <email@example.com>
Redirected to -devel.
I was thinking that boolean syntax/matching rules might be a
good first use of the pretty interface. This interface is designed
allow for mangling of input before storage.
As it is now, TRUE is TRUE and FALSE is FALSE. All
other values are invalid.
The booleanValidate could be modified to liberally allow
alternative values for TRUE ('true', 'T', '1', 'on', 'yes') and
FALSE ('false', 'F', '0', 'off', 'no') and booleanNormalize would
normalize these to TRUE or FALSE respectively.
booleanMatch would be left unchanged.
However, without a prettier, these alternative forms would be
stored and returned in searches. A prettier can however
normalize the value before storage.
At 10:36 AM 6/30/00 +0000, Stephan Siano wrote:
>"Kurt D. Zeilenga" wrote:
>> I added an experiemental (ie: untested) booleanValidate and
>> booleanMatch routines without use of a normalizer...
>ok. the stuff seems to work (I tested adding an object with a boolean
>attribute. That will succeed if the value is TRUE or FALSE and will fail
>> A better approach would be to define booleanValidate as
>> numericStringValidate, add a normalizer which accepted
>> varients of true/false and normalized them to "TRUE"
>> and "FALSE", and add a prettier that stored the vaue
>> in normalized form.
>Hmm, I'm not sure whether I catch you right.
>You say booleanValidate should be numericStringValidate (which is in
>fact IA5StringValidate). The inserted value should be converted to
>"TRUE" of "FALSE" by the normalizer and the prettier should user the
>normalizer to convert. If I try to store a boolean attribute to the
>database, the validator will let it pass (whatever I enter there). The
>prettier is applied to the value before writing the database and
>converts the data to TRUE or FALSE. So if a do a ldap_add or ldap_modify
>with "myBooleanAttribute:hugo" TRUE (or FALSE?) will be written to
>Is this correct?
>Is this the desired behaviour?
>Stephan Siano Mail: Stephan.Siano@suse.de
>SuSE Linux Solutions AG Phone: 06196 50951 31
>Mergenthalerallee 45-47 Fax: 06196 409607