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.
SOLVED

Identify a Binary change on an Asset

Avatar

Level 2

Is there any way in Assets to know if the metadata was updated or the binary was uploaded?

The current use case is we are integrating with third parties with Adobe assets.  This is the second or third time for this ask by a client. One other use case was for approval workflows where a curtain approver was only needed to approve on a binary change not a metadata changes. 

Within the Asset node structure there does not seem to be a way to identify if the metadata or original rendition changes because an entire new node structure is create as the old structure is versioned away.  I have checked the version history structure as well which did not have anything I found useful. 

1 Accepted Solution

Avatar

Correct answer by
Level 10

There is nothing OOTB that can do this. Gaurav provided the best response here. And yes - your idea of using a custom workflow step and workflow is a great way to proceed here. Once of the reasons why AEM allows you to build custom workflow steps - you can introduce Java logic to meet specific business requirements like this one and build a workflow.

Hope this helps...

View solution in original post

5 Replies

Avatar

Community Advisor

I believe if you change anything in assets it will update the jcr:lastModified property. You can listen to this property and identify the change.

There is separate jcr:lastModified property for metadata node to identify the changes in metadata.

It may help, though I never tried.



Arun Patidar

Avatar

Level 2

Hi Arun,

Thanks for the response. All node modified dates are updated no matter what the change.  The entire node tree is copied and updated on version so all dates match.  There is no created date on the revision nodes to key off either. 

Avatar

Level 10

A solution could be generate a hash/checksum of the binary and store it as a property/node either on the asset itself or somewhere else in a centralized location that would've a restricted access so that nobody can modify it (Obviously this would require to think-through the existing business use-cases).

For existing assets, you'd have to implement it in batches based on size/number of assets and for new assets, this solution/service could be a part of DAM Asset Update workflow.

 

Now, based on whatever existing process is to modify an asset each time, you'd calculate the hash again and compare it against the previously stored value and perform some action based on it, either notify or trigger emails or something. This approach can work for  both 'original' or 'renditions' or it could be customized for certain renditions only or with some business logic.

This idea may not be 100% foolproof but yes you can build on top of it and combine it with governance and access permissions to plug the gaps per business requirements.

If you want to read binary for any reason, here are a couple of examples -

Experiencing Adobe Experience Manager - Day CQ: AEM 6420 - Sling Servlet Filter (or sample how-to Vi... 

Downloading multipart file in AEM Sling filter - how?

Avatar

Level 2

This is a solution but as you stated would not be 100% accurate.  I am looking for anything OOTB that would do this before I go down a customization path.  If I was going down the customization path I would add a workflow step to the asset processing flow that sets property with a date of a new asset binary.  That would give me a date to compare the modified date to.  if they match then I know a new binary was added.

Avatar

Correct answer by
Level 10

There is nothing OOTB that can do this. Gaurav provided the best response here. And yes - your idea of using a custom workflow step and workflow is a great way to proceed here. Once of the reasons why AEM allows you to build custom workflow steps - you can introduce Java logic to meet specific business requirements like this one and build a workflow.

Hope this helps...