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 --- src/main/java/com/c2kernel/entity/proxy/ItemProxy.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/c2kernel/entity') diff --git a/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java b/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java index ceea6c3..0e6859d 100644 --- a/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java +++ b/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java @@ -79,7 +79,7 @@ public class ItemProxy extends EntityProxy public void setProperty(AgentProxy agent, String name, String value) throws AccessRightsException, - PersistencyException + PersistencyException, InvalidDataException { String[] params = new String[2]; params[0] = name; @@ -90,9 +90,11 @@ public class ItemProxy extends EntityProxy throw (e); } catch (PersistencyException e) { throw (e); + } catch (InvalidDataException e) { + throw (e); } catch (Exception e) { Logger.error(e); - throw new PersistencyException("Could not store property"); + throw new PersistencyException("Could not store property", ""); } } /************************************************************************** -- cgit v1.2.3