Nico Klasens wrote:
> I have only one question about this. Why are the fields object.owner and 
> insrel.dir persistent and not system?
> 
> I am trying to make a distinction in my code which fields can be written 
> by a user and which ones not. I didn't have problems in previous 
> releases of mmbase, because I excluded all the object and insrel fields, 
> but now with the new datatype features this is not enough.
> 
> org.mmbase.bridge.BridgeException: You cannot change the field lastmodifier
>         at
> org.mmbase.datatypes.processors.LastModifier.process(LastModifier.java:35)
>         at
> org.mmbase.datatypes.BasicDataType.process(BasicDataType.java:476)
>         at
> org.mmbase.bridge.implementation.BasicNode.setStringValue(BasicNode.java:519)
> 
> I thought to do it by checking if the field is system managed, but then 
> the above mentioned fields are an exception on that rule.
> Can I just change these field definitions to state="system"?


I normally check in 'system', indeed to check of a field is
user-modifiable.

But why couldn't owner and dir be changed?

Anyhow, I thing I agree that even if they could be changeable, you
shouldn't want that, so perhaps state="system" would work just
fine. Perhaps we can simply try it out for a while?

> Ps it might be nice to have methods in the bridge like
>       boolean isSystem();
>       boolean isVirtual();
>       boolean isPersistent();
>       boolean isStored(); (isSystem() || isPersistent())
> instead of checking the getState() == STATE_*

I agree.


Michiel


-- 
Michiel Meeuwissen                  mihxil'
Peperbus 111 MediaPark H'sum          [] ()
+31 (0)35 6772979         nl_NL eo_XX en_US



_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to