Free Support Forum - groupdocs.com

How to load same documents for user that comes back again


#1

Hi,

I am using annotation for adding text or for any drawing.
My application will have number of user and they can upload document.
Same user can also upload multiple documents and documents can have same name and i am saving those documents to physical directory.
  • For viewing document i am using GroupDocs Viewer.
  • For annotation I am using GroupDocs Annotation.
  • GroupDocs Annotation uses temporary location for converting documents.
So here is the case,
  • Suppose one user say “User1” logged-in,and upload three documents say of are “.docx” and user has annotate one of document say “Doc2” like add drawing to document and saved it(don’t know how to save), and then he logged-out.
  • same for “User2”,this user has also uploaded document with same name as document of “User1” say “Doc2” .
  • Now when “User1” comes back he can select any document that he has uploaded.suppose he select “Doc2” then it should display document with previous changes.
  • If “User2” selects “Doc2” than he will be able to annotate the doc but without any annotation because he is selecting “Doc2” first time.

I have save button if annotation is saved than it should display changes on the document otherwise no(but don’t know logic of saving annotation).

Problem,
  • so,how to save annotation to document using “Save” button and how to display that specific changes on docs when same user selects same docs for second time.
  • Is there any conflicts if different user are annotating different document with same name.
  • Is GroupDocs is capable of remembering user’s changes that they have made to document or that have to be managed manually.
  • Do we need to take care about database (We are using SqlServer2012).
Please help me with this problem and if it’s possible than please provide any example/demo related to it.

#2

Hello Hiren,

Thank you for your interest in GroupDocs.Annotation. My answer will be detailed, because I need to explain principles of GroupDocs.Annotation.

1. GroupDocs.Annotation doesn’t store annotations inside the document. All annotations are saved in the database as the records in the tables. Original document is not modified in any case. In the browser you see only the HTML-representation of the documents with the annotations over it, but in fact the original document and annotations are stored separately.

2. When you select the specific annotation from the toolbar, put it on the document and click a “Submit” button, this annotation is immediately saved in the database. You can try it here: http://eu-apps.groupdocs.com:86/ Such behaviour is required in order to make possible a multi-user annotating of a single document. So, no, there will be no conflict - two or more user can annotate one and the same document, and each of these users will be able to see annotations, which were made by another user, right after they were added to the document.

3. Every annotation is “bounded” to its author - collaborator. You can programmatically obtain all annotations for the specific user.

4. When you open the same document with the same user, you will see all previous annotations, if they were added to the document at the first time.

5. GroupDocs.Annotation supports MS SQL Server, MS SQL Server Compact and JSON internal storage. If you are using the SQL Server 2012, you should take care about two things: 1) You should have a defined set of tables, how it is described here and 2) you should specify a valid connection string.

6. Now about the documents with the same name. You said that you’re using documents as the files, which are located in the physical directory. In order to open them in the GroupDocs.Annotation, you should put them to the “root storage” folder or its subfolders. MS Windows doesn’t allow you to have two or more files with the same name in the one folder - you should use subfolders. GroupDocs.Annotation takes into account relative path, not the pure filename, so it can distinguish two files with the same filename, but from different folders.

If you will have more questions please feel free to contact us.