0

I have a case represented by user starting a dialog to create a "certain node" and that dialog has two choices only inside it one for create which implies an update of properties that entered by the user and other for cancel/close.

The complete scenario is represented here :

  • Listener for starting dialog (action Listener) that will create a anode without any properties for prepare it to the create process. Why Listener because i use the same dialog to serve multiple type of nodes and i need the listener to supply a node of a certain type without properties that the user will use it later.

  • Create will update properties of a node, that created in the listener.

  • Cancel/Close will removed the temporal referenced node that created previously in the listener.

Now, i'm ensure that once the user leave the dialog from the close button the temporal node is removed but what about leaving the dialog by clicking on another actions in the page such as logout, company home or others.

Your replies are highly appreciated. Thanks

Mohammed Amr
  • 307
  • 5
  • 15

1 Answers1

1

There are many different ways that your 2nd stage could not get run. Certainly the user could browse away to a different link, but equally they could close their browser, or time out, or even the server could be shut down.

What you'll want to do instead is to have a background job run. This job should search for these temporary nodes, and if they were created too long ago (eg more than an hour) then delete them.

To make this easy, you'll want to ensure that your temporary nodes have a specific type or aspect on them, so you can locate them easily with a lucene query.

Gagravarr
  • 47,320
  • 10
  • 111
  • 156