Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

DAM Path Shortening

Avatar

Level 5

Hi,

 

We need to shorten some DAM PDF url in our website.

 

E.g. 

 

if PDF Path is:

/content/dam/cms/myproject/resources/documents/mydoc.pdf,

 

on page, whether is a href or img src, It should display like /Documents/mydoc.pdf

 

Added rule as below in Sling Resource Resolver Factory:

 

^/content/dam/cms/myproject/resources/documents/</Documents/

arvind_0-1670963200003.png

 

When I try to check if it maps to right url, it looks all good.

arvind_0-1670963549218.png

 

 

However, It does not shorten PDF urls on the Pages, whereas all rewrite rules for Pages work fine.

 

1) Do we need to write custom sling rewriter to handle this scenario?

OR

2) Something is missing out here?

 

 

 

FYI:@arunpatidar  @ AvinashGupta01 @kautuk_sahni ,

 

4 Replies

Avatar

Level 5

@SantoshSai  Thanks a lot for your time.

 

I went through above shared link and I found only this part for DAM assets. 

Does it mean that we need to write something custom to shorten dam urls in our website? like Rewriter , transformer factory etc?

 

 

arvind_0-1670994843235.png

 

Avatar

Level 5

hello @arvind 

 

As suggest on the link shared by @SantoshSai .

The URL shortening can also be achieved by using "dispatcher" + "Sling Mappings"

 

Dispatcher can take care of the URL rewites:

  • Shortening URLs, if user enters full URL
  • Converting short to long URLs based on vhost configs 

 

The Sling mappings would take care of URL shortening in the content section.

 

Explanation also available on: https://helpx.adobe.com/ro/experience-manager/kb/multi-domain-management-aem-mappings-for-url-shorte...

https://www.youtube.com/watch?v=bJ_cXcAE7G8 It shows step-by-step how each config enhances the overall solution

Avatar

Level 5

Hi @aanchal-sikka ,

 

Very thanks for sharing these info.

 

As I stated earlier, We have done same things ....Dispatcher plus sling mapping, It all works as expected.

 

 

Only issue is with DAM URL like.../content/dam/....... It does not shorten URLs like it is doing for Page urls.