cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PublicationGroupingHandler to filter canonical item publications

Former Member
0 Likes
425

Hi All,

I am filtering CanonicalProductSales i.e. if distribution channel is 10 then only CanonicalProductSales will get create else CanonicalProductSales will not get created.

After this I want to check in publication level if canonical item :- CanonicalProductSales is not present no other canonical item should get publish. like canonicalproduct should not get publish.

How to use publication grouping handler to filter or block all canonical item publication?

It would be use full if anyone can provide sample code

Regards, Rasika

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi

Did you tried with the composition Handler for not creating the CanonicalProductSales canonical Item?

if ("CanonicalProductSales".equals(t.getType())) {

       final String pos = ((String) (t.getField("distributionChannel")));

       if (pos != null && pos.equals("30")) 
         {
                 t.setStatus(CompositionStatusType.ERROR);
                 return null;
         }

}

tino_kissig
Active Participant
0 Likes

A PublicationGroupingHandler will filter all items when isApplicable always returns true and group always returns am empty List.

Slava
Product and Topic Expert
Product and Topic Expert
Former Member
0 Likes

,

I have created Publication Handler which contains method doesAttributeValueMatches to check value of attribute distributionChannel is 30 but it always returns Null value , please find attached code and no any target item is getting created.Is their any thing missing? Note: I am trying to check attribute distributionChannel is 30 of canonical item CanonicalProductSales then all the canonical item should get publish . link text

Regards, Rasikalink text

tino_kissig
Active Participant
0 Likes

You're searching the wrong pool. CanonicalProductSales are in the SAPCONFIGURATION_POOL pool.

Former Member
0 Likes

, ,

I tried with pool : - SAPCONFIGURATION_POOL but still facing same issue.

is their any thing missing?

Regards, Rasika