Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Created a sling fliter to rename image name having space with "-"

Avatar

Level 2

Hi,

I have created a sling fliter to rename image name having space with "-". It's working in aem sdk but not working on RDE,DEV or higher environment.

I have done the same code as mentioned here:

https://experience-aem.blogspot.com/2020/08/aem-6550-modify-filename-on-upload-before-executing-dam-...

final var requestParts = (Iterator<?>) slingRequest.getAttribute("request-parts-iterator");
this is null in higher environment(RDE, DEV, Stage...) but working in local.
Topics

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

1 Accepted Solution

Avatar

Correct answer by
Adobe Champion

I wonder if this is due to the way AEM Cloud Service differs from AEM 6.5 and technically a local SDK instance when it comes to asset processing.  In 6.5 assets were processed on the author instance so the file upload goes direct to the instance.  In CS the upload actually goes directly into blob storage and processing is handled outside of AEM.

 

Theres an Adobe Tech blog which goes into the details here: https://blog.developer.adobe.com/introduction-to-aem-as-a-cloud-service-asset-upload-http-api-fc560f...

 

This likely means you don't get the same data in the incoming "createasset" request on any CS instance compared to a local SDK or 6.5 instance.

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @SamikshaSh1 ,

Please follow below steps to troubleshoot it. This may be happening due to caching mechanism available in other environment while there is no caching in your local and secondly you can check for pattern that you have given in your sling filter.

 

1. Apply log in your sling filter and check if any request is going through it.

2. Check your filter functionality for DEV publisher and not in dispatcher.

3. If it is working in Publisher then issue might be due to cached content and filter pattern on dispatcher.

4. Flush the dispatcher cache and see if it is working.

5. Check the filter pattern

property = {
      Constants.SERVICE_DESCRIPTION + "=Demo to filter incoming requests",
      EngineConstants.SLING_FILTER_SCOPE + "=" + EngineConstants.FILTER_SCOPE_REQUEST,
      Constants.SERVICE_RANKING + ":Integer=-100",
      EngineConstants.SLING_FILTER_REQUEST_PATTERN + "=/content/dam/.*",
    })

, it should look something like above.  If you already have this then look for URL rewrite pattern in dispatcher for DAM asset and do the modification there so that request go through "content/dam".

 

 

-Tarun

 

 

-Tarun

Avatar

Level 2

Hi @TarunKumar ,

 

I have applied logs , I am getting null at below line -

final var requestParts = (Iterator<?>) slingRequest.getAttribute("request-parts-iterator");

 Also,

I tried to deploy on RDE , even on RDE it's not working.

Avatar

Correct answer by
Adobe Champion

I wonder if this is due to the way AEM Cloud Service differs from AEM 6.5 and technically a local SDK instance when it comes to asset processing.  In 6.5 assets were processed on the author instance so the file upload goes direct to the instance.  In CS the upload actually goes directly into blob storage and processing is handled outside of AEM.

 

Theres an Adobe Tech blog which goes into the details here: https://blog.developer.adobe.com/introduction-to-aem-as-a-cloud-service-asset-upload-http-api-fc560f...

 

This likely means you don't get the same data in the incoming "createasset" request on any CS instance compared to a local SDK or 6.5 instance.

Avatar

Administrator

@SamikshaSh1 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni