【onlyoffice中文指南】8-高级参数

作者 日期
雨中星辰 2018-12-20

可以为ONLYOFFICE文档服务器更改的参数可以细分为以下主要部分:

config - 允许更改使用的平台类型,文档显示大小(宽度和高度)和打开的文档类型;

  • document - 包含与文档有关的所有参数(标题,URL,文件类型等);
    • info - 包含文档的其他参数(文档作者,存储文档的文件夹,创建日期,共享设置);
    • permissions - 定义是否可以编辑和下载文档;
  • editorConfig - 定义与编辑器界面有关的参数:打开模式(查看器或编辑器),界面语言,附加按钮等);
    • 自定义 - 允许自定义编辑器界面,使其看起来像您的其他产品(如果有的话),并更改是否存在其他按钮,链接,更改徽标和编辑所有者详细信息;
    • embedded - 仅用于嵌入式文档类型,允许更改用于控制嵌入模式的按钮的行为;
    • 插件 - 用于将必要的插件连接到文档服务器,以便所有文档编辑器用户都可以看到它们;
  • events - 是在对文档应用某些操作时(在加载,修改等时)调用的特殊事件列表。

包含所有其他参数的完整配置如下所示:

config = {
    "document": {
        "fileType": "docx",
        "info": {
            "author": "John Smith",
            "created": "2010-07-07 3:46 PM",
            "folder": "Example Files",
            "sharingSettings": [
                {
                    "permissions": "Full Access",
                    "user": "John Smith"
                },
                {
                    "permissions": "Read Only",
                    "user": "Kate Cage"
                },
                ...
            ]
        },
        "key": "Khirz6zTPdfd7",
        "permissions": {
            "comment": true,
            "download": true,
            "edit": true,
            "fillForms": true,
            "print": true,
            "review": true
        },
        "title": "Example Document Title.docx",
        "url": "https://example.com/url-to-example-document.docx"
    },
    "documentType": "text",
    "editorConfig": {
        "callbackUrl": "https://example.com/url-to-callback.ashx",
        "createUrl": "https://example.com/url-to-create-document/",
        "customization": {
            "autosave": true,
            "chat": true,
            "commentAuthorOnly": false,
            "compactToolbar": false,
            "customer": {
                "address": "My City, 123a-45",
                "info": "Some additional information",
                "logo": "https://example.com/logo-big.png",
                "mail": "john@example.com",
                "name": "John Smith and Co.",
                "www": "example.com"
            },
            "feedback": {
                "url": "https://example.com",
                "visible": true
            },
            "forcesave": false,
            "goback": {
                "blank": true,
                "text": "Go to Documents",
                "url": "https://example.com"
            },
            "help": true,
            "logo": {
                "image": "https://example.com/logo.png",
                "imageEmbedded": "https://example.com/logo_em.png",
                "url": "https://example.com"
            },
            "showReviewChanges": false,
            "zoom": 100
        },
        "embedded": {
            "embedUrl": "https://example.com/embedded?doc=exampledocument1.docx",
            "fullscreenUrl": "https://example.com/embedded?doc=exampledocument1.docx#fullscreen",
            "saveUrl": "https://example.com/download?doc=exampledocument1.docx",
            "shareUrl": "https://example.com/view?doc=exampledocument1.docx",
            "toolbarDocked": "top"
        },
        "lang": "en-US",
        "mode": "edit",
        "plugins": {
             "autostart": [
                 "asc.{0616AE85-5DBE-4B6B-A0A9-455C4F1503AD}",
                 "asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}",
                 ...
             ],
             "pluginsData": [
                 "https://example.com/plugin1/config.json",
                 "https://example.com/plugin2/config.json",
                 ...
             ]
        },
        "recent": [
            {
                "folder": "Example Files",
                "title": "exampledocument1.docx",
                "url": "https://example.com/exampledocument1.docx"
            },
            {
                "folder": "Example Files",
                "title": "exampledocument2.docx",
                "url": "https://example.com/exampledocument2.docx"
            },
            ...
        ],
        "user": {
            "id": "78e1e841",
            "name": "John Smith"
        }
    },
    "events": {
        "onAppReady": onAppReady,
        "onCollaborativeChanges": onCollaborativeChanges,
        "onDocumentReady": onDocumentReady,
        "onDocumentStateChange": onDocumentStateChange,
        "onDownloadAs": onDownloadAs,
        "onError": onError,
        "onRequestClose": onRequestClose,
        "onRequestEditRights": onRequestEditRights,
        "onRequestHistory": onRequestHistory,
        "onRequestHistoryClose": onRequestHistoryClose,
        "onRequestHistoryData": onRequestHistoryData,
        "onWarning": onWarning
    },
    "height": "100%",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.t-IDcSemACt8x4iTMCda8Yhe3iZaWbvV5XKSTbuAn0M",
    "type": "desktop",
    "width": "100%"
};

其中example.com是安装文档管理器文档存储服务的服务器的名称。请参阅“ 工作原理”部分以了解有关文件服务器服务客户端 - 服务器交互的更多信息。

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-问题及排除

本文翻译自官方文档

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 今天我和爸爸、妈妈、奶奶、妹妹一起去了我期盼已久的云丘山,那里的风景果真名不虚传,那里有一座座高山,一层层...
    yinuo0313阅读 806评论 0 1
  • 听樊登老师解读《第三选择》 第三选择,意味着在面对激烈冲突的时候,不是“只有你赢或者我赢”,更不是“要么我打败你或...
    六爸啦啦啦阅读 214评论 0 0
  • 一、凡事提前10分钟 凡事提前10分钟,会让你有充裕的时间应对可能的突发事件,更加从容。试着把起床闹钟提前10分钟...
    微小狐狸阅读 278评论 0 0
  • 原本想删减两张,但是舍哪张都遗憾。 前两天下雪图。 晚上的学校,每个季节都漂亮,冬天的奉上。 如果喜欢我拍的校园就...
    飘零酒阅读 338评论 2 11