ONLYOFFICE Docs 7.4 for developers: API & Doc Builder updates
Along with the release of the new features in version 7.4, we updated API for the editors, plugins, and Document Builder. Check all the details below.
Support for more file formats
Version 7.4 brings support for new file formats:
- documents — mhtml, stw, sxw, wps, wpt;
- spreadsheets — et, ett, sxc;
- presentations — dps, dpt, sxi.
Further parameters for the setUsers method
The setUsers method sets a list of users to mention in the comments or grant the access rights to edit the specific sheet ranges.
The newly added users.id field defines the identification of the user. It is used only for protecting the sheet ranges when granting editing rights to the specified user.
And the newly added c parameter defines the operation type from the onRequestUsers event. It can take one of the following values – mention or protect.
docEditor.setUsers({
"c": "protect",
"users": [
{
"email": "john@example.com",
"id": "78e1e841",
"name": "John Smith"
},
{
"email": "kate@example.com",
"id": "F89d8069ba2b",
"name": "Kate Cage"
},
...
]
});
Drawing
From now on, the drawing functionality is available in each editor.
Users of ONLYOFFICE Docs Developer Edition with the extended licenses are able to display or hide this new Draw tab via the editorConfig.customization.layout.toolbar parameter.
Font size customization
The newly added size field, in the editorConfig.customization.font parameter, allows adjusting the font for the interface elements such as buttons, tabs, etc.
Please note: this option is available for users with the extended developer license.
Support for the Chinese dameng database
Among the supported database types there is the Chinese dameng. To connect it, change the database type to dameng
. For example, for Docker you will need to adjust the DB_TYPE parameter.
Other updates
- The useforrequest WOPI IP filter parameter changed to false.
- mobileView and mobileEdit for WOPI discovery.
- Updated node-redis connector.
Get the latest version of ONLYOFFICE Docs Developer Edition:
API enhancements for plugins
Thanks to the extended API, plugins can now have as many windows as you want (for example, you can execute a custom script in a separate window) and be dynamically embedded in the context menu of the editors. It gives you more freedom and enhances the number of possible usage scenarios for plugins.
One of the brightest examples here is our updated ChatGPT plugin. From now on, it provides more useful features such as word analysis, image generation, text summarization and keyword generation, translation, etc. Learn more
With the pluginsmanager server utility admins are now able, when a manual installation is required, to install or uninstall plugins with a single command line, instead of copying the folders, e.g.:
pluginsmanager --install zotero
pluginsmanager --install "zotero, chess"
pluginsmanager --uninstall zotero
Besides, we added lots of new events and methods for working with plugins, including:
- onContextMenuClick and onContextMenuShow events.
- GetCurrentSentence and GetCurrentWord methods to return the current sentences or words, also specifying if the whole sentence/word or only its part will be returned.
- InstallDeveloperPlugin method which installs a plugin by the URL to the plugin config.
- GetDocumentLang method which returns the document language.
- ResizeWindow method which resizes the plugin modal window.
Full list of plugin API updates
Check this code example for the InstallDeveloperPlugin method:
window.Asc.plugin.executeMethod ("InstallDeveloperPlugin", ["https://example.com/plugin/config.json"],
function (result) {
postMessage (JSON.stringify (result));
});
API updates for Document Builder
It’s now possible to conveniently debug the Doc Builder JS core in the Chrome or Chromium browser (available for Windows and Linux).
Moreover, in the Document Builder API, we added lots of new characters, font, and range methods to the Spreadsheet API, as well as some other methods, including the following ones:
- ApiCharacters/GetFont
- ApiFont/GetColor
- ApiRange/Replace
- ApiBlockLvlSdt/AddCaption
- ApiDocument/InsertTextForm
Check the full list of new DocBuilder methods.
Create your free ONLYOFFICE account
View, edit and collaborate on docs, sheets, slides, forms, and PDF files online.