move vs rename
dbu opened this issue · 4 comments
reading the doc of the move operation i would assume it to have the same semantics as in PHPCR (it includes the target node name as well).
https://github.com/symfony-cmf/TreeBrowserBundle/blob/master/Tree/TreeInterface.php#L30
however the implementations do not do this, and i guess its because in the jstree we move something with an id to become child of a new id. but i think that is an implementation detail of the jstree and should be handled in javascript in the frontend. alternatively we have to improve the doc.
the added benefit of move as in PHPCR would be that it can also be used to rename a node. currently the interface does not allow to rename a node.
https://github.com/symfony-cmf/TreeBrowserBundle/blob/master/Tree/PHPCRTree.php#L90
https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/blob/master/Tree/PhpcrOdmTree.php#L118
There are different concepts here with different meanings, so its up to us to define them as we think them suitable. Currently the TreeInterface is used to configure, populate and back the jstree, so it seems straightforward to me to design the interface close to jstree (i can't remember i did the doc on the move operation ...).
If I remember properly renaming is a different operation in jstree.
Personally I would prefer to keep the interface close to the tree as long as there is no "real js developer" is around ... So that would be a rename operation in rhe interface ..,
Cheers
Uwe
Am 28.01.2013 um 21:45 schrieb David Buchmann notifications@github.com:
/cc @uwej711 wdyt?
—
Reply to this email directly or view it on GitHub.
thanks for this opinion uwe. it does make sense to me then to keep it
this way. i will do a PR to update the doc and add a rename operation
too (and update our tree implementations).
the frontend side i don't know if i can easily do it, but once its ready
in the backend maybe somebody feels like doing it :-)
rename for phpcr-odm is done in the edit interface. i propose we just declare renaming an edit operation that is out of scope of the tree interface (as all the rest of the edit interface is out of scope as well)