In order to implement versioning the best method would be to implement it again, as it would be quiet difficult to import whole DokuWiki into AContent as a single module. Even simulating DokuWiki externally from AContent was not an easy task and involved a large number of complications.
Therefore, I have decided to implement versioning from scratch and later use the difference engine in DokuWiki for showing the differences or changes in various documents.
02/08/2014
I was able to implement versioning from scratch and used similar functions used by Dokuwiki for maintaining versions of various content pages in AContent.
I have created two folders in the content directory of AContent :-
attic and meta
The attic folder contains the older revisions of the document and the document is compressed as a tar file to save space.
The meta folder contains the user information corresponding to each content, such as who created the document, who reverted the document and what the lastest version of the document is.
Sample data of meta file for random content id:-
version_id user_id action revision_id
1408297143
2
A
1408297167
2
E
1408297170
2
E
1408297173
2
E
1408297184
2
R
1408297170
"A" tells the revision number and user who first created the document.
"E" tells the new version of the document and the user_id who created it.
"R" tells whether the version was reverted from an older revision and if it is reverted then the revision id from which it was reverted is displayed to the user.
From tomorrow onwards I'll start with the Difference Engine.