Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Preprocessor for assets in AEM as a cloud service

Avatar

Level 3

Hey guys,
Environment - AEM as Cloud Service

Do you know of any OSGI service or interface which i can use to hook up a service to run a few validations on an asset before the asset compute services kick-in to process the asset ?
To be more specific, I'm looking at building a few validation rules like

  • asset should follow a particular naming convention
  • assets can only be uploaded to their designated paths
  • etc

I want to restrict the asset from being processed if it does not pass any of the validation rules. Where can i write this logic ? 

I'm aware of post-processing logic but I'm looking for a pre-processing one ? Any leads or ideas to implement this will be highly appreciated. TIA.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@subsul1 

Unfortunately, we dont have Preprocessors in AEMaaCS. For other editions like On Prem and AMS, we can still achieve this usecase by modifying DAMUpdate Workflow, but this is not possible in AEMaaCS.

 

In CS terms, we can't really pause the processing of an asset once it is uploaded in AEM. Hence, I would suggest you

1. to consider restricting Asset Upload(before Asset is ingested into DAM) on basis of your validation rules. (Recommended, as it will save processing overhead of uploading the wrong asset and then delete it)

2. to capture asset upload event and handle it via event handlers or custom workflow. If it fails validation, asset should be deleted or archived into different folder.

 

Let me know if this helps

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

@subsul1 

Unfortunately, we dont have Preprocessors in AEMaaCS. For other editions like On Prem and AMS, we can still achieve this usecase by modifying DAMUpdate Workflow, but this is not possible in AEMaaCS.

 

In CS terms, we can't really pause the processing of an asset once it is uploaded in AEM. Hence, I would suggest you

1. to consider restricting Asset Upload(before Asset is ingested into DAM) on basis of your validation rules. (Recommended, as it will save processing overhead of uploading the wrong asset and then delete it)

2. to capture asset upload event and handle it via event handlers or custom workflow. If it fails validation, asset should be deleted or archived into different folder.

 

Let me know if this helps

 

 

Avatar

Community Advisor

Can this be a feature request? I have a similar validation use case which happens after asset is ingested in DAM using the three steps upload framework on cloud, unfortunately we do not have a validation framework outside AEM.

If a preprocessor is available, the assets need not be submitted for rendition creation and needless sling job will not start as wfpostprocess