Expand my Community achievements bar.

SOLVED

Disable or Override OOTB Replication PreProcessor

Avatar

Level 2

We have a requirement where we need to replicate a locked page .

 

OOTB - com.day.cq.replication.impl.ReplicatorImpl  is failing as  pre processor defined in VersionManagerImpl  is called before replication and fails the replication api

 

if (page.isLocked()) {
throw new ReplicationException("Locked pages cannot be replicated. The owner needs to unlock the page first. Cannot perform replication");
}

 

For now, we have disabled component com.day.cq.wcm.core.impl.VersionManagerImpl and we do not have version purge requirement (suppressversion - true ).

 

Is there a way to disable OOTB replication preprocessor only or override the replication preprocessor ?

Or any other solutions to replicate a locked page ?

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 9

If you don't want to the lock capability just hide that feature for all authors so you don't have to deal with so much customization on the back-end. Hiding this feature would be better and authors would not confuse  why the page gets replicated even though the page was locked.

 

Depends on the AEM version, you may be able to hide this using jus the permissions or you'll have to overlay the OOTB JSP's to hide this lock button.

View solution in original post

4 Replies

Avatar

Community Advisor

@Kundan_Ray1 Thank you for reaching the Adobe Experience League community. The first case, why do you want to replicate a Locked Page? It was there for a reason. Author's may do changes on the page, but before they finalize and make it ready to publish, they may lock the page. If you enable replicate the page even on Lock, will unintentional changes goto Live Site?

 

Please explain a bit more about your usecase so that, we can suggest you better for the initial problem.

 

Hopes this helps

Avatar

Level 2

@Shashi_Mulugu  

We have scheduled replication process where pages are locked (by serviceuser , author )  till the time of replication . Once successful then the pages are unlocked.

This is working fine in AEM 6.3.2

 

But after Upgrade to 6.5.5 this fails as we noticed new code introduced in replication preprocessor

if (page.isLocked()) {
throw new ReplicationException("Locked pages cannot be replicated. The owner needs to unlock the page first. Cannot perform replication");
}

 

which prevents any replication for locked pages.

 

 

 

Avatar

Correct answer by
Level 9

If you don't want to the lock capability just hide that feature for all authors so you don't have to deal with so much customization on the back-end. Hiding this feature would be better and authors would not confuse  why the page gets replicated even though the page was locked.

 

Depends on the AEM version, you may be able to hide this using jus the permissions or you'll have to overlay the OOTB JSP's to hide this lock button.

Avatar

Community Advisor

@Kundan_Ray1 if I understood your case, you are using lock feature that if any author makes change to page and want to publish the change later and also restrict any other user not to make any other changes on same... 

 

This feature is OOTB supported by Publish later feature by way versioning... where when author makes it Scheduled Publish.. it will create a version of current state of page and publish that version at the scheduled time..