コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Automatic page locking/unlocking

Avatar

Level 1

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.

1 受け入れられたソリューション

Avatar

正解者
Level 10

For this use case -- the event can only be tracked at the page level. So you could use a jquery event and send a callback through Sling to execute your lock command. Hope this helps you. 

元の投稿で解決策を見る

1 返信

Avatar

正解者
Level 10

For this use case -- the event can only be tracked at the page level. So you could use a jquery event and send a callback through Sling to execute your lock command. Hope this helps you.