mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44ad9ad1ee | |||
| e97c8a8393 | |||
| 78fe9e02ce | |||
| 8e260dec56 | |||
| 3010db6bec | |||
| 9f922ccdbe | |||
| cb8b4d1681 | |||
| decb722cf9 | |||
| d7d31bd6b7 | |||
| e4f5f0bca7 | |||
| 8714cc3d69 | |||
| f1c5be0401 | |||
| d68860f025 | |||
| fdd90fd851 | |||
| abb7f6e893 | |||
| 89c60280ba | |||
| 8522e08670 | |||
| 52b792f3a2 | |||
| 05f7fa2b84 | |||
| 06c3dc1446 | |||
| b751d44a51 | |||
| 35cf2fb0b0 | |||
| 25ec76084f | |||
| c72218d3ae | |||
| 17458ec5b3 | |||
| c4d80f6b5e | |||
| 50bbd86cf5 | |||
| 2b0b902f9c | |||
| b36bfdec4d | |||
| 97b70cceb5 | |||
| 596d445439 | |||
| 4943adc21a | |||
| db3ccd7482 | |||
| 4c7ea51207 | |||
| 4f8f7399bb | |||
| 581f2aaef6 | |||
| 62f98954b4 | |||
| 819faf84f1 | |||
| 66cf2aca8c | |||
| 73b727ff9f | |||
| dcc5a8f56d | |||
| 14df5fcfa0 | |||
| e2e8087800 | |||
| 4c6e6dc235 | |||
| cd4ff5e045 | |||
| e25b10d618 | |||
| f00abbc9e7 | |||
| 63237f52ca |
32
.github/workflows/artifact-go.yml
vendored
Normal file
32
.github/workflows/artifact-go.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Artifact Golang
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/go/**']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/go/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/go
|
||||
mkdir -p ./deploy/'Go Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Go Example'
|
||||
rm -rf ./deploy/'Go Example'/static/assets/document-formats/.git
|
||||
rm -rf ./deploy/'Go Example'/static/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Go.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/go/deploy
|
||||
31
.github/workflows/artifact-php-laravel.yml
vendored
Normal file
31
.github/workflows/artifact-php-laravel.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: Artifact PHP Laravel
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/php-laravel/**']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/php-laravel/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/php-laravel
|
||||
mkdir -p ./deploy/'PHP Laravel Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'PHP Laravel Example'
|
||||
rm -rf ./deploy/'PHP Laravel Example'/public/assets/document-formats/.git
|
||||
rm -rf ./deploy/'PHP Laravel Example'/public/assets/document-templates/.git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: PHP-Laravel.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/php-laravel/deploy
|
||||
29
.github/workflows/lint-go.yml
vendored
Normal file
29
.github/workflows/lint-go.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Golangci
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/go/**']
|
||||
pull_request:
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/go/**']
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./web/documentserver-example/go
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Lint Golangci
|
||||
run: |
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
golangci-lint run
|
||||
4
.github/workflows/lint-java.yml
vendored
4
.github/workflows/lint-java.yml
vendored
@ -3,10 +3,10 @@ name: Lint Java
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/java/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/java/**']
|
||||
|
||||
jobs:
|
||||
|
||||
4
.github/workflows/lint-nodejs.yml
vendored
4
.github/workflows/lint-nodejs.yml
vendored
@ -3,10 +3,10 @@ name: ESLint
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/nodejs/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/nodejs/**']
|
||||
|
||||
env:
|
||||
|
||||
37
.github/workflows/lint-php-laravel.yml
vendored
Normal file
37
.github/workflows/lint-php-laravel.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Laravel Pint
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/php-laravel/**']
|
||||
pull_request:
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/php-laravel/**']
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php: [8.2]
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./web/documentserver-example/php-laravel
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: json, dom, curl, libxml, mbstring
|
||||
coverage: none
|
||||
|
||||
- name: Install Pint
|
||||
run: composer global require laravel/pint
|
||||
|
||||
- name: Run Pint
|
||||
run: pint --test
|
||||
4
.github/workflows/lint-php.yml
vendored
4
.github/workflows/lint-php.yml
vendored
@ -3,10 +3,10 @@ name: PHPCs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/php/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/php/**']
|
||||
|
||||
jobs:
|
||||
|
||||
4
.github/workflows/lint-python.yml
vendored
4
.github/workflows/lint-python.yml
vendored
@ -3,10 +3,10 @@ name: PyLint
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/python/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/python/**']
|
||||
|
||||
jobs:
|
||||
|
||||
4
.github/workflows/lint-ruby.yml
vendored
4
.github/workflows/lint-ruby.yml
vendored
@ -3,10 +3,10 @@ name: Rubocop
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/ruby/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/ruby/**']
|
||||
|
||||
jobs:
|
||||
|
||||
4
.github/workflows/lint-spring.yml
vendored
4
.github/workflows/lint-spring.yml
vendored
@ -3,10 +3,10 @@ name: Lint Spring
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
branches: [master]
|
||||
paths: ['web/documentserver-example/java-spring/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
branches: [master, develop]
|
||||
paths: ['web/documentserver-example/java-spring/**']
|
||||
|
||||
jobs:
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -2,7 +2,7 @@ name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master,main]
|
||||
branches: [master]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
16
.gitmodules
vendored
16
.gitmodules
vendored
@ -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
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
# Change Log
|
||||
|
||||
## 1.11.0
|
||||
- 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
|
||||
- java-spring: using java docs-integration-sdk
|
||||
|
||||
@ -225,7 +225,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
private static void ProcessResponseError(int errorCode)
|
||||
{
|
||||
var errorMessage = string.Empty;
|
||||
const string errorMessageTemplate = "Error occurred in the ConvertService.ashx: {0}";
|
||||
const string errorMessageTemplate = "Error occurred in the ConvertService: {0}";
|
||||
|
||||
switch (errorCode)
|
||||
{
|
||||
|
||||
@ -89,7 +89,7 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
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 = !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
|
||||
|
||||
@ -109,7 +109,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
var timer = null;
|
||||
var checkConvert = function (filePass, fileType) {
|
||||
filePass = filePass ? filePass : null;
|
||||
filePass = filePass ? filePass : null;
|
||||
if (timer != null) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.10.0"/>
|
||||
<add key="version" value="1.11.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
@ -16,14 +16,14 @@
|
||||
|
||||
<add key="files.docservice.verify-peer-off" value="true"/>
|
||||
|
||||
<add key="files.docservice.languages" value="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"/>
|
||||
<add key="files.docservice.languages" value="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"/>
|
||||
|
||||
<add key="files.docservice.url.site" value="http://documentserver/"/>
|
||||
|
||||
<add key="files.docservice.url.converter" value="ConvertService.ashx"/>
|
||||
<add key="files.docservice.url.converter" value="converter"/>
|
||||
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
|
||||
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
|
||||
<add key="files.docservice.url.command" value="coauthoring/CommandService.ashx"/>
|
||||
<add key="files.docservice.url.command" value="command"/>
|
||||
|
||||
<add key="files.docservice.url.example" value=""/>
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ namespace OnlineEditorsExample
|
||||
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 = !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();
|
||||
|
||||
@ -227,7 +227,7 @@ namespace ASC.Api.DocumentConverter
|
||||
private static void ProcessResponseError(int errorCode)
|
||||
{
|
||||
var errorMessage = string.Empty;
|
||||
const string errorMessageTemplate = "Error occurred in the ConvertService.ashx: {0}";
|
||||
const string errorMessageTemplate = "Error occurred in the ConvertService: {0}";
|
||||
|
||||
switch (errorCode)
|
||||
{
|
||||
|
||||
@ -46,6 +46,7 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
|
||||
if (FormatManager.PdfExtensions().Contains(ext)) return "pdf"; // pdf for pdf extensions
|
||||
if (FormatManager.DocumentExtensions().Contains(ext)) return "word"; // word for text document extensions
|
||||
if (FormatManager.SpreadsheetExtensions().Contains(ext)) return "cell"; // cell for spreadsheet extensions
|
||||
if (FormatManager.PresentationExtensions().Contains(ext)) return "slide"; // slide for presentation extensions
|
||||
|
||||
@ -109,7 +109,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
var timer = null;
|
||||
var checkConvert = function (filePass, fileType) {
|
||||
filePass = filePass ? filePass : null;
|
||||
filePass = filePass ? filePass : null;
|
||||
if (timer != null) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.10.0"/>
|
||||
<add key="version" value="1.11.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
@ -15,14 +15,14 @@
|
||||
|
||||
<add key="files.docservice.token.useforrequest" value="true" />
|
||||
|
||||
<add key="files.docservice.languages" value="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"/>
|
||||
<add key="files.docservice.languages" value="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"/>
|
||||
|
||||
<add key="files.docservice.url.site" value="http://documentserver/"/>
|
||||
|
||||
<add key="files.docservice.url.converter" value="ConvertService.ashx"/>
|
||||
<add key="files.docservice.url.converter" value="converter"/>
|
||||
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
|
||||
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
|
||||
<add key="files.docservice.url.command" value="coauthoring/CommandService.ashx"/>
|
||||
<add key="files.docservice.url.command" value="command"/>
|
||||
|
||||
<add key="files.docservice.url.example" value=""/>
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
<dependency>
|
||||
<groupId>com.onlyoffice</groupId>
|
||||
<artifactId>docs-integration-sdk</artifactId>
|
||||
<version>1.1.4-SNAPSHOT</version>
|
||||
<version>1.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ import com.onlyoffice.manager.security.JwtManager;
|
||||
import com.onlyoffice.manager.settings.SettingsManager;
|
||||
import com.onlyoffice.model.documenteditor.Config;
|
||||
import com.onlyoffice.model.documenteditor.config.document.Type;
|
||||
import com.onlyoffice.model.settings.SettingsConstants;
|
||||
import lombok.SneakyThrows;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -89,8 +88,6 @@ public class EditorController {
|
||||
@RequestParam(value = "action", required = false) final String actionParam,
|
||||
@RequestParam(value = "type", required = false) final String typeParam,
|
||||
@RequestParam(value = "actionLink", required = false) final String actionLink,
|
||||
@RequestParam(value = "directUrl", required = false,
|
||||
defaultValue = "false") final Boolean directUrl,
|
||||
@CookieValue(value = "uid") final String uid,
|
||||
@CookieValue(value = "ulang") final String lang,
|
||||
final Model model) throws JsonProcessingException {
|
||||
@ -105,8 +102,6 @@ public class EditorController {
|
||||
type = Type.valueOf(typeParam.toUpperCase());
|
||||
}
|
||||
|
||||
settingsManager.setSetting(SettingsConstants.DIRECT_URL, String.valueOf(directUrl));
|
||||
|
||||
List<String> langsAndKeys = Arrays.asList(langs.split("\\|"));
|
||||
for (String langAndKey : langsAndKeys) {
|
||||
String[] couple = langAndKey.split(":");
|
||||
@ -144,13 +139,13 @@ public class EditorController {
|
||||
model.addAttribute("docserviceApiUrl", urlManager.getDocumentServerApiUrl());
|
||||
|
||||
// get an image and add it to the model
|
||||
model.addAttribute("dataInsertImage", getInsertImage(directUrl));
|
||||
model.addAttribute("dataInsertImage", getInsertImage());
|
||||
|
||||
// get a document for comparison and add it to the model
|
||||
model.addAttribute("dataDocument", getCompareFile(directUrl));
|
||||
model.addAttribute("dataDocument", getCompareFile());
|
||||
|
||||
// get recipients data for mail merging and add it to the model
|
||||
model.addAttribute("dataSpreadsheet", getSpreadsheet(directUrl));
|
||||
model.addAttribute("dataSpreadsheet", getSpreadsheet());
|
||||
|
||||
// get user data for mentions and add it to the model
|
||||
model.addAttribute("usersForMentions", getUserMentions(uid));
|
||||
@ -210,14 +205,10 @@ public class EditorController {
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
private String getInsertImage(final Boolean directUrl) { // get an image that will be inserted into the document
|
||||
private String getInsertImage() { // get an image that will be inserted into the document
|
||||
Map<String, Object> dataInsertImage = new HashMap<>();
|
||||
dataInsertImage.put("fileType", "svg");
|
||||
dataInsertImage.put("url", storagePathBuilder.getServerUrl(true) + "/css/img/logo.svg");
|
||||
if (directUrl) {
|
||||
dataInsertImage.put("directUrl", storagePathBuilder
|
||||
.getServerUrl(false) + "/css/img/logo.svg");
|
||||
}
|
||||
|
||||
// check if the document token is enabled
|
||||
if (settingsManager.isSecurityEnabled()) {
|
||||
@ -232,14 +223,10 @@ public class EditorController {
|
||||
|
||||
// get a document that will be compared with the current document
|
||||
@SneakyThrows
|
||||
private String getCompareFile(final Boolean directUrl) {
|
||||
private String getCompareFile() {
|
||||
Map<String, Object> dataDocument = new HashMap<>();
|
||||
dataDocument.put("fileType", "docx");
|
||||
dataDocument.put("url", storagePathBuilder.getServerUrl(true) + "/assets?name=sample.docx");
|
||||
if (directUrl) {
|
||||
dataDocument.put("directUrl", storagePathBuilder
|
||||
.getServerUrl(false) + "/assets?name=sample.docx");
|
||||
}
|
||||
|
||||
// check if the document token is enabled
|
||||
if (settingsManager.isSecurityEnabled()) {
|
||||
@ -252,13 +239,10 @@ public class EditorController {
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private String getSpreadsheet(final Boolean directUrl) {
|
||||
private String getSpreadsheet() {
|
||||
Map<String, Object> dataSpreadsheet = new HashMap<>(); // get recipients data for mail merging
|
||||
dataSpreadsheet.put("fileType", "csv");
|
||||
dataSpreadsheet.put("url", storagePathBuilder.getServerUrl(true) + "/csv");
|
||||
if (directUrl) {
|
||||
dataSpreadsheet.put("directUrl", storagePathBuilder.getServerUrl(false) + "/csv");
|
||||
}
|
||||
|
||||
// check if the document token is enabled
|
||||
if (settingsManager.isSecurityEnabled()) {
|
||||
|
||||
@ -436,8 +436,11 @@ public class FileController {
|
||||
|
||||
callbackService.processCallback(callback, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return e.getMessage();
|
||||
String message = e.getMessage();
|
||||
if (!message.contains("\"error\":1")) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
return "{\"error\":\"0\"}";
|
||||
@ -525,7 +528,6 @@ public class FileController {
|
||||
if (!link.contains(storagePathBuilder.getServerUrl(true))) {
|
||||
HashMap<String, String> data = new HashMap<>();
|
||||
data.put("url", link);
|
||||
data.put("directUrl", link);
|
||||
return gson.toJson(data);
|
||||
}
|
||||
|
||||
@ -571,7 +573,6 @@ public class FileController {
|
||||
+ new File(storagePathBuilder.getFileLocation(fileName)).lastModified()
|
||||
));
|
||||
data.put("url", urlManager.getFileUrl(fileName));
|
||||
data.put("directUrl", body.getDirectUrl() ? urlManager.getDirectFileUrl(fileName) : null);
|
||||
data.put("referenceData", referenceData);
|
||||
data.put("path", fileName);
|
||||
data.put("link", storagePathBuilder.getServerUrl(true) + "/editor?fileName=" + fileName);
|
||||
@ -596,9 +597,8 @@ public class FileController {
|
||||
@GetMapping("/historydata")
|
||||
@ResponseBody
|
||||
public String history(@RequestParam("fileName") final String fileName,
|
||||
@RequestParam("version") final String version,
|
||||
@RequestParam(value = "directUrl", defaultValue = "false") final Boolean directUrl) {
|
||||
return historyManager.getHistoryData(fileName, version, directUrl);
|
||||
@RequestParam("version") final String version) {
|
||||
return historyManager.getHistoryData(fileName, version);
|
||||
}
|
||||
|
||||
@PutMapping("/restore")
|
||||
|
||||
@ -33,7 +33,6 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
@ -83,8 +82,7 @@ public class IndexController {
|
||||
private String enableForgotten;
|
||||
|
||||
@GetMapping("${url.index}")
|
||||
public String index(@RequestParam(value = "directUrl", required = false) final Boolean directUrl,
|
||||
final Model model) {
|
||||
public String index(final Model model) {
|
||||
java.io.File[] files = storageMutator.getStoredFiles(); // get all the stored files from the storage
|
||||
List<String> docTypes = new ArrayList<>();
|
||||
List<Boolean> filesEditable = new ArrayList<>();
|
||||
@ -128,7 +126,6 @@ public class IndexController {
|
||||
model.addAttribute("tooltip", tooltip);
|
||||
model.addAttribute("users", users);
|
||||
model.addAttribute("languages", languages);
|
||||
model.addAttribute("directUrl", directUrl);
|
||||
model.addAttribute("serverVersion", serverVersion);
|
||||
model.addAttribute("enableForgotten", Boolean.valueOf(enableForgotten));
|
||||
|
||||
|
||||
@ -135,6 +135,11 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
|
||||
String curExt = documentManager.getExtension(fileName); // get current file extension
|
||||
String downloadExt = callback.getFiletype(); // get an extension of the downloaded file
|
||||
String storagePath = storagePathBuilder.getFileLocation(newFileName); // get the path to a new file
|
||||
|
||||
if (!Paths.get(storagePath).toFile().exists()) {
|
||||
throw new RuntimeException("{\"error\":1, \"message\":\"file does not exist\"}");
|
||||
}
|
||||
|
||||
downloadUri = urlManager.replaceToInnerDocumentServerUrl(downloadUri);
|
||||
changesUri = urlManager.replaceToInnerDocumentServerUrl(changesUri);
|
||||
@ -170,7 +175,6 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
|
||||
byte[] byteArrayFile = getDownloadFile(downloadUri); // download document file
|
||||
|
||||
String storagePath = storagePathBuilder.getFileLocation(newFileName); // get the path to a new file
|
||||
Path lastVersion = Paths.get(storagePathBuilder
|
||||
.getFileLocation(fileName)); // get the path to the last file version
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ public class DefaultHistoryManager implements HistoryManager {
|
||||
|
||||
// todo: Refactoring
|
||||
@SneakyThrows
|
||||
public String getHistoryData(final String fileName, final String version, final Boolean directUrl) {
|
||||
public String getHistoryData(final String fileName, final String version) {
|
||||
// get history directory
|
||||
String histDir = storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(fileName));
|
||||
Integer curVer = storagePathBuilder.getFileVersion(histDir, false); // get current file version
|
||||
@ -175,13 +175,6 @@ public class DefaultHistoryManager implements HistoryManager {
|
||||
.getExtension(fileName), true))
|
||||
.build();
|
||||
|
||||
if (directUrl) {
|
||||
historyData.setDirectUrl(i == curVer
|
||||
? urlManager.getDirectFileUrl(fileName)
|
||||
: urlManager.getHistoryFileUrl(fileName, i, "prev" + documentManager
|
||||
.getExtension(fileName), false)
|
||||
);
|
||||
}
|
||||
historyData.setVersion(String.valueOf(i));
|
||||
|
||||
if (i > 1) { //check if the version number is greater than 1
|
||||
@ -193,9 +186,6 @@ public class DefaultHistoryManager implements HistoryManager {
|
||||
.key(historyDataPrev.getKey())
|
||||
.url(historyDataPrev.getUrl())
|
||||
.build();
|
||||
if (directUrl) {
|
||||
previous.setDirectUrl(historyDataPrev.getDirectUrl());
|
||||
}
|
||||
|
||||
// write information about previous file version to the data object
|
||||
historyData.setPrevious(previous);
|
||||
|
||||
@ -21,6 +21,6 @@ package com.onlyoffice.integration.documentserver.managers.history;
|
||||
// specify the history manager functions
|
||||
public interface HistoryManager {
|
||||
String getHistory(String fileName); // get document history
|
||||
String getHistoryData(String fileName, String version, Boolean directUrl); // get document history data
|
||||
String getHistoryData(String fileName, String version); // get document history data
|
||||
String versionDir(String path, Integer version, boolean historyPath);
|
||||
}
|
||||
|
||||
@ -31,7 +31,6 @@ import lombok.Setter;
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Reference {
|
||||
private Boolean directUrl;
|
||||
private ReferenceData referenceData;
|
||||
private String path;
|
||||
private String link;
|
||||
|
||||
@ -55,11 +55,6 @@ public class UrlManagerImpl extends DefaultUrlManager implements UrlManager {
|
||||
return getDownloadUrl(fileId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDirectFileUrl(final String fileId) {
|
||||
return getDownloadUrl(fileId, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateUrl(final String fileId) {
|
||||
return getCreateUrl(fileId, false);
|
||||
|
||||
@ -93,7 +93,7 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
|
||||
|
||||
Config config = super.createConfig(fileId, mode, type);
|
||||
|
||||
if ((currentAction.equals(Action.fillForms) || currentAction.equals(Action.embedded))
|
||||
if (!currentAction.equals(Action.view)
|
||||
&& appUser.getPermissions().getSubmitForm()) {
|
||||
config.getEditorConfig().getCustomization().setSubmitForm(true);
|
||||
}
|
||||
@ -276,7 +276,7 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
|
||||
|
||||
@Override
|
||||
public Embedded getEmbedded(final String fileId) {
|
||||
String url = getUrlManager().getDirectFileUrl(fileId);
|
||||
String url = getUrlManager().getFileUrl(fileId);
|
||||
|
||||
return Embedded.builder()
|
||||
.embedUrl(url)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
server.version=1.10.0
|
||||
server.version=1.11.0
|
||||
|
||||
server.address=
|
||||
server.port=4000
|
||||
@ -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
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
var directUrl;
|
||||
var formatManager;
|
||||
|
||||
window.onload = function () {
|
||||
@ -42,19 +41,8 @@ window.onload = function () {
|
||||
if (typeof jQuery !== "undefined") {
|
||||
jq = jQuery.noConflict();
|
||||
|
||||
directUrl = getUrlVars()["directUrl"] == "true";
|
||||
|
||||
mustReload = false;
|
||||
|
||||
if (directUrl)
|
||||
jq("#directUrl").prop("checked", directUrl);
|
||||
else
|
||||
directUrl = jq("#directUrl").prop("checked");
|
||||
|
||||
jq("#directUrl").change(function() {
|
||||
window.location = "?directUrl=" + jq(this).prop("checked");
|
||||
});
|
||||
|
||||
jq(function () {
|
||||
jq("#fileupload").fileupload({
|
||||
dataType: "json",
|
||||
@ -272,7 +260,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
|
||||
var url = UrlEditor + "?action=edit&fileName=" + fileId + "&directUrl=" + directUrl;
|
||||
var url = UrlEditor + "?action=edit&fileName=" + fileId;
|
||||
window.open(url, "_blank");
|
||||
jq("#hiddenFileName").val("");
|
||||
jq.unblockUI();
|
||||
@ -280,7 +268,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
jq(document).on("click", "#beginView:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
|
||||
var url = UrlEditor + "?action=view&fileName=" + fileId + "&directUrl=" + directUrl;
|
||||
var url = UrlEditor + "?action=view&fileName=" + fileId;
|
||||
window.open(url, "_blank");
|
||||
jq("#hiddenFileName").val("");
|
||||
jq.unblockUI();
|
||||
@ -288,7 +276,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
jq(document).on("click", "#beginEmbedded:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
|
||||
var url = UrlEditor + "?type=embedded&action=embedded&fileName=" + fileId + "&directUrl=" + directUrl;
|
||||
var url = UrlEditor + "?type=embedded&action=embedded&fileName=" + fileId;
|
||||
|
||||
jq("#mainProgress").addClass("embedded");
|
||||
jq("#beginEmbedded").addClass("disable");
|
||||
|
||||
@ -194,8 +194,6 @@
|
||||
var requestReference = function(data, callback) {
|
||||
innerAlert(data);
|
||||
|
||||
data.directUrl = !!config.document.directUrl;
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "reference");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
@ -220,8 +218,7 @@
|
||||
var onRequestHistoryData = function (event) {
|
||||
var version = event.data;
|
||||
var historyDataUri = "historydata?fileName=" + config.document.title
|
||||
+ "&version=" + version
|
||||
+ "&directUrl=" + !!config.document.directUrl;
|
||||
+ "&version=" + version;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", historyDataUri, false);
|
||||
xhr.send();
|
||||
|
||||
@ -109,14 +109,6 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="middle">
|
||||
<label class="side-option">
|
||||
<input id="directUrl" type="checkbox" class="checkbox" />Try opening on client
|
||||
<img id="directUrlInfo" class="info info-tooltip" data-id="directUrlInfo" data-tooltip="Some files can be opened in the user's browser without connecting to the document server." src="css/img/info.svg" />
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -173,52 +165,51 @@
|
||||
<tr th:each="file,iState : ${files}" class="tableRow" th:title="${files[iState.index].getName() + versions[iState.index]}">
|
||||
<td class="contentCells">
|
||||
<a class="stored-edit" th:classappend="${docTypes[iState.index]}"
|
||||
th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()}, __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()})}" target="_blank">
|
||||
<span th:text="${files[iState.index].getName()}"></span>
|
||||
</a>
|
||||
</td>
|
||||
<th:block th:if="${filesEditable[iState.index]}">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='edit', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='edit')}" target="_blank">
|
||||
<img src="css/img/desktop.svg" alt="Open in editor for full size screens" title="Open in editor for full size screens"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='edit', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='edit')}" target="_blank">
|
||||
<img src="css/img/mobile.svg" alt="Open in editor for mobile devices" title="Open in editor for mobile devices"/>
|
||||
</a>
|
||||
</td>
|
||||
<div th:if="not ${docTypes[iState.index]} eq 'pdf'">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='comment', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='comment')}" target="_blank">
|
||||
<img src="css/img/comment.svg" alt="Open in editor for comment" title="Open in editor for comment"/>
|
||||
</a>
|
||||
</td>
|
||||
</div>
|
||||
<div th:if="${docTypes[iState.index]} eq 'word'">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='review', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='review')}" target="_blank">
|
||||
<img src="css/img/review.svg" alt="Open in editor for review" title="Open in editor for review"/>
|
||||
</a>
|
||||
</td>
|
||||
</div>
|
||||
<div th:if="${docTypes[iState.index]} eq 'cell'">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='filter', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='filter')}" target="_blank">
|
||||
<img src="css/img/filter.svg" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" />
|
||||
</a>
|
||||
</td>
|
||||
</div>
|
||||
<div th:if="${docTypes[iState.index]} eq 'word'">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='blockcontent', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='blockcontent')}" target="_blank">
|
||||
<img src="css/img/block-content.svg" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
|
||||
</a>
|
||||
</td>
|
||||
@ -231,8 +222,8 @@
|
||||
</div>
|
||||
<div th:if="${isFillFormDoc[iState.index]}">
|
||||
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms')}" target="_blank">
|
||||
<img src="css/img/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
|
||||
</a>
|
||||
</td>
|
||||
@ -244,8 +235,8 @@
|
||||
<th:block th:if="${isFillFormDoc[iState.index] and not filesEditable[iState.index]}">
|
||||
<td class="contentCells contentCells-icon "></td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='fillForms', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='fillForms')}" target="_blank">
|
||||
<img src="css/img/mobile-fill-forms.svg" alt="Open in editor for filling in forms for mobile devices" title="Open in editor for filling in forms for mobile devices" />
|
||||
</a>
|
||||
</td>
|
||||
@ -253,8 +244,8 @@
|
||||
<td class="contentCells contentCells-icon "></td>
|
||||
<td class="contentCells contentCells-icon "></td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms')}" target="_blank">
|
||||
<img src="css/img/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
|
||||
</a>
|
||||
</td>
|
||||
@ -263,20 +254,20 @@
|
||||
<td class="contentCells contentCells-shift contentCells-icon contentCellsEmpty" colspan="6"></td>
|
||||
</th:block>
|
||||
<td class="contentCells contentCells-icon firstContentCellViewers">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='view', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='view')}" target="_blank">
|
||||
<img src="css/img/desktop.svg" alt="Open in viewer for full size screens" title="Open in viewer for full size screens"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='view', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='view')}" target="_blank">
|
||||
<img src="css/img/mobile.svg" alt="Open in viewer for mobile devices" title="Open in viewer for mobile devices"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon contentCells-shift">
|
||||
<a th:with="directUrl=${directUrl}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='embedded',action='embedded', __(${#strings.isEmpty(directUrl)} ? '' : ('directUrl=' + ${directUrl}))__)}" target="_blank">
|
||||
<a
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()},type='embedded',action='embedded')}" target="_blank">
|
||||
<img src="css/img/embeded.svg" alt="Open in embedded mode" title="Open in embedded mode"/>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@ -164,7 +164,7 @@ public class FileModel {
|
||||
}
|
||||
|
||||
// check if the Submit form button is displayed or not
|
||||
if (mode.equals("fillForms") || mode.equals("embedded")) {
|
||||
if (!mode.equals("view")) {
|
||||
editorConfig.getCustomization().setSubmitForm(user.getId().equals("uid-1"));
|
||||
}
|
||||
|
||||
|
||||
@ -192,8 +192,12 @@ public final class TrackManager {
|
||||
ver.mkdirs();
|
||||
}
|
||||
|
||||
// get the path to the previous file version and rename the last file version with it
|
||||
lastVersion.renameTo(new File(versionDir + File.separator + "prev." + curExt));
|
||||
if (lastVersion.exists()) {
|
||||
// get the path to the previous file version and rename the last file version with it
|
||||
lastVersion.renameTo(new File(versionDir + File.separator + "prev." + curExt));
|
||||
} else {
|
||||
throw new Exception("The file not exist: " + lastVersion.getAbsolutePath());
|
||||
}
|
||||
|
||||
saveFile(byteArrayFile, toSave); // save document file
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ public final class Users {
|
||||
"group-2", Arrays.asList("group-2", ""), new CommentGroups(null,
|
||||
Arrays.asList("group-2", ""), Arrays.asList("group-2")), Arrays.asList("group-2", ""),
|
||||
true, new ArrayList<String>(), descriptionUserSecond, false, true,
|
||||
new Goback("Go to Documents", null)));
|
||||
new Goback("Go to Documents", false)));
|
||||
add(new User("uid-3", "Hamish Mitchell", null,
|
||||
"group-3", Arrays.asList("group-2"), new CommentGroups(Arrays.asList("group-3", "group-2"),
|
||||
Arrays.asList("group-2"), null), Arrays.asList("group-2"),
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version=1.10.0
|
||||
version=1.11.0
|
||||
|
||||
filesize-max=5242880
|
||||
storage-folder=app_data
|
||||
@ -8,13 +8,13 @@ enable-forgotten=TRUE
|
||||
files.docservice.timeout=120000
|
||||
|
||||
files.docservice.url.site=http://documentserver/
|
||||
files.docservice.url.converter=ConvertService.ashx
|
||||
files.docservice.url.command=coauthoring/CommandService.ashx
|
||||
files.docservice.url.converter=converter
|
||||
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=
|
||||
|
||||
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
|
||||
|
||||
@ -273,7 +273,9 @@ 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');
|
||||
// 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;
|
||||
|
||||
@ -298,7 +300,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"}');
|
||||
@ -458,7 +460,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, result, 'FileTypeIsNotSupported');
|
||||
writeResult(newFileUri.replace('http://localhost/', siteUrl), result, 'FileTypeIsNotSupported');
|
||||
return;
|
||||
}
|
||||
// remove file with the origin extension
|
||||
@ -1101,14 +1103,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;
|
||||
}
|
||||
@ -1117,7 +1116,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
|
||||
}
|
||||
|
||||
let submitForm = false;
|
||||
if (mode === 'fillForms' || mode === 'embedded') {
|
||||
if (mode !== 'view') {
|
||||
submitForm = userid === 'uid-1';
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.10.0",
|
||||
"version": "1.11.0",
|
||||
"log": {
|
||||
"appenders": [
|
||||
{
|
||||
@ -17,8 +17,8 @@
|
||||
"wopi": {
|
||||
"discovery": "hosting/discovery"
|
||||
},
|
||||
"commandUrl": "coauthoring/CommandService.ashx",
|
||||
"converterUrl": "ConvertService.ashx",
|
||||
"commandUrl": "command",
|
||||
"converterUrl": "converter",
|
||||
"apiUrl": "web-apps/apps/api/documents/api.js",
|
||||
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html",
|
||||
"exampleUrl": null,
|
||||
@ -58,6 +58,7 @@
|
||||
"gl": "Galego",
|
||||
"de": "German",
|
||||
"el": "Greek",
|
||||
"he-IL": "Hebrew (Israel)",
|
||||
"hu": "Hungarian",
|
||||
"id": "Indonesian",
|
||||
"it": "Italian",
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="wopi">Wopi</a>
|
||||
<a href="wopi">WOPI</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="forgotten">Forgotten files</a>
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="wopi">Wopi</a>
|
||||
<a href="wopi">WOPI</a>
|
||||
</li>
|
||||
<% if (enableForgotten) { %>
|
||||
<li>
|
||||
@ -196,14 +196,10 @@
|
||||
<a class="action-link" href="editor?type=desktop&mode=edit&fileName=<%= encodeURIComponent(storedFiles[i].name) %>" target="_blank">
|
||||
<img src="images/desktop.svg" alt="Open in editor for full size screens" title="Open in editor for full size screens" /></a>
|
||||
</td>
|
||||
<% if (storedFiles[i].documentType !== "pdf") { %>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a class="action-link" href="editor?type=desktop&mode=comment&fileName=<%= encodeURIComponent(storedFiles[i].name) %>" target="_blank">
|
||||
<img src="images/comment.svg" alt="Open in editor for comment" title="Open in editor for comment" /></a>
|
||||
</td>
|
||||
<% } else { %>
|
||||
<td class="contentCells contentCells-icon"></td>
|
||||
<% } %>
|
||||
<% if (storedFiles[i].documentType == "word") { %>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a class="action-link" href="editor?type=desktop&mode=review&fileName=<%= encodeURIComponent(storedFiles[i].name) %>" target="_blank">
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="wopi">Wopi</a>
|
||||
<a href="wopi">WOPI</a>
|
||||
</li>
|
||||
<% if (enableForgotten) { %>
|
||||
<li>
|
||||
|
||||
Submodule web/documentserver-example/php/assets/document-templates updated: c586c81c72...53e2d9e0af
@ -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:
|
||||
|
||||
@ -61,7 +61,7 @@ function saveas()
|
||||
$formatManager = new FormatManager();
|
||||
|
||||
$post = json_decode(file_get_contents('php://input'), true);
|
||||
$fileurl = $post["url"];
|
||||
$fileurl = str_replace("//localhost", "//proxy", $post["url"]);
|
||||
$title = $post["title"];
|
||||
$extension = mb_strtolower(pathinfo($title, PATHINFO_EXTENSION));
|
||||
$allexts = $formatManager->allExtensions();
|
||||
|
||||
@ -22,7 +22,7 @@ use Example\Common\URL;
|
||||
|
||||
class ConfigurationManager
|
||||
{
|
||||
public string $version = '1.10.0';
|
||||
public string $version = '1.11.0';
|
||||
|
||||
public function getVersion(): string
|
||||
{
|
||||
@ -73,7 +73,7 @@ class ConfigurationManager
|
||||
{
|
||||
$serverURL = $this->documentServerPrivateURL();
|
||||
$path = getenv('DOCUMENT_SERVER_COMMAND_PATH')
|
||||
?: 'coauthoring/CommandService.ashx';
|
||||
?: 'command';
|
||||
return $serverURL->joinPath($path);
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ class ConfigurationManager
|
||||
{
|
||||
$serverURL = $this->documentServerPrivateURL();
|
||||
$path = getenv('DOCUMENT_SERVER_CONVERTER_PATH')
|
||||
?: 'ConvertService.ashx';
|
||||
?: 'converter';
|
||||
return $serverURL->joinPath($path);
|
||||
}
|
||||
|
||||
@ -188,6 +188,7 @@ class ConfigurationManager
|
||||
'gl' => 'Galego',
|
||||
'de' => 'German',
|
||||
'el' => 'Greek',
|
||||
'he-IL' => 'Hebrew (Israel)',
|
||||
'hu' => 'Hungarian',
|
||||
'id' => 'Indonesian',
|
||||
'it' => 'Italian',
|
||||
|
||||
@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerCommandURLTests extends TestCase
|
||||
$configManager = new ConfigurationManager();
|
||||
$url = $configManager->documentServerCommandURL();
|
||||
$this->assertEquals(
|
||||
'http://documentserver/coauthoring/CommandService.ashx',
|
||||
'http://documentserver/command',
|
||||
$url->string()
|
||||
);
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerConverterURLTests extends TestCase
|
||||
$configManager = new ConfigurationManager();
|
||||
$url = $configManager->documentServerConverterURL();
|
||||
$this->assertEquals(
|
||||
'http://documentserver/ConvertService.ashx',
|
||||
'http://documentserver/converter',
|
||||
$url->string()
|
||||
);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ final class DocEditorView extends View
|
||||
}
|
||||
|
||||
// check if the Submit form button is displayed or not
|
||||
$submitForm = in_array($editorsMode, ["fillForms", "embedded"]) && $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"];
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -22,7 +22,7 @@ from src.common import string
|
||||
|
||||
|
||||
class ConfigurationManager:
|
||||
version = '1.10.0'
|
||||
version = '1.11.0'
|
||||
|
||||
def getVersion(self) -> str:
|
||||
return self.version
|
||||
@ -71,7 +71,7 @@ class ConfigurationManager:
|
||||
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)
|
||||
@ -81,7 +81,7 @@ class ConfigurationManager:
|
||||
base_url = server_url.geturl()
|
||||
path = (
|
||||
environ.get('DOCUMENT_SERVER_CONVERTER_PATH') or
|
||||
'/ConvertService.ashx'
|
||||
'/converter'
|
||||
)
|
||||
url = urljoin(base_url, path)
|
||||
return urlparse(url)
|
||||
@ -145,6 +145,7 @@ class ConfigurationManager:
|
||||
'gl': 'Galego',
|
||||
'de': 'German',
|
||||
'el': 'Greek',
|
||||
'he-IL': 'Hebrew (Israel)',
|
||||
'hu': 'Hungarian',
|
||||
'id': 'Indonesian',
|
||||
'it': 'Italian',
|
||||
|
||||
@ -145,7 +145,7 @@ class ConfigurationManagerDocumentServerCommandURLTests(TestCase):
|
||||
url = config_manager.document_server_command_url()
|
||||
self.assertEqual(
|
||||
url.geturl(),
|
||||
'http://localhost/coauthoring/CommandService.ashx'
|
||||
'http://localhost/command'
|
||||
)
|
||||
|
||||
@patch.object(
|
||||
@ -176,7 +176,7 @@ class ConfigurationManagerDocumentServerConverterURLTests(TestCase):
|
||||
url = config_manager.document_server_converter_url()
|
||||
self.assertEqual(
|
||||
url.geturl(),
|
||||
'http://localhost/ConvertService.ashx'
|
||||
'http://localhost/converter'
|
||||
)
|
||||
|
||||
@patch.object(
|
||||
|
||||
@ -203,7 +203,7 @@ def commandRequest(method, key, meta=None):
|
||||
verify=config_manager.ssl_verify_peer_mode_enabled(), timeout=5)
|
||||
|
||||
error = response.json()["error"]
|
||||
if not error == 0:
|
||||
if error not in (4, 0):
|
||||
raise Exception(f"Command Service Error #{error}")
|
||||
|
||||
return response
|
||||
|
||||
@ -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 = 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']
|
||||
|
||||
@ -51,7 +51,7 @@ def getForgottenFiles():
|
||||
private_url = config_manager.document_server_private_url().geturl()
|
||||
public_url = config_manager.document_server_public_url().geturl()
|
||||
if private_url in file["url"]:
|
||||
file["url"] = file["url"].replace(private_url, public_url)
|
||||
file["url"] = file["url"].replace(private_url, public_url)
|
||||
files.append(file)
|
||||
except (Exception, ValueError) as error:
|
||||
logging.error(error)
|
||||
|
||||
@ -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)) }
|
||||
@ -76,7 +76,7 @@ class ConfigurationManager
|
||||
def document_server_command_uri
|
||||
path =
|
||||
ENV['DOCUMENT_SERVER_COMMAND_PATH'] ||
|
||||
'/coauthoring/CommandService.ashx'
|
||||
'/command'
|
||||
URI.join(document_server_private_uri, path)
|
||||
end
|
||||
|
||||
@ -84,7 +84,7 @@ class ConfigurationManager
|
||||
def document_server_converter_uri
|
||||
path =
|
||||
ENV['DOCUMENT_SERVER_CONVERTER_PATH'] ||
|
||||
'/ConvertService.ashx'
|
||||
'/converter'
|
||||
URI.join(document_server_private_uri, path)
|
||||
end
|
||||
|
||||
@ -168,6 +168,7 @@ class ConfigurationManager
|
||||
gl: 'Galego',
|
||||
de: 'German',
|
||||
el: 'Greek',
|
||||
'he-IL': 'Hebrew (Israel)',
|
||||
hu: 'Hungarian',
|
||||
id: 'Indonesian',
|
||||
it: 'Italian',
|
||||
|
||||
@ -151,7 +151,7 @@ class ConfigurationManagerDocumentServerCommandURITests < Test::Unit::TestCase
|
||||
uri = config_manager.document_server_command_uri
|
||||
assert_equal(
|
||||
uri.to_s,
|
||||
'http://documentserver/coauthoring/CommandService.ashx'
|
||||
'http://documentserver/command'
|
||||
)
|
||||
end
|
||||
|
||||
@ -175,7 +175,7 @@ class ConfigurationManagerDocumentServerConverterURITests < Test::Unit::TestCase
|
||||
uri = config_manager.document_server_converter_uri
|
||||
assert_equal(
|
||||
uri.to_s,
|
||||
'http://documentserver/ConvertService.ashx'
|
||||
'http://documentserver/converter'
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ class FileModel
|
||||
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 = !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)
|
||||
|
||||
@ -109,23 +109,23 @@ class ServiceConverter
|
||||
# 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
|
||||
|
||||
@ -314,7 +314,7 @@ class TrackHelper
|
||||
res = http.request(req) # get the response
|
||||
data = res.body # and take its body
|
||||
result = JSON.parse(data) # convert the response body into the json format
|
||||
raise("Command service error: #{result['error']}") if result['error'] != 0
|
||||
raise("Command service error: #{result['error']}") if [4, 0].exclude?(result['error'])
|
||||
rescue StandardError => e
|
||||
raise(e.message)
|
||||
end
|
||||
|
||||
Submodule web/documentserver-example/ruby/assets/document-templates updated: c586c81c72...53e2d9e0af
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user