{"id":31697301,"url":"https://github.com/onlyoffice/docs-integration-sdk-java","last_synced_at":"2026-01-26T13:07:12.094Z","repository":{"id":70234490,"uuid":"474899129","full_name":"ONLYOFFICE/docs-integration-sdk-java","owner":"ONLYOFFICE","description":"Java SDK for integrating ONLYOFFICE Document Server into your own website or application  on Java","archived":false,"fork":false,"pushed_at":"2025-10-15T08:55:36.000Z","size":809,"stargazers_count":39,"open_issues_count":1,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-15T22:41:01.804Z","etag":null,"topics":["integration","java","onlyoffice"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ONLYOFFICE.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-28T07:49:40.000Z","updated_at":"2025-10-15T08:54:16.000Z","dependencies_parsed_at":"2023-10-16T10:48:08.171Z","dependency_job_id":"83e936e5-4263-4f06-85af-ee09c86cacaf","html_url":"https://github.com/ONLYOFFICE/docs-integration-sdk-java","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/ONLYOFFICE/docs-integration-sdk-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONLYOFFICE%2Fdocs-integration-sdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONLYOFFICE%2Fdocs-integration-sdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONLYOFFICE%2Fdocs-integration-sdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONLYOFFICE%2Fdocs-integration-sdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ONLYOFFICE","download_url":"https://codeload.github.com/ONLYOFFICE/docs-integration-sdk-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONLYOFFICE%2Fdocs-integration-sdk-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281324276,"owners_count":26481688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["integration","java","onlyoffice"],"created_at":"2025-10-08T18:00:59.639Z","updated_at":"2025-10-27T19:06:38.807Z","avatar_url":"https://github.com/ONLYOFFICE.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ONLYOFFICE Docs Integration Java SDK\n\nONLYOFFICE Docs Integration Java SDK provides common interfaces and default implementations for integrating ONLYOFFICE Document Server into your own website or application on Java.\n\n## Prerequisites\n* **Java**: version 8 and higher (download from the [Oracle official website](https://www.oracle.com/java/technologies/downloads/#java8));\n* **Apache Maven** (download from the [official website](https://maven.apache.org/download.cgi)).\n\n## SDK structure \nSDK consists of 5 main managers and 4 services.\n\n### Managers\n\n| Manager                       | Description                                                             | Default implementation           |\n| ----------------------------- | ----------------------------------------------------------------------- | -------------------------------- |\n| [DocumentManager](/src/main/java/com/onlyoffice/manager/document/DocumentManager.java)| This manager is used for working with files and document formats.| [DefaultDocumentManager](/src/main/java/com/onlyoffice/manager/document/DefaultDocumentManager.java)  (abstract)|\n| [RequestManager](/src/main/java/com/onlyoffice/manager/request/RequestManager.java)| This manager is used to make requests to the ONLYOFFICE Document Server.| [DefaultRequestManager](/src/main/java/com/onlyoffice/manager/request/DefaultRequestManager.java)|\n| [JwtManager](/src/main/java/com/onlyoffice/manager/security/JwtManager.java) | This manager is used for generating and verifying authorization tokens. | [DefaultJwtManager](/src/main/java/com/onlyoffice/manager/security/DefaultJwtManager.java)|\n| [SettingsManager](/src/main/java/com/onlyoffice/manager/settings/SettingsManager.java)| This manager is used to manage integration application settings.| [DefaultSettingsManager](/src/main/java/com/onlyoffice/manager/settings/DefaultSettingsManager.java)  (abstract)|\n| [UrlManager](/src/main/java/com/onlyoffice/manager/url/UrlManager.java) | This manager is used as a URL provider.| [DefaultUrlManager](/src/main/java/com/onlyoffice/manager/url/DefaultUrlManager.java)|\n\n### Services\n\n| Service                       | Description                                                                   | Default implementation           |\n| ----------------------------- | ----------------------------------------------------------------------------- | -------------------------------- |\n| [ConfigService](/src/main/java/com/onlyoffice/service/documenteditor/config/ConfigService.java) | This configuration generation service is used for opening the document editor.| [DefaultConfigService](/src/main/java/com/onlyoffice/service/documenteditor/config/DefaultConfigService.java)|\n| [CallbackService](/src/main/java/com/onlyoffice/service/documenteditor/callback/CallbackService.java)| This service is used for processing the response of the Document Server.| [DefaultCallbackService](/src/main/java/com/onlyoffice/service/documenteditor/callback/DefaultCallbackService.java)|\n| [ConvertService](/src/main/java/com/onlyoffice/service/convert/ConvertService.java)| This service is used for converting documents.| [DefaultConvertService](/src/main/java/com/onlyoffice/service/convert/DefaultConvertService.java)|\n| [SettingsValidationService](/src/main/java/com/onlyoffice/service/settings/SettingsValidationService.java)| This service is used for checking the Document Server connection settings.| [DefaultSettingsValidationService](/src/main/java/com/onlyoffice/service/settings/DefaultSettingsValidationService.java)  |\n\n\n## Usage\n\nLet's look at the [demo example](/demo-example), which shows how the SDK works in a classic Spring web application:\n\n1. Implement the methods of the abstract **DefaultSettingsManager** class:\n    ```java\n    @Override\n    public String getSetting(final String name) {\n        return properties.getProperty(name);\n    }\n\n    @Override\n    public void setSetting(final String name, final String value) {\n        properties.setProperty(name, value);\n    }\n    ```\n    The full example code can be found [here](/demo-example/src/main/java/com/onlyoffice/demoexample/manager/SettingsManagerImpl.java).\n\n2. Implement the methods of the abstract **DefaultDocumentManager** class:\n    ```java\n    @Override\n    public String getDocumentKey(final  String fileId, final boolean embedded) {\n        return String.valueOf(fileId.hashCode());\n    }\n\n    @Override\n    public String getDocumentName(final String fileId) {\n        return \"sample.docx\";\n    }\n    ```\n    The full example code can be found [here](/demo-example/src/main/java/com/onlyoffice/demoexample/manager/DocumentManagerImpl.java).\n\n3. Implement the **UrlManager** methods. To open the editor in the editing mode, you need to define:\n    ```java\n    @Override\n    public String getFileUrl(final String fileId) {\n        return getServerUrl() + \"/file/download\";\n    }\n\n    @Override\n    public String getCallbackUrl(final String fileId) {\n        return getServerUrl() + \"/callback\";\n    }\n    ```\n    The full example code can be found [here](/demo-example/src/main/java/com/onlyoffice/demoexample/manager/UrlMangerImpl.java).\n\n4. Initialize the **JwtManager** and **RequestManager** Spring beans and add them to the DI container. This allows you to call the registered beans anywhere in the application:\n    ```java\n    @Bean\n    public JwtManager jwtManager(final SettingsManager settingsManager) {\n        return new DefaultJwtManager(settingsManager);\n    }\n\n    @Bean\n    public RequestManager requestManager(final UrlManager urlManager, final JwtManager jwtManager, final SettingsManager settingsManager) {\n        return new DefaultRequestManager(urlManager, jwtManager, settingsManager);\n    }\n    ```\n    The full example code can be found [here](/demo-example/src/main/java/com/onlyoffice/demoexample/DemoExampleApplication.java).\n\n5. Once ready, you can use all available services in their default implementations or by overriding and extending them:\n    * To use the [callback service](/demo-example/src/main/java/com/onlyoffice/demoexample/service/CallbackServiceImpl.java), create the [callback controller](/demo-example/src/main/java/com/onlyoffice/demoexample/controllers/CallbackController.java) where the request body is wrapped in the *Callback* model and the callback service is called to handle this model.\n    * To demonstrate the [config service](/demo-example/src/main/java/com/onlyoffice/demoexample/service/ConfigServiceImpl.java) work, *@GetMapping(\"/editor\")* is used in the [main controller](/demo-example/src/main/java/com/onlyoffice/demoexample/controllers/MainController.java). When the user opens this address, the editor page is requested. At the same time, the config service is called and generates the *Config* model to open the editor:\n    ```java\n    @GetMapping(\"/editor\")\n    public String main(final Model model) throws JsonProcessingException {\n\n        Config config = configService.createConfig(\"1\", Mode.EDIT, Type.DESKTOP);\n\n        model.addAttribute(\"config\", config);\n        model.addAttribute(\"documentServerApiUrl\", urlManager.getDocumentServerApiUrl());\n\n        return \"editor\";\n    }\n    ```\n\n6. Create the [file controller](/demo-example/src/main/java/com/onlyoffice/demoexample/controllers/FileController.java) to get a file for opening in the editor. When the config service generates the config model, the URL for downloading a file is specified in this model. To open the document, the editor sends a request to this URL, and the file controller responds to this request and returns the document.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlyoffice%2Fdocs-integration-sdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonlyoffice%2Fdocs-integration-sdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlyoffice%2Fdocs-integration-sdk-java/lists"}