Expand my Community achievements bar.

Displaying custom error message on replication event

Avatar

Level 2

Hi

I have a requirement to display a custom error message on page deactivation event. In the event handler, I will perform some validation and based on success or failure of the validation, I need to display an error message.

Is it possible to display an error message from event handler (java class) to the content editor. I would be best to stop the deactivation event if possible.

When we activate/deactivate a page from side kick we get a success message on the top right corner of the page. I was thinking if it would be possible to override that message. But not sure how to approach this. Any help/suggestion would be much appreciated.

Using AEM 5.6

5 Replies

Avatar

Administrator

Hi 

If you aim is to just modify this message, then

In 6.2 there is "Sidekick.js" located at "/libs/cq/ui/widgets/source/widgets/wcm/Sidekick.js", which contain this message.

You are on older version 5.6, i hope the path i mentioned is same as in 5.6. 

Overlay this "Sidekick.js" file, and modify the message as per your need.

I just checked it at my end and it is working fine.

 

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 2

Hi Kautuk,

Thanks for ur reply. I had looked into sidekick.js, but the message seems to appear only when the page is activated/deactivated from side kick. I have now looked into siteadmin.actions.js, which seems to be called both from sidekick & site admin. I am thinking, I can probably add my custom message here. Any thoughts?

Also I want my custom message to display only for a particular page hierarchy and not for everything. You mentioned about overlaying. Can you please  advise how that is achieved. Any reference article that I can go through?

Thanks again for your response.

Avatar

Level 2

Also is there a way to search for text in libs/foundation code..? 

Avatar

Administrator

I would recommend you to do it by creating Replication Event Handlers.

Take a look at Adobe Helpx article :- https://helpx.adobe.com/experience-manager/using/replication_events.html

// This article will guild you to build "Replication Event"  custom replication event handler is invoked when AEM content is activated/Deactivated

~kautuk



Kautuk Sahni

Avatar

Level 2

Yes the replication events would be the preferred approach. I in fact have a replication event already written. But the problem I have is displaying a message from event handler class. I am not sure how to do it. Any thoughts?

Thanks for ur reply