Expand my Community achievements bar.

SOLVED

Resolving the URL at AEM cloud publish

Avatar

Level 1

There is a requirement where we need to resolve the Public URL at Publish instance through Servlet. Before this step what we are doing is to get the page Url from the distribution event when distribution completes. I am struggling with the servlet part how to achieve it in AEM as a cloud service.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @shivamaembackend,

I am not 100% sure about the business that you are trying to tackle, however it seems you want to bind the publish URL with a servlet. I recommend proceeding with servlet binding with resourceTypes. Below is the configuration for binding a servlet with resoruceType(page template in this case)

 

@Component(service = Servlet.class,
        property = {
                Constants.SERVICE_DESCRIPTION + "=Servlet for page load",
                ServletResolverConstants.SLING_SERVLET_METHODS + "=" + HttpConstants.METHOD_GET,
                ServletResolverConstants.SLING_SERVLET_RESOURCE_TYPES + "=project-name/components/structure/your-page-template"
        })

 

let me know if this serves you purpose. You can also share more insight on the business you are targeting for better assistance.

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @shivamaembackend,

I am not 100% sure about the business that you are trying to tackle, however it seems you want to bind the publish URL with a servlet. I recommend proceeding with servlet binding with resourceTypes. Below is the configuration for binding a servlet with resoruceType(page template in this case)

 

@Component(service = Servlet.class,
        property = {
                Constants.SERVICE_DESCRIPTION + "=Servlet for page load",
                ServletResolverConstants.SLING_SERVLET_METHODS + "=" + HttpConstants.METHOD_GET,
                ServletResolverConstants.SLING_SERVLET_RESOURCE_TYPES + "=project-name/components/structure/your-page-template"
        })

 

let me know if this serves you purpose. You can also share more insight on the business you are targeting for better assistance.

 

Avatar

Administrator

@shivamaembackend Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni