com.adobe.cq.wcm.core.components.internal.services.embed.UrlProcessorResultImpl -- Cannot be resolved | Community
Skip to main content
bpeddapudi
Level 2
July 1, 2021
Solved

com.adobe.cq.wcm.core.components.internal.services.embed.UrlProcessorResultImpl -- Cannot be resolved

  • July 1, 2021
  • 1 reply
  • 1802 views

I am trying to customize the Embed component by introducing a new URL processor just like the example below
https://github.com/adobe/aem-core-wcm-components/tree/master/content/src/content/jcr_root/apps/core/wcm/components/embed/v1/embed#extending-the-embed-component

On eclipse, all the imports are looking good and code is getting deployed to the local AEM instance. But the bundle is failing with the below issue

com.adobe.cq.wcm.core.components.internal.services.embed.UrlProcessorResultImpl -- Cannot be resolved

 

I am clueless on how to resolve this issue

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 Vijayalakshmi_S

Hi @bpeddapudi,

It is because you are using a class that is internal (implementation class) to Core Components (The one that is not exposed to use by other projects/bundle)

UrlProcessorResultImpl implements UrlProcessor.Result so while creating custom Url processor we need to provide similar implementation and override getOptions() and getProcessor() methods. 

UrlProcessorResultImpl of Core : https://github.com/adobe/aem-core-wcm-components/blob/9dd529595b65a8441bd320b602584c2d568b6361/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/services/embed/UrlProcessorResultImpl.java#L22

 

Sample snippet for custom Url processor: 

@Component(service = UrlProcessor.class) public class CustomEmbedUrlProcessor implements UrlProcessor { protected static final String NAME = "processor name"; protected static final String PIN_ID = "test"; protected static final String SCHEME = "some url pattern"; private Pattern pattern = Pattern.compile(SCHEME); @Override public Result process(String url) { if (StringUtils.isNotEmpty(url)) { Matcher matcher = pattern.matcher(url); if (matcher.matches()) { return new UrlProcessor.Result() { @Override public String getProcessor() { return NAME; } @Override public Map<String, Object> getOptions() { return new HashMap<String, Object>() {{ put(PIN_ID, matcher.group(1)); }}; } }; } } return null; } }

 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
July 1, 2021

Hi @bpeddapudi,

It is because you are using a class that is internal (implementation class) to Core Components (The one that is not exposed to use by other projects/bundle)

UrlProcessorResultImpl implements UrlProcessor.Result so while creating custom Url processor we need to provide similar implementation and override getOptions() and getProcessor() methods. 

UrlProcessorResultImpl of Core : https://github.com/adobe/aem-core-wcm-components/blob/9dd529595b65a8441bd320b602584c2d568b6361/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/services/embed/UrlProcessorResultImpl.java#L22

 

Sample snippet for custom Url processor: 

@Component(service = UrlProcessor.class) public class CustomEmbedUrlProcessor implements UrlProcessor { protected static final String NAME = "processor name"; protected static final String PIN_ID = "test"; protected static final String SCHEME = "some url pattern"; private Pattern pattern = Pattern.compile(SCHEME); @Override public Result process(String url) { if (StringUtils.isNotEmpty(url)) { Matcher matcher = pattern.matcher(url); if (matcher.matches()) { return new UrlProcessor.Result() { @Override public String getProcessor() { return NAME; } @Override public Map<String, Object> getOptions() { return new HashMap<String, Object>() {{ put(PIN_ID, matcher.group(1)); }}; } }; } } return null; } }

 

bpeddapudi
Level 2
July 1, 2021
thank you that worked