You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Vincent Gaudeul <vi...@omalys.com> on 2006/01/13 18:19:40 UTC

[ApacheDS] Creating a new schema for 0.9.3

Hello all,

I've seen that it was possible to create new schemas with ApacheDS 
0.9.3, and that these new schemas were "loaded" at startup, provided one 
has correctly set up the xml configuration file.

My problem is to know how to create a new schema ? What Java class 
should be extended ? Does anybody have any code example that would help 
me doing this ?

Thanks for your help. I only need to add some basic attributed on 
inetOrgPerson objet.



Re: [ApacheDS] Creating a new schema for 0.9.3

Posted by Ersin Er <er...@gmail.com>.
A more on the fly solution ;-)

On 1/13/06, Alex Karasulu <ao...@bellsouth.net> wrote:
> Vincent Gaudeul wrote:
>
> > Hello all,
> >
> > I've seen that it was possible to create new schemas with ApacheDS
> > 0.9.3, and that these new schemas were "loaded" at startup, provided
> > one has correctly set up the xml configuration file.
> >
> > My problem is to know how to create a new schema ? What Java class
> > should be extended ? Does anybody have any code example that would
> > help me doing this ?
> >
> > Thanks for your help. I only need to add some basic attributed on
> > inetOrgPerson objet.
>
> Ok I see what you're trying to do.  I recommend you create a new m2
> module for your schema.  This module can generate the jar file
> containing your extension schema (let's call it the vincent schema).
> Your other projects can just depend on this subproject.
>
> (1) setup the regular m2 layout for the project
> (2) place the file named vincent.schema in ${basedir}/src/main/schema
> with your new objectClass which extends inetOrgPerson
> (3) setup pom to generate schema classes from vincent.schema using this
> build section (change pkg setting to suite your needs)
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.ldap.server</groupId>
>         <artifactId>org.apache.ldap.server.plugin</artifactId>
>         <configuration>
>           <schemaSourcesDir>src/main/schema</schemaSourcesDir>
>           <schemas>
>             <schema>
>               <name>vincent</name>
>               <pkg>org.vincent.schema</pkg>
>               <dependencies>
>                 <dependency>system</dependency>
>                 <dependency>core</dependency>
>                 <dependency>cosine</dependency>
>                 <dependency>inetorgperson</dependency>
>               </dependencies>
>             </schema>
>           </schemas>
>         </configuration>
>         <executions>
>           <execution>
>             <goals>
>               <goal>generate</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>
> (4) write a test case to use your new schema org.vincent.VincentSchema
> which is generated into target/schemas.
>
> NOTE: both the idea:idea and the eclipse:eclipse goal will include the
> target/schemas path in the classpath so you're project should be good to
> go.
>
> Hope this helps,
> Alex
>
>


--
Ersin

Re: [ApacheDS] Creating a new schema for 0.9.3

Posted by Alex Karasulu <ao...@bellsouth.net>.
Vincent Gaudeul wrote:

> Hello all,
>
> I've seen that it was possible to create new schemas with ApacheDS 
> 0.9.3, and that these new schemas were "loaded" at startup, provided 
> one has correctly set up the xml configuration file.
>
> My problem is to know how to create a new schema ? What Java class 
> should be extended ? Does anybody have any code example that would 
> help me doing this ?
>
> Thanks for your help. I only need to add some basic attributed on 
> inetOrgPerson objet.

Ok I see what you're trying to do.  I recommend you create a new m2 
module for your schema.  This module can generate the jar file 
containing your extension schema (let's call it the vincent schema).  
Your other projects can just depend on this subproject.

(1) setup the regular m2 layout for the project
(2) place the file named vincent.schema in ${basedir}/src/main/schema 
with your new objectClass which extends inetOrgPerson
(3) setup pom to generate schema classes from vincent.schema using this 
build section (change pkg setting to suite your needs)

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.ldap.server</groupId>
        <artifactId>org.apache.ldap.server.plugin</artifactId>
        <configuration>
          <schemaSourcesDir>src/main/schema</schemaSourcesDir>
          <schemas>
            <schema>
              <name>vincent</name>
              <pkg>org.vincent.schema</pkg>
              <dependencies>
                <dependency>system</dependency>
                <dependency>core</dependency>
                <dependency>cosine</dependency>
                <dependency>inetorgperson</dependency>
              </dependencies>
            </schema>
          </schemas>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
 
(4) write a test case to use your new schema org.vincent.VincentSchema 
which is generated into target/schemas. 

NOTE: both the idea:idea and the eclipse:eclipse goal will include the 
target/schemas path in the classpath so you're project should be good to 
go. 

Hope this helps,
Alex


Re: [ApacheDS] Creating a new schema for 0.9.3

Posted by Ersin Er <er...@gmail.com>.
Hi,

I'm not sure if this is the answer for your question but you may
consider extending this:

http://svn.apache.org/viewcvs.cgi/directory/trunks/apacheds/core/src/main/schema/inetorgperson.schema?rev=368682&view=markup

and of course rebuild the server..

--
Ersin

On 1/13/06, Vincent Gaudeul <vi...@omalys.com> wrote:
> Hello all,
>
> I've seen that it was possible to create new schemas with ApacheDS
> 0.9.3, and that these new schemas were "loaded" at startup, provided one
> has correctly set up the xml configuration file.
>
> My problem is to know how to create a new schema ? What Java class
> should be extended ? Does anybody have any code example that would help
> me doing this ?
>
> Thanks for your help. I only need to add some basic attributed on
> inetOrgPerson objet.
>
>
>


--
Ersin