this is the problem.
A user can submit a pdf file that can be downloaded for other users, who can do modification for the pdf file, basically make comments and annotations. And the users can submit again the file with these modifications.
The problem is, how can I manage the versions of the file? because if two users try to submit the file (with different things), maybe one file can be lost.
At a glance, I try to implement a signature for the files, this is the approach:
The file in the server is the file A.
The users download the file and make their modifications. Now we have the file A1 and file A2.
When the user A1 submit the file, the system checks the signature and matches, so can submit the file. The server now signs the file again and changes to B.
When A2 tries to submit the file, the system check the signature and determines that B doesn't match with A. so the users needs to download the latest file.
Pretty cool, Ah? Thats the theory, but I don't know how to implements it!
How can I append this signature to the pdf file in a transparente way to the user?
Or maybe i'm too complicated. Can you give a hint of how to implement it, an api, or a different way?
I'm using java, with spring.
Use a table to hold the "header" data to the record, such as filename, creation date, last modified date, etc...then create a Versions table that has a FK back to the primary table, and an Integer that represents the version of the document. Then when you display or retrieve the documents you can reference them by Version, or just get most recent version. This plays well with Government auditing as well. Document retention is very important, they would want to see the original document, untouched, and the revision trail that led to the new document.