Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

short url for a content page in author

Avatar

Level 3

I have an requirement in one of the workflow steps where after the PVT step users are sent an email about activation ,however in the email body they would like to have a link to the live site url for the page .The page  served from dispatcher obviously have short url backed with 1:1 mappings in publisher (for both incoming and outgoing).

The url mappings are only defined for publish instances and not in author  . If i redefine the mappings in author and use resourceresolver.resolve or map i could have easily retrieved the transformed short URl but  this means that all pages served in author would also have short url's which i would like to avoid .

One of my colleague gave a suggestion to create etc/map in author although matching host as a  publish host and then use ResourceResolver.map(HttpServletRequest, String) method with a faked implementation of HttpServletRequest that simulates a request on the publish host . Another alternative i had thought of was creating a custom configurations in osgi with 1:1 mapping similar to url mapping in resource resolver ,and then in my custom service use this configuration to transform my long url to short . 

Any suggestions or pointers for any better approaches to tackle this use case ?

0 Replies