directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BerkOFF <berkoff_2...@mail.ru>
Subject How I'm able to delete schema by it's dn programmatically
Date Thu, 01 Jan 2009 21:48:08 GMT

I've written following code - it executes without exceptions, but nothing
happens.
Any suggestions?

DirectoryService directoryService = (DirectoryService) servletContext
					.getAttribute(DirectoryService.JNDI_KEY);
			
			CoreSession cs = directoryService.getSession(new LdapDN(Config
					.getProperty(Config.LDAP_SERVER_USER_DN)), Config
					.getProperty(Config.LDAP_SERVER_PASSWORD).getBytes());
			
		
			Partition sysPart = directoryService.getPartitionNexus().getPartition(new
LdapDN("2.5.4.11=schema"));
			Registries rs = directoryService.getRegistries();
			
			PartitionSchemaLoader psl = new PartitionSchemaLoader(sysPart, rs);
			SchemaPartitionDao spd = new SchemaPartitionDao(sysPart, rs);
			SchemaOperationControl soc = new SchemaOperationControl(rs, psl, spd);

			String ids[] = request.getParameterValues("schemasSelected");
			if (ids != null) {
				for (String id : ids) {
					LdapDN dn = new LdapDN(id);
					DeleteOperationContext doc = new DeleteOperationContext(cs,
							dn);
					ClonedServerEntry cse = new ClonedServerEntry(cs.lookup(dn));
					soc.delete(doc, cse, true);
					changeOccured = true;
				}
			}

-- 
View this message in context: http://www.nabble.com/How-I%27m-able-to-delete-schema-by-it%27s-dn-programmatically-tp21245176p21245176.html
Sent from the Apache Directory Project mailing list archive at Nabble.com.


Mime
View raw message