directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: API behavior questions
Date Thu, 22 Aug 2013 23:04:09 GMT

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Le 8/22/13 8:11 PM, Gerald Turner a écrit :
> Gerald Turner <gturner@unzane.com> writes:
> Sorry about the huge mailing list post, I went ahead and created bug
DIRAPI-156 instead. I'm trying like mad to get the ApacheDS client API
schema aware with our OpenLDAP server contianing a couple custom
attributes/classes. I can proceed with the hacked copy of the 'schema'
folder and use LdifSchemaLoader(File) - unfortunately this will be ugly
as far as deployment goes.
Sorry for not beng able to help... I wrote some part of his API, but I
have no time to give ou some direction, as I leave for one week...

The key, here, is to create the correct schemaLoader and to use it to
initialize the schemaManager :

        LdifSchemaLoader loader = new LdifSchemaLoader( new File(
workingDirectory, "schema" ) );
        SchemaManager sm = new DefaultSchemaManager( loader );

        boolean loaded = sm.loadAllEnabled();

The first step creates a loader that read the schema from ldif files on
the disk. The second step creates the schemamanager. the third step
loads the enabled schemas to generate a valid schemaManager that can be
use by the API.

The tricky part here is that the schema must be stored in a LDIF format
which is specific to ApacheDS.

Or you can use a SchemaEditorSchemaLoader, which is capable of
converting OpenLDAP formatted schema to standard ApacheDS entries (this
should work, I never tested it).


I'm not sure tht it helps, but I would be pleased to help when I'll be
back from vacations (in one week).

- -- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCgAGBQJSFpjoAAoJEDFHTl58a3A0kkUP/3xxFnPt6dBAoqpsQ8pXGAWA
ErVWGzHmr+VJczuS5fYEN+Q1Y/0RVfF1YivmnAvhwTHq/edrbN+CnT8n/Nc6eJxj
5y4h2558DGEaFqF6f5PzAKzigI1gkYvjey2rpss0sFIqLW1f58sNadfYKFloIRT7
PglLva3yxOqgpt3rrjvIj4kCATg2GIvTL1ugTNBhZkcdO0TBRSsOcxORCCN4SUg0
Mt5oK2dVqoPBlth+aIUz14FYympk42WjIZc7YNCIxTKN4ixZxh+4CjUqEoxoOks/
vrXAXEgOELPmmYj7qjUc082IU95cmqa1Qvvq6Ytf2MF3lCSlrlwbHz3mjPVMcLMS
Yom+TdNauusRA3DjIweRpf7rCaNI3BIwd0omChPuQvk7MArYvEpe2odl6BuWdEsL
Q0ZwXw7QT0Biol/csFIdaIMrDmbajIQmt11gQge3PSyP/q1W+AwwVCG8pYjUuJMW
AtXgVsDIan+Ak5Cvmt5IGA31aYuy2Ivkp+oWH5ajT7wgcZQeasNLKvkpl1RDb9iT
8Vql8yoluPra4Aq97KOz9U/Bwf6REKW1cGUx00rlMScfaS12RBZiP1+lkTdDRLEF
UbLRrrf6KGfK07KlpajBr+PsTlSuRwEjw/wlsujjzZPuhW+o+dTanLnDOvNRDkE6
QJHGuQI0OpwcQRiC7EOG
=LUVg
-----END PGP SIGNATURE-----


Mime
View raw message