directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tino Schwarze <>
Subject Re: I'm impressed
Date Fri, 29 Dec 2006 08:47:29 GMT
Hi Johan,

I'm CCing to the list since it might be interesting for other people as well.

On Fri, Dec 29, 2006 at 08:26:11AM +0100, Johan Asterholm wrote:

> Im about to do the same but towards another system. Any chance that you
> could share whats needed in
> order to do this?

I implemented the following:

- EISPartition 
- EISPartitionConfiguration (implements,
  adds some open-EIS specific options)
- EISObjectClass (implements
- EISAttributeType (implements
- EISSchemaMgr
  * provides Template -> ObjectClass mapping (creates EISObjectClasses,
    figures out mandatory and optional attributes)
  * provides Component -> AttributeType mapping (creates
  * provides Template GUID -> OID mapping
  * provides Component -> OID mapping (some open-EIS components are
    special and will be shared amongst templates)
  * caches the above

You may also want to have a look at
for default syntaxes and matching rules available (@developers: There
are a lot of strings in there which should be collected somewhere
central as constants with readable names - not everybody knows by heart 
that is a Directory String -
BOOTSTRAP_SYNTAX_DIRECTORY_STRING would be more readable and could be
reused somewhere else; I've got the same strings in my classes now).

Then I added my partition to the server:

  MutableServerStartupConfiguration _serverconfig = new MutableServerStartupConfiguration
  // ... initialize system partition, add bootstrap schema (I do it by
  // hand)

  // then setup our EIS partition
  EISPartitionConfiguration _eispc = new EISPartitionConfiguration();
  _objectClassAttr = new BasicAttribute("objectClass", "top");
  _entryAttr = new BasicAttributes ("o", "");
  _entryAttr.put (_objectClassAttr);
  // use our special partition
  _eispc.setContextPartition(new EISPartition());
  // and configure it
  _eispc.setRootCategory(new ContentHandle<Category> (CoreCategories.CORE_ADMIN_USERS,

      LanguageMgr.getInstance().getDefaultLanguageGUID(), Category.TEMPLATE_GUID));
  Set<PartitionConfiguration> _contextPartitions = new LinkedHashSet<PartitionConfiguration>();
  _contextPartitions.add (_eispc);

  // then launch server via JNDI
  Hashtable<String, Object> _environment = new Hashtable<String, Object>();
  _environment.put ("", "simple");
  _environment.put ("", "uid=admin,ou=system");
  _environment.put ("", "secret");
  _environment.put ("java.naming.provider.url", "ou=system");
  _environment.put ("java.naming.factory.initial", "");
  _environment.put ("", _serverconfig);
  // this actually starts up the server
  InitialDirContext _idc = new InitialDirContext (_environment);




View raw message