WOPI discovery

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 https://documentserver/hosting/discovery address where the documentserver is the name of the server with the ONLYOFFICE Docs installed.

WOPI discovery actions

The action element of the discovery XML provides the important characteristics of the online office. This element represents:

  • available document operations in the online office,
  • supported file formats (extensions).

WOPI actions

NameDescription
viewRenders a non-editable view of a document.
editAllows users to edit a document.
editnewCreates a new document using a blank file template appropriate to the file type and opens this file for editing in the online office.
embedviewRenders 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.
convertConverts 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.

Attributes

NameDescription
requiresThe WOPI REST endpoints required to use the actions.
urlsrcThe URL that you navigate to in order to invoke the action on a particular file.

Example

  1. <action name="edit" ext="docx" requires="locks,update"
  2. urlsrc="https://word-edit.officeapps.live.com/we/wordeditorframe.aspx?
  3. 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.

WOPI standard

Parameters

NameDescriptionExample
uiIndicates that the WOPI server includes the preferred UI language in the format described in [RFC1766].en-us
rsIndicates 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
thmIndicates 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
dchatIndicates 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
embedIndicates that the output of the action will be embedded in a web page (true).true

Collabora specific

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:

  1. <app name="application/msword">
  2. <action default="true" ext="" name="edit" urlsrc="http://159.89.20.129:9980/loleaflet/ba528af/loleaflet.html?"/>
  3. </app>

The app element like this:

  1. <app name="Word" favIconUrl="http://localhost:8000/web-apps/apps/documenteditor/main/resources/img/favicon.ico">

is ignored by the Collabora connectors.