Hi
I am sure somebody encountered the same problem before. I am working on long documents, this is why I split them in 3 or 4 parts. Later on, I assemble them to print them of to view them (includeTopic() is good for that).
But now I would like to get a diff between a complete version of an old document and a new one. What would be the simplest way to achieve this result in your opinion?
I don't know the history api well enough to think of something definitive. But what if I could list all revision dates of all the parts documents twice in 2 columns, and then pick the old in the left and the new date in the right (eg. as radio buttons)? I would see the combined history computed this way:
- compute rev date for each part document
. If the date matches keep it, otherwise use the next existing date in the timeline
- generate the "old" document by merging part documents for the respective dates computed above
- in moreless the same way, generate the new document
- use xwiki $doc.getContentDiff(old, new) to generate the big diff
Alternatively,
- combine the history pages for each one of the part document as an interface
- modify (reuse) the xwiki code that creates the page above to have the user choose a revision date for each one of the parts. Then the user clicks a big button which calls the existing diff mechanism for each parts and then assemble the diff for the user to see.
Is that doable?
Marc Lijour