Any ideas of how best i can implement article revision history for a Java based web application and save it in AuditLog
StackOverflow already has such a feature allowing one to see the differences from one version to another, almost like SVN clients.
This is more of a design than implementation question.
addition: How would one display these changes on the 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 an XML string of the old object.
The class and id is used to get the revisions of a particular object.
google-diff-match-patch will be used for creating HTML diff files