WOPI discovery is a process which helps the WOPI server discover a WOPI client by requesting the discovery XML from an online office. WOPI hosts use the discovery XML to specify how to interact with the online office. The requests are sent to the address where the documentserver is the name of the server with the ONLYOFFICE Docs installed.
The action element of the discovery XML provides the important characteristics of the online office. This element represents:
|view||Renders a non-editable view of a document.|
|edit||Allows users to edit a document.|
|editnew||Creates a new document using a blank file template appropriate to the file type and opens this file for editing in the online office.|
|embedview||Renders a non-editable view of a document that is optimized for embedding in a web page. This action is available starting from version 7.2.|
|convert||Converts a document in a binary format (doc, ppt, xls) into a modern format (docx, pptx, xlsx) so that it can be edited in the online office.|
|requires||The WOPI REST endpoints required to use the actions.|
|urlsrc||The URL that you navigate to in order to invoke the action on a particular file.|
<action name="edit" ext="docx" requires="locks,update" urlsrc="https://word-edit.officeapps.live.com/we/wordeditorframe.aspx? ui=en-us&thm=1&"/>
Discovery query parameters are the parameters that can be exposed by file storage in the urlsrc attribute to customize the editor behavior. For example, change a language, theme, or chat.
|ui||Indicates that the WOPI server includes the preferred UI language in the format described in [RFC1766].||en-us|
|rs||Indicates that the WOPI server includes preferred data language in the format described in [RFC1766] for cases where the language can affect data calculation (in spreadsheet editor).||en-us|
|thm||Indicates that the WOPI server includes a value to designate the theme used. The current values are "1" to indicate a light-colored theme and "2" to indicate a dark-colored theme.||1|
|dchat||Indicates that the WOPI server includes the value "1" to load a view of the document that does not create or join a chat session.||1|
|embed||Indicates that the output of the action will be embedded in a web page (true).||true|
|lang||Indicates that the Nextcloud WOPI server includes the document language in the format described in [RFC1766]. This language is used when creating a new document with the editnew action.||en-us|
Please pay attention to the discovery.xml structure of the Collabora connectors. They open the editor via the MIME-type which is included in the app element of the following structure:
<app name="application/msword"> <action default="true" ext="" name="edit" urlsrc="http://22.214.171.124:9980/loleaflet/ba528af/loleaflet.html?"/> </app>
The app element like this:
<app name="Word" favIconUrl="http://localhost:8000/web-apps/apps/documenteditor/main/resources/img/favicon.ico">
is ignored by the Collabora connectors.