You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Ole Ersoy <ol...@gmail.com> on 2007/06/22 21:30:58 UTC

[Boolean Valued Attributes] Should Java's "true" work?

Hey Guys,

I tried to create an entry containing an attribute like this:

attributes.put("someBooleanTypeAttributeName", true);

And got an exception (Noted in most recent JIRA filed).  Should that work?  

Thanks,
- Ole

  

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Ole Ersoy <ol...@gmail.com>.
Super - Thanks Martin and Emmanuel!  Have a terrific weekend,
- Ole



Emmanuel Lecharny wrote:
> Oh, very TRUE, Martin.
> 
> The syntax checker will throw an exception if you inject 'true' or 'false'.
> 
> This is compliant with the RFC...
> 
> Thanks Martin !
> 
> On 6/23/07, Martin Alderson <ma...@salfordsoftware.co.uk> wrote:
>> Ole Ersoy wrote:
>> > Emmanuel Lecharny wrote:
>> >> System.out.println( true ) will *always print "true"/
>> >>
>> >> Ok, which attributeType are you using ? It seems that it might be an
>> >> H/R attribute, so in tis case, you must do :
>> >> attributes.put( "yourHRattribute", Boolean.TRUE.toString() );
>> >
>> > Hmmm - now that you mention it, it's a custom attributeType entry.
>> > Maybe when adding AttributeType entries that have the Boolean syntax I
>> > should set human readable attribute to false.  I'll give it a shot.
>>
>> I think that would have to be attributes.put( "yourHRattribute",
>> Boolean.TRUE.toString().toUpperCase() ); too.
>>
>> Martin
>>
> 
> 

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Emmanuel Lecharny <el...@gmail.com>.
Oh, very TRUE, Martin.

The syntax checker will throw an exception if you inject 'true' or 'false'.

This is compliant with the RFC...

Thanks Martin !

On 6/23/07, Martin Alderson <ma...@salfordsoftware.co.uk> wrote:
> Ole Ersoy wrote:
> > Emmanuel Lecharny wrote:
> >> System.out.println( true ) will *always print "true"/
> >>
> >> Ok, which attributeType are you using ? It seems that it might be an
> >> H/R attribute, so in tis case, you must do :
> >> attributes.put( "yourHRattribute", Boolean.TRUE.toString() );
> >
> > Hmmm - now that you mention it, it's a custom attributeType entry.
> > Maybe when adding AttributeType entries that have the Boolean syntax I
> > should set human readable attribute to false.  I'll give it a shot.
>
> I think that would have to be attributes.put( "yourHRattribute",
> Boolean.TRUE.toString().toUpperCase() ); too.
>
> Martin
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Martin Alderson <ma...@salfordsoftware.co.uk>.
Ole Ersoy wrote:
> Emmanuel Lecharny wrote:
>> System.out.println( true ) will *always print "true"/
>>
>> Ok, which attributeType are you using ? It seems that it might be an
>> H/R attribute, so in tis case, you must do :
>> attributes.put( "yourHRattribute", Boolean.TRUE.toString() );
> 
> Hmmm - now that you mention it, it's a custom attributeType entry.  
> Maybe when adding AttributeType entries that have the Boolean syntax I 
> should set human readable attribute to false.  I'll give it a shot.

I think that would have to be attributes.put( "yourHRattribute", 
Boolean.TRUE.toString().toUpperCase() ); too.

Martin

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Ole Ersoy <ol...@gmail.com>.

Emmanuel Lecharny wrote:
> System.out.println( true ) will *always print "true"/
> 
> Ok, which attributeType are you using ? It seems that it might be an
> H/R attribute, so in tis case, you must do :
> attributes.put( "yourHRattribute", Boolean.TRUE.toString() );

Hmmm - now that you mention it, it's a custom attributeType entry.  Maybe when adding AttributeType entries that have the Boolean syntax I should set human readable attribute to false.  I'll give it a shot.
  
> 
> Btw, you might want to svn up : I have fixed the readible typo.
> 
Terrific - Thanks!
- Ole

SNIP

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Emmanuel Lecharny <el...@gmail.com>.
System.out.println( true ) will *always print "true"/

Ok, which attributeType are you using ? It seems that it might be an
H/R attribute, so in tis case, you must do :
attributes.put( "yourHRattribute", Boolean.TRUE.toString() );

Btw, you might want to svn up : I have fixed the readible typo.

On 6/22/07, Ole Ersoy <ol...@gmail.com> wrote:
> I did use the Boolean syntax for the entry and I just tried it with Boolean.TRUE as the value.  I still get this exception:
>
> javax.naming.NamingException: The value stored in an Human Readible attribute is not a String
>         at org.apache.directory.server.core.schema.SchemaService.assertHumanReadible(SchemaService.java:1965)
>
> When I do this:
> System.out.println(true);  ... It prints "true", so I imagine that "true" is what is sent over the wire to ADS.  Seems like this should be an OK value?
>
> Thoughts?
>
> Thanks,
> - Ole
>
>
> Emmanuel Lecharny wrote:
> > No, it won't work, I guess.
> >
> > You sould store an object into your attribute, like Boolean.TRUE.
> >
> > Be aware that your attribute syntax must also allow you to use booleans
> > values.
> >
> > On 6/22/07, Ole Ersoy <ol...@gmail.com> wrote:
> >> Hey Guys,
> >>
> >> I tried to create an entry containing an attribute like this:
> >>
> >> attributes.put("someBooleanTypeAttributeName", true);
> >>
> >> And got an exception (Noted in most recent JIRA filed).  Should that
> >> work?
> >>
> >> Thanks,
> >> - Ole
> >>
> >>
> >>
> >
> >
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Ole Ersoy <ol...@gmail.com>.
I did use the Boolean syntax for the entry and I just tried it with Boolean.TRUE as the value.  I still get this exception:

javax.naming.NamingException: The value stored in an Human Readible attribute is not a String
	at org.apache.directory.server.core.schema.SchemaService.assertHumanReadible(SchemaService.java:1965)

When I do this:
System.out.println(true);  ... It prints "true", so I imagine that "true" is what is sent over the wire to ADS.  Seems like this should be an OK value?

Thoughts?

Thanks,
- Ole


Emmanuel Lecharny wrote:
> No, it won't work, I guess.
> 
> You sould store an object into your attribute, like Boolean.TRUE.
> 
> Be aware that your attribute syntax must also allow you to use booleans 
> values.
> 
> On 6/22/07, Ole Ersoy <ol...@gmail.com> wrote:
>> Hey Guys,
>>
>> I tried to create an entry containing an attribute like this:
>>
>> attributes.put("someBooleanTypeAttributeName", true);
>>
>> And got an exception (Noted in most recent JIRA filed).  Should that 
>> work?
>>
>> Thanks,
>> - Ole
>>
>>
>>
> 
> 

Re: [Boolean Valued Attributes] Should Java's "true" work?

Posted by Emmanuel Lecharny <el...@gmail.com>.
No, it won't work, I guess.

You sould store an object into your attribute, like Boolean.TRUE.

Be aware that your attribute syntax must also allow you to use booleans values.

On 6/22/07, Ole Ersoy <ol...@gmail.com> wrote:
> Hey Guys,
>
> I tried to create an entry containing an attribute like this:
>
> attributes.put("someBooleanTypeAttributeName", true);
>
> And got an exception (Noted in most recent JIRA filed).  Should that work?
>
> Thanks,
> - Ole
>
>
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com