From 428d828ca640d1348979f9982d1c0bc0a489a3b4 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 12 Dec 2013 14:13:36 +0100 Subject: Properties preserve and respect the PropertyDescription 'isMutable' property. This setting prevents the WriteProperty predefined step from changing the property value when isMutable is false. WriteProperty also requires the selected property to already exist - they should be created either during Item instantiation or using AddC2KObject. LDAPPropertyManager prepends the Property name in its entries with ! if they are non mutable. Various places around the kernel that create properties now set the mutable field. Fixes #150 --- .../c2kernel/lookup/LegacyLDAPPropertyManager.java | 75 ---------------------- 1 file changed, 75 deletions(-) delete mode 100644 src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java (limited to 'src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java') diff --git a/src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java b/src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java deleted file mode 100644 index 638c694..0000000 --- a/src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.c2kernel.lookup; - -import com.c2kernel.common.ObjectCannotBeUpdated; -import com.c2kernel.common.ObjectNotFoundException; -import com.c2kernel.property.Property; -import com.c2kernel.utils.Logger; -import com.novell.ldap.LDAPAttribute; -import com.novell.ldap.LDAPAttributeSet; -import com.novell.ldap.LDAPDN; -import com.novell.ldap.LDAPEntry; -import com.novell.ldap.LDAPException; - -public class LegacyLDAPPropertyManager extends LDAPPropertyManager { - - public LegacyLDAPPropertyManager(LDAPLookup ldap) { - super(ldap); - } - - @Override - public void deleteProperty(EntityPath thisEntity, String name) throws ObjectNotFoundException, ObjectCannotBeUpdated { - try { - LDAPLookupUtils.delete(ldap.getConnection(), "cn="+name+","+thisEntity.getFullDN()); - } catch (LDAPException ex) { - Logger.error("Error deleting prop "+name+" from "+thisEntity.getSysKey()); - Logger.error(ex); - } - } - - @Override - public String[] getPropertyNames(EntityPath thisEntity) throws ObjectNotFoundException { - String props[]= LDAPLookupUtils.getChildrenDNs(ldap.getConnection(), thisEntity.getFullDN(), "objectclass=cristalproperty"); - String names[] = new String[props.length]; - for (int i=0; i