directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRSHARED-139) LdifReader missing attributes
Date Wed, 17 Oct 2012 20:52:03 GMT

    [ https://issues.apache.org/jira/browse/DIRSHARED-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478363#comment-13478363
] 

Emmanuel Lecharny commented on DIRSHARED-139:
---------------------------------------------

The problem is that the value is considered as binary as soon as there is a '::' after the
AttributeType. Now, when you have many values, teh first one which is parsed will give a type
to the ATtribteType : either String or Binary. Now, if th AT is declared as String, any Binary
value will simply be discarded...

We certainly should try to convert the byte[] to a String instead of discarding the value...
But what if we encounter a binary value and then some Strings ? Should we consider the whole
AttributeType as a String ?

Not simple...

The best would be to have a SchemaAware LDIFReader, which gets the AT type directly from the
Schema. We could perfectly whip such a feature.

Thanks for the interesting report !


                
> LdifReader missing attributes
> -----------------------------
>
>                 Key: DIRSHARED-139
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-139
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M12
>         Environment: Linux
>            Reporter: Allen Zhao
>
> $ cat t.ldif
> dn: cn=DeviceTypes,cn=SDT,cn=prod_81,o=myconfiguration
> cn: DeviceTypes
> javaClassName: java.lang.String
> myconfigstringvalue: P:Phone (except BlackBerry)
> myconfigstringvalue:: WjpCbGFja0JlcnJ5w4LCrg==
> myconfigstringvalue: 3:Internet only device
> objectClass: top
> objectClass: javaobject
> objectClass: myconfigstringvaluedobject
> Code:
> LdifReader lr = new LdifReader(fileName);
> while (lr.hasNext()) {
>     LdifEntry e = lr.next();
>     System.out.println(e.toString());
> }
> The attribute "myconfigstringvalue:: WjpCbGFja0JlcnJ5w4LCrg==" missed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message