Статьи с тэгом :
Закрыть
История изменений
Закрыть
Попробовать в облаке
Попробовать в облаке
Справочный центр
Интеграция

Overview

ONLYOFFICE integration plugin allows WordPress administrators to open documents, spreadsheets, and presentations for collaborative editing using ONLYOFFICE Docs. In published posts, the editors are visible to all WordPress site visitors (both authorized and unauthorized) in the Embedded mode only.

Main features

  • Creating, editing and viewing text documents, spreadsheets, and presentations.
  • Co-editing documents in real-time: two co-editing modes (Fast and Strict), the Track Changes mode, comments, and the built-in chat.
  • JWT support to secure your traffic so that no one can have access to your documents with the exception of the users with proper rights.

Supported formats

  • For creating, editing and viewing: DOCX, PPTX, XLSX.
  • For viewing only: XLS, XLSX, XLSM, XLT, XLTX, XLTM, ODS, FODS, OTS, CSV, PPS, PPSX, PPSM, PPT, PPTX, PPTM, POT, POTX, POTM, ODP, FODP, OTP, DOC, DOCX, DOCM, DOT, DOTX, DOTM, ODT, FODT, OTT, RTF, TXT, HTML, HTM, MHT, XML, PDF, DJVU, FB2, EPUB, XPS, OXPS.

Connecting ONLYOFFICE Docs to WordPress

Requirements

  • ONLYOFFICE Document Server v6.1.0 or later

    You need an instance of ONLYOFFICE Docs that is resolvable and connectable both from WordPress and any end clients. It must be able to POST to WordPress directly.

    Please refer to the official documentation page to learn more about installing ONLYOFFICE Docs.

    You can also use ONLYOFFICE Docs Cloud (SaaS version).

  • WordPress v. 5.7 or higher
  • ONLYOFFICE Connector 1.0.2 for WordPress

Installing and configuring the ONLYOFFICE and WordPress module package

  1. Go to WordPress administrative dashboard -> ONLYOFFICE -> Settings.
  2. Specify the URL for the connector settings:
    • Document Editing Service address - specify the URL address where the Document Editing Service is installed.
      ImportantThe address of ONLYOFFICE Docs must be accessible from WordPress, as well as the address of WordPress must be accessible from ONLYOFFICE Docs.
    • Secret Key - specify the secret used to sign the data.
      Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to enable it on the WordPress side as well: find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings. For more details, see the Enabling JWT for the ONLYOFFICE and WordPress integration section of this article.
      configure configure

Enabling JWT for the ONLYOFFICE and WordPress integration

To protect documents from unauthorized access, ONLYOFFICE editors use the JSON Web Token (JWT). The token is added in the configuration when the Document Editor is initialized and during the exchange of commands between inner ONLYOFFICE Docs services. The secret key is used to sign the JSON web token and validate the token upon the request to ONLYOFFICE Docs.

Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings.

Step 1: Find your secret key in the ONLYOFFICE Docs configuration file

  1. Open the local.json file with any available text editor.
    • For Linux - /etc/onlyoffice/documentserver/local.json
    • For Windows - %ProgramFiles%\ONLYOFFICE\DocumentServer\config\local.json
    • For Docker – enter the ONLYOFFICE Docs container using the docker exec -it <containerID> bash command and open /etc/onlyoffice/documentserver/local.json

      Alternatively, you can use the following command to find the default secret key without opening local.json:

      sudo docker exec <containerID> /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'

    The local.json file should look like this:

    {
      "services": {
        "CoAuthoring": {
          "token": {
            "enable": {
              "request": {
                "inbox": true,
                "outbox": true
              },
              "browser": true
            }
          },
          "secret": {
            "inbox": {
              "string": "yoursecret"
            },
            "outbox": {
              "string": "yoursecret"
            },
            "session": {
              "string": "yoursecret"
            }
          }
        }
      }
    }
    
  2. The true value is specified in three sections. It means that token validation is enabled.
    • services.CoAuthoring.token.enable.browser
    • services.CoAuthoring.token.enable.request.inbox
    • services.CoAuthoring.token.enable.request.outbox
  3. The automatically generated secret key is specified in three sections. You can replace the default secret value with your own secret key. The secret key must be the same in three sections.
    • services.CoAuthoring.secret.inbox.string
    • services.CoAuthoring.secret.outbox.string
    • services.CoAuthoring.secret.session.string
  4. If you make changes, save them and restart the services for the config changes to take effect.
    supervisorctl restart all

Step 2: Specify the same secret key in the connector settings

In the connector settings, specify the same secret in the Secret key field and save the settings.

Start using ONLYOFFICE Docs within WordPress

To view all documents, go to WordPress administrative dashboard -> ONLYOFFICE -> Files.

view view

To add ONLYOFFICE block for future use:

  1. Open the Create a post window.
  2. Click the ONLYOFFICE icon in the panel below.
add_block add_block

To upload a file to the ONLYOFFICE block and embed it into a new post:

  1. Open the Create a post window.
  2. Choose the ONLYOFFICE block.
  3. Click the Upload button to upload a file from your computer to the ONLYOFFICE block
    or
    Click the Media Library button to select a file from your library and upload it to the ONLYOFFICE block.
    upload upload
    embed embed

The document will be embedded in the created post.

embedded embedded
Скачать Лучшие редакторы на вашем сайте Совместно просматривайте и редактируйте
все типы текстовых файлов, таблиц и презентаций
Вас также может заинтересовать:
Закрыть