directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: LDAP 0.9.3 . Modify attribute fails with exception
Date Mon, 16 Jan 2006 09:45:22 GMT
Somashish Gupta a écrit :

>Sorry for bugging again.
>
>As I had mentioned in my earlier mail, the "activeFlag" attribute was not
>defined(so even though creation was successful, modification was not). As
>suggested by you I tried to add this attribute in the schema using the JNDI
>calls( as given in examples in JNDI tutorial at the SUN site
>http://java.sun.com/products/jndi/tutorial/ldap/schema/attribute.html).
>However there was no success as I kept on getting NamingException (even
>though I was using the administrator password). 
>
You can't change the schema dynamically in ADS. You should define your 
own schema (as in OpenLdap, with the very same syntax). Here is an 
recipe to do so :
"

> 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 "


>I am not sure if that is the
>correct way of changing schema. I didn't find any document regarding
>changing schema at the Apache Directory site.
>  
>
True. And sorry ;) And yes, we will document it soon !

>Also is there any way to turn off schema checking in case I don't want
>it(JXplorer has a menu item "Stop Schema Checking" but that doesn't seem to
>work when the LDAP server is Apache Directory)
>  
>
No. The switch on JXplorer is on client side only.

>Thanks to all for replying
>Somashish
>  
>
You are welcome ! All the user experiences are good to improve the 
server and its documentation !

-- Emmanuel Lécharny

Mime
View raw message