Author component: Create an action to move a node

Post here questions and problems related to oXygen frameworks/document types.
sebastienlavandier
Posts: 124
Joined: Tue May 29, 2012 5:42 pm

Author component: Create an action to move a node

Post by sebastienlavandier » Tue Jul 22, 2014 6:26 pm

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

alex_jitianu
Posts: 770
Joined: Wed Nov 16, 2005 11:11 am

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

Post by alex_jitianu » Wed Jul 23, 2014 11:28 am

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

sebastienlavandier
Posts: 124
Joined: Tue May 29, 2012 5:42 pm

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

Post by sebastienlavandier » Wed Jul 23, 2014 11:35 am

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.

Post Reply