Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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 Accepted Solution

Avatar

Correct answer by
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. 

View solution in original post

0 Replies

Avatar

Correct answer by
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.