Michiel Meeuwissen wrote:
Nico Klasens wrote:
System maintained doesn't mean the user can't change it. It does only
mean that the system will put values in it. An user should know what it
is doing when it is changing the field.
The system can put values in every field (default values). I don't know,
but I considered 'system fields' more or less as a synonym to
'unmodifiable'. At least the only thing I could come up with to make sure
that 'lastmodifier' is not manually modified by the user, is making it
'system'.
Guess, this only not true for the owner field, but that is already
handled by BasicNode.java.
public void setValueWithoutProcess(String fieldName, Object value) {
edit(ACTION_EDIT);
if (MMObjectBuilder.FIELD_OWNER.equals(fieldName)) {
setContext(Casting.toString(value));
return;
}
That is, I ensured that that 'system' fields don't appear modifiable in
generic editors, which made sense to me any how. No need to make
exceptions for fields like number and otype any more.
You can also set the 'input order' to -1, but that will mean that these
fields are not event shown in a generic editor, while they may contain
quite relevant information (like lastmodifier)
Of course, perhaps the system does not give errors if you try to change
it any way (in the case of 'lastmodifier' it does though)
IMO this is the problem of the user changing the field. The state
already warned that it is a system field and that the system can protect
the fueld.
Yes, perhaps Field#isModifiable() would have been clearer, and more
correct. So, I'm all before introducing that too..
I agree, default implementation could be
if (isVirtual()) return false;
if (isSystem()) {
return getDataType().isModifiable();
}
return true;
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers