Language-specific examples
With ONLYOFFICE Docs, any of collaborative solutions can be enhanced with document editing and co-editing.
In this section, you will learn how to integrate ONLYOFFICE Docs into your own website.
Each ONLYOFFICE Docs instance includes online editors for text documents, spreadsheets, presentations, and fillable forms, plus a test example.
Test example is simple document management system that can be built into your application for testing.
The test example included by default is written on Node.js. It is disabled by default. To enable it, follow the instructions on your start screen.
The integration examples are used to demonstrate document editors functions and the ways to connect ONLYOFFICE Docs to your own application.
DO NOT USE these examples on your own server without PROPER CODE MODIFICATIONS!
If you enabled any of the test examples, disable it before going for production.
Important security info
Please keep in mind the following security aspects when you are using test examples:
- There is no protection of the storage from unauthorized access since there is no need for authorization.
- There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
- There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Docs.
- There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Docs from another domain.
To start integrating document editors into your own website you need to do the following:
-
Download ONLYOFFICE Docs and set it up on your local server:
-
Select the programming language and download the code for the sample of online editors integration into your website:
or find source code:
integration example.
-
Edit the configuration files in the sample changing the default path for the one to the editors installed at step 1 and other parameters available for editor configuration.
You can find the configuration files at the following paths:
- .Net (C# MVC) - web/documentserver-example/csharp-mvc/web.appsettings.config
- .Net (C#) - web/documentserver-example/csharp/settings.config
- Java - web/documentserver-example/java/src/main/resources/settings.properties
- Java Spring - web/documentserver-example/java-spring/src/main/resources/application.properties
- Node.js - web/documentserver-example/nodejs/config/default.json
- PHP - web/documentserver-example/php/config.json
- Python - web/documentserver-example/python/config.py
- Ruby - web/documentserver-example/ruby/config/application.rb
- In case the example and ONLYOFFICE Docs are installed on different computers, make sure that your server with the example installed has access to the ONLYOFFICE Docs with the address which you specify instead of documentserver in the configuration files.
And you must also make sure that the ONLYOFFICE Docs in its turn has access to the server with the example installed with the address which you specify instead of example.com in the configuration files.
The result should look like the demo preview below.
Demo Preview
If you have any further questions, please contact us at
integration@onlyoffice.com.