Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to create version of the current page

Avatar

Level 9

In the siteadmin open page action, I am trying to create a version of the page before opening.

How do I create a version using js in SiteAdmin.Actions.js

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

Hm, that requirement seems a bit weird; even if I just want to check the content of a page on authoring, a new version is being created and the page is locked. How do you plan to unlock it again? Is the editor supposed to unlock the page after the changes? What do you want to do with the number of versions you create? Be aware, that you have to store and maintain them, and it can really become a driver for disk space.

kind regards,
Jörg

View solution in original post

7 Replies

Avatar

Level 10

Could you not just use the JCR API to create a node in that represents a page in the location where you want it? After all - a page is just a node. 

Avatar

Level 9

I want the similar functionality that we see on Sidekick version, I think that is done through js.

As soon as Author clicks open from siteadmin it will create a new version and lock the page for that author.

Author can make the changes to the page and save it, however they have open to rollback all the changes

In case of rollback, we delete the version of the page.

Thanks

Mohammed Ahmed

Avatar

Level 10

This is a unique use case. What about creating an AEM workflow that knows how to do this. Kick off the workflow via an API call and have the workflow perform the page operations that you need. I will pass this to Will. He may have some suggestions. 

Avatar

Correct answer by
Employee Advisor

Hi,

Hm, that requirement seems a bit weird; even if I just want to check the content of a page on authoring, a new version is being created and the page is locked. How do you plan to unlock it again? Is the editor supposed to unlock the page after the changes? What do you want to do with the number of versions you create? Be aware, that you have to store and maintain them, and it can really become a driver for disk space.

kind regards,
Jörg

Avatar

Level 9

Authors have options to lock, unlock and discard on the pages. We have to maintain the versions until there is a need to clean the disk space. If this becomes bottle neck we might have to come with purge workflow to cleanup disk space at regular intervals.

Avatar

Employee Advisor

Hi,

ok, but be aware, that only the owner of the lock (or admin) can unlock a page. If a user forgets to unlock a page and then goes on holiday, you always need to call the person owning the admin account, which is kind of restrictive to editors (and a burden to the admin person). The majority of projects I was at were not using locking in daily business, but only when it was a hard requirement. They prevent 2 users changing the same page by some organisational rules (which they needed anyhow).

kind regards,
Jörg

Avatar

Level 9

Yes, those are administrative overheads for this implementation