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

SOLVED

Need best approach to identify if data has been modified in a project

Avatar

Level 2

Hi

I am working on AEM 6.0 for web content management and we have validation and publish processes (Publish process also has validation, to make sure it covers if there are any changes made by other users from the time of last successful validation). Now we trying to avoid redo of validation if there is NO data change from the last successful validation. We have timestamp of last successful validation and tried validating it against the history.log file; but during the testing we found that not all data changes are logged in history.log. for e.g. we have custom functionality where we are updating the nodes data but not updating its lastModifiedDate and hence it is NOT resulting the event to be logged in history.log

Please help what would be best approach to identify if the data has been modified in a project OR is there any easy way to make history.log to capture all the events no matter my custom code is updating lastModifiedDate or not

 

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Publishing should be the one driven by the authors. It can be an action called or via a workflow if there is any governance for publishing. Automating it isnt a good idea !! It should be the responsibility of the authors to publish their changes when ready!

Regards,

Lokesh

View solution in original post

9 Replies

Avatar

Level 10

Hi,

You can implement Event Listener, so when ever their is any change in node values, event will trigger and then you can execute any custom defined method to log or keep track of it somewhere...

https://helpx.adobe.com/experience-manager/using/events.html

http://blogs.adobe.com/experiencedelivers/experience-management/event_handling_incq/

Avatar

Level 2

Thanks for responding! We have a custom functionality where users can import the data using spreadsheet, and the spreadsheet may contain thousands of records. So, in this context I am not sure if it is still appropriate to use Event Listener to identify data change.

Avatar

Level 10

Now this seems to a be a different case of spreadsheet. Although spreadsheet data would get save in node you do not want to fire event listener thousand times.

What you can do in this scenario of spreadsheet: If spreadsheet is having some data call you custom method to log ( only once all excel data is saved ). and if it doesnt not contain any data just ignore it.

Avatar

Level 2

To add little more context around my problem and what we tried....

We have cq-history jar that belongs to Event Listener category. But the problem there I have is if I do not update lastModifiedDate property for any node then the event is not triggered. And we have number of such occurrences where we have our custom code to update nodes but not updating the lastModifiedDate. Identifying and modifying all the occurrences is a big challenge and we may not opt for that at this point of time. 

Avatar

Level 10

Looks like some issue in event listener cofigurations. Is that an OOTB listener or you wrote (if yes share snippet) ?

Avatar

Correct answer by
Community Advisor

Hi,

Publishing should be the one driven by the authors. It can be an action called or via a workflow if there is any governance for publishing. Automating it isnt a good idea !! It should be the responsibility of the authors to publish their changes when ready!

Regards,

Lokesh

Avatar

Level 2

Hi Lokesh

Thanks for going through this problem. Thought of providing some more details....

Even in my case Publishing is driven by authorized authors. I am not sure what you meant by "Automating it isnt a good idea !!". I believe we are not trying to automate anything here. In large scale applications there are multiple authors authoring the content from different locations. There are two processes involved in my case for publishing the content. one is validating the content so that the authors can correct the validation errors before they click on Publish, and second is publishing it if the validation was good. So, think for a moment Author #1 authored some content and validated the project and no validation errors, on the other hand Author #2 authored some content on the same project which may not be correct, Now when Author #1 tries to publish it and if we dont redo validation again in publish process the system ends up generating incorrect content. So, we are redoing the validation in publish process as well to guarantee the content generated is correct. Now, what I am trying to do is, skip redoing the validation if there are NO EDITs from the previous Validation.

Key points to note

1) Multiple authors working on the same project from different locations. We cannot limit the authors from this.

2) Validation process is to ensure the authored content is good and an opportunity to authors to correct the data if any and user not necessarily ready at the moment to publish it

3) Publish process should ensure the content is good and it doesn't break the website.

Hope this helps to understand the problem

Avatar

Community Advisor

Hi Basheer,

I got your usecase and thanks for explaining in detail. I think its better to run a validation in publish process aswell irrespective of its been done before or not and make it as process. This would be better as it doesnt harm in anyways instead of breaking time over history.