‎2018 Apr 05 10:27 PM - edited ‎2024 Feb 04 5:17 AM
We are using Hybris 6.6 and noticed that some of the raw and canonical items are not deleted inspite of being published successfully. Also there are some canonical items which are just intermediate objects and not the canonical item source for any of the target items. Hence these are not being deleted. Need help in custom implementation of the cleanup functionality.
Request clarification before answering.
In order to Build Custom Cleanup logic you need to create or reuse an extension and Implement the following Interface: CleanupExtensionHandler.
/**
* defines the cleanup hooks to be implemented by custom cleanup extension if needed
*/
public interface CleanupExtensionHandler
{
/**
* Defines behaviour to execute before given Cleanup logic.
* @param context
*/
public void beforeCleanup(final CleanupContext context);
/**
* Defines behaviour to execute after given Cleanup logic.
* @param context
*/
public void afterCleanup(final CleanupContext context);
/**
* Determines whether this handler is applicable to the context.
* @param context
* @return true if handler should be executed in this context
*/
public boolean isApplicable(final CleanupContext context);
}
Your implementation will be called before and after cleanup. Also you can specify if your Implementation is applicable for a given CleanupContext. E.g. which event triggered this call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks ! I was thinking of overriding the listeners (AbstractJdbcDataHubEventListener) for composition/publication events and modify the delete query to fetch objects for deletion as per the criteria I specify. This way I can delete the Canonical objects which dont have an entry in CanItemPubStatus table as well. Any thoughts in this regard?
Hi kauser,
use below properties in dataub local.properties file :
datahub.cleanup.rawitem.enabled=true
datahub.cleanup.canonicalitem.enabled=true
datahub.cleanup.targetitem.enabled=true
datahub.cleanup.publisheditems.enabled=true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.