cancel
Showing results for 
Search instead for 
Did you mean: 

Distinguishing between a move and a delete

sksengupta
Champ in-the-making
Champ in-the-making
Hi,

I have set up a rule to run a particular server side javascript script on a file being deleted or existing the current directory. Everything is working fine. However, I now need to execute slightly different things depending on whether a file is being deleted or being moved.

Currently, I am thinking of enhancing the javascript that I have already written with a mechanism to determine which action (move or delete) has been taken on the file. Is there any way in the JS API to do this?

Is there a better way of doing this?

Thanks for your help.
3 REPLIES 3

fstnboy
Champ on-the-rise
Champ on-the-rise
I guess you can do a search with the nodeRef in javascript and check if that returns anything, if it does then the node has been moved, not deleted.

davix
Champ in-the-making
Champ in-the-making
Looking at this –>http://wiki.alfresco.com/wiki/3.4_JavaScript_API#WCM_Web_Projects

I found this method –> asset.isDeleted

fstnboy
Champ on-the-rise
Champ on-the-rise
That is WCM Asset specific.