Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 30911 invoked from network); 2 Nov 2005 01:11:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Nov 2005 01:11:00 -0000 Received: (qmail 15710 invoked by uid 500); 2 Nov 2005 01:10:59 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 15657 invoked by uid 500); 2 Nov 2005 01:10:58 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 15646 invoked by uid 99); 2 Nov 2005 01:10:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2005 17:10:58 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [212.27.42.28] (HELO smtp2-g19.free.fr) (212.27.42.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2005 17:10:53 -0800 Received: from routeur (vol75-3-82-66-216-176.fbx.proxad.net [82.66.216.176]) by smtp2-g19.free.fr (Postfix) with ESMTP id 5DDDF8AD4 for ; Wed, 2 Nov 2005 02:10:35 +0100 (CET) Subject: Re: Adding a schema extension From: Emmanuel Lecharny To: Apache Directory Developers List In-Reply-To: <20051102001056.59394.qmail@web54707.mail.yahoo.com> References: <20051102001056.59394.qmail@web54707.mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Organization: iktek Date: Wed, 02 Nov 2005 02:06:56 +0100 Message-Id: <1130893616.11438.68.camel@wkslx01.iktek.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-6) Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tue, 2005-11-01 at 16:10 -0800, David Le Strat wrote: > All, David, > I apologize for posting a fairly basic question on the > dev list. I could not find the user list. Don't be sorry, at this moment, we don't have any user list : we don't have many users, so welcome !!! > I am working on integrating apacheDS with Jetspeed2 > security. I need to create a schema extension. I > have generated my schema (as a jar) using the > directory maven plugin I bet that you have used maven goals : Goal Description directory:generate Generates class files for OpenLDAP schemas. directory:init Finds the required parameters needed for the goals of the plugin. directory:prepare-filesystem Creates source output directories used to deposite schema files that are generated. directory:schema Top level schema generating function that uses other goals to coordinate generation. > and I added my new schema to my > server.xml as followed: > > > > Apache DS entries > ... > class="org.apache.jetspeed.security.ldap.JetspeedSchema"/> > > > > I start apacheDS with the new jar file in its > classpath. The new schema does not seem to get picked > up. I am missing a step. Here is an excerpt to the doc that will be soon available on the site : "How to Integrate Plugin Into Your Own Projects You want to use the plugin to generate classes for your own schema. Here's a step wise process you can follow to do that using maven: 1. Place your schema files (i.e. foo.schema) with the schema extension into ${basedir}/src/main/schema. If you opt to store it in another location you must override the maven.ldap.server.schema.dir property in your project.properties file. For each schema file add the file base name to the maven.ldap.server.schemas property which is a space separated list. 2. The plugin will by default generate java files within the ${basedir}/target/schema directory. If you would like to generate code elsewhere you must override the maven.ldap.server.schema.target.dir property in your project.properties file. 3. By default the plugin generates code in a server schema package: org.apache.ldap.server.schema.bootstrap. If you want generated code for a schema to be put into a package other than this, then you're going to need to set the package property for the schema. The package property key is composed of the following base, maven.ldap.server.schema.package. with the name of the schema (without the extension) appended to it. So for schema file foo.schema the following property key would be used: maven.ldap.server.schema.package.foo where foo is the schema name. 4. Using the same pattern above for all schema specific properties you can set other per schema properties as well. One of these properties is the dependency list for a schema. Schemas can obviously depend on others. The schema dependency list is a comma separated list of other schema names. These schemas need not be present in your project to generate the code for your schema. The dependent schema classes must however be present within the server at start up time in order to load and use your schema. At the end we list the default schemas already packaged into the server's jar. You can use any one of these schemas as dependencies needed by your schema and not worry about their presence. The property key base for the schema dependency list is maven.ldap.server.schema.deps. and for a foo.schema file the full key would be maven.ldap.server.schema.deps.foo 5. Each schema has an owner associated with it. If you want the owner to be anything other than the server's super user you may want to set the owner property for the schema in your project.properties file. The property key base for the schema is maven.ldap.server.schema.owner. so don't forget to append the schema name to it. Once setup you can invoke maven to generate the schema sources like so: [akarasulu@newton dib]$ maven directory:schema __ __ | \/ |__ _Apache__ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |___,_|_/___|_||_| v. 1.0.2 Attempting to download ldap-common-0.8.0-SNAPSHOT.jar. Attempting to download apacheds-shared-0.8.0-SNAPSHOT.jar. Attempting to download apacheds-protocol-0.8.0-SNAPSHOT.jar. Attempting to download snickers-codec-0.2.0-SNAPSHOT.jar. Attempting to download ldap-snickers-provider-0.8.0-SNAPSHOT.jar. Attempting to download snickers-ber-0.2.0-SNAPSHOT.jar. Attempting to download seda-0.2.0-SNAPSHOT.jar. Attempting to download maven-directory-plugin-0.8.0-SNAPSHOT.jar. Attempting to download ldap-common-0.8.0-SNAPSHOT.jar. Attempting to download apacheds-shared-0.8.0-SNAPSHOT.jar. build:start: directory:schema: directory:init: directory:prepare-filesystem: directory:generate: [echo] Generated schema producer classes for autofs.schema [echo] Generated schema producer classes for core.schema [echo] Generated schema producer classes for cosine.schema [echo] Generated schema producer classes for corba.schema [echo] Generated schema producer classes for eve.schema [echo] Generated schema producer classes for inetorgperson.schema [echo] Generated schema producer classes for java.schema [echo] Generated schema producer classes for krb5kdc.schema [echo] Generated schema producer classes for nis.schema [echo] Generated schema producer classes for system.schema [echo] Generated schema producer classes for scheduleworld.schema [touch] Creating /home/akarasulu/projects/directory/server/trunk/core/target/schema/.flagfile BUILD SUCCESSFUL Total time: 28 seconds Finished at: Tue Dec 14 15:26:26 EST 2004 The example above is from the server's core project. If you would like to look at how to use this plugin best the server core project.properties file here is perhaps the best place to look. Also from the output above you can see the schema files that are used and packaged into the server by default. This may however change in the future to restrict the set. WARNING: As a last bit of advice make note that the plugin may be sensitive to case for keywords in the OpenLDAP file. For example the prefix before an objectClass or an attributeType must be in all lowercase. However words like MUST, and MAY and SUP should all be in uppercase. So if plugin bombs just check out where this happens and play with the case. Another thing to watch out for is the order of terms. This we follow the RFC for which is pretty much the same as the OpenLDAP format minus the objectclass and attributetype prefixes to the descriptions. We figure the OpenLDAP parser is less complex if the prefixes are there (where the parser is told if the description is an objectclass or attributetype and does not have to figure this out). However I have encountered schemas whose formats do not comply with standards in with respect to the order of description fields and had to edit the files. This issue did not occur when the files were from the OpenLDAP Foundation which means they do it right but overlook schema objects that are not correctly formated." (Thanks Alex for the doc ;) I hope that it will help you to embed ApacheDS in JetSpeed. However, feel free to contact us if you hit a wall. > > Regards, > > David Le Strat -- Emmanuel PS : Cool blog, David. PS2 : Et désolé pour l'anglais défaillant ... Pourtant, je fais des efforts ;)