How to use annotation API without database in .NET

Hi,


I am using Annotation in my project , but it is compulsory to use database.
Because in my project user will use annotation than they can only download screenshot of it ,
there is no need to to save changes of user.


thanks

Hello Hiren,

Thank you for your interest in GroupDocs.

GroupDocs.Annotation (for .NET and for Java) requires a database for storing the annotation data in any case. This means storing the annotation themselves (what type, position, text and so on) and storing the data about who have added this particular annotation, when and to which document. This does not mean storing the “output” documents with annotations embedded inside - these documents are generated on the fly on demand (“Export” button) and are not saved on the server.

If you do not want to use any of third-party databases like SQL Server (which is a standard choice when using GroupDocs.Annotation for .NET) or MySQL (which is commonly used along with the GroupDocs.Annotation for Java), you can enable JSON storage: in that case GroupDocs.Annotation stores all data in the several JSON files which are located in the “root storage” folder. It might be an acceptable choice for you.

If you want to enable this function, please specify which exact version of the GroupDocs.Annotation you want to use, GroupDocs.Annotation for .NET or GroupDocs.Annotation for Java? In that case we will prepare the exact instructions.

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

Hi Denis,



can you please provide some sample code to enable JSON storage for GroupDocs.Annotation 1.7.0 for .NET?



Thanks in advance!

Hello,

Thank you for your interest in GroupDocs.Annotation for .NET.

It is very simple. You need to use the second overload of the “Groupdocs.Web.Annotation.WidgetFactory.Initialize” static method:
public static void Initialize(HttpContext context, bool useJsonRepo, string storagePath = “~/App_Data”);
This method is usually (in the example demo, in particular) invoked in the “Application_Start” method in the Global.asax. You need to use it and specify a “true” value for the second parameter “useJsonRepo”. After executing this code and applying the annotations you will see several new JSON files in the “~/App_Data” folder (or where the root storage is present).

Thanks.

It would be nice to be able to write our own custom storage provider for the annotations, in case we want to store the JSON in our own database or do something specialized with the data. I seems that the only options are to use a database with a fixed scheme or the file system, both may not be as desired in certain scenarios.

Hello Stuart,

As we can see, you are interested in GroupDocs.Annotation for .NET. Unfortunately Annotation for .NET supports only 3 storage types: MS SQL Server, MS SQL Server Compact and internal JSON storage; and doesn’t support custom storage providers for storing annotations. It also supports the MS Azure and Amazon S3, but only as the document storage providers, not the annotation storage providers.

However, we have a GroupDocs.Annotation for Java, and this version, unlike the .NET version, supports much more database types and even custom providers: “How to store annotations in a DB”. In particular, it supports MS SQL Server, MySQL, PostgreSQL and SQLite. You also can implement your own provider by implementing the “IConnector” interface. Maybe, the GroupDocs.Annotation for Java will also be suitable for you; you didn’t specify your intention, which version you want to use.

We have plans to implement such functionality in the GroupDocs.Annotation for .NET, but we cannot guarantee, that this will be implemented in the near future.

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

Unfortunately it’s still not possible to do what you want even with Java version. We tried. Still waiting for some sample. The db-scheme makes the integration impossible.


Kind Regards,
Mariusz
It is possible in the Java version. Actually provided samples already are packaged with the XML "connector" sample which can be easily modified to store JSON data. Also you can modify the exposed meta-data API to store data in any way you want.