2018 Jul 22 1:08 AM - edited 2024 Feb 04 6:27 AM
Hi Experts,
We are using CanonicalProductSales through SalesAreaCatalogMapping for publication of products to a mapped catalog version. However every time I do this a copy of product gets created in default catalog as well. What is the simplest approach to stop publication of the products(i.e CanonicalProduct) to default catalog? Note: I do not want to write a handler unless there are no other ways to meet this requirement.
Request clarification before answering.
Hi Rahul,
I wrote one publication handler and returned empty list for particular item. It worked for me. Attaching piece of code as well.
public <T extends CanonicalItem> List<T> group(final T item, final TargetItemCreationContext context)
{
return Collections.emptyList();
}
public <T extends CanonicalItem> boolean isApplicable(final T item, final TargetItemCreationContext context)
{
return "BaseProduct".equals(context.getTargetItemTypeCode());
}
Thanks, Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rahul,
here is what you can do:
try not to send those items to DataHub: if they never entered DataHub, they never will be published. So, check, if you filter them somehow out before they reach DataHub.
you can remove the item types from the target extension (that's if you own the extension and not using or extending a provided extension with type definitions). Or you can create your own extension with a different target system name and copy only those item type definitions, which you want to publish excluding all others. This way when data published to the old target system the products will be included; but when they're published to the new target system the products will be excluded. There is serious drawback to this approach - unpublished items will accumulate in DataHub, so you will have to exclude them from raw and canonical models as well; or exclude them from raw only; or customize the cleanup extension to remove unpublished items.
Last suggestion is most commonly used but least wanted by you. You could write publication grouping handler to exclude the items you don't want to publish. This approach is well supported and you don't need to worry about accumulation of unpublished items.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.