onlyoffice/onlyoffice-drupal
Composer 安装命令:
composer require onlyoffice/onlyoffice-drupal
包简介
The ONLYOFFICE module enables users to edit files in the Media module from Drupal using ONLYOFFICE Docs packaged as Document Server
关键字:
README 文档
README
Contents of this file
- Introduction
- Requirements
- Installation
- Configuration
- Usage
- Installing ONLYOFFICE Docs
- Known issues
Introduction
The ONLYOFFICE module allows users to view and edit files stored in the Drupal Media module using ONLYOFFICE Docs.
The module allows to:
- Edit text documents, spreadsheets, and presentations.
- Preview files on public pages.
- Collaborate on documents using two co-editing modes (real-time and paragraph-locking).
- Create and fill out PDF forms.
Supported formats:
- For editing: DOCX, XLSX, PPTX, PDF forms.
- For viewing only: DJVU, DOC, DOCM, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OTT, OXPS, PDF, RTF, TXT, XPS, XML, CSV, FODS, ODS, OTS, XLS, XLSM, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM.
For a full description of the module, visit the project page: drupal.org/project/onlyoffice.
To submit bug reports and feature suggestions, or track changes: drupal.org/project/issues/onlyoffice.
Requirements
- firebase/php-jwt: 6.0.0 or higher
Make sure to run:
composer require firebase/php-jwt:^6.0
Installation
Step 1: Add the module
First way: Add a module using Drupal's User Interface (easy).
- On the Admin toolbar project page on drupal.org (https://www.drupal.org/project), scroll to the Downloads section at the bottom of the page.
- Copy the address of the tar.gz link. Depending on your device and browser, you might do this by right clicking and selecting Copy link address.
- In the Manage administrative menu, navigate to Extend (admin/modules). The Extend page appears.
- Click Install new module. The Install new module page appears.
- In the field Install from a URL, paste the copied download link.
- Click Install to upload and unpack the new module on the server. The files are being downloaded to the modules directory.
Second way: Add a module with Composer.
Enter the following command at the root of your site:
composer require onlyoffice/onlyoffice-drupal
Step 2: Enable the module
First way: Using the Drupal User Interface (easy).
- Navigate to the Extend page (admin/modules) via the Manage administrative menu.
- Locate the ONLYOFFICE Connector module and check the box.
- Click Install to enable.
Second way: Using the command line (advanced, but very efficient).
- Run the following Drush command, giving the project name as a parameter:
drush pm:enable onlyoffice
- Follow the instructions on the screen.
Configuration
In Drupal, open the ~/config/system/onlyoffice-settings page with administrative settings for ONLYOFFICE section. Or follow Configuration –> MEDIA –> ONLYOFFICE Connector settings.
Enter the address to connect ONLYOFFICE Document Server:
https://<documentserver>/
Where documentserver is the name of the server with the ONLYOFFICE Document Server installed. The address must be accessible for the user browser and from the Drupal server. The Drupal server address must also be accessible from ONLYOFFICE Document Server for correct work.
Configuration settings include JWT, enabled by default to protect the editors from unauthorized access. If setting a custom Secret key, ensure it matches the one in the ONLYOFFICE Docs config file for proper validation.
Usage
Edit files already uploaded to Drupal
All office files added to Media can be opened for editing. In the last table column, call the drop-down list and select the Edit in ONLYOFFICE action. The editor opens in the same tab. Users with Administrator rights are able to co-edit files using ONLYOFFICE Docs. All changes are saved in the same file.
Create new posts
When creating a post, you can add the new ONLYOFFICE element.
-
Go to Structure -> Content types -> Manage fields. On the opened page, click Add field. Add a new field: File or Media. Set the label and save.
-
For the added File field, specify the file extensions. Go to Structure -> Content types -> Manage fields. In the Allowed file extensions field, specify the file formats that will be shown in the editors (docx,xlsx,pptx).
For the added Media field, click the Document checkbox.
-
Go to Structure -> Media types -> Document -> Manage display.
For the Document field, specify the ONLYOFFICE Preview format. By clicking on the gear symbol, you can specify the dimensions of the embedded editor window.
When you are done with the pre-settings, you can create posts on the Content tab. Click on the Add Content button and select the created content.
Specify title and select a file (if the content contains File fields).
For Media section, specify the name of the previously uploaded file.
Your site visitors will also be able to view the created page (People -> Permissions -> View published content).
Work with forms
The ONLYOFFICE form section allows Drupal users to create new PDF forms: Manage-> Content -> ONLYOFFICE form.
Creating, uploading, editing PDF forms
To create a new PDF form, click the Create&Upload button. Select the Blank option and fill in the name for the new file.
To upload, select the Upload option and upload a PDF form from your device.
The created/uploaded file will appear in the list on the Forms page and open in editing mode in the ONLYOFFICE editor in a new tab.
Publishing PDF forms on a Drupal page
To add a PDF form to a Drupal page, some initial setup is required. Navigate to Manage → Structure → Content types. For the desired content type, select Manage fields. On the next page, click Create a new field, choose ONLYOFFICE form, and set a field name. This will add a field of the ONLYOFFICE form type to the selected content type.
To add a PDF form to a site page, navigate to Manage → Content. Click the Add content button and select the content type that includes the previously added ONLYOFFICE form field. In the form field, enter the name of the existing form. If the form hasn’t been created yet, click Create new ONLYOFFICE form to open the PDF Forms section, where you can upload or create a new PDF form. Finally, click the Save button to complete the page creation in Drupal.
Filling out PDF forms
On the Drupal page, users can fill out the form with their data. To submit the completed form, click the Complete & Submit button in the top editor panel.
Once submitted, the completed form will be sent to the site. Visitors can also download a copy to their device by opening the context menu in the top editor panel and selecting Download as DOCX or Download as PDF.
Working with the filled forms
In the Manage → Content → ONLYOFFICE form → Submitted forms section, Drupal users can view completed forms, organized by template name. To view all responses for a specific template, simply select the form's template name.
Installing ONLYOFFICE Docs
You will need an instance of ONLYOFFICE Docs (Document Server) that is resolvable and connectable both from Drupal and any end clients. ONLYOFFICE Document Server must also be able to POST to Drupal directly.
You can install free Community version of ONLYOFFICE Docs or scalable Enterprise Edition.
To install free Community version, use Docker (recommended) or follow these instructions for Debian, Ubuntu, or derivatives.
To install Enterprise Edition, follow the instructions here.
Alternatively, you can opt for ONLYOFFICE Docs Cloud which doesn't require downloading and installation. To get ONLYOFFICE Docs Cloud, get started here.
ONLYOFFICE Docs packaged as Document Server:
- Community Edition 🆓 (
onlyoffice-documentserverpackage) - Enterprise Edition 🏢 (
onlyoffice-documentserver-eepackage)
The table below will help you to make the right choice.
| Pricing and licensing | Community Edition | Enterprise Edition |
|---|---|---|
| Get it now | Start Free Trial | |
| Cost | FREE | Go to the pricing page |
| Number of users | up to 20 recommended | As in chosen pricing plan |
| License | GNU AGPL v.3 | Proprietary |
| Support | Community Edition | Enterprise Edition |
| Documentation | Help Center | Help Center |
| Standard support | GitHub or Community | 1 or 3 years support included |
| Premium support | Contact us | Contact us |
| Services | Community Edition | Enterprise Edition |
| Conversion Service | + | + |
| Live Viewer | + | + |
| Document Builder Service | - | - |
| Automation API | - | - |
| Interface | Community Edition | Enterprise Edition |
| Tabbed interface | + | + |
| Dark theme | + | + |
| 125%, 150%, 175%, 200% scaling | + | + |
| White Label | - | - |
| Integrated test example (node.js) | + | + |
| Admin Panel | - | + |
| Mobile web editors | - | +* |
| Plugins & Macros | Community Edition | Enterprise Edition |
| Plugins | + | + |
| Macros | + | + |
| Collaborative capabilities | Community Edition | Enterprise Edition |
| Two co-editing modes | + | + |
| Comments | + | + |
| Built-in chat | + | + |
| Review and tracking changes | + | + |
| Display modes of tracking changes | + | + |
| Version history | + | + |
| Document Editor features | Community Edition | Enterprise Edition |
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Adding Content control | + | + |
| Editing Content control | + | + |
| Layout tools | + | + |
| Table of contents | + | + |
| Navigation panel | + | + |
| Mail Merge | + | + |
| Comparing documents | + | + |
| Multipage View | + | + |
| Spreadsheet Editor features | Community Edition | Enterprise Edition |
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Functions, formulas, equations | + | + |
| Table templates | + | + |
| Pivot tables | + | + |
| Data validation | + | + |
| Conditional formatting | + | + |
| Sparklines | + | + |
| Sheet Views | + | + |
| Solver | + | + |
| Presentation Editor features | Community Edition | Enterprise Edition |
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Transitions | + | + |
| Animations | + | + |
| Presenter mode | + | + |
| Notes | + | + |
| Slide Master | + | + |
| Form creator features | Community Edition | Enterprise Edition |
| Adding form fields | + | + |
| Form preview | + | + |
| Saving as PDF | + | + |
| Role-matching colors for fields | + | + |
| PDF Editor features | Community Edition | Enterprise Edition |
| Text editing and co-editing | + | + |
| Work with pages (adding, deleting, rotating) | + | + |
| Inserting objects (shapes, images, hyperlinks, etc.) | + | + |
| Text annotations (highlight, underline, cross out, stamps) | + | + |
| Redact | + | + |
| Comments | + | + |
| Freehand drawings | + | + |
| Form filling | + | + |
| Get it now | Start Free Trial |
* If supported by DMS.
Known issues
Setting HTTPS via proxy (callback URL 308 error)
Drupal is designed in such a way that if you configure HTTPS via proxy, Drupal
will still replace links with http. Therefore, links to callback and
fileUrl are sent to the config in the http format. As a result, ONLYOFFICE
Document Server receives the 308 Permanent Redirect response to the
callback request.
To fix it, adjust the Drupal settings in your settings.php file:
$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);
Need help? User Feedback and Support 💡
- 🐞 Found a bug? Please report it by creating an issue.
- ❓ Have a question? Ask our community and developers on the ONLYOFFICE Forum.
- 👨💻 Need help for developers? Check our API documentation.
onlyoffice/onlyoffice-drupal 适用场景与选型建议
onlyoffice/onlyoffice-drupal 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56 次下载、GitHub Stars 达 4, 最近一次更新时间为 2023 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「drupal」 「onlyoffice」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 onlyoffice/onlyoffice-drupal 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 onlyoffice/onlyoffice-drupal 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 onlyoffice/onlyoffice-drupal 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ONLYOFFICE Docs integration SDK
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
This module extends Drupal Migrate framework.
Installs and configures the WissKI base environment with mandatory modules.
统计信息
- 总下载量: 56
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-02-15