From 581f2aaef683b4753c63f3964fab23993aa82a1a Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 23 Sep 2024 10:51:25 +0300 Subject: [PATCH 01/14] he-IL skin language --- CHANGELOG.md | 2 ++ web/documentserver-example/csharp-mvc/web.appsettings.config | 2 +- web/documentserver-example/csharp/settings.config | 2 +- .../java-spring/src/main/resources/application.properties | 2 +- .../java/src/main/resources/settings.properties | 2 +- web/documentserver-example/nodejs/config/default.json | 1 + .../php/src/configuration/ConfigurationManager.php | 1 + .../python/src/configuration/configuration.py | 1 + .../ruby/app/configuration/configuration.rb | 1 + 9 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b98e10c4..eb963efa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +- he-IL skin language + ## 1.10.0 - nodejs: converting function on index page - java-spring: using java docs-integration-sdk diff --git a/web/documentserver-example/csharp-mvc/web.appsettings.config b/web/documentserver-example/csharp-mvc/web.appsettings.config index 7d16f7153..384caec77 100644 --- a/web/documentserver-example/csharp-mvc/web.appsettings.config +++ b/web/documentserver-example/csharp-mvc/web.appsettings.config @@ -16,7 +16,7 @@ - + diff --git a/web/documentserver-example/csharp/settings.config b/web/documentserver-example/csharp/settings.config index ac30df391..745a832c6 100644 --- a/web/documentserver-example/csharp/settings.config +++ b/web/documentserver-example/csharp/settings.config @@ -15,7 +15,7 @@ - + diff --git a/web/documentserver-example/java-spring/src/main/resources/application.properties b/web/documentserver-example/java-spring/src/main/resources/application.properties index 28d7ae465..de075c7dd 100755 --- a/web/documentserver-example/java-spring/src/main/resources/application.properties +++ b/web/documentserver-example/java-spring/src/main/resources/application.properties @@ -15,7 +15,7 @@ files.docservice.history.postfix=-hist files.docservice.url.example= -files.docservice.languages=en:English|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|en-GB:English (United Kingdom)|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Cyrl-RS:Serbian (Cyrillic)|sr-Latn-RS:Serbian (Latin)|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language +files.docservice.languages=en:English|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|en-GB:English (United Kingdom)|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|he-IL:Hebrew (Israel)|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Cyrl-RS:Serbian (Cyrillic)|sr-Latn-RS:Serbian (Latin)|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language docservice.url=http://documentserver/ docservice.ignoreSSLCertificate=false diff --git a/web/documentserver-example/java/src/main/resources/settings.properties b/web/documentserver-example/java/src/main/resources/settings.properties index b21da57c8..9bb383228 100644 --- a/web/documentserver-example/java/src/main/resources/settings.properties +++ b/web/documentserver-example/java/src/main/resources/settings.properties @@ -14,7 +14,7 @@ files.docservice.url.api=web-apps/apps/api/documents/api.js files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html files.docservice.url.example= -files.docservice.languages=en:English|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|en-GB:English (United Kingdom)|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Cyrl-RS:Serbian (Cyrillic)|sr-Latn-RS:Serbian (Latin)|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language +files.docservice.languages=en:English|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|en-GB:English (United Kingdom)|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|he-IL:Hebrew (Israel)|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Cyrl-RS:Serbian (Cyrillic)|sr-Latn-RS:Serbian (Latin)|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language files.docservice.secret= files.docservice.header=Authorization diff --git a/web/documentserver-example/nodejs/config/default.json b/web/documentserver-example/nodejs/config/default.json index 0c6ef9dfc..45dea196f 100644 --- a/web/documentserver-example/nodejs/config/default.json +++ b/web/documentserver-example/nodejs/config/default.json @@ -58,6 +58,7 @@ "gl": "Galego", "de": "German", "el": "Greek", + "he-IL": "Hebrew (Israel)", "hu": "Hungarian", "id": "Indonesian", "it": "Italian", diff --git a/web/documentserver-example/php/src/configuration/ConfigurationManager.php b/web/documentserver-example/php/src/configuration/ConfigurationManager.php index d4ac30075..b57742bfc 100644 --- a/web/documentserver-example/php/src/configuration/ConfigurationManager.php +++ b/web/documentserver-example/php/src/configuration/ConfigurationManager.php @@ -188,6 +188,7 @@ public function languages(): array 'gl' => 'Galego', 'de' => 'German', 'el' => 'Greek', + 'he-IL' => 'Hebrew (Israel)', 'hu' => 'Hungarian', 'id' => 'Indonesian', 'it' => 'Italian', diff --git a/web/documentserver-example/python/src/configuration/configuration.py b/web/documentserver-example/python/src/configuration/configuration.py index 847ffc414..f4b5eb499 100644 --- a/web/documentserver-example/python/src/configuration/configuration.py +++ b/web/documentserver-example/python/src/configuration/configuration.py @@ -145,6 +145,7 @@ def languages(self) -> dict[str, str]: 'gl': 'Galego', 'de': 'German', 'el': 'Greek', + 'he-IL': 'Hebrew (Israel)', 'hu': 'Hungarian', 'id': 'Indonesian', 'it': 'Italian', diff --git a/web/documentserver-example/ruby/app/configuration/configuration.rb b/web/documentserver-example/ruby/app/configuration/configuration.rb index 6a4b11e3f..58fe758a0 100644 --- a/web/documentserver-example/ruby/app/configuration/configuration.rb +++ b/web/documentserver-example/ruby/app/configuration/configuration.rb @@ -168,6 +168,7 @@ def languages gl: 'Galego', de: 'German', el: 'Greek', + 'he-IL': 'Hebrew (Israel)', hu: 'Hungarian', id: 'Indonesian', it: 'Italian', From db3ccd7482572f91405bb964356f8b6ae48607f7 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 24 Sep 2024 12:06:41 +0300 Subject: [PATCH 02/14] Revert "nodejs: filling by default if possible" (Fix Bug 70284) This reverts commit 15e09fece2fbd1ec377e7d68b23aeb37093feace. # Conflicts: # web/documentserver-example/nodejs/app.js --- web/documentserver-example/nodejs/app.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index 5bf18c59a..0b23bbe4b 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -1101,14 +1101,11 @@ app.get('/editor', (req, res) => { // define a handler for editing document const key = req.DocManager.getKey(fileName); const url = req.DocManager.getDownloadUrl(fileName, true); const directUrl = req.DocManager.getDownloadUrl(fileName); - - // check if this file can be filled - const canFill = fileUtility.getFillExtensions().indexOf(fileExt.slice(1)) !== -1; - let mode = req.query.mode || (canFill ? 'fillForms' : 'edit'); // mode: view/edit/review/comment/fillForms/embedded + let mode = req.query.mode || 'edit'; // mode: view/edit/review/comment/fillForms/embedded let canEdit = fileUtility.getEditExtensions().indexOf(fileExt.slice(1)) !== -1; // check if this file can be edited if (((!canEdit && mode === 'edit') || mode === 'fillForms') - && canFill) { + && fileUtility.getFillExtensions().indexOf(fileExt.slice(1)) !== -1) { mode = 'fillForms'; canEdit = true; } From b36bfdec4d079cb859f2f9ccd05fdc743e4e5044 Mon Sep 17 00:00:00 2001 From: Andrei Panov Date: Fri, 27 Sep 2024 10:38:51 +0300 Subject: [PATCH 03/14] fix(nodejs): fix maxfilesize issue on upload (Fix Bug 70516) --- web/documentserver-example/nodejs/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index 0b23bbe4b..d2a1aa449 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -273,7 +273,8 @@ app.post('/upload', (req, res) => { // define a handler for uploading files const uploadDirTmp = path.join(uploadDir, 'tmp'); // and create directory for temporary files if it doesn't exist req.DocManager.createDirectory(uploadDirTmp); - const form = new formidable.IncomingForm(); // create a new incoming form + const fileSizeLimit = configServer.get('maxFileSize'); + const form = new formidable.IncomingForm({maxFileSize: fileSizeLimit, maxTotalFileSize: fileSizeLimit }); // create a new incoming form form.uploadDir = uploadDirTmp; // and write there all the necessary parameters form.keepExtensions = true; @@ -298,7 +299,7 @@ app.post('/upload', (req, res) => { // define a handler for uploading files file.originalFilename = req.DocManager.getCorrectName(file.originalFilename); // check if the file size exceeds the maximum file size - if (configServer.get('maxFileSize') < file.size || file.size <= 0) { + if (fileSizeLimit < file.size || file.size <= 0) { // DocManager.cleanFolderRecursive(uploadDirTmp, true); // clean the folder with temporary files res.writeHead(200, { 'Content-Type': 'text/plain' }); res.write('{ "error": "File size is incorrect"}'); From 2b0b902f9c3cc484a3bb97a3b64c7191aa736f1d Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 30 Sep 2024 12:10:34 +0300 Subject: [PATCH 04/14] using default empty files (For Bug 70101) --- .gitmodules | 16 ++++++++-------- .../csharp-mvc/assets/document-templates | 2 +- .../csharp/assets/document-templates | 2 +- .../src/main/resources/assets/document-templates | 2 +- .../src/main/resources/assets/document-templates | 2 +- .../nodejs/public/assets/document-templates | 2 +- .../php/assets/document-templates | 2 +- .../python/assets/document-templates | 2 +- .../ruby/assets/document-templates | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.gitmodules b/.gitmodules index d7f56c93b..7d814d355 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,21 @@ [submodule "web/documentserver-example/nodejs/public/assets/document-templates"] path = web/documentserver-example/nodejs/public/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/nodejs/public/assets/document-formats"] path = web/documentserver-example/nodejs/public/assets/document-formats url = https://github.com/ONLYOFFICE/document-formats [submodule "web/documentserver-example/csharp-mvc/assets/document-templates"] path = web/documentserver-example/csharp-mvc/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/csharp-mvc/assets/document-formats"] path = web/documentserver-example/csharp-mvc/assets/document-formats url = https://github.com/ONLYOFFICE/document-formats [submodule "web/documentserver-example/php/assets/document-templates"] path = web/documentserver-example/php/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/php/assets/document-formats"] path = web/documentserver-example/php/assets/document-formats url = https://github.com/ONLYOFFICE/document-formats @@ -23,19 +23,19 @@ [submodule "web/documentserver-example/python/assets/document-templates"] path = web/documentserver-example/python/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/java/src/main/resources/assets/document-templates"] path = web/documentserver-example/java/src/main/resources/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/ruby/assets/document-templates"] path = web/documentserver-example/ruby/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/java-spring/src/main/resources/assets/document-templates"] path = web/documentserver-example/java-spring/src/main/resources/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/python/assets/document-formats"] path = web/documentserver-example/python/assets/document-formats url = https://github.com/ONLYOFFICE/document-formats @@ -51,7 +51,7 @@ [submodule "web/documentserver-example/csharp/assets/document-templates"] path = web/documentserver-example/csharp/assets/document-templates url = https://github.com/ONLYOFFICE/document-templates - branch = main/en + branch = main/default [submodule "web/documentserver-example/csharp/assets/document-formats"] path = web/documentserver-example/csharp/assets/document-formats url = https://github.com/ONLYOFFICE/document-formats diff --git a/web/documentserver-example/csharp-mvc/assets/document-templates b/web/documentserver-example/csharp-mvc/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/csharp-mvc/assets/document-templates +++ b/web/documentserver-example/csharp-mvc/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/csharp/assets/document-templates b/web/documentserver-example/csharp/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/csharp/assets/document-templates +++ b/web/documentserver-example/csharp/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/java-spring/src/main/resources/assets/document-templates b/web/documentserver-example/java-spring/src/main/resources/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/java-spring/src/main/resources/assets/document-templates +++ b/web/documentserver-example/java-spring/src/main/resources/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/java/src/main/resources/assets/document-templates b/web/documentserver-example/java/src/main/resources/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/java/src/main/resources/assets/document-templates +++ b/web/documentserver-example/java/src/main/resources/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/nodejs/public/assets/document-templates b/web/documentserver-example/nodejs/public/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/nodejs/public/assets/document-templates +++ b/web/documentserver-example/nodejs/public/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/php/assets/document-templates b/web/documentserver-example/php/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/php/assets/document-templates +++ b/web/documentserver-example/php/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/python/assets/document-templates b/web/documentserver-example/python/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/python/assets/document-templates +++ b/web/documentserver-example/python/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d diff --git a/web/documentserver-example/ruby/assets/document-templates b/web/documentserver-example/ruby/assets/document-templates index c9fc1ee6b..53e2d9e0a 160000 --- a/web/documentserver-example/ruby/assets/document-templates +++ b/web/documentserver-example/ruby/assets/document-templates @@ -1 +1 @@ -Subproject commit c9fc1ee6beac118a7d9472f971a61cd2eb285293 +Subproject commit 53e2d9e0af00844eea402f601678cf801559aa8d From c72218d3ae846d0008472fe60b0f4b4f519554b5 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 7 Oct 2024 11:34:22 +0300 Subject: [PATCH 05/14] ConvertService.ashx address replaced with converter --- CHANGELOG.md | 1 + .../csharp-mvc/Helpers/DocumentConverter.cs | 2 +- .../csharp-mvc/web.appsettings.config | 2 +- .../csharp/DocumentConverter.cs | 2 +- .../csharp/settings.config | 2 +- .../src/main/resources/settings.properties | 2 +- .../nodejs/config/default.json | 2 +- .../src/configuration/ConfigurationManager.php | 2 +- ...nManagerDocumentServerConverterURLTests.php | 2 +- .../python/src/configuration/configuration.py | 2 +- .../src/configuration/configuration_tests.py | 2 +- .../ruby/app/configuration/configuration.rb | 2 +- .../app/configuration/configuration_tests.rb | 2 +- .../ruby/app/models/service_converter.rb | 18 +++++++++--------- 14 files changed, 22 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb963efa6..52676142d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log - he-IL skin language +- ConvertService.ashx address replaced with converter ## 1.10.0 - nodejs: converting function on index page diff --git a/web/documentserver-example/csharp-mvc/Helpers/DocumentConverter.cs b/web/documentserver-example/csharp-mvc/Helpers/DocumentConverter.cs index 0ee440192..ff8880dfc 100644 --- a/web/documentserver-example/csharp-mvc/Helpers/DocumentConverter.cs +++ b/web/documentserver-example/csharp-mvc/Helpers/DocumentConverter.cs @@ -225,7 +225,7 @@ private static int GetResponseData(string jsonDocumentResponse, out Dictionary - + diff --git a/web/documentserver-example/csharp/DocumentConverter.cs b/web/documentserver-example/csharp/DocumentConverter.cs index 580f77afb..2164a7442 100644 --- a/web/documentserver-example/csharp/DocumentConverter.cs +++ b/web/documentserver-example/csharp/DocumentConverter.cs @@ -227,7 +227,7 @@ private static int GetResponseData(string jsonDocumentResponse, out Dictionary - + diff --git a/web/documentserver-example/java/src/main/resources/settings.properties b/web/documentserver-example/java/src/main/resources/settings.properties index 9bb383228..97f5bb288 100644 --- a/web/documentserver-example/java/src/main/resources/settings.properties +++ b/web/documentserver-example/java/src/main/resources/settings.properties @@ -8,7 +8,7 @@ enable-forgotten=TRUE files.docservice.timeout=120000 files.docservice.url.site=http://documentserver/ -files.docservice.url.converter=ConvertService.ashx +files.docservice.url.converter=converter files.docservice.url.command=coauthoring/CommandService.ashx files.docservice.url.api=web-apps/apps/api/documents/api.js files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html diff --git a/web/documentserver-example/nodejs/config/default.json b/web/documentserver-example/nodejs/config/default.json index 45dea196f..86744e5a5 100644 --- a/web/documentserver-example/nodejs/config/default.json +++ b/web/documentserver-example/nodejs/config/default.json @@ -18,7 +18,7 @@ "discovery": "hosting/discovery" }, "commandUrl": "coauthoring/CommandService.ashx", - "converterUrl": "ConvertService.ashx", + "converterUrl": "converter", "apiUrl": "web-apps/apps/api/documents/api.js", "preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html", "exampleUrl": null, diff --git a/web/documentserver-example/php/src/configuration/ConfigurationManager.php b/web/documentserver-example/php/src/configuration/ConfigurationManager.php index b57742bfc..03f2af266 100644 --- a/web/documentserver-example/php/src/configuration/ConfigurationManager.php +++ b/web/documentserver-example/php/src/configuration/ConfigurationManager.php @@ -81,7 +81,7 @@ public function documentServerConverterURL(): URL { $serverURL = $this->documentServerPrivateURL(); $path = getenv('DOCUMENT_SERVER_CONVERTER_PATH') - ?: 'ConvertService.ashx'; + ?: 'converter'; return $serverURL->joinPath($path); } diff --git a/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerConverterURLTests.php b/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerConverterURLTests.php index 796183856..67661ed09 100644 --- a/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerConverterURLTests.php +++ b/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerConverterURLTests.php @@ -42,7 +42,7 @@ public function testAssignsADefaultValue() $configManager = new ConfigurationManager(); $url = $configManager->documentServerConverterURL(); $this->assertEquals( - 'http://documentserver/ConvertService.ashx', + 'http://documentserver/converter', $url->string() ); } diff --git a/web/documentserver-example/python/src/configuration/configuration.py b/web/documentserver-example/python/src/configuration/configuration.py index f4b5eb499..dd7cfa89b 100644 --- a/web/documentserver-example/python/src/configuration/configuration.py +++ b/web/documentserver-example/python/src/configuration/configuration.py @@ -81,7 +81,7 @@ def document_server_converter_url(self) -> ParseResult: base_url = server_url.geturl() path = ( environ.get('DOCUMENT_SERVER_CONVERTER_PATH') or - '/ConvertService.ashx' + '/converter' ) url = urljoin(base_url, path) return urlparse(url) diff --git a/web/documentserver-example/python/src/configuration/configuration_tests.py b/web/documentserver-example/python/src/configuration/configuration_tests.py index 3c86b380a..468577dd3 100644 --- a/web/documentserver-example/python/src/configuration/configuration_tests.py +++ b/web/documentserver-example/python/src/configuration/configuration_tests.py @@ -176,7 +176,7 @@ def test_assigns_a_default_value(self, _): url = config_manager.document_server_converter_url() self.assertEqual( url.geturl(), - 'http://localhost/ConvertService.ashx' + 'http://localhost/converter' ) @patch.object( diff --git a/web/documentserver-example/ruby/app/configuration/configuration.rb b/web/documentserver-example/ruby/app/configuration/configuration.rb index 58fe758a0..1cbcd5b54 100644 --- a/web/documentserver-example/ruby/app/configuration/configuration.rb +++ b/web/documentserver-example/ruby/app/configuration/configuration.rb @@ -84,7 +84,7 @@ def document_server_command_uri def document_server_converter_uri path = ENV['DOCUMENT_SERVER_CONVERTER_PATH'] || - '/ConvertService.ashx' + '/converter' URI.join(document_server_private_uri, path) end diff --git a/web/documentserver-example/ruby/app/configuration/configuration_tests.rb b/web/documentserver-example/ruby/app/configuration/configuration_tests.rb index 16189727e..e075bc3d5 100644 --- a/web/documentserver-example/ruby/app/configuration/configuration_tests.rb +++ b/web/documentserver-example/ruby/app/configuration/configuration_tests.rb @@ -175,7 +175,7 @@ def test_assigns_a_default_value uri = config_manager.document_server_converter_uri assert_equal( uri.to_s, - 'http://documentserver/ConvertService.ashx' + 'http://documentserver/converter' ) end diff --git a/web/documentserver-example/ruby/app/models/service_converter.rb b/web/documentserver-example/ruby/app/models/service_converter.rb index 09b83fbe5..bfe04e275 100755 --- a/web/documentserver-example/ruby/app/models/service_converter.rb +++ b/web/documentserver-example/ruby/app/models/service_converter.rb @@ -109,23 +109,23 @@ def self.process_convert_service_responce_error(error_code) # add an error message to the error message template depending on the error code case error_code when -9 - error_message = 'Error occurred in the ConvertService.ashx: Error conversion output format' + error_message = 'Error occurred in the ConvertService: Error conversion output format' when -8 - error_message = 'Error occurred in the ConvertService.ashx: Error document VKey' + error_message = 'Error occurred in the ConvertService: Error document VKey' when -7 - error_message = 'Error occurred in the ConvertService.ashx: Error document request' + error_message = 'Error occurred in the ConvertService: Error document request' when -6 - error_message = 'Error occurred in the ConvertService.ashx: Error database' + error_message = 'Error occurred in the ConvertService: Error database' when -5 - error_message = 'Error occurred in the ConvertService.ashx: Incorrect password' + error_message = 'Error occurred in the ConvertService: Incorrect password' when -4 - error_message = 'Error occurred in the ConvertService.ashx: Error download error' + error_message = 'Error occurred in the ConvertService: Error download error' when -3 - error_message = 'Error occurred in the ConvertService.ashx: Error convertation error' + error_message = 'Error occurred in the ConvertService: Error convertation error' when -2 - error_message = 'Error occurred in the ConvertService.ashx: Error convertation timeout' + error_message = 'Error occurred in the ConvertService: Error convertation timeout' when -1 - error_message = 'Error occurred in the ConvertService.ashx: Error convertation unknown' + error_message = 'Error occurred in the ConvertService: Error convertation unknown' when 0 # public const int c_nErrorNo = 0 else From 25ec76084f0e8fbe2ec1fb69cffa8f9fdc512dd8 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 7 Oct 2024 11:35:55 +0300 Subject: [PATCH 06/14] coauthoring/CommandService.ashx address replaced with command --- CHANGELOG.md | 1 + web/documentserver-example/csharp-mvc/web.appsettings.config | 2 +- web/documentserver-example/csharp/settings.config | 2 +- .../java/src/main/resources/settings.properties | 2 +- web/documentserver-example/nodejs/config/default.json | 2 +- .../php/src/configuration/ConfigurationManager.php | 2 +- .../ConfigurationManagerDocumentServerCommandURLTests.php | 2 +- .../python/src/configuration/configuration.py | 2 +- .../python/src/configuration/configuration_tests.py | 2 +- .../ruby/app/configuration/configuration.rb | 2 +- .../ruby/app/configuration/configuration_tests.rb | 2 +- 11 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52676142d..479e29803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - he-IL skin language - ConvertService.ashx address replaced with converter +- coauthoring/CommandService.ashx address replaced with command ## 1.10.0 - nodejs: converting function on index page diff --git a/web/documentserver-example/csharp-mvc/web.appsettings.config b/web/documentserver-example/csharp-mvc/web.appsettings.config index 2f9e31cf0..89aafb428 100644 --- a/web/documentserver-example/csharp-mvc/web.appsettings.config +++ b/web/documentserver-example/csharp-mvc/web.appsettings.config @@ -23,7 +23,7 @@ - + diff --git a/web/documentserver-example/csharp/settings.config b/web/documentserver-example/csharp/settings.config index 421c496a0..e8242d0d4 100644 --- a/web/documentserver-example/csharp/settings.config +++ b/web/documentserver-example/csharp/settings.config @@ -22,7 +22,7 @@ - + diff --git a/web/documentserver-example/java/src/main/resources/settings.properties b/web/documentserver-example/java/src/main/resources/settings.properties index 97f5bb288..a14d464b3 100644 --- a/web/documentserver-example/java/src/main/resources/settings.properties +++ b/web/documentserver-example/java/src/main/resources/settings.properties @@ -9,7 +9,7 @@ files.docservice.timeout=120000 files.docservice.url.site=http://documentserver/ files.docservice.url.converter=converter -files.docservice.url.command=coauthoring/CommandService.ashx +files.docservice.url.command=command files.docservice.url.api=web-apps/apps/api/documents/api.js files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html files.docservice.url.example= diff --git a/web/documentserver-example/nodejs/config/default.json b/web/documentserver-example/nodejs/config/default.json index 86744e5a5..dbe100a92 100644 --- a/web/documentserver-example/nodejs/config/default.json +++ b/web/documentserver-example/nodejs/config/default.json @@ -17,7 +17,7 @@ "wopi": { "discovery": "hosting/discovery" }, - "commandUrl": "coauthoring/CommandService.ashx", + "commandUrl": "command", "converterUrl": "converter", "apiUrl": "web-apps/apps/api/documents/api.js", "preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html", diff --git a/web/documentserver-example/php/src/configuration/ConfigurationManager.php b/web/documentserver-example/php/src/configuration/ConfigurationManager.php index 03f2af266..592b015ca 100644 --- a/web/documentserver-example/php/src/configuration/ConfigurationManager.php +++ b/web/documentserver-example/php/src/configuration/ConfigurationManager.php @@ -73,7 +73,7 @@ public function documentServerCommandURL(): URL { $serverURL = $this->documentServerPrivateURL(); $path = getenv('DOCUMENT_SERVER_COMMAND_PATH') - ?: 'coauthoring/CommandService.ashx'; + ?: 'command'; return $serverURL->joinPath($path); } diff --git a/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerCommandURLTests.php b/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerCommandURLTests.php index 3e3746f08..27451c554 100644 --- a/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerCommandURLTests.php +++ b/web/documentserver-example/php/src/configuration/ConfigurationManagerDocumentServerCommandURLTests.php @@ -42,7 +42,7 @@ public function testAssignsADefaultValue() $configManager = new ConfigurationManager(); $url = $configManager->documentServerCommandURL(); $this->assertEquals( - 'http://documentserver/coauthoring/CommandService.ashx', + 'http://documentserver/command', $url->string() ); } diff --git a/web/documentserver-example/python/src/configuration/configuration.py b/web/documentserver-example/python/src/configuration/configuration.py index dd7cfa89b..cb5bf9881 100644 --- a/web/documentserver-example/python/src/configuration/configuration.py +++ b/web/documentserver-example/python/src/configuration/configuration.py @@ -71,7 +71,7 @@ def document_server_command_url(self) -> ParseResult: base_url = server_url.geturl() path = ( environ.get('DOCUMENT_SERVER_COMMAND_PATH') or - '/coauthoring/CommandService.ashx' + '/command' ) url = urljoin(base_url, path) return urlparse(url) diff --git a/web/documentserver-example/python/src/configuration/configuration_tests.py b/web/documentserver-example/python/src/configuration/configuration_tests.py index 468577dd3..f150cf877 100644 --- a/web/documentserver-example/python/src/configuration/configuration_tests.py +++ b/web/documentserver-example/python/src/configuration/configuration_tests.py @@ -145,7 +145,7 @@ def test_assigns_a_default_value(self, _): url = config_manager.document_server_command_url() self.assertEqual( url.geturl(), - 'http://localhost/coauthoring/CommandService.ashx' + 'http://localhost/command' ) @patch.object( diff --git a/web/documentserver-example/ruby/app/configuration/configuration.rb b/web/documentserver-example/ruby/app/configuration/configuration.rb index 1cbcd5b54..2afca57e3 100644 --- a/web/documentserver-example/ruby/app/configuration/configuration.rb +++ b/web/documentserver-example/ruby/app/configuration/configuration.rb @@ -76,7 +76,7 @@ def document_server_preloader_uri def document_server_command_uri path = ENV['DOCUMENT_SERVER_COMMAND_PATH'] || - '/coauthoring/CommandService.ashx' + '/command' URI.join(document_server_private_uri, path) end diff --git a/web/documentserver-example/ruby/app/configuration/configuration_tests.rb b/web/documentserver-example/ruby/app/configuration/configuration_tests.rb index e075bc3d5..b78f660ef 100644 --- a/web/documentserver-example/ruby/app/configuration/configuration_tests.rb +++ b/web/documentserver-example/ruby/app/configuration/configuration_tests.rb @@ -151,7 +151,7 @@ def test_assigns_a_default_value uri = config_manager.document_server_command_uri assert_equal( uri.to_s, - 'http://documentserver/coauthoring/CommandService.ashx' + 'http://documentserver/command' ) end From 35cf2fb0b02cc639a07bb7440595266573ee3ce5 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 7 Oct 2024 14:52:59 +0300 Subject: [PATCH 07/14] submit for all modes --- CHANGELOG.md | 1 + web/documentserver-example/csharp-mvc/Models/FileModel.cs | 2 +- web/documentserver-example/csharp/DocEditor.aspx.cs | 2 +- .../integration/sdk/service/ConfigServiceImpl.java | 3 +-- .../java/src/main/java/entities/FileModel.java | 4 +--- web/documentserver-example/nodejs/app.js | 5 +---- web/documentserver-example/php/src/views/DocEditorView.php | 2 +- web/documentserver-example/python/src/views/actions.py | 2 +- web/documentserver-example/ruby/app/models/file_model.rb | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 479e29803..dea68d0fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - he-IL skin language - ConvertService.ashx address replaced with converter - coauthoring/CommandService.ashx address replaced with command +- submitForm for all modes ## 1.10.0 - nodejs: converting function on index page diff --git a/web/documentserver-example/csharp-mvc/Models/FileModel.cs b/web/documentserver-example/csharp-mvc/Models/FileModel.cs index 291474737..03b6ac924 100755 --- a/web/documentserver-example/csharp-mvc/Models/FileModel.cs +++ b/web/documentserver-example/csharp-mvc/Models/FileModel.cs @@ -89,7 +89,7 @@ public string GetDocConfig(HttpRequest request, UrlHelper url) editorsMode = "fillForms"; canEdit = true; } - var submitForm = (editorsMode.Equals("fillForms") || editorsMode.Equals("embedded")) && user.id.Equals("uid-1"); // check if the Submit form button is displayed or not + var submitForm = user.id.Equals("uid-1"); // check if the Submit form button is displayed or not var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // set the mode parameter: change it to view if the document can't be edited // favorite icon state diff --git a/web/documentserver-example/csharp/DocEditor.aspx.cs b/web/documentserver-example/csharp/DocEditor.aspx.cs index cd878f9e7..2eec1913c 100755 --- a/web/documentserver-example/csharp/DocEditor.aspx.cs +++ b/web/documentserver-example/csharp/DocEditor.aspx.cs @@ -154,7 +154,7 @@ protected void Page_Load(object sender, EventArgs e) editorsMode = "fillForms"; canEdit = true; } - var submitForm = (editorsMode.Equals("fillForms") || editorsMode.Equals("embedded")) && user.id.Equals("uid-1"); // check if the Submit form button is displayed or hidden + var submitForm = user.id.Equals("uid-1"); // check if the Submit form button is displayed or hidden var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // get the editor opening mode (edit or view) var jss = new JavaScriptSerializer(); diff --git a/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java b/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java index 61f4a41f0..01630b5cb 100644 --- a/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java +++ b/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java @@ -93,8 +93,7 @@ public Config createConfig(final String fileId, final Action action, final Type Config config = super.createConfig(fileId, mode, type); - if ((currentAction.equals(Action.fillForms) || currentAction.equals(Action.embedded)) - && appUser.getPermissions().getSubmitForm()) { + if (appUser.getPermissions().getSubmitForm()) { config.getEditorConfig().getCustomization().setSubmitForm(true); } diff --git a/web/documentserver-example/java/src/main/java/entities/FileModel.java b/web/documentserver-example/java/src/main/java/entities/FileModel.java index 503ef39ef..f0604a33c 100755 --- a/web/documentserver-example/java/src/main/java/entities/FileModel.java +++ b/web/documentserver-example/java/src/main/java/entities/FileModel.java @@ -164,9 +164,7 @@ public void changeType(final String modeParam, final String typeParam, final Use } // check if the Submit form button is displayed or not - if (mode.equals("fillForms") || mode.equals("embedded")) { - editorConfig.getCustomization().setSubmitForm(user.getId().equals("uid-1")); - } + editorConfig.getCustomization().setSubmitForm(user.getId().equals("uid-1")); if ((!canEdit && mode.equals("edit") || mode.equals("fillForms")) && canFill) { canEdit = true; diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index d2a1aa449..01c874b0f 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -1114,10 +1114,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document mode = 'view'; } - let submitForm = false; - if (mode === 'fillForms' || mode === 'embedded') { - submitForm = userid === 'uid-1'; - } + const submitForm = userid === 'uid-1'; if (user.goback != null) { user.goback.url = `${req.DocManager.getServerUrl()}`; diff --git a/web/documentserver-example/php/src/views/DocEditorView.php b/web/documentserver-example/php/src/views/DocEditorView.php index 697b614bd..deb28b7ad 100644 --- a/web/documentserver-example/php/src/views/DocEditorView.php +++ b/web/documentserver-example/php/src/views/DocEditorView.php @@ -83,7 +83,7 @@ public function __construct($request, $tempName = "docEditor") } // check if the Submit form button is displayed or not - $submitForm = in_array($editorsMode, ["fillForms", "embedded"]) && $user->id == "uid-1"; + $submitForm = $user->id == "uid-1"; $mode = $canEdit && $editorsMode != "view" ? "edit" : "view"; // define if the editing mode is edit or view $type = empty($request["type"]) ? "desktop" : $request["type"]; diff --git a/web/documentserver-example/python/src/views/actions.py b/web/documentserver-example/python/src/views/actions.py index 46fa20bce..fdd06f8a4 100755 --- a/web/documentserver-example/python/src/views/actions.py +++ b/web/documentserver-example/python/src/views/actions.py @@ -207,7 +207,7 @@ def edit(request): edMode = 'fillForms' canEdit = True # if the Submit form button is displayed or hidden - submitForm = edMode in ['fillForms', 'embedded'] and user.id == 'uid-1' + submitForm = user.id == 'uid-1' mode = 'edit' if canEdit & (edMode != 'view') else 'view' # if the file can't be edited, the mode is view types = ['desktop', 'mobile', 'embedded'] diff --git a/web/documentserver-example/ruby/app/models/file_model.rb b/web/documentserver-example/ruby/app/models/file_model.rb index 69a596292..4702b5d4b 100755 --- a/web/documentserver-example/ruby/app/models/file_model.rb +++ b/web/documentserver-example/ruby/app/models/file_model.rb @@ -106,7 +106,7 @@ def config editors_mode = 'fillForms' can_edit = true end - submit_form = ['fillForms', 'embedded'].include?(editors_mode) && @user.id.eql?('uid-1') # Submit form button state + submit_form = @user.id.eql?('uid-1') # Submit form button state mode = can_edit && !editors_mode.eql?('view') ? 'edit' : 'view' # templates image url in the "From Template" section templates_image_url = DocumentHelper.get_template_image_url(document_type) From 8714cc3d693a1647e91983d1ded2839be093e060 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 14 Oct 2024 12:08:22 +0300 Subject: [PATCH 08/14] Revert "nodejs: comment only is not for pdf" This reverts commit 146d26c8685d6e7a7841f7c93b706e91efb9d1ed. --- web/documentserver-example/nodejs/views/index.ejs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web/documentserver-example/nodejs/views/index.ejs b/web/documentserver-example/nodejs/views/index.ejs index 9abaa9262..a0544a4c8 100755 --- a/web/documentserver-example/nodejs/views/index.ejs +++ b/web/documentserver-example/nodejs/views/index.ejs @@ -196,14 +196,10 @@ Open in editor for full size screens - <% if (storedFiles[i].documentType !== "pdf") { %> Open in editor for comment - <% } else { %> - - <% } %> <% if (storedFiles[i].documentType == "word") { %> From e4f5f0bca7b0da38ca77d18f2a713652c02b5875 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 15 Oct 2024 18:06:37 +0300 Subject: [PATCH 09/14] submit not for viewer This reverts commit 35cf2fb0b02cc639a07bb7440595266573ee3ce5. --- CHANGELOG.md | 1 - web/documentserver-example/csharp-mvc/Models/FileModel.cs | 2 +- web/documentserver-example/csharp/DocEditor.aspx.cs | 2 +- .../integration/sdk/service/ConfigServiceImpl.java | 3 ++- .../java/src/main/java/entities/FileModel.java | 4 +++- web/documentserver-example/nodejs/app.js | 5 ++++- web/documentserver-example/php/src/views/DocEditorView.php | 2 +- web/documentserver-example/python/src/views/actions.py | 2 +- web/documentserver-example/ruby/app/models/file_model.rb | 2 +- 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dea68d0fa..479e29803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ - he-IL skin language - ConvertService.ashx address replaced with converter - coauthoring/CommandService.ashx address replaced with command -- submitForm for all modes ## 1.10.0 - nodejs: converting function on index page diff --git a/web/documentserver-example/csharp-mvc/Models/FileModel.cs b/web/documentserver-example/csharp-mvc/Models/FileModel.cs index 03b6ac924..26f05c292 100755 --- a/web/documentserver-example/csharp-mvc/Models/FileModel.cs +++ b/web/documentserver-example/csharp-mvc/Models/FileModel.cs @@ -89,7 +89,7 @@ public string GetDocConfig(HttpRequest request, UrlHelper url) editorsMode = "fillForms"; canEdit = true; } - var submitForm = user.id.Equals("uid-1"); // check if the Submit form button is displayed or not + var submitForm = !editorsMode.Equals("view") && user.id.Equals("uid-1"); // check if the Submit form button is displayed or not var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // set the mode parameter: change it to view if the document can't be edited // favorite icon state diff --git a/web/documentserver-example/csharp/DocEditor.aspx.cs b/web/documentserver-example/csharp/DocEditor.aspx.cs index 2eec1913c..dade52b34 100755 --- a/web/documentserver-example/csharp/DocEditor.aspx.cs +++ b/web/documentserver-example/csharp/DocEditor.aspx.cs @@ -154,7 +154,7 @@ protected void Page_Load(object sender, EventArgs e) editorsMode = "fillForms"; canEdit = true; } - var submitForm = user.id.Equals("uid-1"); // check if the Submit form button is displayed or hidden + var submitForm = !editorsMode.Equals("view") && user.id.Equals("uid-1"); // check if the Submit form button is displayed or hidden var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // get the editor opening mode (edit or view) var jss = new JavaScriptSerializer(); diff --git a/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java b/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java index df14fe0b7..c66329397 100644 --- a/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java +++ b/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/sdk/service/ConfigServiceImpl.java @@ -93,7 +93,8 @@ public Config createConfig(final String fileId, final Action action, final Type Config config = super.createConfig(fileId, mode, type); - if (appUser.getPermissions().getSubmitForm()) { + if (!currentAction.equals(Action.view) + && appUser.getPermissions().getSubmitForm()) { config.getEditorConfig().getCustomization().setSubmitForm(true); } diff --git a/web/documentserver-example/java/src/main/java/entities/FileModel.java b/web/documentserver-example/java/src/main/java/entities/FileModel.java index f0604a33c..1819ef612 100755 --- a/web/documentserver-example/java/src/main/java/entities/FileModel.java +++ b/web/documentserver-example/java/src/main/java/entities/FileModel.java @@ -164,7 +164,9 @@ public void changeType(final String modeParam, final String typeParam, final Use } // check if the Submit form button is displayed or not - editorConfig.getCustomization().setSubmitForm(user.getId().equals("uid-1")); + if (!mode.equals("view")) { + editorConfig.getCustomization().setSubmitForm(user.getId().equals("uid-1")); + } if ((!canEdit && mode.equals("edit") || mode.equals("fillForms")) && canFill) { canEdit = true; diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index 0d5c53656..47e5998d1 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -1114,7 +1114,10 @@ app.get('/editor', (req, res) => { // define a handler for editing document mode = 'view'; } - const submitForm = userid === 'uid-1'; + let submitForm = false; + if (mode !== 'view') { + submitForm = userid === 'uid-1'; + } if (user.goback != null) { user.goback.url = `${req.DocManager.getServerUrl()}`; diff --git a/web/documentserver-example/php/src/views/DocEditorView.php b/web/documentserver-example/php/src/views/DocEditorView.php index deb28b7ad..f0cf0cf4b 100644 --- a/web/documentserver-example/php/src/views/DocEditorView.php +++ b/web/documentserver-example/php/src/views/DocEditorView.php @@ -83,7 +83,7 @@ public function __construct($request, $tempName = "docEditor") } // check if the Submit form button is displayed or not - $submitForm = $user->id == "uid-1"; + $submitForm = $editorsMode != "view" && $user->id == "uid-1"; $mode = $canEdit && $editorsMode != "view" ? "edit" : "view"; // define if the editing mode is edit or view $type = empty($request["type"]) ? "desktop" : $request["type"]; diff --git a/web/documentserver-example/python/src/views/actions.py b/web/documentserver-example/python/src/views/actions.py index fdd06f8a4..ac68f3abe 100755 --- a/web/documentserver-example/python/src/views/actions.py +++ b/web/documentserver-example/python/src/views/actions.py @@ -207,7 +207,7 @@ def edit(request): edMode = 'fillForms' canEdit = True # if the Submit form button is displayed or hidden - submitForm = user.id == 'uid-1' + submitForm = edMode != 'view' and user.id == 'uid-1' mode = 'edit' if canEdit & (edMode != 'view') else 'view' # if the file can't be edited, the mode is view types = ['desktop', 'mobile', 'embedded'] diff --git a/web/documentserver-example/ruby/app/models/file_model.rb b/web/documentserver-example/ruby/app/models/file_model.rb index 4702b5d4b..4019427fb 100755 --- a/web/documentserver-example/ruby/app/models/file_model.rb +++ b/web/documentserver-example/ruby/app/models/file_model.rb @@ -106,7 +106,7 @@ def config editors_mode = 'fillForms' can_edit = true end - submit_form = @user.id.eql?('uid-1') # Submit form button state + submit_form = !editors_mode.eql?('view') && @user.id.eql?('uid-1') # Submit form button state mode = can_edit && !editors_mode.eql?('view') ? 'edit' : 'view' # templates image url in the "From Template" section templates_image_url = DocumentHelper.get_template_image_url(document_type) From d7d31bd6b793d638d35d25a8efe0ddcc219cdc9c Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 16 Oct 2024 11:56:16 +0300 Subject: [PATCH 10/14] fix changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 479e29803..f6cec2f37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - he-IL skin language - ConvertService.ashx address replaced with converter - coauthoring/CommandService.ashx address replaced with command +- without submitForm in viewer ## 1.10.0 - nodejs: converting function on index page From decb722cf94f3c9d79bddead55b3060ac89238ba Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Sun, 20 Oct 2024 17:08:13 +0300 Subject: [PATCH 11/14] 1.11.0 --- CHANGELOG.md | 1 + web/documentserver-example/csharp-mvc/web.appsettings.config | 2 +- web/documentserver-example/csharp/settings.config | 2 +- .../java-spring/src/main/resources/application.properties | 2 +- .../java/src/main/resources/settings.properties | 2 +- web/documentserver-example/nodejs/config/default.json | 2 +- .../php/src/configuration/ConfigurationManager.php | 2 +- .../python/src/configuration/configuration.py | 2 +- .../ruby/app/configuration/configuration.rb | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6cec2f37..bb6458dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Change Log +## 1.11.0 - he-IL skin language - ConvertService.ashx address replaced with converter - coauthoring/CommandService.ashx address replaced with command diff --git a/web/documentserver-example/csharp-mvc/web.appsettings.config b/web/documentserver-example/csharp-mvc/web.appsettings.config index 89aafb428..ebd9fc210 100644 --- a/web/documentserver-example/csharp-mvc/web.appsettings.config +++ b/web/documentserver-example/csharp-mvc/web.appsettings.config @@ -1,7 +1,7 @@ - + diff --git a/web/documentserver-example/csharp/settings.config b/web/documentserver-example/csharp/settings.config index e8242d0d4..ac9e9b380 100644 --- a/web/documentserver-example/csharp/settings.config +++ b/web/documentserver-example/csharp/settings.config @@ -1,7 +1,7 @@ - + diff --git a/web/documentserver-example/java-spring/src/main/resources/application.properties b/web/documentserver-example/java-spring/src/main/resources/application.properties index de075c7dd..38624b00e 100755 --- a/web/documentserver-example/java-spring/src/main/resources/application.properties +++ b/web/documentserver-example/java-spring/src/main/resources/application.properties @@ -1,4 +1,4 @@ -server.version=1.10.0 +server.version=1.11.0 server.address= server.port=4000 diff --git a/web/documentserver-example/java/src/main/resources/settings.properties b/web/documentserver-example/java/src/main/resources/settings.properties index a14d464b3..51a890eec 100644 --- a/web/documentserver-example/java/src/main/resources/settings.properties +++ b/web/documentserver-example/java/src/main/resources/settings.properties @@ -1,4 +1,4 @@ -version=1.10.0 +version=1.11.0 filesize-max=5242880 storage-folder=app_data diff --git a/web/documentserver-example/nodejs/config/default.json b/web/documentserver-example/nodejs/config/default.json index dbe100a92..c42c270c2 100644 --- a/web/documentserver-example/nodejs/config/default.json +++ b/web/documentserver-example/nodejs/config/default.json @@ -1,5 +1,5 @@ { - "version": "1.10.0", + "version": "1.11.0", "log": { "appenders": [ { diff --git a/web/documentserver-example/php/src/configuration/ConfigurationManager.php b/web/documentserver-example/php/src/configuration/ConfigurationManager.php index 592b015ca..d2437347b 100644 --- a/web/documentserver-example/php/src/configuration/ConfigurationManager.php +++ b/web/documentserver-example/php/src/configuration/ConfigurationManager.php @@ -22,7 +22,7 @@ class ConfigurationManager { - public string $version = '1.10.0'; + public string $version = '1.11.0'; public function getVersion(): string { diff --git a/web/documentserver-example/python/src/configuration/configuration.py b/web/documentserver-example/python/src/configuration/configuration.py index cb5bf9881..c78a0fc00 100644 --- a/web/documentserver-example/python/src/configuration/configuration.py +++ b/web/documentserver-example/python/src/configuration/configuration.py @@ -22,7 +22,7 @@ class ConfigurationManager: - version = '1.10.0' + version = '1.11.0' def getVersion(self) -> str: return self.version diff --git a/web/documentserver-example/ruby/app/configuration/configuration.rb b/web/documentserver-example/ruby/app/configuration/configuration.rb index 2afca57e3..b4d442d6b 100644 --- a/web/documentserver-example/ruby/app/configuration/configuration.rb +++ b/web/documentserver-example/ruby/app/configuration/configuration.rb @@ -31,7 +31,7 @@ class ConfigurationManager sig { void } def initialize - @version = '1.10.0' + @version = '1.11.0' end sig { returns(T.nilable(URI::Generic)) } From cb8b4d1681363b15957630b71e1a92a92cf4ad35 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 21 Oct 2024 14:09:42 +0300 Subject: [PATCH 12/14] fix(nodejs): replace localhost in unsupported converted file url. Fix Bug 70551 (c4d80f6b5e13f6976a090090c210de6b5b5b03ce) --- web/documentserver-example/nodejs/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index 47e5998d1..8b9c59a0f 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -459,7 +459,7 @@ app.post('/convert', (req, res) => { // define a handler for converting files if (fileUtility.getFileType(correctName) !== null) { fileSystem.writeFileSync(req.DocManager.storagePath(correctName), data); } else { - writeResult(newFileUri.replace('http://localhost', siteUrl), result, 'FileTypeIsNotSupported'); + writeResult(newFileUri.replace('http://localhost/', siteUrl), result, 'FileTypeIsNotSupported'); return; } // remove file with the origin extension From 9f922ccdbe1e189d9795be0787f65f35d472f849 Mon Sep 17 00:00:00 2001 From: sshakndr Date: Mon, 28 Oct 2024 16:39:47 +0700 Subject: [PATCH 13/14] build: update documentserver version to 8.2 in docker-compose files --- web/documentserver-example/php/docker-compose.yml | 2 +- web/documentserver-example/python/compose-base.yml | 2 +- web/documentserver-example/ruby/compose-base.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/documentserver-example/php/docker-compose.yml b/web/documentserver-example/php/docker-compose.yml index 590bc087b..c082640a8 100644 --- a/web/documentserver-example/php/docker-compose.yml +++ b/web/documentserver-example/php/docker-compose.yml @@ -3,7 +3,7 @@ version: "3.8" services: documentserver: container_name: documentserver - image: onlyoffice/documentserver:8.0 + image: onlyoffice/documentserver:8.2 expose: - "80" environment: diff --git a/web/documentserver-example/python/compose-base.yml b/web/documentserver-example/python/compose-base.yml index 2b8e839a2..ed293c9da 100644 --- a/web/documentserver-example/python/compose-base.yml +++ b/web/documentserver-example/python/compose-base.yml @@ -3,7 +3,7 @@ version: "3.8" services: documentserver: container_name: documentserver - image: onlyoffice/documentserver:8.0 + image: onlyoffice/documentserver:8.2 expose: - "80" environment: diff --git a/web/documentserver-example/ruby/compose-base.yml b/web/documentserver-example/ruby/compose-base.yml index b0a4ba5a5..5b54f8f6c 100644 --- a/web/documentserver-example/ruby/compose-base.yml +++ b/web/documentserver-example/ruby/compose-base.yml @@ -3,7 +3,7 @@ version: "3.8" services: documentserver: container_name: documentserver - image: onlyoffice/documentserver:8.0 + image: onlyoffice/documentserver:8.2 expose: - "80" environment: From 8e260dec56457711968af30ea49bbdda37e1e959 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 8 Oct 2024 18:14:14 +0300 Subject: [PATCH 14/14] nodejs: fix lint (b36bfdec4d079cb859f2f9ccd05fdc743e4e5044) --- web/documentserver-example/nodejs/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index 8b9c59a0f..002be5203 100755 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -274,7 +274,8 @@ app.post('/upload', (req, res) => { // define a handler for uploading files req.DocManager.createDirectory(uploadDirTmp); const fileSizeLimit = configServer.get('maxFileSize'); - const form = new formidable.IncomingForm({maxFileSize: fileSizeLimit, maxTotalFileSize: fileSizeLimit }); // create a new incoming form + // create a new incoming form + const form = new formidable.IncomingForm({ maxFileSize: fileSizeLimit, maxTotalFileSize: fileSizeLimit }); form.uploadDir = uploadDirTmp; // and write there all the necessary parameters form.keepExtensions = true;