How Do You Provide the Version Difference Function for Images in Custom Components?
Currently using CQ5.5.
I've been asked to provide the diff functionality that OOB components have using the "Diff" button in the Version/Restore tab within the CQ Sidekick.
I've been able to add this feature for the text portions of our components, by using the DiffInfo and DiffService classes provided in CQ. This has been accomplished by copying code from /libs/mcm/components/newsletter/footer/footer.jsp and adapting it for my custom components.
The OOB (out-of-the-box) Image component seems to provide diffs correctly when an image is deleted by appending the URL parameter, "cq_diffType=REMOVED", on the image source, which places an "X" across the image. The diff also works when an image is added--but I can't say it's actually very reliable.
My question is how do I provide this feature for an image within my component?
I tried copying the code from /libs/foundation/components/mobiletextimage/mobiletextimage.jsp for diff'ing an image, but it doesn't work. Actually, it doesn't appear to work in the original mobiletextimage component, so it may not be in how my component is coded.
Is the OOB Image component using the DiffService and DiffInfo classes to get this feature, or is there some other interface which I can use? When I tried using DiffService and DiffInfo, the DiffInfo.getType() function always returned the value, DiffInfo.TYPE.SAME.
Any pointers to code, examples, or better documentation for DiffService and DiffInfo will be appreciated.