Hello
On Thu, Jun 12, 2008 at 10:53 AM, Guillaume Lerouge <guillaume(a)xwiki.com>
wrote:
Hi Pascal,
thanks for your work :-) It's great to have people working on improving
this
since it's at the heart of what makes XWiki powerful.
do you remember my work on classes and objects?
I fear the answer is "no" :)
We certainly do :-)
liar ;)
Anyway, I have been working on some other
critical projects so I haven't
been able to work on that for some time.
But, now I have restarted my study for my current needs.
The idea was to provide a simple way to manage classes, to delete/restore
class properties and to synchronize objects with these classes.
As I was not really happy about the result of my previous work based on
class versioning (I found it too much intrusive in XWiki code and
complicated), I totally changed my approach into something much lighter.
The idea is really simple:
I propose to add the feature of enabling/disabling class properties.
* If you disable a property, it is only "hidden" without being deleted so
you can modify the structure of the class without losing anything.
* Then the disabled properties are also "hidden" for the objects
instantiating this class and the valued fields are also not lost.
* If you add a new property to the class, all objects will inherit a new
field with the default value.
* If you enable a disabled property, all the objects owning the field
re-find it and the objects not having the field now have it with the
default
value.
* you could also delete a disabled field from an object for some
optimization issues.
That sounds god as it solves the issue without deleting the data. The
developer shouldn't forget to update his / her ClassSheet pages in order to
remove the $doc.display('NowHiddenProperty') afterwards I guess...
Disabled properties should be seen only by people with rights to see it...
I also propose to add the "remove
property" feature which would be quite
protected but which is useful: you simply delete the property from the
class.
* All objects having the "removed" field are no more synchronized with
the
class.
* the removed field still exist in the object but is no more available to
classical display functions which use "class properties" to find object
fields.
* the removed field can be deleted from the object to resynchronize the
object to the class
* if a new property with the same type and name is re-added to the class,
the object re-finds its existing field.
What about adding the ability to automatically synchronize all objects at
once (that is, deleting the property from all objects) ? This feature would
be even more protected, but I can see its usefulness (for instance, when
I've just started writing a class, added a couple objects then thought
about
a better way to do what I wanted -> little data to lose, would help me gain
some time & avoid having me go to 10 objects to delete the property from
each of them).
Naturally this would be great...
This was my first idea in fact and then I began studying class management
and now I go back to this issue :)
I'm really thinking about refactoring the whole class/object editor with
something with better ergonomics... something to build, view and modify your
classes in a simple and practical way, to be able to show lots of objects...
to add some automatic and mass object refactoring mechanism while keeping
precise actions on one object etc...
As you said, I think this is a real strength of XWiki and it needs to be
pushed a bit further...
The way to do it is quite simple: just add a
"enabled" field to the
PropertyClass and manage it in the code.
I have modified a bit XWiki-Core and some velocity scripts but it seems
really light without any really new logic
Are you interested in this?
I think so, though I'll let Vincent / Sergiu provide a Developer /
Committer
answer.
Let's wait for their comments (I'm on holiday next week so they will have
time to answer ;))... Anyway, I will work on this for myself because I will
certainly need it...
I'll take a look at it:)
regards
Pascal
Guillaume
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs