Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Sling Delegation Pattern not working for Breadcrumb Commerce Component

Jatin-Verma
Level 1
Level 1

We had a requirement wherein it was required for us to do the customization of OOTB Breadcrumb CIF component. As OOTB Breadcrumb CIF component internally inherits Breadcrumb Core component, it was using Sling Delegation Pattern for the same. 

But now, when we tried to using the same logic and use Delegation Pattern for our custom breadcrumb component which inherits OOTB Breadcrumb CIF component, it has started to give us a Null object for the same. 

Below are the levels of inheritance we are following:

CustomBreadcrumbImpl <- CIF BreadcrumbImpl <- WCM BreadcrumbImpl

 

Below is the code snippet through which I am trying to access the object.

import com.adobe.cq.commerce.core.components.models.breadcrumb.Breadcrumb;

@Model(adaptables = SlingHttpServletRequest.class, adapters = { Breadcrumb.class,
CustomBreadcrumb.class }, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, resourceType = "project/components/commerce/breadcrumb")
public class CustomBreadcrumbImpl implements CustomBreadcrumb {

@Self
@Via(type = ResourceSuperType.class)
private Breadcrumb customBreadcrumb;

 

Has anyone faced any such issues? Any idea how we can manage these kind of issues where three layers of inheritance is observed? 

Help would be much appreciated. Thanks. 

 

1 Reply