| Emmanuel Lecharny (JIRA) 2006-05-10, 1:11 am |
| [ http://issues.apache.org/jira/brows...action_12378831 ]
Emmanuel Lecharny commented on DIRSERVER-604:
---------------------------------------------
Well, the (a) is possible, but a little bit overkilling. We are supposed to send data to the server which will check their sanity against the schema internally. Of course, as we are connected to the server, we could ask for the schema.
The (b) seems to be a better soltion. However, just keep in mind that when importing files, you are supposed to put them into binary data (like jpegPhoto). I don't know if it makes sense to inject text into an attribute like 'givename' or 'description'. I
guess that the initial intent of G. Good was to support a kind of ldap BLOB, so the data are supposed to be binary.
I must admit that I suffered from this UTF-8/ISO8859-1 format when injecting data into a ldap server, so your idea seems to be a good solution. I have added a method to deal with imported files that could take an encoding as a parameter (it was not commit
ted), so we can easily extended the :< operation the way you suggested.
Last thing, remember that in any case, attributes are always stored as byte[], not as UTF-8 Strings, except if the schema tells that the attributeType is not binary. Here is the transformations applied to an attribute value if you send it through a Ldap c
lient :
initial data ASN.1 ASN.1 Storage
encoding decoding
UTF-8 ------> byte[] -----------> byte[] ---------> if attributeType is binary, byte[], String(UTF-8) otherwise
binary ------> byte[] -----------> byte[] ---------> if attributeType is binary, byte[], String(UTF-8) otherwise
So if the file contains binary data, it will *not* be transformed in any case, except if you fill a textual attributeType.
> Support for ":<" LDIF syntax in ApacheDS
> ----------------------------------------
>
> Key: DIRSERVER-604
> URL: http://issues.apache.org/jira/browse/DIRSERVER-604
> Project: Directory ApacheDS
> Type: New Feature
> Components: ldap
> Environment: N/A
> Reporter: Norbert Reilly
> Assignee: Emmanuel Lecharny
> Attachments: rfc2849 _inclusion_support.patch, rfc2849 _inclusion_support.patch, test_inclusion.ldif, test_ldif_inclusion.txt
>
> I have need to import potentially long files via LDAP and noted that
> rfc2849 mentioned the ":<" operator allowing an attribute's value to
> be provided by "including" the contents of a URL.
> I have added the support for ":<" by enhancing
> org.apache.directory.shared.ldap.ldif.LdifParserImpl in
> trunks/shared/ldap .
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|