Expand my Community achievements bar.

SOLVED

Is there a way to import the OOTB LinkHandler implementation?

Avatar

Level 2

I have a requirement to build Link Objects (Type: com.adobe.cq.wcm.core.components.commons.link.Link) for multiple custom components that we are developing. I see that the LinkHandler (Type: com.adobe.cq.wcm.core.components.internal.link.LinkHandler) does this job. But, this class belongs to the internal package and hence I cannot import it into any of my custom implementations. As this is not associated with any core component, I'm not sure if there is a way to get a reference of  LinkHandler using the Sling delegation pattern approach. 

 

Is there any way we could create a reference of this class? Or do we need to do the implementation ground up again?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Please post this question on the github repository of the core components project (https://github.com/adobe/aem-core-wcm-components) including some more details about your usecase.

There are definitely reasons why this is internal and not a public extension point.

View solution in original post

6 Replies

Avatar

Level 2

@arunpatidar :  I see that you are suggesting to use the sling delegation pattern. However, this works only when you extend the core component by specifying the resource supertype property in the child component. 

My use case is a little different. I'd like to build objects of type "com.adobe.cq.wcm.core.components.commons.link.Link"  so that I could use them in custom components that I am developing. Here, Link is not a core component model and hence I wouldn't be able to use the sling delegation pattern. Is there any other way I can get around this?

Avatar

Correct answer by
Employee Advisor

Please post this question on the github repository of the core components project (https://github.com/adobe/aem-core-wcm-components) including some more details about your usecase.

There are definitely reasons why this is internal and not a public extension point.

Avatar

Level 2

Sure thing @Jörg_Hoh . Will post it in the git repo. In the mean time, it would be really helpful if you have any alternate or workaround. 

 

Thanks!

Avatar

Employee Advisor

I don't know any way to achieve that, I am sorry.

Avatar

Level 2

Just in case if anyone is after a solution for this requirement, there is already a github issue open:

 

https://github.com/adobe/aem-core-wcm-components/discussions/1861