Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Publish / unpublish History

Avatar

Level 2

Hi

 

Is there any way of checking if a page was unpublished before it was published?
Want to check when (Date) it got published and when (Date) it got unpublished and User who published & unpublished

Thanks in Advance !!!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Sigkumar ,

You can use ReplicationStatus to get the deactivated/unpublished status of the page:

 

ReplicationStatus status = page.adaptTo(ReplicationStatus.class);
boolean deactivatedStatus = status.isDeactivated();

 You can also check the activated/published status below:

boolean activatedStatus = status.isActivated();

Hope this could help you

Thanks

Shiv 

Shiv Prakash

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @Sigkumar ,

You can use ReplicationStatus to get the deactivated/unpublished status of the page:

 

ReplicationStatus status = page.adaptTo(ReplicationStatus.class);
boolean deactivatedStatus = status.isDeactivated();

 You can also check the activated/published status below:

boolean activatedStatus = status.isActivated();

Hope this could help you

Thanks

Shiv 

Shiv Prakash