Page 1 of 1

Author component: Create an action to move a node

Posted: Tue Jul 22, 2014 6:26 pm
by sebastienlavandier
Hi,

I have already create customized actions used with author component 14.2, for insert an xml fragment, delete a node ...

But now I want to create an action for moved up/down a node in author view, after have click on a up/down button.

I want to know, if an oxygen action already exist to do that ?
Else could you gave me the best way to do that ?

Thanks in advance for your help.
Regards

Re: Author component: Create an action to move a node

Posted: Wed Jul 23, 2014 11:28 am
by alex_jitianu
Hello,

Such a behavior is not possible to implement in an author author action (in a general fashion) by using only the existing author operations (an action consists in one or more operations). The good news is that such a move AuthorOperation can be implemented using the public API. Basically this operation must use the API from AuthorDocumentController to identify the node to move (by executing an XPath), create a document fragment over the node (AuthorDocumentController.createDocumentFragment()) and inserting the fragment at the destination (AuthorDocumentController.insertFragment()). Last, it must delete the original node (AuthorDocumentController.deleteNode())

We had previous requests for such an operation from our users and we decided to implement one ourselves. We have already started working on it in the current development stream. If you find it helpful, I can send you the source code for this operation (like I said, it uses public API) and you can tailor it some more, if required.

Best regards,
Alex

Re: Author component: Create an action to move a node

Posted: Wed Jul 23, 2014 11:35 am
by sebastienlavandier
Hi Alex,

Yes, if it's possible I want this source code.
I want to look for Oxygen API best practices.
Thank you for your quick answer too.
Regards.