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.

Reply via email to