美文网首页onlyOffice
【onlyoffice中文指南】4-协同编辑

【onlyoffice中文指南】4-协同编辑

作者: 雨中星辰0 | 来源:发表于2018-12-19 17:02 被阅读0次
    作者 日期
    雨中星辰 2018-12-20

    参考图和步骤说明了在ONLYOFFICE文档服务器中共同编辑文档的过程。

    image.png
    1. 用户1和用户2在文档编辑器中打开同一个文档,即当打开文件时,使用了同一个document.key
    2. 用户1对打开的文档进行更改。
    3. 文档编辑器发送由用户1做出的更改文档编辑服务
    4. 文档编辑服务发送由用户1做出了用户2的变化的文档编辑器
    5. 现在,用户2可以看到这些更改。
    共同编辑

    如何在实践中做到这一点

    1. 创建一个空的html文件。
    2. 添加div元素,如下所示。
    <div id="placeholder"></div>
    
    1. 使用将用于您网站的JavaScript API指定您的ONLYOFFICE文档服务器链接。
    <script type="text/javascript" src="https://documentserver/web-apps/apps/api/documents/api.js"></script>
    

    documentserver是一台安装ONLYOFFICE文件服务器的服务器的名称。

    1. 添加脚本初始化文件编辑器DIV与您要打开的文档的配置元素。
    new DocsAPI.DocEditor("placeholder", {
      "document": {
          "fileType": "docx",
          "key": "Khirz6zTPdfd7",
          "title": "Example Document Title.docx",
          "url": "https://example.com/url-to-example-document.docx"
      },
      "documentType": "text",
      "editorConfig": {
          "user": {
              "id": "78e1e841",
              "name": "John Smith"
          }
      }
    });
    
    其中**example.com**是安装**文档管理器**和**文档存储服务**的服务器的名称。
    
    1. 在浏览器中打开您的html文件。
    2. 现在制作上面创建的html文件的副本。
    3. 更改在复制的html文件中初始化文档编辑器的脚本。
    new DocsAPI.DocEditor("placeholder", {
        "document": {
            "fileType": "docx",
            "key": "Khirz6zTPdfd7",
            "title": "Example Document Title.docx",
            "url": "https://example.com/url-to-example-document.docx"
        },
        "documentType": "text",
        "editorConfig": {
            "user": {
                "id": "F89d8069ba2b",
                "name": "Kate Cage"
            }
        }
    });
    
    其中**example.com**是安装**文档管理器**和**文档存储服务**的服务器的名称。
    
    1. 在浏览器中打开复制和编辑的html文件。

    onlyoffice中文指南 目录

    【onlyoffice中文指南】0-基本概念
    【onlyoffice中文指南】1-onlyoffice的工作原理
    【onlyoffice中文指南】2-打开文件
    【onlyoffice中文指南】3-保存文件
    【onlyoffice中文指南】4-协同编辑
    【onlyoffice中文指南】5-转换和下载文件
    【onlyoffice中文指南】6-文档历史
    【onlyoffice中文指南】7-安全
    【onlyoffice中文指南】8-高级参数
    【onlyoffice中文指南】9-回调处理程序
    【onlyoffice中文指南】10-Document配置
    【onlyoffice中文指南】11-编辑器(Editor)参数配置
    【onlyoffice中文指南】12-问题及排除

    本文翻译自官方文档

    相关文章

      网友评论

        本文标题:【onlyoffice中文指南】4-协同编辑

        本文链接:https://www.haomeiwen.com/subject/yknjkqtx.html