Ok, I had to make the following change for these directions:
- open command shell and cd to E:\Program Files\apacheds-1.0-RC3\src\core
+ - modify pom.xml in this directory by adding the following (e.g. after the
samba schema:
+ <schema>
+ <name>myschema</name>
+ <dependencies>
+ <dependency>system</dependency>
+ <dependency>core</dependency>
+ <dependency>inetorgperson</dependency>
+ <dependency>organizationalunit</dependency>
+ </dependencies>
+ </schema>
- run "mvn process-resources" to generate the myschema schema sources
Also, you need to add the schema to the bootstrap schemas section of server.xml:
<property name="bootstrapSchemas">
<set>
[other bootstrap schemas]
<bean
class="org.apache.directory.server.core.schema.bootstrap.MyschemaSchema"/>
</set>
</property>
Works great! Thanks a ton for the example!
Cheers,
Craig
________________________________
From: Ajay Upadhyaya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 1:25 PM
To: Apache Directory Developers List
Cc: [EMAIL PROTECTED]
Subject: Re: Adding an objectClass to ApacheDS
Here is an example, I did it with RC3 here are the steps (as far as I
could recollect)
- Download apacheds1.0-RC3
- create a custom schema file myschema.schema
#================= begin myschema.schema =============================
# define myschemaOrgPerson -- extends InetOrgPerson
# define myschemaOrganizationalUnit -- extends organizationalUnit
#================================================================
# myschema 94555
# AttributeTypes 94555.2.1
# Object Classes 94555.2.2
#
attributetype ( 94555.2.1.1
NAME 'dateCreated'
DESC 'dateCreated'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.2
NAME 'dateModified'
DESC 'dateModified'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.3
NAME 'dateCodeGenerated'
DESC 'dateCodeGenerated'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.4
NAME 'dateActivated'
DESC 'dateActivated'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.5
NAME 'codeFlag'
DESC 'codeFlag'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.6
NAME 'activeFlag'
DESC 'activeFlag'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.7
NAME 'employeeType'
DESC 'employeeType'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.8
NAME 'companyURL'
DESC 'companyURL'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.9
NAME 'selfRegAllowed'
DESC 'selfRegAllowed'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.10
NAME 'protected'
DESC 'protected'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.11
NAME 'serviceType'
DESC 'serviceType'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.12
NAME 'domainKey'
DESC 'domainKey'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.13
NAME 'autoActivationAllowed'
DESC 'autoActivationAllowed'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.14
NAME 'companyName'
DESC 'companyName'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.15
NAME 'city'
DESC 'city'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.16
NAME 'state'
DESC 'state'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
attributetype ( 94555.2.1.17
NAME 'countryname'
DESC 'countryname'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
# myschemaOrgPerson
# The inetOrgPerson represents people who are associated with an
# organization in some way. It is a structural class and is derived
# from the organizationalPerson which is defined in X.521 [X521].
objectclass ( 94555.2.2.1
NAME 'myschemaOrgPerson'
DESC 'myschema Organizational Person'
SUP inetOrgPerson
STRUCTURAL
MAY (
dateCreated $ dateCodeGenerated $ employeeType $ dateModified $
activeFlag $ codeFlag )
)
objectclass ( 94555.2.2.2 NAME 'myschemaOrganizationalUnit'
DESC 'myschemaOrganizationalUnit'
SUP organizationalUnit STRUCTURAL
MAY ( dateCreated $ dateModified $ dateActivated $
dateCodeGenerated $ activeFlag $ codeFlag $
selfRegAllowed $ protected $ serviceType $ domainKey $
autoActivationAllowed $
companyName $ companyURL $ state $ city $ countryname )
)
#================= end myschema.schema =============================
- put this file in E:\Program
Files\apacheds-1.0-RC3\src\core\src\main\schema folder
- install maven 2
- open command shell and cd to E:\Program
Files\apacheds-1.0-RC3\src\core
- run "mvn process-resources" to generate the myschema schema sources
- generated source files will be found in E:\Program
Files\apacheds-1.0-RC3\src\core\target\generated-sources\org\apache\directory\server\core\schema\bootstrap
- create a patch dir somewhere
- copy the generated Myschema* files into patch dir
- build the patch myschema.jar by placing apacheds libraries in
classath... a simple javac inside ant will work
- this myschema.jar has to be placed in E:\Program
Files\apacheds-1.0-RC3\lib\ext folder
- configure the E:\Program Files\apacheds- 1.0-RC3\conf\server.xml
#=============== add this to server.xml =============================
<bean id="myschemaPartitionConfiguration"
class="org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration
">
<property name="name"><value>myschema</value></property>
<property name="suffix"><value>dc=myschema,dc=com</value></property>
<property name="indexedAttributes">
<set>
<value>dc</value>
<value>ou</value>
<value>objectClass</value>
<value>krb5PrincipalName</value>
<value>uid</value>
</set>
</property>
<property name="contextEntry">
<value>
objectClass: top
objectClass: domain
objectClass: extensibleObject
dc: myschema
</value>
</property>
</bean>
On 8/23/06, Craig L. Ching <[EMAIL PROTECTED]> wrote:
Great, thanks for the info! BTW, I'm going to be using an
embedded server, once this is built, will it include my new schema in the
embeddable server?
As for the project, it's a commercial product called Q Pasa!
We monitor and manage middleware software (e.g. IBM WebSphere MQ, IBM WebSphere
App Server, and tons of other stuff). We are planning on using ApacheDS to do
our default authentication/authorization to begin with (replacing a legacy,
home-grown solution), but we're going to be adding in the capability to find
other installations of our software so that disparate installations can be
integrated (sort of hard to explain the latter use). I'm sure if this is
successful we'll find lots of other uses for it. I am evaluating ADS because
it is 100% pure java and it is embeddable, not to mention that it's the Apache
organization ;-)
Again, thanks for the help, I'll let you all know how I
progress.
Cheers,
Craig
________________________________
From: Emmanuel Lecharny [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 10:24 AM
To: Apache Directory Developers List
Subject: Re: Adding an objectClass to ApacheDS
Great !
Don't worry to much about the mailing list, we don't use [EMAIL
PROTECTED] atm. So this is the right place to post.
Extending the schema is a little bit complicated in this
version, but it does not mean it's complicated.
Here are the steps :
1) create your schema using OpenLdap syntax (which is RFC
syntax, btw)
2) put it in apacheds/core/src/main/schema, beside the other
schemas
3) go into apacheds/core and modify the pom.xml file :
...
<configuration>
<schemaSourcesDir>src/main/schema</schemaSourcesDir>
<schemas>
<schema>
<name>apache</name>
<dependencies>
<dependency>system</dependency>
</dependencies>
</schema>
<schema>
<name>apachedns</name>
<dependencies>
<dependency>system</dependency>
<dependency>core</dependency>
</dependencies>
</schema>
...
here, you just add your schema, with its dependencies.
4) now, go back to the root project and compile the project :
mvn install
(it will take around 3 minutes)
5) build the binaries :
cd apacheds/server-installers
mvn install
now, you can install the server with the installer that has
been generated.
If you are lost, here is a link to a page which explains the
build process :
http://docs.safehaus.org/display/APACHEDS/Building
I think there is something sompler, but I don't know it.
Anybody on the list ?
However, if you have any pb, just push a mail. We will help you
as fast as we can.
btw, which kind of project are you working on, if it's not
secret ?
Emmanuel lécharny
On 8/23/06, Craig L. Ching < [EMAIL PROTECTED] <mailto:[EMAIL
PROTECTED]> > wrote:
Hi!
I realize this is the developer's list and that it's a
bit early for
ApacheDS, but I'm evaluating it for use in our
products. I'm trying to
figure out how to extend the schema (I need to add a
new objectClass),
can anyone point me in the right direction? I'm fine
with reading some
code to understand it.
Cheers,
Craig
--
Cordialement,
Emmanuel Lécharny