Is there a way to import the OOTB LinkHandler implementation? | Community
Skip to main content
SRK_1D
Level 2
April 24, 2022
Solved

Is there a way to import the OOTB LinkHandler implementation?

  • April 24, 2022
  • 1 reply
  • 2039 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

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.

1 reply

arunpatidar
Community Advisor
Community Advisor
April 25, 2022

Hi,

You can extend this and change/implement custom logic.

 

e.g. https://github.com/arunpatidar02/aem63app-repo/blob/master/java/CustomTeaser.java

Arun Patidar
SRK_1D
SRK_1DAuthor
Level 2
April 25, 2022

@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?

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
April 25, 2022

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.