Implement article change history for Java-based web application

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

+3
2

, , Apache Jackrabbit.

, , . ? (00001, 00002 ..) (, current). , ( current) .

, , , . max(version), SQL- . .

[EDIT] diffs, : google-diff-match-patch

+2

VCS (, SVN) . - , , VCS.

+1

Source: https://habr.com/ru/post/1721877/


All Articles