I have a requirement to automatically lock and unlock pages when an author opens and closes a page respectively (in order to avoid two authors editing the same page simulatenously). I was trying to leverage the currentPage.lock() and .unlock() methods - the .lock() method is easy enough to execute on page load, but I have no good means of triggering .unlock() when the page closes since currentPage isn't in the scope of jspDestroy(). Am I going about this the wrong way, or is there an easy way in CQ5.6 to trigger the unlock when the page is closed?
Thanks in advance.