Hello!
I have a how-to question. I have a free desktop/Docker OnlyOffice instance what use on two web applications. I has a problem with migrate a configuration of OnlyOffice. Each apps use a views with iframe and JS configuration method to open a document. Django-based Web API project open and save document successful but it is very old project and will not support. Yii2-based Web API project will replace previous API. But I see warning message about ‘The document could not be saved’ if open file in Yii2-based project.
Each of project use similar views with iframe and generate config. Python project genered configuration like this:
var connectEditor = function () {
config = {
"type": "desktop",
"documentType": "slide",
"document": {
"title": "filename.pptx",
"url": "https://storage.yandexcloud.net/ligarobotov-methodical-test/documents/3/8/9/zagriaznenie_musorom_lsh2020__552d2dd6-0bb6-4b48-9d06-2ca6849faec4.pptx?AWSAccessKeyId=<KeyId?&Signature=<Signature>&Expires=1699353409",
"fileType": "pptx",
"key": "-7879767301923523783",
"info": {
"owner": "Unknown",
"uploaded": "07.11.2023 10:31:49"
},
"permissions": {
"comment": true,
"download": true,
"edit": true,
"fillForms": true,
"modifyFilter": true,
"modifyContentControl": true,
"review": true
}
}, "editorConfig": {
"actionLink": null,
"mode": "edit",
"lang": "ru",
"region": "ru-RU",
"callbackUrl": "https://delta.ligarobotov.ru/api/methodology/onlyoffice/track/?key=documents/3/8/9/filename.pptx&file_secret=<S3 Secret>&token=Bearer%<JWT-bearer>",
"user": {
"id": "1",
"name": "login 1"
},
"embedded": {
"saveUrl": "https://storage.yandexcloud.net/path/filename.pptx?AWSAccessKeyId=<KeyId>&Signature=<Signature>&Expires=1699353409",
"embedUrl": "https://storage.yandexcloud.net/path/filename.pptx?AWSAccessKeyId=<KeyId>&Signature=<Signature>&Expires=1699353409",
"shareUrl": "https://storage.yandexcloud.net/path/filename.pptx?AWSAccessKeyId=<KeyId>&Signature=<Signature>&Expires=1699353409",
"toolbarDocked": "top"
},
"customization": {
"about": true,
"feedback": true,
"compactHeader": true,
"plugins": true,
"compactToolbar": true,
"goback": {
"url": "https://delta.ligarobotov.ru/franchise/methodology/admin/lessons/9"
}
}
}
}
config.width = "100%";
config.height = "100%";
config.events = {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
'onMakeActionLink': onMakeActionLink,
};
console.log(config)
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
fixSize();
};
PHP project generate configuration like this:
var connectEditor = function () {
var config = {
"type": "desktop",
"documentType": "word",
"parentOrigin": "https://127.0.0.1:10075/",
"document": {
"title": "41f8d18a-ee2d-4c28-874f-7b2a875afb74.docx",
"url": "https://storage.yandexcloud.net/delta-is-methodology-v2/documents/doc.docx?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Credential>&X-Amz-Date=20231107T074832Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=<Signature>",
"fileType": "docx",
"key": "<Key>",
"info": {
"owner": "Unknown",
"uploaded": "07.11.2023 07:48:32"
},
"permissions": {
"comment": true,
"download": true,
"edit": true,
"fillForms": true,
"modifyFilter": true,
"modifyContentControl": true,
"review": true
}
},
"editorConfig": {
"mode": "edit",
"lang": "ru",
"region": "ru-RU",
"callbackUrl": "https://dev-delta.ligarobotov.ru/methodology/editor/track/?key=documents/doc.docx&type=2&token=<JWT Bearer>",
"user": {
"id": "102",
"name": "doc"
},
"embedded": {
"saveUrl": "https://storage.yandexcloud.net/delta-is-methodology-v2/documents/doc.docx?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Credential>&X-Amz-Date=20231107T074832Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=<Signature>",
"embedUrl": "https://storage.yandexcloud.net/delta-is-methodology-v2/documents/doc.docx?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Credential>&X-Amz-Date=20231107T074832Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=<Signature>",
"shareUrl": "https://storage.yandexcloud.net/delta-is-methodology-v2/documents/doc.docx?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Credential>&X-Amz-Date=20231107T074832Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=<Signature>",
"toolbarDocked": "top"
},
"customization": {
"about": true,
"feedback": true,
"compactHeader": true,
"plugins": true,
"compactToolbar": true,
"goBack": {
"url": "http://127.0.0.1:10075/methodology/admin/documents/view/1"
}
}
}
};
config.width = "100%";
config.height = "100%";
config.events = {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
'onMakeActionLink': onMakeActionLink,
};
console.log(config)
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
fixSize();
};
I’m not see a critical difference between this configurations. Can you?
Thanks for any help,
Dmitry