Any ideas on how best I can implement the article change history for a Java based web application and save it in AuditLog
StackOverflow already has this feature, allowing you to see the differences from one version to another, almost like SVN clients.
This is more of a design than a matter of implementation.
addition: how to display these changes on a web page?
addition: proposed solution
Article
--------------------------------
Integer id
String title
String body
List<Tag> tags
AppUser createdBy
Date createdDate
AuditLog
--------------------------------
Integer id
Integer objectId
Operation operation // enum with UPDATE and DELETE. I won't audit an insert
Date createdDate
AppUser createdBy
String class
String revisionXML
String comment
A Hibernate Interceptor will intercept the save process and use Castor XML to create the XML string of the old object.
The class and identifier are used to receive changes to a specific object.
google-diff-match-patch HTML diff