Compare commits

...

352 Commits

Author SHA1 Message Date
05b4e9d63d Merge pull request 'nodejs-fileslist-fix' from nodejs-fileslist-fix into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/21
2024-12-11 13:41:47 +00:00
c6e73540ac Merge branch 'feature/vsdx' into develop (For Bug 72011) 2024-12-11 16:26:45 +03:00
eb31cabed5 nodejs: support vssx, vstx, vsdm, vssm, vstm in ds visio v8.3 2024-12-11 16:24:38 +03:00
135d17e7cc fix(nodejs): files list responsive width. Fix Bug 71949 2024-12-11 13:42:58 +07:00
ae21e7c6ca fix(nodejs): files list height. Fix Bug 71461 2024-12-11 13:42:50 +07:00
945402cede Merge branch 'feature/refresh-file' into develop 2024-12-09 12:08:40 +03:00
6051bbeb6d nodejs: onRequestRefreshFile not for anonymous 2024-12-09 12:08:28 +03:00
465d90e518 Merge pull request 'feature/refresh-file' from feature/refresh-file into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/20
2024-12-05 11:40:54 +00:00
05adfca5e0 nodejs: current permissions to refreshFile 2024-12-05 14:39:28 +03:00
0e627ad8fd nodejs: refresh file config 2024-12-05 14:39:21 +03:00
5dba1fa5ee changelog reorder 2024-12-05 11:27:12 +03:00
8940f71501 Merge pull request 'build(ruby): bump rails-html-sanitizer from 1.6.0 to 1.6.1' from bump-rails-html-sanitizer into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/19
2024-12-04 09:10:41 +00:00
c1d98d9df9 build(ruby): bump rails-html-sanitizer from 1.6.0 to 1.6.1 2024-12-04 15:16:35 +07:00
fa1c7eea2d Merge branch 'feature/8.3' into develop 2024-11-29 14:48:28 +03:00
186d7df2d3 nodejs: support vsdx in visio editor 2024-11-29 14:47:22 +03:00
d090ac039b nodejs: support pages, numbers, key formats 2024-11-29 14:46:17 +03:00
3186245cc8 update file type icons 2024-11-26 17:19:28 +03:00
6f7927c894 fix(nodejs): list of files is hidden behind the footer 2024-11-26 13:29:51 +07:00
b7b4e36367 Merge pull request 'Only available formats for forced conversion' from force-conversion-correct-formats into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/18
2024-11-21 14:08:29 +00:00
524bd4951a xml with -9 to changelog 2024-11-21 17:07:46 +03:00
9a189b06ee Merge remote-tracking branch 'remotes/origin/develop' into force-conversion-correct-formats 2024-11-21 17:05:25 +03:00
89d7145eec Merge pull request 'feature/convert-button' from feature/convert-button into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/15
Reviewed-by: serik.kerimbayevich <serik.kerimbayevich@onlyoffice.com>
2024-11-21 13:52:33 +00:00
983ba4ff30 converting to changelog 2024-11-21 16:45:38 +03:00
cd4afd7131 Merge remote-tracking branch 'remotes/origin/develop' into feature/convert-button 2024-11-21 16:44:25 +03:00
4dc13cc102 update file type icons 2024-11-21 16:25:30 +03:00
5d291649ed Merge remote-tracking branch 'remotes/origin/master' into develop
# Conflicts:
#	.github/workflows/lint-go.yml
2024-11-21 13:27:37 +03:00
44ad9ad1ee master branch only 2024-11-21 13:26:00 +03:00
e97c8a8393 actions for go 2024-11-21 13:23:19 +03:00
829e1cc234 go: readme 2024-11-21 13:19:03 +03:00
34ec3a994a copyright 2024 2024-11-21 13:18:43 +03:00
02adb6cdca copyright to forgotten 2024-11-21 13:14:37 +03:00
48a15fba8b go: license files 2024-11-21 13:06:25 +03:00
8765bd9504 Merge pull request 'feature/go-lang' from feature/go-lang into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/17
2024-11-21 09:11:42 +00:00
28a26f001a fix(php): public url for unsupported converted files 2024-11-21 15:55:40 +07:00
2ee81699e9 fix(python): public url for unsupported converted files 2024-11-21 15:55:21 +07:00
c28aec0c0f fix(ruby): public url for unsupported converted files 2024-11-21 15:54:56 +07:00
f01bcae614 fix(go): available formats for forced conversion 2024-11-21 13:22:55 +07:00
321e60b17d fix(ruby): available formats for forced conversion 2024-11-21 13:19:06 +07:00
0ee55e0e87 fix(python): available formats for forced conversion 2024-11-21 13:17:09 +07:00
5fe1bf2f14 fix(php): available formats for forced conversion 2024-11-21 13:15:02 +07:00
c2153c48c5 fix(java-spring): available formats for forced conversion 2024-11-21 13:12:26 +07:00
90e46de59b fix(php-laravel): available formats for forced conversion 2024-11-21 13:08:43 +07:00
4eecbdeb3d fix(java): available formats for forced conversion 2024-11-20 16:50:50 +07:00
8b6cc401ee fix(csharp-mvc): available formats for forced conversion 2024-11-20 16:43:01 +07:00
f8cf8ebc84 fix(csharp): available formats for forced conversion 2024-11-20 16:40:32 +07:00
be92907929 fix(nodejs): available formats for forced conversion 2024-11-20 16:37:18 +07:00
4ce6aa42be update submodules 2024-11-08 17:14:57 +03:00
8ecddf831c Merge remote-tracking branch 'remotes/origin/develop' into feature/go-lang 2024-11-08 17:14:22 +03:00
5dc7ffdecd update submodules 2024-11-08 17:13:49 +03:00
72821c7741 Merge remote-tracking branch 'remotes/origin/develop' into feature/go-lang
# Conflicts:
#	CHANGELOG.md
2024-11-08 10:18:55 +03:00
e8e42b6632 build(ruby): bump rexml from 3.3.3 to 3.3.9 2024-11-07 14:50:29 +07:00
42c5850c04 build(go): add go example linter workflow 2024-11-07 14:34:12 +07:00
54782d497d style(go): simplifycompositelit lint fix 2024-11-07 14:34:12 +07:00
7a39b68a68 style(go): usestdlibvars lint fix 2024-11-07 14:34:12 +07:00
cd0eaa9185 style(go): assignment to nil map lint fix (staticcheck:SA5000) 2024-11-07 14:34:12 +07:00
78400cdd8e style(go): stylecheck lint fix (ST1023) 2024-11-07 14:34:12 +07:00
e0b0c0f6c7 style(go): bodyclose lint fix 2024-11-07 14:34:12 +07:00
f71dd6b7cb style(go): misspell lint fix 2024-11-07 14:34:12 +07:00
bc6ba94703 style(go): errname lint fix 2024-11-07 14:34:11 +07:00
f952fc4ba5 style(go): godot lint fix 2024-11-07 14:34:11 +07:00
df8690b2c4 style(go): gocritic lint fix 2024-11-07 14:34:11 +07:00
adb8efd489 style(go): deprecated lint fix (staticcheck:SA1019) 2024-11-07 14:34:11 +07:00
9ba754f7bb style(go): unused lint fix 2024-11-07 14:34:11 +07:00
46c008499f style(go): line length(lll) lint fix 2024-11-07 14:34:11 +07:00
40221ecb11 style(go): errcheck lint fix 2024-11-07 14:34:11 +07:00
94f65b4f06 style(go): add golangci linter configuration 2024-11-07 14:34:03 +07:00
d4c83b5305 refactor(go): endpoint interface is divided into topic interfaces 2024-11-02 13:51:47 +07:00
c8b1b12e83 refactor(go): api endpoints are split into separate files 2024-11-01 16:08:12 +07:00
240e61d250 Merge remote-tracking branch 'remotes/origin/master' into develop 2024-10-31 16:52:40 +03:00
b67f6140a3 Merge pull request 'fix(php): correct forcesave submitform url. Fix Bug 71218' from fix-php-submitform into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/13
2024-10-31 07:58:49 +00:00
cd826987f6 feat(go): convert button 2024-10-31 14:32:13 +07:00
8ff457a219 fix(nodejs): docType icon for converting pdf 2024-10-30 16:32:35 +07:00
d2eb17607d feat(ruby): convert button 2024-10-30 16:32:35 +07:00
b7fcf10791 feat(python): convert button 2024-10-30 16:32:34 +07:00
2cdab7cbe1 feat(php-laravel): convert button 2024-10-30 16:32:34 +07:00
9f3561575f feat(php): convert button 2024-10-30 16:32:34 +07:00
3fda69efc8 feat(java-spring): convert button 2024-10-30 16:32:34 +07:00
55b709f87c feat(java): convert button 2024-10-30 16:32:34 +07:00
cbe6a1af48 feat(csharp-mvc): convert button 2024-10-30 16:32:34 +07:00
96a787cd5d feat(csharp): convert button 2024-10-30 16:32:33 +07:00
a886d535c8 fix(php): correct download urls for trackmanager. Fix Bug 71218 2024-10-29 13:31:54 +07:00
a5492d86c7 Merge remote-tracking branch 'remotes/origin/release/v1.11.0' into develop 2024-10-28 13:11:57 +03:00
ad51cad2fb build: update documentserver version to 8.2 in docker-compose files 2024-10-28 16:39:47 +07:00
1e6b3672ae Merge pull request 'feature/on-request-reference-source' from feature/on-request-reference-source into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/10
Reviewed-by: serik.kerimbayevich <serik.kerimbayevich@onlyoffice.com>
2024-10-21 11:38:21 +00:00
9aca7a2b52 Merge remote-tracking branch 'remotes/origin/develop' into feature/on-request-reference-source
# Conflicts:
#	CHANGELOG.md
2024-10-21 14:37:46 +03:00
63934eedeb Merge remote-tracking branch 'remotes/origin/release/v1.11.0' into develop 2024-10-21 14:34:28 +03:00
8c6328e409 Merge pull request 'update-dependencies' from update-dependencies into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/12
2024-10-21 10:05:11 +00:00
b1fd32a0f6 Merge remote-tracking branch 'remotes/origin/release/v1.11.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-10-20 17:14:02 +03:00
ac98ecb8e7 nodejs: fix author 2024-10-20 17:13:12 +03:00
401451b830 build(ruby): update dependencies 2024-10-16 17:02:16 +07:00
026daa0bf7 build(nodejs): update dependencies 2024-10-16 17:01:51 +07:00
1154ad273b Merge pull request 'revert-filling-by-default' from revert-filling-by-default into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/11
2024-10-16 09:00:35 +00:00
55cb8f0b9d Merge remote-tracking branch 'remotes/origin/release/v8.2.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-10-16 11:57:20 +03:00
3ab9ce15f0 changelog: revert filling by default 2024-10-16 15:00:21 +07:00
a615acd73d fix(php-laravel): revert filling by default 2024-10-16 15:00:21 +07:00
4bdae5d83b fix(ruby): revert filling by default 2024-10-16 15:00:21 +07:00
a9c737dbac fix(python): revert filling by default 2024-10-16 15:00:21 +07:00
639c20cffc fix(php): revert filling by default 2024-10-16 15:00:21 +07:00
011be765ab fix(java-spring): revert filling by default 2024-10-16 15:00:21 +07:00
cf9bc29986 fix(java): revert filling by default 2024-10-16 15:00:20 +07:00
5cb551a8db fix(csharp-mvc): revert filling by default 2024-10-16 15:00:20 +07:00
8dfce0020b fix(csharp): revert filling by default 2024-10-16 15:00:20 +07:00
17a03eea56 Merge remote-tracking branch 'remotes/origin/release/v8.2.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-10-15 18:29:42 +03:00
d6a821a7f9 feat(php-laravel): fetch files endpoint 2024-10-15 16:25:31 +07:00
37d07b1903 feat(php-laravel): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
e922fb4bdb feat(ruby): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
e736b94076 feat(python): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
c9528a6e47 feat(php): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
93fcf5264d feat(java-spring): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
c039a8a94e feat(java): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
5c3134d451 feat(csharp-mvc): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
8c7f4ffee0 feat(csharp): onRequestReferenceSource 2024-10-15 16:25:30 +07:00
727a3018b9 Merge remote-tracking branch 'remotes/origin/release/v8.2.0' into develop 2024-10-14 13:03:35 +03:00
b7d6afb7d9 build(ruby): bump rexml from 3.3.3 to 3.3.6 2024-10-11 16:55:04 +07:00
50721212b1 Merge remote-tracking branch 'remotes/origin/develop' into feature/go-lang
# Conflicts:
#	CHANGELOG.md
2024-10-10 13:50:04 +03:00
70a515f276 Merge remote-tracking branch 'remotes/origin/release/v8.2.0' into develop 2024-10-10 13:49:08 +03:00
cddb89ced3 Merge pull request 'feature/on-request-close' from feature/on-request-close into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/7
2024-10-10 10:45:50 +00:00
c318020c6b php-laravel: fix lint 2024-10-10 13:44:07 +03:00
675d8ff8e1 Merge remote-tracking branch 'remotes/origin/master' into develop 2024-10-10 13:40:29 +03:00
bb4cbd1625 Merge remote-tracking branch 'remotes/origin/develop' into feature/on-request-close 2024-10-10 13:37:57 +03:00
4a595fc60e nodejs: fix lint (b36bfdec4d) 2024-10-10 13:37:09 +03:00
fc45eca00d Merge remote-tracking branch 'remotes/origin/master' into develop 2024-10-10 13:29:38 +03:00
bf4451bef1 close to changelog 2024-10-10 13:24:22 +03:00
a942265f63 feat(java-spring): close editor. Fix Bug 69915 2024-10-10 15:54:30 +07:00
ab8eab83cc feat(ruby): close editor. Fix Bug 69915 2024-10-10 15:32:43 +07:00
c01c486f3c feat(python): close editor. Fix Bug 69915 2024-10-10 15:32:42 +07:00
4a0ec745a7 feat(php-laravel): close editor. Fix Bug 69915 2024-10-10 15:32:42 +07:00
f145cadf01 feat(php): close editor. Fix Bug 69915 2024-10-10 15:32:42 +07:00
00f43b6ecd feat(java): close editor. Fix Bug 69915 2024-10-10 15:32:42 +07:00
6ad97aebc7 feat(csharp-mvc): close editor. Fix Bug 69915 2024-10-10 15:32:42 +07:00
ea5f2efe46 feat(csharp): close editor. Fix Bug 69915 2024-10-10 15:32:41 +07:00
eba8bce11b Merge pull request 'feature/filename-title' from feature/filename-title into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/6
2024-10-08 15:15:05 +00:00
a92c71e045 python: fix lint 2024-10-08 18:14:22 +03:00
77a9435e29 nodejs: fix lint 2024-10-08 18:14:14 +03:00
a7e0e462d0 Merge pull request 'feature/golang-update' (#4) from feature/golang-update into feature/go-lang
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/4
2024-10-08 09:56:29 +00:00
d13798f9db Merge remote-tracking branch 'remotes/origin/release/v8.2.0' into develop 2024-10-08 12:54:34 +03:00
55ab10a1a6 changelog: filename in editor page title 2024-10-08 15:24:54 +07:00
11f62358be feat(go): filename in editor page title 2024-10-08 15:04:19 +07:00
1ced3a7f0d feat(php-laravel): filename in editor page title 2024-10-08 14:31:15 +07:00
b138385196 feat(ruby): filename in editor page title 2024-10-08 13:42:48 +07:00
940ae9fedd go: submit for all modes (35cf2fb0b0) 2024-10-07 14:56:26 +03:00
2ab8a55d8f Merge remote-tracking branch 'remotes/origin/develop' into feature/golang-update 2024-10-07 14:55:58 +03:00
e32dd4152b php-laravel: submit for all modes (35cf2fb0b0) 2024-10-07 14:55:30 +03:00
3db9b887ed Merge branch 'release/v8.2.0' into develop 2024-10-07 14:54:30 +03:00
728c74b1aa feat(python): filename in editor page title 2024-10-07 16:37:16 +07:00
e2bc4a6628 feat(php): filename in editor page title 2024-10-07 16:23:25 +07:00
8e8593d7c1 feat(java-spring): filename in editor page title 2024-10-07 16:13:34 +07:00
353e1b9ea6 feat(java): filename in editor page title 2024-10-07 16:00:12 +07:00
4cb2c83581 feat(csharp-mvc): filename in editor page title 2024-10-07 15:49:15 +07:00
ce72ffe77e feat(csharp): filename in editor page title 2024-10-07 15:49:15 +07:00
efba3452c6 feat(nodejs): filename in editor page title 2024-10-07 15:49:10 +07:00
cfff9c95ea go: command and converter address 2024-10-07 11:39:48 +03:00
95cdc163c1 Merge remote-tracking branch 'remotes/origin/develop' into feature/golang-update
# Conflicts:
#	.gitmodules
#	CHANGELOG.md
2024-10-07 11:38:47 +03:00
a27081b288 php-laravel: command and converter address 2024-10-07 11:37:30 +03:00
11bcd3805a Merge remote-tracking branch 'remotes/origin/release/v8.2.0' into develop 2024-10-07 11:36:13 +03:00
cd81f8cd1c feat(go): using default empty files 2024-10-07 15:19:20 +07:00
85b7284c8a feat(go): update main page 2024-10-02 16:06:47 +07:00
5cccae71f3 feat(go): forgotten files 2024-10-02 16:06:47 +07:00
2a05278c16 feat(go): file versions for index endpoint 2024-10-02 16:06:47 +07:00
ba4024665a feat(go): real server version in meta 2024-10-02 16:06:47 +07:00
dfb4e06772 feat(go): update convert endpoint. force conversion support 2024-10-02 16:06:47 +07:00
618369fe5f feat(go): pdf filetype support 2024-10-02 16:06:47 +07:00
641ae7c15d feat(go): removeAll endpoint 2024-10-02 16:06:47 +07:00
481ac474bd feat(go): formats endpoint 2024-10-02 16:06:46 +07:00
9828fdd704 fix(go): not nil remove comment group for uid-3 2024-10-02 16:06:46 +07:00
b1343c7554 feat(go): fillForms extensions support 2024-10-02 16:06:46 +07:00
78e8394457 feat(go): update configuration 2024-10-02 16:06:46 +07:00
fd7579a36a feat(go): update static resources 2024-10-02 16:06:33 +07:00
f1cf416166 nodejs: resize wopi frame (fix Bug 70591) 2024-10-01 15:16:13 +03:00
a0ddf8d350 using default empty files (2b0b902f9c) 2024-09-30 12:54:58 +03:00
576a234289 Merge branch 'release/v8.2.0' into develop 2024-09-30 12:53:39 +03:00
f3e5b8e8cf Revert "nodejs: disable forgotten by default"
This reverts commit f48734b235.
2024-09-24 18:18:16 +03:00
4c2a654871 Merge branch 'release/v8.2.0' into develop 2024-09-24 15:08:14 +03:00
b762ef4120 php-laravel: he-IL skin language (581f2aaef6) 2024-09-23 10:59:52 +03:00
934eaecad9 Merge branch 'release/v8.2.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-09-23 10:53:42 +03:00
fe4340e731 Merge remote-tracking branch 'remotes/origin/release/v1.10.0' into develop 2024-09-23 10:52:10 +03:00
a96bfe0777 build(go): update submodules 2024-09-23 13:34:59 +07:00
aeae7446df Merge remote-tracking branch 'remotes/origin/release/v1.10.0' into develop 2024-09-10 22:36:43 +03:00
4cd3385b33 php-laravel: update empty files (f55beaa8ac) 2024-09-10 18:16:31 +03:00
d675b92ba8 Merge branch 'release/v1.10.0' into develop 2024-09-10 18:12:13 +03:00
0a802159f0 Merge remote-tracking branch 'remotes/origin/develop' into feature/go-lang
# Conflicts:
#	CHANGELOG.md
2024-09-10 17:20:13 +03:00
3f3274a316 Merge remote-tracking branch 'remotes/origin/feature/php-laravel' into develop 2024-09-09 12:22:25 +03:00
6eb812eb40 format changelog 2024-09-09 12:22:07 +03:00
e6862bce87 update submodule with tiff ext (4be1abca19) 2024-09-09 09:26:54 +03:00
21c92bb13a Merge remote-tracking branch 'remotes/origin/develop' into feature/php-laravel 2024-09-09 09:25:59 +03:00
b8a5bd4fab discard user creation during building process 2024-08-27 15:04:29 +05:00
3d4df2a316 fix incorrect language retrieving method 2024-08-27 13:21:32 +05:00
3a17c7aef9 update templates 2024-08-26 11:07:33 +03:00
19ef21c440 Merge remote-tracking branch 'remotes/origin/develop' into feature/php-laravel 2024-08-26 11:07:09 +03:00
9f823a64f3 run laravel pint autofix 2024-08-19 00:12:37 +05:00
e811ae280e implement reference data 2024-08-19 00:10:03 +05:00
ad44aa982c append port to origin only if present 2024-08-19 00:08:50 +05:00
95cb7e708a fix incorrect config key 2024-08-19 00:07:54 +05:00
82ef4af322 feat(go): artifact and release workflows 2024-08-08 19:46:23 +05:00
143e809228 docs(go): changelog 2024-08-08 19:20:05 +05:00
1c01d6c081 docs(go): deps bump, revised licenses 2024-08-08 19:14:31 +05:00
6d119e1449 Merge pull request #572 from ONLYOFFICE/feature/golang-update
Update golang example
2024-08-08 18:25:19 +05:00
06538c87fc run laravel pint autofix 2024-08-05 17:50:25 +05:00
112bb10c5e implement on request rename 2024-08-05 17:49:21 +05:00
909d503f24 enable on make action link event 2024-08-05 17:16:00 +05:00
26cefa9592 autofix linter offences 2024-08-04 12:42:47 +05:00
2d7491c5cb implement file version restore method 2024-08-04 12:40:31 +05:00
23e12fd02a return an absolute path of a version file 2024-08-04 12:38:30 +05:00
9e9152e29f create a method for retrieving an absolute path of a file 2024-08-04 12:37:37 +05:00
dbec7788ca change version creation order 2024-08-04 12:36:29 +05:00
5caeb643c7 fix incorrect commands 2024-08-04 12:35:10 +05:00
a1758227a8 create php-laravel release artifact 2024-08-01 15:33:49 +05:00
1c9a1fee9c fix linter offences: new_with_parentheses 2024-08-01 15:22:33 +05:00
5c8f1f525e add troubleshooting section 2024-08-01 15:08:10 +05:00
ae75cfecde add php-laravel changelogs 2024-08-01 14:09:27 +05:00
4da1b99f0a update linter actions versions 2024-08-01 14:01:40 +05:00
5e47e8904a update artifact actions versions 2024-08-01 13:59:11 +05:00
5939624d96 add user info entry to env variables list 2024-08-01 13:50:26 +05:00
c20d8f6dd7 specify laravel version and and show only essential env variables in configration section 2024-08-01 13:31:13 +05:00
31cda491e3 set default values to example app env variables 2024-08-01 12:30:12 +05:00
53687405b2 fix incorrect npm command 2024-08-01 12:28:45 +05:00
7d7d4abb62 fix undefined user 2024-08-01 12:28:05 +05:00
4822db320d hide restore button 2024-08-01 12:26:49 +05:00
56101aa086 sort files lsit by modification time by default 2024-08-01 12:26:02 +05:00
c781fd2bc2 create readme 2024-07-31 18:14:37 +05:00
c38a8ce22e add additional installation commands 2024-07-31 18:14:22 +05:00
07bdcc70af Merge remote-tracking branch 'remotes/origin/develop' into feature/php-laravel 2024-07-31 14:47:13 +03:00
11a22f88a5 php-laravel: fix remove favorite status (c46b4e16d5) 2024-07-31 14:46:56 +03:00
5179e81d8f Revert "trigger php-laravel artifact"
This reverts commit bdca18f28c.
2024-07-31 12:55:04 +05:00
f70dddd627 rename jwt secret env variable 2024-07-31 12:54:34 +05:00
29d1401687 add user related env variables and change default drivers 2024-07-31 12:54:07 +05:00
bdca18f28c trigger php-laravel artifact 2024-07-31 12:09:28 +05:00
07a0d4f62b create artifact for php-laravel example 2024-07-31 12:07:46 +05:00
d411a9f98e Revert "test php-laravel action linter"
This reverts commit b1c272e17f.
2024-07-30 18:41:49 +05:00
f20676c964 do not fix style errors 2024-07-30 18:39:30 +05:00
b1c272e17f test php-laravel action linter 2024-07-30 18:36:29 +05:00
3eedf0ad6d create action linter for php-laravel example 2024-07-30 18:33:15 +05:00
71879477c7 remove unrelated info 2024-07-30 16:17:35 +05:00
a618e19617 add copyright info to original files 2024-07-30 16:17:10 +05:00
5bf073dd66 add 3rd party licenses 2024-07-30 15:55:24 +05:00
297bed31e7 add license 2024-07-30 15:54:37 +05:00
e9e066da8e autofix linter errors in EnsureForgottenPageEnabled class 2024-07-30 14:10:05 +05:00
0086aba64d control forgotten page display with env variable 2024-07-30 14:08:37 +05:00
5ab85490f5 run laravel pint fix 2024-07-30 13:56:31 +05:00
35e44e3eb6 log errors in controller methods 2024-07-30 13:53:17 +05:00
c3c05490b7 add and rename doc server version env variable 2024-07-30 13:47:32 +05:00
edd8813e56 add makefile 2024-07-30 13:40:33 +05:00
f5e2bbb82b create and modify env variables 2024-07-30 13:39:08 +05:00
f5664fe912 fix incorrect path to formats js file 2024-07-30 13:38:17 +05:00
0786a1c326 add submodules 2024-07-30 12:08:00 +05:00
ee0680f806 Merge branch 'develop' into feature/php-laravel 2024-07-30 11:11:01 +05:00
414cb9b535 delete redundant vite config inputs 2024-07-29 18:11:03 +05:00
e3aa07ef9a delete redundant static js file 2024-07-29 18:10:08 +05:00
267c53bb14 update composer.lock 2024-07-29 18:09:32 +05:00
6b32e9f95d implement editor history function 2024-07-29 18:09:11 +05:00
77ecde55c0 complete refactor 2024-07-29 18:07:54 +05:00
2c61843695 add and check additional embeded param and refactor use classes 2024-07-29 17:55:08 +05:00
c85fc5ef31 check and decode jwt tokens in middleware 2024-07-29 17:52:49 +05:00
88ddd4c2cb check and create user directories in middleware 2024-07-29 17:51:57 +05:00
b772ffba90 create enum for format type 2024-07-29 17:49:26 +05:00
a6fdc58767 create custom view for errors 2024-07-29 17:47:57 +05:00
856dce26c9 add filesystem disk for force saved files 2024-07-29 17:46:09 +05:00
06be29e983 show file upload errors using jqxhr responsejson property 2024-07-29 17:40:57 +05:00
110cbdefab upgrade docs docker image to 8.1 version 2024-07-29 17:39:31 +05:00
5ba55833db rename proxy docker image 2024-07-29 17:38:28 +05:00
4d424a2ee6 increase php upload file size 2024-07-29 17:35:50 +05:00
6b47993786 add pdf icons 2024-07-29 17:32:32 +05:00
cabb56cbbb move resources/css to public/css 2024-07-29 17:31:04 +05:00
681912f544 move resources/images to public/images 2024-07-29 17:29:34 +05:00
0b03376e0e fix: incorrect files/saveas url 2024-07-08 17:47:38 +05:00
1e3c48ddad feat: implement forgotten files page 2024-07-08 17:46:34 +05:00
dbe896c1c1 feature: implement editor saveas 2024-07-08 17:43:34 +05:00
afca8b2eea validate direct url 2024-07-08 17:39:09 +05:00
7fa9444201 add jquery ui 2024-07-08 17:37:46 +05:00
3f0c1d51d3 publish node service port 2024-07-01 13:08:34 +05:00
1c80079e1d create package-lock 2024-07-01 12:57:52 +05:00
4b50cb7ab6 composer: use firebase/php-jwt 2024-07-01 12:48:57 +05:00
b86e9d6b60 remove User class 2024-07-01 12:47:36 +05:00
6db9bdbc4e bind local storage to interface 2024-07-01 12:46:13 +05:00
30a3365bc9 implement local storage 2024-07-01 12:45:41 +05:00
4554a630bf rename and change class usage 2024-07-01 12:45:18 +05:00
3593ea6e13 pass client ip to storage 2024-07-01 12:43:19 +05:00
4b05cc0c1b rename Document to DocumentStorage 2024-07-01 12:42:21 +05:00
6a428cd861 handle jwt tokens in middleware 2024-07-01 12:41:19 +05:00
b7ac2f7984 skip editor/track route csrf validation 2024-07-01 12:40:24 +05:00
3e30d34159 add file disks for files and formats 2024-07-01 12:39:41 +05:00
3b12f3bd53 create command request 2024-07-01 12:38:42 +05:00
4d1e6e5333 rename Document to DocumentServer 2024-07-01 12:36:54 +05:00
ed1f5503d2 format api implementation 2024-07-01 12:36:07 +05:00
f8390113e5 change conversion classes namespace 2024-07-01 12:33:53 +05:00
12732cab10 create editor key helper 2024-07-01 12:32:26 +05:00
7471f80d26 add function for parsing url origin 2024-07-01 12:31:23 +05:00
a199018adf create command service error class 2024-07-01 12:30:23 +05:00
27e090fe3b implement document server class 2024-07-01 12:29:39 +05:00
d8585f4499 add template path 2024-07-01 12:27:47 +05:00
9c61dbab16 create storage interface 2024-07-01 12:25:09 +05:00
faa9595e4f implement editor 2024-07-01 12:23:39 +05:00
6418d924e3 replace Storage class with DocumentStorage 2024-07-01 12:21:28 +05:00
1a46d063fd createurl helpers 2024-06-18 15:34:02 +05:00
6e08c9d898 create path helper 2024-06-18 15:33:30 +05:00
3ca3dfa763 create document service class 2024-06-18 15:32:57 +05:00
3f3ea583a7 create conversion exceptions 2024-06-18 15:31:13 +05:00
9d3971c10d add jquery 2024-06-18 15:29:27 +05:00
06b2459ae4 implement file upload 2024-06-18 15:27:08 +05:00
b70eefe10f implement file delete 2024-06-18 15:25:39 +05:00
81d9336a3e create jwt class 2024-06-18 15:21:51 +05:00
bd5ab3d7e9 add firebase/jwt to composer file 2024-06-18 15:21:31 +05:00
ba4c10d326 bind local file repository to file repository interface 2024-06-18 13:55:50 +05:00
13bd01c73e create index controller 2024-06-18 13:54:57 +05:00
55e0ad536f create storage class 2024-06-18 13:53:31 +05:00
49e2cfbf48 create local file repository 2024-06-18 13:52:43 +05:00
692926b0e4 create formats class 2024-06-18 13:51:32 +05:00
9cc2859c1d create languages class 2024-06-18 13:51:03 +05:00
040962ae28 create users class 2024-06-18 13:50:32 +05:00
eed9fd3098 create file repository interface 2024-06-18 13:49:19 +05:00
5d3bcfed8f create file entity 2024-06-18 13:48:29 +05:00
a9eaad4cfb create format entity 2024-06-18 13:47:57 +05:00
6b10a17ee7 create user entity 2024-06-18 13:47:21 +05:00
764d87eecd create autoload config for onlyoffice directory 2024-06-18 13:44:52 +05:00
f5a8ca367b create route to main page 2024-06-18 13:40:45 +05:00
940d759e36 configure vite 2024-06-18 13:38:27 +05:00
1cdcf6c0a8 create config file for static assets 2024-06-18 13:36:03 +05:00
7a1f6a471b add images 2024-06-18 13:34:40 +05:00
f161da3879 add index page js files 2024-06-18 13:33:30 +05:00
d525fa6611 add style files for index page 2024-06-18 13:32:29 +05:00
f0fd90f115 create main page view 2024-06-18 13:31:28 +05:00
f45b6f60d4 bind config class as singleton 2024-06-18 13:24:51 +05:00
ceecd1af09 php-laravel: create config class 2024-06-17 18:02:24 +05:00
39edf9f364 feat(go): editor template, config and events update 2024-05-29 17:20:50 +07:00
6fd44a3f4c feat(go): restore endpoint 2024-05-28 18:00:43 +07:00
02b50f7a36 feat(go): historyObj endpoint 2024-05-27 16:14:49 +07:00
de33a42391 fix(go): now history of file without changes is not null 2024-05-27 16:13:39 +07:00
03fa66fbce build docker compose 2024-05-27 13:09:37 +05:00
0817960acd install laravel 2024-05-27 13:08:26 +05:00
109ebcf45d feat(go): rename endpoint 2024-05-27 15:05:27 +07:00
8e76c7ad61 feat(go): add command request manager 2024-05-27 15:04:44 +07:00
bea25acd69 feat(go): create endpoint post method 2024-05-23 16:18:51 +07:00
075ad0ee1f feat(go): convey users and insert data in editor template 2024-05-23 14:12:43 +07:00
7c60aeb26b feat(go): files edpoint 2024-05-22 15:36:57 +07:00
61fb573a4b feat(go): reference endpoint 2024-05-22 13:18:29 +07:00
982a853058 fix(go): posExt without dot 2024-05-21 14:05:22 +07:00
61f20f5ddd feat(go): update users 2024-05-16 16:39:45 +07:00
c3a5c15781 feat(go): add document-formats submodule 2024-05-14 15:02:42 +07:00
7620eb1f8e Merge branch 'develop' into feature/golang-update 2024-05-07 14:28:46 +07:00
e25ca233ee deps: bump gomod dependencies 2024-01-18 10:05:48 +03:00
fa24c1b823 fix: history highlights 2023-02-02 18:49:17 +05:00
b1ef74d2a2 fix: create asset files 2023-02-01 17:48:01 +05:00
6145ae0fcd doc: readme 2023-02-01 17:25:57 +05:00
40412b6c17 fix: server_address as internal address for callback and download url 2023-02-01 17:21:44 +05:00
d43ecd489e fix: go submodule 2023-02-01 14:42:02 +05:00
190f5bba65 chore: submodules 2023-02-01 13:18:31 +05:00
ce39734850 chore: copyrights 2023-02-01 12:26:44 +05:00
7f31cefd76 fix: invalid path to key.txt 2023-01-31 18:38:44 +05:00
b5220091ff fix: handle callback errors 2023-01-31 18:00:03 +05:00
724d7363d8 feat: refactoring 2023-01-31 17:44:01 +05:00
5678307eb5 go-lang: add a download link handler (file, prev, diff) 2022-01-21 18:19:22 +03:00
7a149c6faa go-lang: basic example 2021-09-23 14:33:25 +05:00
556 changed files with 39462 additions and 875 deletions

32
.github/workflows/artifact-go.yml vendored Normal file
View 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

29
.github/workflows/lint-go.yml vendored Normal file
View 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

View File

@ -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:

View File

@ -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:

View File

@ -3,10 +3,10 @@ name: Laravel Pint
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
pull_request:
branches: [master, main, develop]
branches: [master, develop]
paths: ['web/documentserver-example/php-laravel/**']
jobs:

View File

@ -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:
@ -17,7 +17,7 @@ jobs:
working-directory: ./web/documentserver-example/php
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -2,7 +2,7 @@ name: Release
on:
push:
branches: [master,main]
branches: [master]
permissions:
contents: write
@ -63,6 +63,14 @@ jobs:
rsync -av --exclude='PHP Example' ./ ./'PHP Example'
rm -rf ./'PHP Example'/assets/document-formats/.git
rm -rf ./'PHP Example'/assets/document-templates/.git
- name: Build PHP Laravel Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/php-laravel
mkdir -p ./'PHP Laravel Example'
rsync -av --exclude='PHP Laravel Example' ./ ./'PHP Laravel Example'
rm -rf ./'PHP Laravel Example'/public/assets/document-formats/.git
rm -rf ./'PHP Laravel Example'/public/assets/document-templates/.git
- name: Build Python Artifact
run: |
cd ${{ github.workspace }}
@ -87,6 +95,14 @@ jobs:
rsync -av --exclude='Java Spring Example' ./ ./'Java Spring Example'
rm -rf ./'Java Spring Example'/src/main/resources/assets/document-formats/.git
rm -rf ./'Java Spring Example'/src/main/resources/assets/document-templates/.git
- name: Build Go Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/go
mkdir -p .'Go Example'
rsync -av --exclude='Go Example' ./ ./'Go Example'
rm -rf ./'Go Example'/static/assets/document-formats/.git
rm -rf ./'Go Example'/static/assets/document-templates/.git
- name: Pack Artifacts
run: |
cd ${{ github.workspace }}/web/documentserver-example/csharp-mvc
@ -99,12 +115,16 @@ jobs:
zip -r Node.js.Example.zip ./'Node.js Example'
cd ${{ github.workspace }}/web/documentserver-example/php
zip -r PHP.Example.zip ./'PHP Example'
cd ${{ github.workspace }}/web/documentserver-example/php-laravel
zip -r PHP.Laravel.Example.zip ./'PHP Laravel Example'
cd ${{ github.workspace }}/web/documentserver-example/python
zip -r Python.Example.zip ./'Python Example'
cd ${{ github.workspace }}/web/documentserver-example/ruby
zip -r Ruby.Example.zip ./'Ruby Example'
cd ${{ github.workspace }}/web/documentserver-example/java-spring
zip -r Java.Spring.Example.zip ./'Java Spring Example'
cd ${{ github.workspace }}/web/documentserver-example/go
zip -r Go.Example.zip ./'Go Example'
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
@ -116,8 +136,10 @@ jobs:
${{ github.workspace }}/web/documentserver-example/java/Java.Example.zip,
${{ github.workspace }}/web/documentserver-example/nodejs/Node.js.Example.zip,
${{ github.workspace }}/web/documentserver-example/php/PHP.Example.zip,
${{ github.workspace }}/web/documentserver-example/php-laravel/PHP.Laravel.Example.zip,
${{ github.workspace }}/web/documentserver-example/python/Python.Example.zip,
${{ github.workspace }}/web/documentserver-example/ruby/Ruby.Example.zip,
${{ github.workspace }}/web/documentserver-example/java-spring/Java.Spring.Example.zip
${{ github.workspace }}/web/documentserver-example/java-spring/Java.Spring.Example.zip,
${{ github.workspace }}/web/documentserver-example/go/Go.Example.zip
"
tag: v${{ steps.info.outputs.version }}

17
.gitmodules vendored
View File

@ -5,6 +5,7 @@
[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
branch = feature/v8.3
[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
@ -36,6 +37,14 @@
path = web/documentserver-example/java-spring/src/main/resources/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/go/static/assets/document-templates"]
path = web/documentserver-example/go/static/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/go/static/assets/document-formats"]
path = web/documentserver-example/go/static/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = master
[submodule "web/documentserver-example/python/assets/document-formats"]
path = web/documentserver-example/python/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
@ -55,3 +64,11 @@
[submodule "web/documentserver-example/csharp/assets/document-formats"]
path = web/documentserver-example/csharp/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/php-laravel/public/assets/document-formats"]
path = web/documentserver-example/php-laravel/public/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = master
[submodule "web/documentserver-example/php-laravel/public/assets/document-templates"]
path = web/documentserver-example/php-laravel/public/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default

View File

@ -82,6 +82,37 @@ License: MICROSOFT .NET LIBRARY LICENSE
License File: WebGrease.license
web/documentserver-example/go
fx - An application framework for Go that makes dependency injection easy. (https://github.com/uber-go/fx).
License: MIT
License File: fx.license
golang-jwt - A go implementation of JSON Web Tokens. (https://github.com/golang-jwt/jwt).
License: MIT
License File: golang-jwt.license
gorilla/mux - Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler. (https://github.com/gorilla/mux).
License: BSD-3-Clause License
License File: mux.license
mapstructure - Go library for decoding generic map values into native Go structures and vice versa. (https://github.com/mitchellh/mapstructure)
License: MIT
License File: mapstructure.license
schema - Package gorilla/schema fills a struct with form values. (https://github.com/gorilla/schema)
License: BSD-3-Clause License
License File: schema.license
viper - Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed to work within an application, and can handle all types of configuration needs and formats. (https://github.com/spf13/viper).
License: MIT
License File: viper.license
zap - Blazing fast, structured, leveled logging in Go. (https://github.com/uber-go/zap).
License: MIT
License File: zap.license
web/documentserver-example/java
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)

View File

@ -1,5 +1,29 @@
# Change Log
- nodejs: refresh config
- nodejs: support vsdx in visio editor
- nodejs: support pages, numbers, key formats
- golang: new integration example
- golang: upload files to the server
- golang: create blank files and files with sample content
- golang: edit uploaded files in onlyoffice editor
- golang: delete files on the server
- golang: show files history
- php-laravel: new integration example
- php-laravel: upload files to the server
- php-laravel: create blank files and files with sample content
- php-laravel: edit uploaded files in onlyoffice editor
- php-laravel: delete files on the server
- php-laravel: create, edit, and submit pdf forms
- php-laravel: show forgotten files on a seperate page
- php-laravel: fetch files
- on uploading xml convert to supported type only
- converting function on index page
- editing by default
- change reference source
- filename in editor page title
- close editor
## 1.11.0
- he-IL skin language
- ConvertService.ashx address replaced with converter

View File

@ -10,6 +10,7 @@ The package contains examples written in .Net (C# MVC), .Net (C#), Java, Java Sp
You should change `http://documentserver` to your server address in these files:
* [.Net (C# MVC)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp-mvc) - `web/documentserver-example/csharp-mvc/web.appsettings.config`
* [.Net (C#)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp) - `web/documentserver-example/csharp/settings.config`
* [Go](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/go) - `web\documentserver-example\go\config\configuration.json`
* [Java](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java) - `web/documentserver-example/java/src/main/resources/settings.properties`
* [Java Spring](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java-spring) - `web/documentserver-example/java-spring/src/main/resources/application.properties`
* [Node.js](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/nodejs) - `web/documentserver-example/nodejs/config/default.json`

View File

@ -1,4 +1,22 @@
.center {
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
.center {
width: auto;
}

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4285 13C14.4102 13 14 13 14 13.5V15H6C5.44772 15 5 15.4477 5 16V17C5 17.5523 5.44771 18 6 18H14V19.5C14 20 14.3816 20 14.4285 20C14.6359 20 15.0099 19.9113 15.2172 19.7363L18.6207 17.0833C19.1264 16.6566 19.1264 16.3434 18.6207 15.9167L15.2172 13.2637C15.0099 13.0887 14.6359 13 14.4285 13Z" fill="#444444"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.5715 4C9.58984 4 10 4 10 4.50002V6H18C18.5523 6 19 6.44772 19 7V8C19 8.55228 18.5523 9 18 9H10V10.5C10 11 9.61841 11 9.57151 11C9.36409 11 8.99012 10.9113 8.78279 10.7363L5.37934 8.08333C4.87356 7.65662 4.87356 7.34338 5.37934 6.91667L8.78279 4.26366C8.99012 4.08874 9.36409 4 9.5715 4Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 821 B

View File

@ -1 +1,7 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#1E7AAA"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path d="M6 15h18v1H6v-1zM6 19h18v1H6v-1zM6 23h18v1H6v-1zM6 27h18v1H6v-1z" fill="#fff"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#287CA9"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="7" y="28" width="10" height="2" rx="1" fill="#fff"/>
<rect x="7" y="22" width="16" height="2" rx="1" fill="#fff"/>
<rect x="7" y="16" width="16" height="2" rx="1" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 503 B

View File

@ -1,5 +1,8 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H23L30 7V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#9E1919"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.0062 15V16.0065H24V15H17.0062ZM17.0062 19V20.0163H24V19H17.0062ZM24 23H17.0062V24.0261H24V23ZM6 28V27.0293H24V28H6ZM7 16H14V23H7V16ZM6 15H7H14H15V16V23V24H14H7H6V23V16V15Z" fill="white"/>
<path d="M23 0L30 7H26C24.3431 7 23 5.65685 23 4V0Z" fill="black" fill-opacity="0.25"/>
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#E54D39"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="7" y="28" width="16" height="2" rx="1" fill="#fff"/>
<rect x="18" y="22" width="5" height="2" rx="1" fill="#fff"/>
<rect x="18" y="16" width="5" height="2" rx="1" fill="#fff"/>
<rect x="8" y="17" width="6" height="6" rx=".833" stroke="#fff" stroke-width="2"/>
</svg>

Before

Width:  |  Height:  |  Size: 558 B

After

Width:  |  Height:  |  Size: 590 B

View File

@ -1 +1,8 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#F36700"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path stroke="#fff" stroke-opacity=".95" d="M6.5 15.5h17v12h-17z"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#F36700"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="6" y="28" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="2" height="14" rx="1" fill="#fff"/>
<rect x="22" y="16" width="2" height="14" rx="1" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 570 B

View File

@ -1 +1,5 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#D0D5DA"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#646464"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 23c-.27614 0-.5.2239-.5.5v4c0 .2761.22386.5.5.5h15c.2761 0 .5-.2239.5-.5v-4c0-.2761-.2239-.5-.5-.5h-2c-.2761 0-.5-.2239-.5-.5s.2239-.5.5-.5h2c.8284 0 1.5.6716 1.5 1.5v4c0 .8284-.6716 1.5-1.5 1.5h-15c-.82843 0-1.5-.6716-1.5-1.5v-4c0-.8284.67157-1.5 1.5-1.5h2c.27614 0 .5.2239.5.5s-.22386.5-.5.5h-2z" fill="#646464"/><path fill-rule="evenodd" clip-rule="evenodd" d="M20 20.0001L15 14l-5 6.0001h3v4c0 .5523.4477 1 1 1h2c.5523 0 1-.4477 1-1v-4h3z" fill="#646464"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#D1D5DA"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5zm-5.293 14.293a1 1 0 0 0-1.414 0l-4 4a1 1 0 1 0 1.414 1.414L14 17.414V25a1 1 0 1 0 2 0v-7.586l2.293 2.293a1 1 0 0 0 1.414-1.414z" fill="#646464"/>
<path d="M8.833 22H11a1 1 0 1 1 0 2H9v4h12v-4h-2a1 1 0 1 1 0-2h2.167c1.012 0 1.833.82 1.833 1.833v4.334C23 29.179 22.18 30 21.167 30H8.833A1.833 1.833 0 0 1 7 28.167v-4.334C7 22.821 7.82 22 8.833 22" fill="#646464"/>
</svg>

Before

Width:  |  Height:  |  Size: 797 B

After

Width:  |  Height:  |  Size: 638 B

View File

@ -1 +1,10 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#6AAA1E"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 15h18v13H7.00001v-1H12v-3H7v4H6V15zm7 12h4v-3h-4v3zm5 0h5v-3h-5v3zm5-7v3h-5v-3h5zm-6 0v3h-4v-3h4zm-5 0v3H7v-3h5zm11-1v-3h-5v3h5zm-10-3h4v3h-4v-3zm-1 3v-3H7v3h5z" fill="#fff" fill-opacity=".95"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#3AA133"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="6" y="28" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="22" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="2" height="14" rx="1" fill="#fff"/>
<rect x="12" y="16" width="2" height="14" rx="1" fill="#fff"/>
<rect x="22" y="16" width="2" height="14" rx="1" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 703 B

View File

@ -1,12 +1,5 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.84616 1H10.8462L14.8462 5V15H2.84616V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8462 5L10.8462 1H2.84616V15H14.8462V5ZM10.8462 0L15.8462 5V16H1.84616V0H10.8462Z" fill="#BFBFBF"/>
<rect x="3.84616" y="10" width="10" height="4" fill="#3779A6"/>
<path d="M3.84616 4H4.84616V5H3.84616V4Z" fill="#BFBFBF"/>
<path d="M3.84616 6H4.84616V7H3.84616V6Z" fill="#BFBFBF"/>
<path d="M4.84616 8H3.84616V9H4.84616V8Z" fill="#BFBFBF"/>
<path d="M12.8462 8H5.84616V9H12.8462V8Z" fill="#BFBFBF"/>
<path d="M7.84616 6H5.84616V7H7.84616V6Z" fill="#BFBFBF"/>
<path d="M12.8462 4H5.84616V5H12.8462V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9.84616 1H10.8462V4H14.8462L15.8462 5H9.84616V1Z" fill="#333333"/>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
<path fill="#287CA9" d="M5 7h6v1H5zm0 2h6v1H5zm0 2h4v1H5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 394 B

View File

@ -1 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 1h8l4 4v10H2V1z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5l-4-4H2v14h12V5zm-4-5l5 5v11H1V0h9z" fill="#BFBFBF"/><path fill="#9E1919" d="M3 10h10v4H3z"/><path d="M7 7V2H3v5h4zM8 3V2h2v1H8zM8 5V4h5v1H8zM13 6H8v1h5V6zM13 8H3v1h10V8z" fill="#BFBFBF"/><path opacity=".3" d="M9 1h1v3h4l1 1H9V1z" fill="#333"/></svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
<path d="M7.36 5.777c0 1.085-.31 2.363-.833 3.543-.526 1.185-1.235 2.198-1.974 2.796l.803 1.109c1.992-1.342 4.198-2.262 6.333-1.954L12 9.938c-1.819-.612-3.278-2.449-3.278-4.16zm.888 2.84a6.7 6.7 0 0 0 1.161 1.35c-.668.122-1.323.32-1.957.573q.17-.322.316-.657c.183-.41.344-.836.48-1.267" fill="#E54D39"/>
</svg>

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 637 B

View File

@ -1,12 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1H10L14 5V15H2V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 5L10 1H2V15H14V5ZM10 0L15 5V16H1V0H10Z" fill="#BFBFBF"/>
<rect x="3" y="10" width="10" height="4" fill="#F36700"/>
<path d="M3 4H4V5H3V4Z" fill="#BFBFBF"/>
<path d="M3 6H4V7H3V6Z" fill="#BFBFBF"/>
<path d="M4 8H3V9H4V8Z" fill="#BFBFBF"/>
<path d="M12 8H5V9H12V8Z" fill="#BFBFBF"/>
<path d="M7 6H5V7H7V6Z" fill="#BFBFBF"/>
<path d="M12 4H5V5H12V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9 1H10V4H14L15 5H9V1Z" fill="#333333"/>
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
<path d="M5 10a3 3 0 1 0 3-3v3z" fill="#F36700"/>
<path d="M4.5 9A2.5 2.5 0 0 1 7 6.5V9z" fill="#F36700"/>
</svg>

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 444 B

View File

@ -1,12 +1,5 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.84592 1H10.8459L14.8459 5V15H2.84592V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8459 5L10.8459 1H2.84592V15H14.8459V5ZM10.8459 0L15.8459 5V16H1.84592V0H10.8459Z" fill="#BFBFBF"/>
<rect x="3.84592" y="10" width="10" height="4" fill="#78A73B"/>
<path d="M3.84592 4H4.84592V5H3.84592V4Z" fill="#BFBFBF"/>
<path d="M3.84592 6H4.84592V7H3.84592V6Z" fill="#BFBFBF"/>
<path d="M4.84592 8H3.84592V9H4.84592V8Z" fill="#BFBFBF"/>
<path d="M12.8459 8H5.84592V9H12.8459V8Z" fill="#BFBFBF"/>
<path d="M7.84592 6H5.84592V7H7.84592V6Z" fill="#BFBFBF"/>
<path d="M12.8459 4H5.84592V5H12.8459V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9.84592 1H10.8459V4H14.8459L15.8459 5H9.84592V1Z" fill="#333333"/>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.207V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.793z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v1.9c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.109.494.109 1.054.109H13" stroke="#BBB"/>
<path fill="#3AA133" d="M8 7h3v2H8zm0 3h3v2H8zM5 7h2v2H5zm0 3h2v2H5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 408 B

View File

@ -42,10 +42,14 @@
}
.tableHeaderCellViewers {
width: 29%;
width: 18%;
text-align: right;
}
.tableHeaderCellAction {
width: 23%;
}
.tableHeaderCellDownload {
width: 21%;
padding-right: 18px;
@ -220,7 +224,7 @@
}
.tableHeaderCellFileName {
width: 16%;
width: 9%;
}
.tableHeaderCellEditors {
@ -229,7 +233,12 @@
.tableHeaderCellViewers {
text-align: right;
width: 37%;
width: 9%;
}
.tableHeaderCellAction{
width: 11%;
padding-right: 82px;
}
.tableHeaderCellDownload {
@ -244,19 +253,24 @@
}
.tableHeaderCellEditors {
width: 26%;
width: 15%;
text-align: left;
}
.tableHeaderCellFileName {
width: 17%;
width: 28%;
}
.tableHeaderCellViewers {
width: 27%;
width: 6%;
text-align: right;
}
.tableHeaderCellAction{
width: 18%;
padding-right: 54px;
}
.tableHeaderCellDownload {
padding-right: 18px;
width: 20%;
@ -277,12 +291,17 @@
.tableRow td:first-child {
flex-grow: 0;
width: 15%;
width: 25%;
margin-right: auto;
}
.contentCells-icon {
width: 3%;
}
.firstContentCellViewers {
margin-left: 0;
}
}
@media (max-width: 890px) and (min-width: 769px ) {
@ -290,7 +309,7 @@
width: 20%;
}
.contentCells-shift {
padding-right: 28px;
padding-right: 27px;
}
.main-panel {
@ -323,11 +342,16 @@
.tableHeaderCellEditors {
text-align: left;
width: 31%;
width: 1%;
}
.tableHeaderCellViewers {
width: 18%;
width: 19%;
}
.tableHeaderCellAction {
width: 19%;
padding-right: 45px;
}
}
@ -429,8 +453,8 @@
.downloadContentCellShift {
max-width: 7%;
margin-right: -11px;
margin-left: auto;
margin-right: 24px;
margin-left: 0;
}
.contentCells-icon {
@ -438,13 +462,13 @@
}
.tableRow td:last-child {
width: 12%;
padding-right: 40px;
width: 7%;
padding-right: 0px;
border: none;
}
.contentCells-shift {
padding-right: 35px;
padding-right: 0px;
}
.downloadContentCellShift:after {
@ -530,6 +554,15 @@
height: 56px;
margin-bottom: 24px !important;
}
.button.hoar{
width: 18%;
height: 27px;
margin-bottom: 7px !important;
}
.button.converting{
width: 126px;
margin-top: 0;
}
}
@media (max-width: 560px) and (min-width: 510px) {
@ -538,7 +571,7 @@
}
.downloadContentCellShift {
padding-right: 45px;
padding-right: 16px;
max-width: 4%;
}
}
@ -558,7 +591,7 @@
.downloadContentCellShift {
max-width: 6%;
padding-right: 37px;
padding-right: 6px;
}
.firstContentCellShift {
@ -584,12 +617,12 @@
.downloadContentCellShift {
max-width: 3%;
padding-right: 37px;
padding-right: 0px;
padding-left: 0;
}
.firstContentCellShift {
margin-left: 1px;
margin-left: 2px;
flex-basis: 14%;
}
@ -619,7 +652,7 @@
.downloadContentCellShift {
max-width: 4%;
margin-right: -18px;
margin-right: 18px;
margin-left: -1px;
}
@ -628,7 +661,7 @@
}
.contentCells-icon{
width: 10%;
width: 12%;
}
footer table td {
margin: 0;

View File

@ -238,6 +238,52 @@ label .checkbox {
color: #FF6F3D;
}
.button.converting {
margin-top: -20px;
padding: 16px 16px;
}
.button.converting.wide {
padding: 16px 29px;
}
.button.hoar {
background: #EFEFEF;
border: 1px solid #EFEFEF;
margin-right: 7px;
margin-bottom: 7px;
width: 13%;
padding-left: 0;
padding-right: 0;
font-size: 11px;
}
.button.hoar.disable {
opacity: 30%;
cursor: default;
}
.button.hoar:not(.disable):hover {
background: #FF6F3D;
border: 1px solid #FF6F3D;
color: #FFFFFF;
}
.button.hoar.orange {
background: #FF6F3D;
border: 1px solid #FF6F3D;
color: #FFFFFF;
cursor: default;
}
.button.hoar.orange.disable {
background: #444444;
border: 1px solid #444444;
color: #FFFFFF;
cursor: default;
opacity: 100%;
}
.button.file-type {
font-size: 11px;
color: #FFFFFF;
@ -380,6 +426,32 @@ label .checkbox {
display: none;
}
#convertingProgress {
color: #333333;
display: none;
font-size: 12px;
margin: 30px 35px;
}
#convertingProgress .convertFileName{
background-position: left center;
background-repeat: no-repeat;
display: block;
font-size: 14px;
line-height: 160%;
overflow: hidden;
padding-left: 28px;
margin-bottom: 16px;
text-overflow: ellipsis;
white-space: nowrap;
}
#convertingProgress .describeUpload {
line-height: 150%;
letter-spacing: -0.02em;
padding: 16px 0;
}
.error-message {
background: url("images/error.svg") no-repeat scroll 4px 10px;
color: #CB0000;
@ -401,6 +473,10 @@ label .checkbox {
padding-left: 35px;
}
.waiting {
opacity: 30%;
}
.current {
background-image: url("images/loader16.gif");
}
@ -413,6 +489,12 @@ label .checkbox {
background-image: url("images/notdone.svg");
}
.convertPercent {
color: #FF6F3D;
font-weight: 700;
display: inline;
}
.step-descr {
display: block;
margin-left: 35px;
@ -420,6 +502,10 @@ label .checkbox {
line-height: 188%;
}
.step-descr.disable {
display: none;
}
.progress-descr {
letter-spacing: -0.02em;
line-height: 150%;
@ -521,21 +607,25 @@ footer table tr td:first-child {
white-space: nowrap;
}
.convertFileName.word,
.stored-edit.word,
.uploadFileName.word {
background-image: url("images/icon_docx.svg");
}
.convertFileName.cell,
.stored-edit.cell,
.uploadFileName.cell {
background-image: url("images/icon_xlsx.svg");
}
.convertFileName.slide,
.stored-edit.slide,
.uploadFileName.slide {
background-image: url("images/icon_pptx.svg");
}
.convertFileName.pdf,
.stored-edit.pdf,
.uploadFileName.pdf {
background-image: url("images/icon_pdf.svg");
@ -592,6 +682,11 @@ footer table tr td:first-child {
visibility: hidden;
}
.convertTable {
margin-top: 10px;
margin-left: 35px;
}
.tableRow {
background: transparent;
-moz-transition: all 0.2s ease-in-out;
@ -638,6 +733,12 @@ footer table tr td:first-child {
width: 11%;
}
.tableHeaderCellAction{
width: 13%;
text-align: right;
padding-right: 88px;
}
.tableHeaderCellDownload {
width: 13%;
text-align: right;
@ -662,7 +763,7 @@ footer table tr td:first-child {
}
.contentCells-shift {
padding-right: 44px;
padding-right: 43px;
}
.contentCells-icon {
@ -726,7 +827,7 @@ footer table tr td:first-child {
width: 100%;
}
.icon-delete {
.icon-action {
cursor: pointer;
}
@ -805,6 +906,13 @@ html {
position: relative;
}
.typeButtonsRow {
width: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
position: relative;
}
.tableRow td:first-child {
display: flex;
@ -813,11 +921,11 @@ html {
}
.tableHeaderCellFileName {
width: 30%;
width: 20%;
}
.tableHeaderCellEditors {
width: 28%;
width: 20%;
}
.tableHeaderCellViewers {

View File

@ -95,7 +95,8 @@ namespace OnlineEditorsExampleMVC.Helpers
descr_user_1,
true,
true,
new Goback(null, false)
new Goback(null, false),
new Close(null, false)
),
new User(
"uid-2",
@ -115,7 +116,8 @@ namespace OnlineEditorsExampleMVC.Helpers
descr_user_2,
false,
true,
new Goback("Go to Documents", null)
new Goback("Go to Documents", null),
new Close(null, true)
),
new User(
"uid-3",
@ -135,7 +137,8 @@ namespace OnlineEditorsExampleMVC.Helpers
descr_user_3,
false,
false,
null
null,
new Close(null, true)
),
new User(
"uid-0",
@ -150,6 +153,7 @@ namespace OnlineEditorsExampleMVC.Helpers
descr_user_0,
false,
false,
null,
null
)
};
@ -242,8 +246,9 @@ namespace OnlineEditorsExampleMVC.Helpers
public bool avatar;
public Goback goback;
public Close close;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback)
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
{
this.id = id;
this.name = name;
@ -258,6 +263,7 @@ namespace OnlineEditorsExampleMVC.Helpers
this.userInfoGroups = userInfoGroups;
this.avatar = avatar;
this.goback = goback;
this.close = close;
}
}
@ -274,4 +280,18 @@ namespace OnlineEditorsExampleMVC.Helpers
this.blank = blank;
}
}
public class Close
{
public string text;
public bool visible;
public Close(){}
public Close(string text, bool visible)
{
this.text = text;
this.visible = visible;
}
}
}

View File

@ -77,15 +77,14 @@ namespace OnlineEditorsExampleMVC.Models
var jss = new JavaScriptSerializer();
var ext = Path.GetExtension(FileName).ToLower(); // get file extension
var canFill = DocManagerHelper.FillFormExts.Contains(ext);
var editorsMode = Mode ?? (canFill ? "fillForms" : "edit"); // get editor mode
var editorsMode = Mode ?? "edit"; // get editor mode
var canEdit = DocManagerHelper.EditedExts.Contains(ext); // check if the file with such an extension can be edited
var id = request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id); // get the user
if ((!canEdit && editorsMode.Equals("edit") || editorsMode.Equals("fillForms")) && canFill) {
if ((!canEdit && editorsMode.Equals("edit") || editorsMode.Equals("fillForms")) && DocManagerHelper.FillFormExts.Contains(ext)) {
editorsMode = "fillForms";
canEdit = true;
}
@ -221,6 +220,13 @@ namespace OnlineEditorsExampleMVC.Models
{ "text", user.goback.text },
{ "blank", user.goback.blank }
} : new Dictionary<string, object>{}
},
{
"close", user.close != null ? new Dictionary<string, object>
{
{ "text", user.close.text },
{ "visible", user.close. visible }
} : new Dictionary<string, object>{}
}
}
}

View File

@ -31,6 +31,7 @@ namespace OnlineEditorsExampleMVC.Models
{
public enum FileType
{
Null,
Word,
Cell,
Slide,
@ -47,7 +48,7 @@ namespace OnlineEditorsExampleMVC.Models
if (FormatManager.SpreadsheetExtensions().Contains(ext)) return FileType.Cell; // cell type for spreadsheet extensions
if (FormatManager.PresentationExtensions().Contains(ext)) return FileType.Slide; // slide type for presentation extensions
return FileType.Word; // the default type is word
return FileType.Null; // the default type is word
}
}

View File

@ -1,3 +1,21 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
function deleteFile(event) {
let filename = event.currentTarget.getAttribute("data");
filename = encodeURIComponent(filename);

View File

@ -154,6 +154,16 @@ if (typeof jQuery != "undefined") {
return;
} else {
if (response.error.includes("Error conversion output format")) {
let format = formatManager.findByExtension(fileName.split(".").pop());
if (!format.convert.includes("docx")) {
jq(".document").addClass("invisible")
}
if (!format.convert.includes("xlsx")) {
jq(".spreadsheet").addClass("invisible")
}
if (!format.convert.includes("pptx")) {
jq(".presentation").addClass("invisible")
}
jq("#select-file-type").removeClass("invisible");
jq("#step2").removeClass("current");
jq("#hiddenFileName").attr("placeholder", filePass);
@ -294,6 +304,134 @@ if (typeof jQuery != "undefined") {
jq("#embeddedView").attr("src", url);
});
jq(document).on("click", "#beginEditConverted:not(.disable)", function () {
var fileId = encodeURIComponent(jq('#hiddenFileName').attr("data"));
var url = UrlEditor + "?fileName=" + fileId;
window.open(url, "_blank");
jq('#hiddenFileName').val("");
jq.unblockUI();
document.location.reload();
});
jq(document).on("click", "#beginViewConverted:not(.disable)", function () {
var fileId = encodeURIComponent(jq('#hiddenFileName').attr("data"));
var url = UrlEditor + "?editorsMode=view&fileName=" + fileId;
window.open(url, "_blank");
jq('#hiddenFileName').val("");
jq.unblockUI();
document.location.reload();
});
jq(document).on("click", "#downloadConverted:not(.disable)", function () {
var fileId = jq('#hiddenFileName').attr("data");
if (jq("#downloadConverted").attr("data") == "fromConverter") window.location.assign(fileId);
else window.open("webeditor.ashx?type=download&fileName=" + encodeURIComponent(fileId), "_blank");
});
jq(document).on("click", ".convert-file", function () {
const currentElement = jq(this);
var fileName = currentElement.attr("data");
var type = currentElement.attr("data-type");
jq.blockUI({
theme: true,
title: "Converting file" + "<div class=\"dialog-close\"></div>",
message: jq("#convertingProgress"),
overlayCSS: { "background-color": "#aaa" },
themedCSS: { width: "539px", top: "20%", left: "50%", marginLeft: "-269px" }
});
jq("#convertFileName").text(decodeURIComponent(fileName));
jq("#convertFileName").removeClass("word slide cell");
jq("#convertFileName").addClass(type);
jq("#convTypes").empty();
let format = formatManager.findByExtension(fileName.split('.').pop());
if (format) {
format.convert.forEach(ext => {
jq("#convTypes").append(jq(`<td name="convertingTypeButton" id="wordTo${ext}" class="button hoar" data="${ext}">${ext}</td>`));
});
}
jq("#hiddenFileName").val(fileName);
jq("#convertStep1").addClass("done");
jq("#convertStep2").addClass("waiting");
});
jq(document).on("click", "td[name='convertingTypeButton']:not(.disable, .orange)", function () {
const currentElement = jq(this);
let id = currentElement[0].id;
let fileExt = jq(`#${id}`).attr("data");
jq(`#${id}`).addClass("orange");
jq("td[name='convertingTypeButton']").addClass("disable");
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
jq("#convertStep2").text('2. File conversion');
jq("#convert-descr").removeClass("disable");
jq("#convertPercent").text("0 %");
jq("#hiddenFileName").attr("placeholder",fileExt);
jq("#downloadConverted").addClass("disable");
jq("#beginEditConverted").addClass("disable");
jq("#beginViewConverted").addClass("disable");
mustReload = true;
convertFile();
});
function convertFile (filePass) {
let fileName = decodeURIComponent(jq("#hiddenFileName").val());
let fileExt = jq("#hiddenFileName").attr("placeholder");
filePass = filePass ? filePass : null;
if (timer != null) {
clearTimeout(timer);
}
timer = setTimeout(function () {
jq.ajax({
async: true,
contentType: "text/xml",
type: "post",
dataType: "json",
data: JSON.stringify({filename: fileName, filePass: filePass, lang: language, fileExt: fileExt, keepOriginal: true}),
url: UrlConverter,
complete: function (data) {
try {
var response = jq.parseJSON(data.responseText);
} catch (e) {
response = { error: e };
}
if (!response.filename && !response.step && response.error) {
jq("#convertStep2").removeClass("current").addClass("error");
jq("#convertStep2").text(`2. File conversion to ${fileExt}`);
jq("#convert-error").removeClass("hidden");
jq("#convert-error").text(`${response.error}`);
jq("td[name='convertingTypeButton']").removeClass("disable orange");
return;
}
if (response.step != undefined && response.step != 100) {
jq("#convertPercent").text(`${response.step} %`);
convertFile();
} else {
jq("#convertPercent").text(`${response.step} %`);
jq("#convertStep2").removeClass("current").addClass("done");
jq("#convertStep2").text(`2. File conversion to ${fileExt}`);
jq("#downloadConverted").removeClass("disable");
if (response.error !== "FileTypeIsNotSupported") {
jq("#hiddenFileName").attr("data",response.filename);
jq("#beginEditConverted").removeClass("disable");
jq("#beginViewConverted").removeClass("disable");
jq("#downloadConverted").attr("data","fromStorage");
} else {
let newFilename = fileName.split('.').slice(0,-1).join('.')
jq("#hiddenFileName").attr("data",response.filename.split("&filename=download").join(`&filename=${newFilename}`));
jq("#downloadConverted").attr("data","fromConverter");
}
jq("td[name='convertingTypeButton']").removeClass("disable orange");
}
}
});
}, 1000);
}
jq(document).on("click", "#cancelEdit, .dialog-close", function () {
jq('#hiddenFileName').val("");
jq("#embeddedView").attr("src", "");

View File

@ -62,8 +62,8 @@
// the document is modified
var onDocumentStateChange = function (event) {
var title = document.title.replace(/\*$/g, "");
document.title = title + (event.data ? "*" : "");
var title = document.title.replace(/^\*/g, "");
document.title = (event.data ? "*" : "") + title;
};
// the user is trying to switch the document from the viewing into the editing mode
@ -106,6 +106,11 @@
docEditor.setActionLink(replaceActionLink(location.href, linkParam)); // set the link to the document which contains a bookmark
};
var onRequestClose = function () { // close editor
docEditor.destroyEditor();
innerAlert("Document editor closed successfully");
};
// the meta information of the document is changed via the meta command
var onMetaChange = function (event) {
if (event.data.favorite !== undefined) {
@ -218,6 +223,52 @@
}
};
var onRequestReferenceSource = function (event) {
innerAlert("onRequestReferenceSource");
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=files");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
xhr.onload = function () {
if (xhr.status === 200) {
innerAlert(JSON.parse(xhr.responseText));
let fileList = JSON.parse(xhr.responseText);
let firstXlsxName;
let file;
for (file of fileList) {
if (file["title"]) {
if (getFileExt(file["title"]) === "xlsx")
{
firstXlsxName = file["title"];
break;
}
}
}
if (firstXlsxName) {
let data = {
directUrl : !!config.document.directUrl,
path : firstXlsxName
};
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor.ashx?type=reference");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(data));
xhr.onload = function () {
if (xhr.status === 200) {
docEditor.setReferenceSource(JSON.parse(xhr.responseText));
} else {
innerAlert("/reference - bad status");
}
}
} else {
innerAlert("No *.xlsx files");
}
} else {
innerAlert("/files - bad status");
}
}
};
var onRequestHistory = function () {
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=gethistory&filename=<%= Model.FileName %>");
@ -319,6 +370,7 @@
};
if (config.editorConfig.user.id) {
config.events['onRequestClose'] = onRequestClose;
// the user is trying to show the document version history
config.events['onRequestHistory'] = onRequestHistory;
// the user is trying to click the specific document version in the document version history
@ -346,12 +398,20 @@
// prevent switch the document from the viewing into the editing mode for anonymous users
config.events['onRequestEditRights'] = onRequestEditRights;
config.events['onRequestOpen'] = onRequestOpen;
config.events['onRequestReferenceSource'] = onRequestReferenceSource;
}
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
const getFileExt = function (fileName) {
if (fileName.indexOf(".")) {
return fileName.split('.').reverse()[0];
}
return false;
};
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {

View File

@ -192,8 +192,7 @@
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td class="tableHeaderCell tableHeaderCellEditors contentCells-shift">Editors</td>
<td class="tableHeaderCell tableHeaderCellViewers">Viewers</td>
<td class="tableHeaderCell tableHeaderCellDownload">Download</td>
<td class="tableHeaderCell tableHeaderCellRemove">Remove</td>
<td class="tableHeaderCell tableHeaderCellAction">Action</td>
</tr>
</thead>
</table>
@ -301,14 +300,22 @@
<img src="content/images/embeded.svg" alt="Open in embedded mode" title="Open in embedded mode"/>
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift downloadContentCellShift">
<% if (docType != null ) { %>
<td class="contentCells contentCells-icon">
<a class="convert-file" data="<%= storedFile.Name %>" data-type="<%= docType %>">
<img class="icon-action" src="content/images/convert.svg" alt="Convert" title="Convert" /></a>
</td>
<% } else { %>
<td class="contentCells contentCells-icon downloadContentCellShift"></td>
<% } %>
<td class="contentCells contentCells-icon downloadContentCellShift">
<a href="webeditor.ashx?type=download&fileName=<%= HttpUtility.UrlEncode(storedFile.Name) %>">
<img class="icon-download" src="content/images/download.svg" alt="Download" title="Download" />
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<a class="delete-file" data-filename="<%= storedFile.Name %>">
<img class="icon-delete" src="content/images/delete.svg" alt="Delete" title="Delete" />
<img class="icon-action" src="content/images/delete.svg" alt="Delete" title="Delete" />
</a>
</td>
</tr>
@ -377,6 +384,32 @@
</div>
</div>
<div id="convertingProgress">
<div id="convertingSteps">
<span id="convertFileName" class="convertFileName"></span>
<span id="convertStep1" class="step">1. Select a format file to convert</span>
<span class="step-descr">The converting speed depends on file size and additional elements it contains.</span>
<table cellspacing="0" cellpadding="0" width="100%" class="convertTable">
<tbody>
<tr class="typeButtonsRow" id="convTypes"></tr>
</tbody>
</table>
<br />
<span id="convertStep2" class="step">2. File conversion</span>
<span class="step-descr disable" id="convert-descr">The file is converted <div class="convertPercent" id="convertPercent">0 %</div></span>
<span class="step-error hidden" id="convert-error"></span>
<div class="describeUpload">Note the speed of all operations depends on your connection quality and server location.</div>
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
</div>
<br />
<div class="buttonsMobile">
<div id="downloadConverted" class="button converting orange disable">DOWNLOAD</div>
<div id="beginViewConverted" class="button converting wide gray disable">VIEW</div>
<div id="beginEditConverted" class="button converting wide gray disable">EDIT</div>
<div id="cancelEdit" class="button converting gray">CANCEL</div>
</div>
</div>
<span id="loadScripts" data-docs="<%= WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.preloader"] %>"></span>
<footer>

View File

@ -254,8 +254,15 @@ namespace OnlineEditorsExampleMVC
conversionExtension = fileExt.ToString();
}
object keepOriginal;
bool removeOriginal = true;
if (body.TryGetValue("keepOriginal", out keepOriginal) && !String.IsNullOrEmpty(keepOriginal.ToString()))
{
removeOriginal = keepOriginal.ToString().ToLower() != "true";
}
// check if the file with such an extension can be converted
if (DocManagerHelper.ConvertExts.Contains("." + extension))
if (DocManagerHelper.ConvertExts.Contains("." + extension) || conversionExtension != "ooxml")
{
// generate document key
var key = ServiceConverter.GenerateRevisionId(fileUri);
@ -278,9 +285,14 @@ namespace OnlineEditorsExampleMVC
}
var newFileUri = newFileData["fileUrl"];
var newFileType = "." + newFileData["fileType"];
var newFileType = newFileData["fileType"];
if (!FormatManager.All().Any(f => f.Name == newFileType && f.Type != FileUtility.FileType.Null))
{
context.Response.Write("{\"step\": \"" + result + "\", \"filename\": \"" + newFileUri + "\", \"error\": \"FileTypeIsNotSupported\"}");
return;
}
// get a file name of an internal file extension with an index if the file with such a name already exists
var correctName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + newFileType);
var correctName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "." + newFileType);
var req = (HttpWebRequest)WebRequest.Create(newFileUri);
@ -302,11 +314,14 @@ namespace OnlineEditorsExampleMVC
}
}
Remove(fileName); // remove the original file and its history if it exists
if (removeOriginal) Remove(fileName); // remove the original file and its history if it exists
fileName = correctName; // create meta information about the converted file with user id and name specified
var id = context.Request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
DocManagerHelper.CreateMeta(fileName, user.id, user.name);
context.Response.Write("{ \"filename\" : \"" + fileName + "\", \"step\": \"" + result + "\" }");
return;
}
var documentType = FileUtility.GetFileType(fileName).ToString().ToLower();

View File

@ -1,4 +1,22 @@
.center {
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
.center {
width: auto;
}

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4285 13C14.4102 13 14 13 14 13.5V15H6C5.44772 15 5 15.4477 5 16V17C5 17.5523 5.44771 18 6 18H14V19.5C14 20 14.3816 20 14.4285 20C14.6359 20 15.0099 19.9113 15.2172 19.7363L18.6207 17.0833C19.1264 16.6566 19.1264 16.3434 18.6207 15.9167L15.2172 13.2637C15.0099 13.0887 14.6359 13 14.4285 13Z" fill="#444444"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.5715 4C9.58984 4 10 4 10 4.50002V6H18C18.5523 6 19 6.44772 19 7V8C19 8.55228 18.5523 9 18 9H10V10.5C10 11 9.61841 11 9.57151 11C9.36409 11 8.99012 10.9113 8.78279 10.7363L5.37934 8.08333C4.87356 7.65662 4.87356 7.34338 5.37934 6.91667L8.78279 4.26366C8.99012 4.08874 9.36409 4 9.5715 4Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 821 B

View File

@ -1 +1,7 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#1E7AAA"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path d="M6 15h18v1H6v-1zM6 19h18v1H6v-1zM6 23h18v1H6v-1zM6 27h18v1H6v-1z" fill="#fff"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#287CA9"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="7" y="28" width="10" height="2" rx="1" fill="#fff"/>
<rect x="7" y="22" width="16" height="2" rx="1" fill="#fff"/>
<rect x="7" y="16" width="16" height="2" rx="1" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 503 B

View File

@ -1,5 +1,8 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H23L30 7V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#9E1919"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.0062 15V16.0065H24V15H17.0062ZM17.0062 19V20.0163H24V19H17.0062ZM24 23H17.0062V24.0261H24V23ZM6 28V27.0293H24V28H6ZM7 16H14V23H7V16ZM6 15H7H14H15V16V23V24H14H7H6V23V16V15Z" fill="white"/>
<path d="M23 0L30 7H26C24.3431 7 23 5.65685 23 4V0Z" fill="black" fill-opacity="0.25"/>
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#E54D39"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="7" y="28" width="16" height="2" rx="1" fill="#fff"/>
<rect x="18" y="22" width="5" height="2" rx="1" fill="#fff"/>
<rect x="18" y="16" width="5" height="2" rx="1" fill="#fff"/>
<rect x="8" y="17" width="6" height="6" rx=".833" stroke="#fff" stroke-width="2"/>
</svg>

Before

Width:  |  Height:  |  Size: 558 B

After

Width:  |  Height:  |  Size: 590 B

View File

@ -1 +1,8 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#F36700"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path stroke="#fff" stroke-opacity=".95" d="M6.5 15.5h17v12h-17z"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#F36700"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="6" y="28" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="2" height="14" rx="1" fill="#fff"/>
<rect x="22" y="16" width="2" height="14" rx="1" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 570 B

View File

@ -1 +1,5 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#D0D5DA"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#646464"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 23c-.27614 0-.5.2239-.5.5v4c0 .2761.22386.5.5.5h15c.2761 0 .5-.2239.5-.5v-4c0-.2761-.2239-.5-.5-.5h-2c-.2761 0-.5-.2239-.5-.5s.2239-.5.5-.5h2c.8284 0 1.5.6716 1.5 1.5v4c0 .8284-.6716 1.5-1.5 1.5h-15c-.82843 0-1.5-.6716-1.5-1.5v-4c0-.8284.67157-1.5 1.5-1.5h2c.27614 0 .5.2239.5.5s-.22386.5-.5.5h-2z" fill="#646464"/><path fill-rule="evenodd" clip-rule="evenodd" d="M20 20.0001L15 14l-5 6.0001h3v4c0 .5523.4477 1 1 1h2c.5523 0 1-.4477 1-1v-4h3z" fill="#646464"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#D1D5DA"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5zm-5.293 14.293a1 1 0 0 0-1.414 0l-4 4a1 1 0 1 0 1.414 1.414L14 17.414V25a1 1 0 1 0 2 0v-7.586l2.293 2.293a1 1 0 0 0 1.414-1.414z" fill="#646464"/>
<path d="M8.833 22H11a1 1 0 1 1 0 2H9v4h12v-4h-2a1 1 0 1 1 0-2h2.167c1.012 0 1.833.82 1.833 1.833v4.334C23 29.179 22.18 30 21.167 30H8.833A1.833 1.833 0 0 1 7 28.167v-4.334C7 22.821 7.82 22 8.833 22" fill="#646464"/>
</svg>

Before

Width:  |  Height:  |  Size: 797 B

After

Width:  |  Height:  |  Size: 638 B

View File

@ -1 +1,10 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3c0-1.65685 1.34315-3 3-3h20l7 7v30c0 1.6569-1.3431 3-3 3H3c-1.65685 0-3-1.3431-3-3V3z" fill="#6AAA1E"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#000" fill-opacity=".25"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 15h18v13H7.00001v-1H12v-3H7v4H6V15zm7 12h4v-3h-4v3zm5 0h5v-3h-5v3zm5-7v3h-5v-3h5zm-6 0v3h-4v-3h4zm-5 0v3H7v-3h5zm11-1v-3h-5v3h5zm-10-3h4v3h-4v-3zm-1 3v-3H7v3h5z" fill="#fff" fill-opacity=".95"/></svg>
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 2.5A2.5 2.5 0 0 1 2.5 0H21l9 9v28.5a2.5 2.5 0 0 1-2.5 2.5h-25A2.5 2.5 0 0 1 0 37.5z" fill="#3AA133"/>
<path d="m21 0 9 9h-6.5A2.5 2.5 0 0 1 21 6.5z" fill="#000" fill-opacity=".25"/>
<rect x="6" y="28" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="22" width="18" height="2" rx="1" fill="#fff"/>
<rect x="6" y="16" width="2" height="14" rx="1" fill="#fff"/>
<rect x="12" y="16" width="2" height="14" rx="1" fill="#fff"/>
<rect x="22" y="16" width="2" height="14" rx="1" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 703 B

View File

@ -1,12 +1,5 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.84616 1H10.8462L14.8462 5V15H2.84616V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8462 5L10.8462 1H2.84616V15H14.8462V5ZM10.8462 0L15.8462 5V16H1.84616V0H10.8462Z" fill="#BFBFBF"/>
<rect x="3.84616" y="10" width="10" height="4" fill="#3779A6"/>
<path d="M3.84616 4H4.84616V5H3.84616V4Z" fill="#BFBFBF"/>
<path d="M3.84616 6H4.84616V7H3.84616V6Z" fill="#BFBFBF"/>
<path d="M4.84616 8H3.84616V9H4.84616V8Z" fill="#BFBFBF"/>
<path d="M12.8462 8H5.84616V9H12.8462V8Z" fill="#BFBFBF"/>
<path d="M7.84616 6H5.84616V7H7.84616V6Z" fill="#BFBFBF"/>
<path d="M12.8462 4H5.84616V5H12.8462V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9.84616 1H10.8462V4H14.8462L15.8462 5H9.84616V1Z" fill="#333333"/>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
<path fill="#287CA9" d="M5 7h6v1H5zm0 2h6v1H5zm0 2h4v1H5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 394 B

View File

@ -1 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 1h8l4 4v10H2V1z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5l-4-4H2v14h12V5zm-4-5l5 5v11H1V0h9z" fill="#BFBFBF"/><path fill="#9E1919" d="M3 10h10v4H3z"/><path d="M7 7V2H3v5h4zM8 3V2h2v1H8zM8 5V4h5v1H8zM13 6H8v1h5V6zM13 8H3v1h10V8z" fill="#BFBFBF"/><path opacity=".3" d="M9 1h1v3h4l1 1H9V1z" fill="#333"/></svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
<path d="M7.36 5.777c0 1.085-.31 2.363-.833 3.543-.526 1.185-1.235 2.198-1.974 2.796l.803 1.109c1.992-1.342 4.198-2.262 6.333-1.954L12 9.938c-1.819-.612-3.278-2.449-3.278-4.16zm.888 2.84a6.7 6.7 0 0 0 1.161 1.35c-.668.122-1.323.32-1.957.573q.17-.322.316-.657c.183-.41.344-.836.48-1.267" fill="#E54D39"/>
</svg>

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 637 B

View File

@ -1,12 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1H10L14 5V15H2V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 5L10 1H2V15H14V5ZM10 0L15 5V16H1V0H10Z" fill="#BFBFBF"/>
<rect x="3" y="10" width="10" height="4" fill="#F36700"/>
<path d="M3 4H4V5H3V4Z" fill="#BFBFBF"/>
<path d="M3 6H4V7H3V6Z" fill="#BFBFBF"/>
<path d="M4 8H3V9H4V8Z" fill="#BFBFBF"/>
<path d="M12 8H5V9H12V8Z" fill="#BFBFBF"/>
<path d="M7 6H5V7H7V6Z" fill="#BFBFBF"/>
<path d="M12 4H5V5H12V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9 1H10V4H14L15 5H9V1Z" fill="#333333"/>
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
<path d="M5 10a3 3 0 1 0 3-3v3z" fill="#F36700"/>
<path d="M4.5 9A2.5 2.5 0 0 1 7 6.5V9z" fill="#F36700"/>
</svg>

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 444 B

View File

@ -1,12 +1,5 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.84592 1H10.8459L14.8459 5V15H2.84592V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8459 5L10.8459 1H2.84592V15H14.8459V5ZM10.8459 0L15.8459 5V16H1.84592V0H10.8459Z" fill="#BFBFBF"/>
<rect x="3.84592" y="10" width="10" height="4" fill="#78A73B"/>
<path d="M3.84592 4H4.84592V5H3.84592V4Z" fill="#BFBFBF"/>
<path d="M3.84592 6H4.84592V7H3.84592V6Z" fill="#BFBFBF"/>
<path d="M4.84592 8H3.84592V9H4.84592V8Z" fill="#BFBFBF"/>
<path d="M12.8459 8H5.84592V9H12.8459V8Z" fill="#BFBFBF"/>
<path d="M7.84592 6H5.84592V7H7.84592V6Z" fill="#BFBFBF"/>
<path d="M12.8459 4H5.84592V5H12.8459V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9.84592 1H10.8459V4H14.8459L15.8459 5H9.84592V1Z" fill="#333333"/>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.207V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.793z" fill="#fff" stroke="#BBB"/>
<path d="M9.5 1v1.9c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.109.494.109 1.054.109H13" stroke="#BBB"/>
<path fill="#3AA133" d="M8 7h3v2H8zm0 3h3v2H8zM5 7h2v2H5zm0 3h2v2H5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 408 B

View File

@ -42,10 +42,14 @@
}
.tableHeaderCellViewers {
width: 29%;
width: 18%;
text-align: right;
}
.tableHeaderCellAction {
width: 23%;
}
.tableHeaderCellDownload {
width: 21%;
padding-right: 18px;
@ -220,7 +224,7 @@
}
.tableHeaderCellFileName {
width: 16%;
width: 9%;
}
.tableHeaderCellEditors {
@ -229,7 +233,12 @@
.tableHeaderCellViewers {
text-align: right;
width: 37%;
width: 9%;
}
.tableHeaderCellAction{
width: 11%;
padding-right: 82px;
}
.tableHeaderCellDownload {
@ -244,19 +253,24 @@
}
.tableHeaderCellEditors {
width: 26%;
width: 15%;
text-align: left;
}
.tableHeaderCellFileName {
width: 17%;
width: 28%;
}
.tableHeaderCellViewers {
width: 27%;
width: 6%;
text-align: right;
}
.tableHeaderCellAction{
width: 18%;
padding-right: 54px;
}
.tableHeaderCellDownload {
padding-right: 18px;
width: 20%;
@ -277,12 +291,17 @@
.tableRow td:first-child {
flex-grow: 0;
width: 15%;
width: 25%;
margin-right: auto;
}
.contentCells-icon {
width: 3%;
}
.firstContentCellViewers {
margin-left: 0;
}
}
@media (max-width: 890px) and (min-width: 769px ) {
@ -290,7 +309,7 @@
width: 20%;
}
.contentCells-shift {
padding-right: 28px;
padding-right: 27px;
}
.main-panel {
@ -323,11 +342,16 @@
.tableHeaderCellEditors {
text-align: left;
width: 31%;
width: 1%;
}
.tableHeaderCellViewers {
width: 18%;
width: 19%;
}
.tableHeaderCellAction {
width: 19%;
padding-right: 45px;
}
}
@ -429,8 +453,8 @@
.downloadContentCellShift {
max-width: 7%;
margin-right: -11px;
margin-left: auto;
margin-right: 24px;
margin-left: 0;
}
.contentCells-icon {
@ -438,13 +462,13 @@
}
.tableRow td:last-child {
width: 12%;
padding-right: 40px;
width: 7%;
padding-right: 0px;
border: none;
}
.contentCells-shift {
padding-right: 35px;
padding-right: 0px;
}
.downloadContentCellShift:after {
@ -530,6 +554,15 @@
height: 56px;
margin-bottom: 24px !important;
}
.button.hoar{
width: 18%;
height: 27px;
margin-bottom: 7px !important;
}
.button.converting{
width: 126px;
margin-top: 0;
}
}
@media (max-width: 560px) and (min-width: 510px) {
@ -538,7 +571,7 @@
}
.downloadContentCellShift {
padding-right: 45px;
padding-right: 16px;
max-width: 4%;
}
}
@ -558,7 +591,7 @@
.downloadContentCellShift {
max-width: 6%;
padding-right: 37px;
padding-right: 6px;
}
.firstContentCellShift {
@ -584,12 +617,12 @@
.downloadContentCellShift {
max-width: 3%;
padding-right: 37px;
padding-right: 0px;
padding-left: 0;
}
.firstContentCellShift {
margin-left: 1px;
margin-left: 2px;
flex-basis: 14%;
}
@ -619,7 +652,7 @@
.downloadContentCellShift {
max-width: 4%;
margin-right: -18px;
margin-right: 18px;
margin-left: -1px;
}
@ -628,7 +661,7 @@
}
.contentCells-icon{
width: 10%;
width: 12%;
}
footer table td {
margin: 0;

View File

@ -238,6 +238,52 @@ label .checkbox {
color: #FF6F3D;
}
.button.converting {
margin-top: -20px;
padding: 16px 16px;
}
.button.converting.wide {
padding: 16px 29px;
}
.button.hoar {
background: #EFEFEF;
border: 1px solid #EFEFEF;
margin-right: 7px;
margin-bottom: 7px;
width: 13%;
padding-left: 0;
padding-right: 0;
font-size: 11px;
}
.button.hoar.disable {
opacity: 30%;
cursor: default;
}
.button.hoar:not(.disable):hover {
background: #FF6F3D;
border: 1px solid #FF6F3D;
color: #FFFFFF;
}
.button.hoar.orange {
background: #FF6F3D;
border: 1px solid #FF6F3D;
color: #FFFFFF;
cursor: default;
}
.button.hoar.orange.disable {
background: #444444;
border: 1px solid #444444;
color: #FFFFFF;
cursor: default;
opacity: 100%;
}
.button.file-type {
font-size: 11px;
color: #FFFFFF;
@ -380,6 +426,32 @@ label .checkbox {
display: none;
}
#convertingProgress {
color: #333333;
display: none;
font-size: 12px;
margin: 30px 35px;
}
#convertingProgress .convertFileName{
background-position: left center;
background-repeat: no-repeat;
display: block;
font-size: 14px;
line-height: 160%;
overflow: hidden;
padding-left: 28px;
margin-bottom: 16px;
text-overflow: ellipsis;
white-space: nowrap;
}
#convertingProgress .describeUpload {
line-height: 150%;
letter-spacing: -0.02em;
padding: 16px 0;
}
.error-message {
background: url("images/error.svg") no-repeat scroll 4px 10px;
color: #CB0000;
@ -401,6 +473,10 @@ label .checkbox {
padding-left: 35px;
}
.waiting {
opacity: 30%;
}
.current {
background-image: url("images/loader16.gif");
}
@ -413,6 +489,12 @@ label .checkbox {
background-image: url("images/notdone.svg");
}
.convertPercent {
color: #FF6F3D;
font-weight: 700;
display: inline;
}
.step-descr {
display: block;
margin-left: 35px;
@ -420,6 +502,10 @@ label .checkbox {
line-height: 188%;
}
.step-descr.disable {
display: none;
}
.progress-descr {
letter-spacing: -0.02em;
line-height: 150%;
@ -525,21 +611,25 @@ footer a:hover {
white-space: nowrap;
}
.convertFileName.word,
.stored-edit.word,
.uploadFileName.word {
background-image: url("images/icon_docx.svg");
}
.convertFileName.cell,
.stored-edit.cell,
.uploadFileName.cell {
background-image: url("images/icon_xlsx.svg");
}
.convertFileName.slide,
.stored-edit.slide,
.uploadFileName.slide {
background-image: url("images/icon_pptx.svg");
}
.convertFileName.pdf,
.stored-edit.pdf,
.uploadFileName.pdf {
background-image: url("images/icon_pdf.svg");
@ -596,6 +686,11 @@ footer a:hover {
visibility: hidden;
}
.convertTable {
margin-top: 10px;
margin-left: 35px;
}
.tableRow {
background: transparent;
-moz-transition: all 0.2s ease-in-out;
@ -642,6 +737,12 @@ footer a:hover {
width: 11%;
}
.tableHeaderCellAction{
width: 13%;
text-align: right;
padding-right: 88px;
}
.tableHeaderCellDownload {
width: 13%;
text-align: right;
@ -666,7 +767,7 @@ footer a:hover {
}
.contentCells-shift {
padding-right: 44px;
padding-right: 43px;
}
.contentCells-icon {
@ -730,7 +831,7 @@ footer a:hover {
width: 100%;
}
.icon-delete {
.icon-action {
cursor: pointer;
}
@ -809,6 +910,13 @@ html {
position: relative;
}
.typeButtonsRow {
width: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
position: relative;
}
.tableRow td:first-child {
display: flex;
@ -817,11 +925,11 @@ html {
}
.tableHeaderCellFileName {
width: 30%;
width: 20%;
}
.tableHeaderCellEditors {
width: 28%;
width: 20%;
}
.tableHeaderCellViewers {

View File

@ -194,8 +194,7 @@
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td class="tableHeaderCell tableHeaderCellEditors contentCells-shift">Editors</td>
<td class="tableHeaderCell tableHeaderCellViewers">Viewers</td>
<td class="tableHeaderCell tableHeaderCellDownload">Download</td>
<td class="tableHeaderCell tableHeaderCellRemove">Remove</td>
<td class="tableHeaderCell tableHeaderCellAction">Action</td>
</tr>
</thead>
</table>
@ -303,14 +302,22 @@
<img src="app_themes/images/embeded.svg" alt="Open in embedded mode" title="Open in embedded mode"/>
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift downloadContentCellShift">
<% if (docType != null ) { %>
<td class="contentCells contentCells-icon">
<a class="convert-file" data="<%= storedFile.Name %>" data-type="<%= docType %>">
<img class="icon-action" src="app_themes/images/convert.svg" alt="Convert" title="Convert" /></a>
</td>
<% } else { %>
<td class="contentCells contentCells-icon downloadContentCellShift"></td>
<% } %>
<td class="contentCells contentCells-icon downloadContentCellShift">
<a href="webeditor.ashx?type=download&fileName=<%= HttpUtility.UrlEncode(storedFile.Name) %>">
<img class="icon-download" src="app_themes/images/download.svg" alt="Download" title="Download" />
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<a class="delete-file" data-filename="<%= storedFile.Name %>">
<img class="icon-delete" src="app_themes/images/delete.svg" alt="Delete" title="Delete" />
<img class="icon-action" src="app_themes/images/delete.svg" alt="Delete" title="Delete" />
</a>
</td>
</tr>
@ -379,6 +386,32 @@
</div>
</div>
<div id="convertingProgress">
<div id="convertingSteps">
<span id="convertFileName" class="convertFileName"></span>
<span id="convertStep1" class="step">1. Select a format file to convert</span>
<span class="step-descr">The converting speed depends on file size and additional elements it contains.</span>
<table cellspacing="0" cellpadding="0" width="100%" class="convertTable">
<tbody>
<tr class="typeButtonsRow" id="convTypes"></tr>
</tbody>
</table>
<br />
<span id="convertStep2" class="step">2. File conversion</span>
<span class="step-descr disable" id="convert-descr">The file is converted <div class="convertPercent" id="convertPercent">0 %</div></span>
<span class="step-error hidden" id="convert-error"></span>
<div class="describeUpload">Note the speed of all operations depends on your connection quality and server location.</div>
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
</div>
<br />
<div class="buttonsMobile">
<div id="downloadConverted" class="button converting orange disable">DOWNLOAD</div>
<div id="beginViewConverted" class="button converting wide gray disable">VIEW</div>
<div id="beginEditConverted" class="button converting wide gray disable">EDIT</div>
<div id="cancelEdit" class="button converting gray">CANCEL</div>
</div>
</div>
<span id="loadScripts" data-docs="<%= UrlPreloadScripts %>"></span>
<footer>

View File

@ -447,8 +447,15 @@ namespace OnlineEditorsExample
conversionExtension = fileExt.ToString();
}
object keepOriginal;
bool removeOriginal = true;
if (body.TryGetValue("keepOriginal", out keepOriginal) && !String.IsNullOrEmpty(keepOriginal.ToString()))
{
removeOriginal = keepOriginal.ToString().ToLower() != "true";
}
// check if the file with such an extension can be converted
if (ConvertExts.Contains("." + extension))
if (ConvertExts.Contains("." + extension) || conversionExtension != "ooxml")
{
// generate document key
var key = ServiceConverter.GenerateRevisionId(FileUri(_fileName, true));
@ -469,9 +476,13 @@ namespace OnlineEditorsExample
}
var newFileUri = newFileData["fileUrl"];
var newFileType = "." + newFileData["fileType"];
var newFileType = newFileData["fileType"];
if (!FormatManager.All().Any(f => f.Name == newFileType && f.Type != ""))
{
return "{\"step\": \"" + result + "\", \"filename\": \"" + newFileUri + "\", \"error\": \"FileTypeIsNotSupported\"}";
}
// get a file name of an internal file extension with an index if the file with such a name already exists
var fileName = GetCorrectName(Path.GetFileNameWithoutExtension(_fileName) + newFileType);
var fileName = GetCorrectName(Path.GetFileNameWithoutExtension(_fileName) + "." + newFileType);
var req = (HttpWebRequest)WebRequest.Create(newFileUri);
@ -493,17 +504,21 @@ namespace OnlineEditorsExample
}
}
// remove the original file and its history if it exists
var storagePath = StoragePath(_fileName, null);
var histDir = HistoryDir(storagePath);
File.Delete(storagePath);
if (Directory.Exists(histDir)) Directory.Delete(histDir, true);
if (removeOriginal)
{
// remove the original file and its history if it exists
var storagePath = StoragePath(_fileName, null);
var histDir = HistoryDir(storagePath);
File.Delete(storagePath);
if (Directory.Exists(histDir)) Directory.Delete(histDir, true);
}
// create meta information about the converted file with user id and name specified
_fileName = fileName;
var id = context.Request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id); // get the user
DocEditor.CreateMeta(_fileName, user.id, user.name, null);
return "{\"step\": \"" + result + "\", \"filename\": \"" + _fileName + "\"}";
}
return "{ \"filename\" : \"" + _fileName + "\"}";

View File

@ -12,7 +12,7 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" href="<%= "app_themes/images/" + DocumentType + ".ico" %>" type="image/x-icon" />
<title>ONLYOFFICE</title>
<title><%= FileName + " - ONLYOFFICE" %></title>
<!--
*
* (c) Copyright Ascensio System SIA 2024
@ -80,8 +80,8 @@
// the document is modified
var onDocumentStateChange = function (event) {
var title = document.title.replace(/\*$/g, "");
document.title = title + (event.data ? "*" : "");
var title = document.title.replace(/^\*/g, "");
document.title = (event.data ? "*" : "") + title;
};
// the user is trying to switch the document from the viewing into the editing mode
@ -124,6 +124,11 @@
docEditor.setActionLink(replaceActionLink(location.href, linkParam)); // set the link to the document which contains a bookmark
};
var onRequestClose = function () { // close editor
docEditor.destroyEditor();
innerAlert("Document editor closed successfully");
};
// the meta information of the document is changed via the meta command
var onMetaChange = function (event) {
if (event.data.favorite !== undefined) {
@ -233,6 +238,52 @@
}
};
var onRequestReferenceSource = function (event) {
innerAlert("onRequestReferenceSource");
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=files");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
xhr.onload = function () {
if (xhr.status === 200) {
innerAlert(JSON.parse(xhr.responseText));
let fileList = JSON.parse(xhr.responseText);
let firstXlsxName;
let file;
for (file of fileList) {
if (file["title"]) {
if (getFileExt(file["title"]) === "xlsx")
{
firstXlsxName = file["title"];
break;
}
}
}
if (firstXlsxName) {
let data = {
directUrl : !!config.document.directUrl,
path : firstXlsxName
};
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor.ashx?type=reference");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(data));
xhr.onload = function () {
if (xhr.status === 200) {
docEditor.setReferenceSource(JSON.parse(xhr.responseText));
} else {
innerAlert("/reference - bad status");
}
}
} else {
innerAlert("No *.xlsx files");
}
} else {
innerAlert("/files - bad status");
}
}
};
var onRequestUsers = function (event) {
if (event && event.data){
var c = event.data.c;
@ -287,6 +338,7 @@
if (config.editorConfig.user.id) {
config.events['onRequestClose'] = onRequestClose;
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history
let xhr = new XMLHttpRequest();
@ -347,12 +399,20 @@
// prevent switch the document from the viewing into the editing mode for anonymous users
config.events['onRequestEditRights'] = onRequestEditRights;
config.events['onRequestOpen'] = onRequestOpen;
config.events['onRequestReferenceSource'] = onRequestReferenceSource;
}
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
const getFileExt = function (fileName) {
if (fileName.indexOf(".")) {
return fileName.split('.').reverse()[0];
}
return false;
};
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {

View File

@ -140,9 +140,8 @@ namespace OnlineEditorsExample
// get file extension
var ext = Path.GetExtension(FileName).ToLower();
var canFill = _Default.FillFormsExts.Contains(ext);
// get editor mode or set the default one (edit)
var editorsMode = Request.GetOrDefault("editorsMode", canFill ? "fillForms" : "edit");
var editorsMode = Request.GetOrDefault("editorsMode", "edit");
var canEdit = _Default.EditedExts.Contains(ext); // check if this file can be edited
var editorsType = Request.GetOrDefault("editorsType", "desktop");
@ -150,7 +149,7 @@ namespace OnlineEditorsExample
var id = Request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id); // get the user
if ((!canEdit && editorsMode.Equals("edit") || editorsMode.Equals("fillForms")) && canFill) {
if ((!canEdit && editorsMode.Equals("edit") || editorsMode.Equals("fillForms")) && _Default.FillFormsExts.Contains(ext)) {
editorsMode = "fillForms";
canEdit = true;
}
@ -288,6 +287,13 @@ namespace OnlineEditorsExample
{ "text", user.goback.text },
{ "blank", user.goback.blank }
} : new Dictionary<string, object>{}
},
{
"close", user.close != null ? new Dictionary<string, object>
{
{ "visible", user.close.visible },
{ "text", user.close.text }
} : new Dictionary<string, object>{}
}
}
}

View File

@ -94,7 +94,8 @@ namespace OnlineEditorsExample
descr_user_1,
true,
true,
new Goback(null, false)
new Goback(null, false),
new Close(null, false)
),
new User(
"uid-2",
@ -114,7 +115,8 @@ namespace OnlineEditorsExample
descr_user_2,
false,
true,
new Goback("Go to Documents",null)
new Goback("Go to Documents",null),
new Close(null, true)
),
new User(
"uid-3",
@ -134,7 +136,8 @@ namespace OnlineEditorsExample
descr_user_3,
false,
false,
null
null,
new Close(null, true)
),
new User(
"uid-0",
@ -149,6 +152,7 @@ namespace OnlineEditorsExample
descr_user_0,
false,
false,
null,
null
)
};
@ -242,8 +246,9 @@ namespace OnlineEditorsExample
public List<string> userInfoGroups;
public bool avatar;
public Goback goback;
public Close close;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback)
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
{
this.id = id;
this.name = name;
@ -258,6 +263,7 @@ namespace OnlineEditorsExample
this.userInfoGroups = userInfoGroups;
this.avatar = avatar;
this.goback = goback;
this.close = close;
}
}
@ -274,4 +280,18 @@ namespace OnlineEditorsExample
this.blank = blank;
}
}
public class Close
{
public string text;
public bool visible;
public Close(){}
public Close(string text, bool visible)
{
this.text = text;
this.visible = visible;
}
}
}

View File

@ -1,3 +1,21 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
function deleteFile(event) {
let filename = event.currentTarget.getAttribute("data");
filename = encodeURIComponent(filename);

View File

@ -154,6 +154,16 @@ if (typeof jQuery != "undefined") {
return;
} else {
if (response.error.includes("Error conversion output format")) {
let format = formatManager.findByExtension(fileName.split(".").pop());
if (!format.convert.includes("docx")) {
jq(".document").addClass("invisible")
}
if (!format.convert.includes("xlsx")) {
jq(".spreadsheet").addClass("invisible")
}
if (!format.convert.includes("pptx")) {
jq(".presentation").addClass("invisible")
}
jq("#select-file-type").removeClass("invisible");
jq("#step2").removeClass("current");
jq("#hiddenFileName").attr("placeholder", filePass);
@ -294,6 +304,134 @@ if (typeof jQuery != "undefined") {
jq("#embeddedView").attr("src", url);
});
jq(document).on("click", "#beginEditConverted:not(.disable)", function () {
var fileId = encodeURIComponent(jq('#hiddenFileName').attr("data"));
var url = "doceditor.aspx?fileID=" + fileId;
window.open(url, "_blank");
jq('#hiddenFileName').val("");
jq.unblockUI();
document.location.reload();
});
jq(document).on("click", "#beginViewConverted:not(.disable)", function () {
var fileId = encodeURIComponent(jq('#hiddenFileName').attr("data"));
var url = "doceditor.aspx?editorsMode=view&fileID=" + fileId;
window.open(url, "_blank");
jq('#hiddenFileName').val("");
jq.unblockUI();
document.location.reload();
});
jq(document).on("click", "#downloadConverted:not(.disable)", function () {
var fileId = jq('#hiddenFileName').attr("data");
if (jq("#downloadConverted").attr("data") == "fromConverter") window.location.assign(fileId);
else window.open("webeditor.ashx?type=download&fileName=" + encodeURIComponent(fileId), "_blank");
});
jq(document).on("click", ".convert-file", function () {
const currentElement = jq(this);
var fileName = currentElement.attr("data");
var type = currentElement.attr("data-type");
jq.blockUI({
theme: true,
title: "Converting file" + "<div class=\"dialog-close\"></div>",
message: jq("#convertingProgress"),
overlayCSS: { "background-color": "#aaa" },
themedCSS: { width: "539px", top: "20%", left: "50%", marginLeft: "-269px" }
});
jq("#convertFileName").text(decodeURIComponent(fileName));
jq("#convertFileName").removeClass("word slide cell");
jq("#convertFileName").addClass(type);
jq("#convTypes").empty();
let format = formatManager.findByExtension(fileName.split('.').pop());
if (format) {
format.convert.forEach(ext => {
jq("#convTypes").append(jq(`<td name="convertingTypeButton" id="wordTo${ext}" class="button hoar" data="${ext}">${ext}</td>`));
});
}
jq("#hiddenFileName").val(fileName);
jq("#convertStep1").addClass("done");
jq("#convertStep2").addClass("waiting");
});
jq(document).on("click", "td[name='convertingTypeButton']:not(.disable, .orange)", function () {
const currentElement = jq(this);
let id = currentElement[0].id;
let fileExt = jq(`#${id}`).attr("data");
jq(`#${id}`).addClass("orange");
jq("td[name='convertingTypeButton']").addClass("disable");
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
jq("#convertStep2").text('2. File conversion');
jq("#convert-descr").removeClass("disable");
jq("#convertPercent").text("0 %");
jq("#hiddenFileName").attr("placeholder",fileExt);
jq("#downloadConverted").addClass("disable");
jq("#beginEditConverted").addClass("disable");
jq("#beginViewConverted").addClass("disable");
mustReload = true;
convertFile();
});
function convertFile (filePass) {
let fileName = decodeURIComponent(jq("#hiddenFileName").val());
let fileExt = jq("#hiddenFileName").attr("placeholder");
filePass = filePass ? filePass : null;
if (timer != null) {
clearTimeout(timer);
}
timer = setTimeout(function () {
jq.ajax({
async: true,
contentType: "text/xml",
type: "post",
dataType: "json",
data: JSON.stringify({filename: fileName, filePass: filePass, lang: language, fileExt: fileExt, keepOriginal: true}),
url: "webeditor.ashx?type=convert",
complete: function (data) {
try {
var response = jq.parseJSON(data.responseText);
} catch (e) {
response = { error: e };
}
if (!response.filename && !response.step && response.error) {
jq("#convertStep2").removeClass("current").addClass("error");
jq("#convertStep2").text(`2. File conversion to ${fileExt}`);
jq("#convert-error").removeClass("hidden");
jq("#convert-error").text(`${response.error}`);
jq("td[name='convertingTypeButton']").removeClass("disable orange");
return;
}
if (response.step != undefined && response.step != 100) {
jq("#convertPercent").text(`${response.step} %`);
convertFile();
} else {
jq("#convertPercent").text(`${response.step} %`);
jq("#convertStep2").removeClass("current").addClass("done");
jq("#convertStep2").text(`2. File conversion to ${fileExt}`);
jq("#downloadConverted").removeClass("disable");
if (response.error !== "FileTypeIsNotSupported") {
jq("#hiddenFileName").attr("data",response.filename);
jq("#beginEditConverted").removeClass("disable");
jq("#beginViewConverted").removeClass("disable");
jq("#downloadConverted").attr("data","fromStorage");
} else {
let newFilename = fileName.split('.').slice(0,-1).join('.')
jq("#hiddenFileName").attr("data",response.filename.split("&filename=download").join(`&filename=${newFilename}`));
jq("#downloadConverted").attr("data","fromConverter");
}
jq("td[name='convertingTypeButton']").removeClass("disable orange");
}
}
});
}, 1000);
}
jq(document).on("click", "#cancelEdit, .dialog-close", function () {
jq('#hiddenFileName').val("");
jq("#embeddedView").attr("src", "");

View File

@ -0,0 +1,14 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
[*.go]
indent_style = tab
[*.{js, ts, json, html}]
indent_style = space
indent_size = 4

View File

@ -0,0 +1,2 @@
filestore
assets/*

View File

@ -0,0 +1,46 @@
linters:
enable-all: true
disable:
- cyclop
- depguard
- dogsled
- err113
- errchkjson
- execinquery
- exhaustruct
- exportloopref
- funlen
- gochecknoglobals
- gocognit
- goconst
- godox
- gofumpt
- gomnd
- gosec
- interfacebloat
- ireturn
- mirror
- mnd
- musttag
- nestif
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- perfsprint
- prealloc
- revive
- varnamelen
- wrapcheck
- wsl
linters-settings:
errcheck:
exclude-functions:
- (net/http.ResponseWriter).Write
lll:
line-length: 120
gofmt:
simplify: false
stylecheck:
checks: ["all", "-ST1016", "-ST1003"]

View File

@ -0,0 +1,29 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
fx - An application framework for Go that makes dependency injection easy. (https://github.com/uber-go/fx).
License: MIT
License File: fx.license
golang-jwt - A go implementation of JSON Web Tokens. (https://github.com/golang-jwt/jwt).
License: MIT
License File: golang-jwt.license
gorilla/mux - Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler. (https://github.com/gorilla/mux).
License: BSD-3-Clause License
License File: mux.license
mapstructure - Go library for decoding generic map values into native Go structures and vice versa. (https://github.com/mitchellh/mapstructure)
License: MIT
License File: mapstructure.license
schema - Package gorilla/schema fills a struct with form values. (https://github.com/gorilla/schema)
License: BSD-3-Clause License
License File: schema.license
viper - Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed to work within an application, and can handle all types of configuration needs and formats. (https://github.com/spf13/viper).
License: MIT
License File: viper.license
zap - Blazing fast, structured, leveled logging in Go. (https://github.com/uber-go/zap).
License: MIT
License File: zap.license

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,62 @@
## Overview
This example will help you integrate ONLYOFFICE Docs into your web application written in Go.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
## Installation
### Step 1. Install ONLYOFFICE Docs
Download and install ONLYOFFICE Docs (packaged as Document Server).
See the detailed guide to learn how to install Document Server [for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx).
### Step 2. Download the Go code for the editors integration
Download the [Go example](https://api.onlyoffice.com/editors/demopreview) from our site.
To connect the editors to your website, specify the path to the editors installation, server protocol, address and port in the *configuration.env* file:
```
SERVER_ADDRESS=http(s)://address (optional)
SERVER_PORT=port
DOC_SERVER_HOST=http://documentserver/
JWT_IS_ENABLED=flag
JWT_SECRET=secret
JWT_HEADER=Authorization
```
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed.
**address** is the address of the server, **port** is the server port.
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) it the *templates/editor.html* file.
### Step 3. Install the prerequisites
To run the Go example code, install the Go compiler:
* Go (download from [The Go lang website](https://golang.org/);
### Step 4. Set environment variables
Having installed the compiler, update golang env variables:
```
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:/usr/local/go/bin
```
### Step 5. Start the application
1. Go to the project root.
2. Run:
```
go run main.go
```
3. In your browser go to **server.address** and **server.port**:
### Step 6. Check accessibility
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files.

View File

@ -0,0 +1,71 @@
{
"VERSION": "1.11.0",
"SERVER_ADDRESS" : "",
"SERVER_PORT" : 3000,
"DOC_SERVER_HOST" : "http://documentserver/",
"DOC_SERVER_CONVERTER_URL" : "converter",
"DOC_SERVER_API_URL" : "web-apps/apps/api/documents/api.js",
"DOC_SERVER_PRELOADER_URL" : "web-apps/apps/api/documents/cache-scripts.html",
"DOC_SERVER_COMMAND_URL" : "command",
"JWT_IS_ENABLED" : false,
"JWT_SECRET" : "secret",
"JWT_HEADER" : "Authorization",
"STORAGE_PATH" : "filestore",
"LOGGER_DEBUG" : true,
"FORGOTTEN_ENABLED": true,
"PLUGINS" : "{\"pluginsData\":[]}",
"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"
}
}

View File

@ -0,0 +1,32 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package config
type Extensions struct {
Viewed []string `json:"viewed"`
Edited []string `json:"edited"`
Converted []string `json:"converted"`
Filled []string `json:"filled"`
}
type ExtensionTypes struct {
Spreadsheet []string `json:"spreadsheet"`
Presentation []string `json:"presentation"`
Document []string `json:"document"`
Pdf []string `json:"pdf"`
}

View File

@ -0,0 +1,105 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package config
import (
"path/filepath"
"runtime"
"github.com/ONLYOFFICE/document-server-integration/utils"
"github.com/spf13/viper"
"go.uber.org/fx"
)
type ApplicationConfig struct {
Version string `mapstructure:"VERSION"`
ServerAddress string `mapstructure:"SERVER_ADDRESS"`
ServerPort string `mapstructure:"SERVER_PORT"`
DocumentServerHost string `mapstructure:"DOC_SERVER_HOST"`
DocumentServerConverter string `mapstructure:"DOC_SERVER_CONVERTER_URL"`
DocumentServerApi string `mapstructure:"DOC_SERVER_API_URL"`
DocumentServerPreloader string `mapstructure:"DOC_SERVER_PRELOADER_URL"`
DocumentServerCommandUrl string `mapstructure:"DOC_SERVER_COMMAND_URL"`
JwtEnabled bool `mapstructure:"JWT_IS_ENABLED"`
JwtHeader string `mapstructure:"JWT_HEADER"`
JwtSecret string `mapstructure:"JWT_SECRET"`
StoragePath string `mapstructure:"STORAGE_PATH"`
Plugins string `mapstructure:"PLUGINS"`
LoggerDebug bool `mapstructure:"LOGGER_DEBUG"`
ForgottenEnabled bool `mapstructure:"FORGOTTEN_ENABLED"`
Languages map[string]string `mapstructure:"LANGUAGES"`
}
type SpecificationConfig struct {
Extensions Extensions `mapstructure:"extensions"`
ExtensionTypes ExtensionTypes `mapstructure:"extension_types"`
}
func NewConfiguration() (app_config ApplicationConfig, err error) {
_, b, _, _ := runtime.Caller(0)
basepath := filepath.Dir(b)
viper.AddConfigPath(basepath)
viper.SetConfigName("configuration")
viper.SetConfigType("json")
viper.AutomaticEnv()
err = viper.ReadInConfig()
if err != nil {
return ApplicationConfig{}, err
}
err = viper.Unmarshal(&app_config)
if err != nil {
return ApplicationConfig{}, err
}
return
}
func NewSpecification() (specification SpecificationConfig, err error) {
fm, err := utils.NewFormatManager()
if err != nil {
return SpecificationConfig{}, err
}
exts := Extensions{
fm.GetViewedExtensions(),
fm.GetEditedExtensions(),
fm.GetConvertedExtensions(),
fm.GetFilledExtensions(),
}
extTypes := ExtensionTypes{
fm.GetSpreadsheetExtensions(),
fm.GetPresentationExtensions(),
fm.GetDocumentExtensions(),
fm.GetPdfExtensions(),
}
specification = SpecificationConfig{
exts,
extTypes,
}
return
}
var ConfigurationModule = fx.Options(
fx.Provide(NewConfiguration),
fx.Provide(NewSpecification),
)

View File

@ -0,0 +1,34 @@
module github.com/ONLYOFFICE/document-server-integration
go 1.21
require (
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/gorilla/mux v1.8.1
github.com/gorilla/schema v1.4.1
github.com/mitchellh/mapstructure v1.5.0
github.com/spf13/viper v1.19.0
go.uber.org/fx v1.22.2
go.uber.org/zap v1.27.0
)
require (
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/dig v1.18.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@ -0,0 +1,82 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw=
go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE=
go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw=
go.uber.org/fx v1.22.2/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -0,0 +1,29 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
fx - An application framework for Go that makes dependency injection easy. (https://github.com/uber-go/fx).
License: MIT
License File: fx.license
golang-jwt - A go implementation of JSON Web Tokens. (https://github.com/golang-jwt/jwt).
License: MIT
License File: golang-jwt.license
gorilla/mux - Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler. (https://github.com/gorilla/mux).
License: BSD-3-Clause License
License File: mux.license
mapstructure - Go library for decoding generic map values into native Go structures and vice versa. (https://github.com/mitchellh/mapstructure)
License: MIT
License File: mapstructure.license
schema - Package gorilla/schema fills a struct with form values. (https://github.com/gorilla/schema)
License: BSD-3-Clause License
License File: schema.license
viper - Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed to work within an application, and can handle all types of configuration needs and formats. (https://github.com/spf13/viper).
License: MIT
License File: viper.license
zap - Blazing fast, structured, leveled logging in Go. (https://github.com/uber-go/zap).
License: MIT
License File: zap.license

View File

@ -0,0 +1,19 @@
Copyright (c) 2016-2018 Uber Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,9 @@
Copyright (c) 2012 Dave Grijalva
Copyright (c) 2021 golang-jwt maintainers
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013 Mitchell Hashimoto
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,27 @@
Copyright (c) 2012-2018 The Gorilla Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,27 @@
Copyright (c) 2023 The Gorilla Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Steve Francia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,19 @@
Copyright (c) 2016-2017 Uber Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,47 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package main
import (
"github.com/ONLYOFFICE/document-server-integration/config"
"github.com/ONLYOFFICE/document-server-integration/server"
"github.com/ONLYOFFICE/document-server-integration/server/api"
defaultApi "github.com/ONLYOFFICE/document-server-integration/server/api/default"
bootstrapper "github.com/ONLYOFFICE/document-server-integration/server/config"
"github.com/ONLYOFFICE/document-server-integration/server/handlers"
dhandlers "github.com/ONLYOFFICE/document-server-integration/server/handlers/default"
"github.com/ONLYOFFICE/document-server-integration/server/log"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
dmanagers "github.com/ONLYOFFICE/document-server-integration/server/managers/default"
"go.uber.org/fx"
)
func main() {
fx.New(
fx.Provide(api.New),
fx.Provide(managers.New),
fx.Provide(handlers.New),
fx.Provide(server.New),
fx.Invoke(bootstrapper.Initialize),
config.ConfigurationModule,
log.LoggingModule,
dhandlers.DefaultHandlersModule,
dmanagers.DefaultManagersModule,
defaultApi.DefaultServerEndpointsHandlerModule,
).Run()
}

View File

@ -0,0 +1,63 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package api
import (
"net/http"
)
type FileOperationsEndpointsHandler interface {
Callback(w http.ResponseWriter, r *http.Request)
Convert(w http.ResponseWriter, r *http.Request)
Create(w http.ResponseWriter, r *http.Request)
Download(w http.ResponseWriter, r *http.Request)
Remove(w http.ResponseWriter, r *http.Request)
Rename(w http.ResponseWriter, r *http.Request)
Restore(w http.ResponseWriter, r *http.Request)
Upload(w http.ResponseWriter, r *http.Request)
}
type InfoEndpointsHandler interface {
Files(w http.ResponseWriter, r *http.Request)
Formats(w http.ResponseWriter, r *http.Request)
History(w http.ResponseWriter, r *http.Request)
HistoryObj(w http.ResponseWriter, r *http.Request)
Reference(w http.ResponseWriter, r *http.Request)
}
type PagesEndpointsHandler interface {
Editor(w http.ResponseWriter, r *http.Request)
Forgotten(w http.ResponseWriter, r *http.Request)
Index(w http.ResponseWriter, r *http.Request)
}
type ServerEndpointsHandler interface {
FileOperationsEndpointsHandler
InfoEndpointsHandler
PagesEndpointsHandler
}
type ServerAPI struct {
ServerEndpointsHandler
}
func New(endpointsHandler ServerEndpointsHandler) *ServerAPI {
return &ServerAPI{
endpointsHandler,
}
}

View File

@ -0,0 +1,69 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"fmt"
"html/template"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/config"
"github.com/ONLYOFFICE/document-server-integration/server/api"
"github.com/ONLYOFFICE/document-server-integration/server/handlers"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/gorilla/schema"
"go.uber.org/zap"
)
type DefaultServerEndpointsHandler struct {
logger *zap.SugaredLogger
config config.ApplicationConfig
specification config.SpecificationConfig
*handlers.CallbackRegistry
*managers.Managers
}
func NewDefaultServerEndpointsHandler(logger *zap.SugaredLogger, config config.ApplicationConfig,
spec config.SpecificationConfig, reg *handlers.CallbackRegistry,
managers *managers.Managers) api.ServerEndpointsHandler {
return &DefaultServerEndpointsHandler{
logger,
config,
spec,
reg,
managers,
}
}
func generateUrl(r *http.Request) string {
scheme := "http"
if r.Header.Get("X-Forwarded-Proto") != "" {
scheme = r.Header.Get("X-Forwarded-Proto")
}
if r.TLS != nil {
scheme = "https"
}
return fmt.Sprintf("%s://%s", scheme, r.Host)
}
var decoder = schema.NewDecoder()
var indexTemplate = template.Must(template.ParseFiles("templates/index.html"))
var forgottenTemplate = template.Must(template.ParseFiles("templates/forgotten.html"))
var editorTemplate = template.Must(template.ParseFiles("templates/editor.html"))

View File

@ -0,0 +1,57 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Callback(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
filename, userAddress := query.Get("filename"), query.Get("user_address")
if filename == "" || userAddress == "" {
shared.SendDocumentServerRespose(w, true)
return
}
var body models.Callback
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
srv.logger.Error("Callback body decoding error")
shared.SendDocumentServerRespose(w, true)
return
}
if err := srv.Managers.JwtManager.ParseCallback(&body, r.Header.Get(srv.config.JwtHeader)); err != nil {
srv.logger.Error(err.Error())
shared.SendDocumentServerRespose(w, true)
return
}
body.Filename = filename
body.UserAddress = userAddress
if err := srv.CallbackRegistry.HandleIncomingCode(&body); err != nil {
shared.SendDocumentServerRespose(w, true)
return
}
shared.SendDocumentServerRespose(w, false)
}

View File

@ -0,0 +1,155 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"net/http"
"time"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
)
func (srv *DefaultServerEndpointsHandler) Convert(w http.ResponseWriter, r *http.Request) {
_, uid := shared.GetCookiesInfo(r.Cookies())
if uid == "" {
srv.logger.Errorf("invalid user id")
shared.SendDocumentServerRespose(w, true)
return
}
user, err := srv.UserManager.GetUserById(uid)
if err != nil {
srv.logger.Errorf("could not find user with id: %s", uid)
shared.SendDocumentServerRespose(w, true)
return
}
srv.logger.Debug("A new convert call")
var payload managers.ConvertRequest
err = json.NewDecoder(r.Body).Decode(&payload)
if err != nil {
srv.logger.Error(err.Error())
shared.SendDocumentServerRespose(w, true)
return
}
filename := payload.Filename
response := managers.ConvertResponse{Filename: filename}
defer shared.SendResponse(w, &response)
remoteAddr := generateUrl(r)
if srv.config.ServerAddress != "" {
remoteAddr = srv.config.ServerAddress
}
fileUrl := srv.StorageManager.GeneratePublicFileUri(filename, remoteAddr, managers.FileMeta{})
fileExt := utils.GetFileExt(filename, true)
toExt := "ooxml"
if payload.Filetype != "" {
toExt = payload.Filetype
}
keepOriginal := payload.Keeporiginal
if srv.DocumentManager.IsDocumentConvertable(filename) || payload.Filetype != "" {
key, err := srv.StorageManager.GenerateFileHash(filename)
if err != nil {
response.Error = err.Error()
srv.logger.Errorf("File conversion error: %s", err.Error())
return
}
newUrl, newExt, err := srv.ConversionManager.GetConverterUri(fileUrl, fileExt, toExt, key, true)
if err != nil {
response.Error = err.Error()
srv.logger.Errorf("File conversion error: %s", err.Error())
return
}
if newUrl == "" {
response.Step = 1
} else {
response.Step = 100
supportedExt := true
fm, err := utils.NewFormatManager()
for _, f := range fm.GetFormats() {
if f.Name == newExt && len(f.Actions) == 0 {
supportedExt = false
break
}
}
if !supportedExt && err == nil {
response.Error = "FileTypeIsNotSupported"
response.Filename = newUrl
return
} else if err != nil {
response.Error = err.Error()
return
}
correctName, err := srv.StorageManager.GenerateVersionedFilename(
utils.GetFileNameWithoutExt(filename) + "." + newExt,
)
if err != nil {
response.Error = err.Error()
srv.logger.Errorf("File conversion error: %s", err.Error())
return
}
err = srv.StorageManager.SaveFileFromUri(models.Callback{
Url: newUrl,
Filename: correctName,
UserAddress: r.Host,
})
if err != nil {
response.Error = err.Error()
return
}
if !keepOriginal {
err = srv.StorageManager.RemoveFile(filename)
if err != nil {
srv.logger.Errorf("File deletion error: %s", err.Error())
}
}
response.Filename = correctName
err = srv.HistoryManager.CreateMeta(response.Filename, models.History{
ServerVersion: srv.config.Version,
Changes: []models.Changes{
{
Created: time.Now().UTC().Format("2006-02-1 15:04:05"),
User: models.User{
Id: user.Id,
Username: user.Username,
},
},
},
})
if err != nil {
srv.logger.Errorf("Meta creation error: %s", err.Error())
}
}
}
}

View File

@ -0,0 +1,178 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"fmt"
"net/http"
"os"
"path"
"strings"
"time"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
)
func (srv *DefaultServerEndpointsHandler) Create(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodPost {
var body map[string]string
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
srv.logger.Error("Reference body decoding error")
shared.SendDocumentServerRespose(w, true)
return
}
fileName, url := body["title"], body["url"]
if fileName == "" || url == "" {
srv.logger.Error("empty url or title")
shared.SendCustomErrorResponse(w, "empty url or title")
return
}
_, uid := shared.GetCookiesInfo(r.Cookies())
user, err := srv.UserManager.GetUserById(uid)
if err != nil {
srv.logger.Errorf("could not find user with id: %s", uid)
shared.SendCustomErrorResponse(w, err.Error())
return
}
fileExt := utils.GetFileExt(fileName, true)
if strings.TrimSpace(fileExt) == "" || !utils.IsInList(fileExt, srv.specification.Extensions.Viewed) {
srv.logger.Errorf("%s extension is not supported", fileExt)
shared.SendCustomErrorResponse(w, "extension is not supported")
return
}
correctName, err := srv.StorageManager.GenerateVersionedFilename(fileName)
if err != nil {
srv.logger.Errorf("file saving error: %s", err.Error())
shared.SendCustomErrorResponse(w, "file saving error")
return
}
err = srv.StorageManager.SaveFileFromUri(models.Callback{
Url: url,
Filename: correctName,
UserAddress: r.Host,
})
if err != nil {
srv.logger.Errorf("file saving error: %s", err.Error())
shared.SendCustomErrorResponse(w, "file saving error")
return
}
err = srv.HistoryManager.CreateMeta(correctName, models.History{
ServerVersion: srv.config.Version,
Changes: []models.Changes{
{
Created: time.Now().UTC().Format("2006-02-1 15:04:05"),
User: models.User{
Id: user.Id,
Username: user.Username,
},
},
},
})
if err != nil {
srv.logger.Errorf("meta creation error: %s", err.Error())
}
return
}
query := r.URL.Query()
fileExt, isSample := query.Get("fileExt"), query.Get("sample")
if strings.TrimSpace(fileExt) == "" || !utils.IsInList(fileExt, srv.specification.Extensions.Edited) {
srv.logger.Errorf("%s extension is not supported", fileExt)
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
_, uid := shared.GetCookiesInfo(r.Cookies())
if uid == "" {
srv.logger.Errorf("user id is blank")
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
user, err := srv.UserManager.GetUserById(uid)
if err != nil {
srv.logger.Errorf("could not find user with id: %s", uid)
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
srv.logger.Debugf("Creating a new %s file", fileExt)
sampleType := "new"
if strings.TrimSpace(isSample) != "" {
sampleType = "sample"
}
filename := fmt.Sprintf("%s.%s", sampleType, fileExt)
file, err := os.Open(path.Join("static/assets/document-templates", sampleType, filename))
if err != nil {
srv.logger.Errorf("could not create a new file: %s", err.Error())
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
defer file.Close()
filename, err = srv.StorageManager.GenerateVersionedFilename(filename)
if err != nil {
srv.logger.Errorf("could not generated versioned filename: %s", filename)
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
fpath, err := srv.StorageManager.GenerateFilePath(filename)
if err != nil {
srv.logger.Errorf("could not generated file path: %s", filename)
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
err = srv.StorageManager.CreateFile(file, fpath)
if err != nil {
srv.logger.Errorf("could not create file: %s", filename)
http.Redirect(w, r, "/", http.StatusSeeOther)
return
}
err = srv.HistoryManager.CreateMeta(filename, models.History{
ServerVersion: srv.config.Version,
Changes: []models.Changes{
{
Created: time.Now().UTC().Format("2006-02-1 15:04:05"),
User: models.User{
Id: user.Id,
Username: user.Username,
},
},
},
})
if err != nil {
srv.logger.Errorf("could not create file meta: %s", filename)
}
http.Redirect(w, r, "/editor?filename="+filename, http.StatusSeeOther)
}

View File

@ -0,0 +1,44 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Download(w http.ResponseWriter, r *http.Request) {
filename := r.URL.Query().Get("fileName")
srv.logger.Debugf("A new download call (%s)", filename)
if filename == "" {
shared.SendDocumentServerRespose(w, true)
return
}
var meta managers.FileMeta
fileUrl := srv.StorageManager.GenerateFilestoreUri(filename, meta)
if fileUrl == "" {
shared.SendDocumentServerRespose(w, true)
return
}
http.Redirect(w, r, fileUrl, http.StatusMovedPermanently)
}

View File

@ -0,0 +1,84 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Editor(w http.ResponseWriter, r *http.Request) {
var editorParameters managers.Editor
if err := decoder.Decode(&editorParameters, r.URL.Query()); err != nil {
srv.logger.Error("Invalid query parameters")
return
}
if err := editorParameters.IsValid(); err != nil {
srv.logger.Errorf("Editor parameters are invalid: %s", err.Error())
return
}
srv.logger.Debug("A new editor call")
editorParameters.Language, editorParameters.UserId = shared.GetCookiesInfo(r.Cookies())
remoteAddr := generateUrl(r)
if srv.config.ServerAddress != "" {
remoteAddr = srv.config.ServerAddress
}
config, err := srv.Managers.DocumentManager.BuildDocumentConfig(editorParameters, remoteAddr)
if err != nil {
srv.logger.Errorf("A document manager error has occurred: %s", err.Error())
return
}
var usersForMentions, usersForProtect, usersInfo []models.UserInfo
if config.EditorConfig.User.Id != "uid-0" {
usersForMentions = srv.GetUsersForMentions(config.EditorConfig.User.Id)
usersForProtect = srv.GetUsersForProtect(config.EditorConfig.User.Id, remoteAddr)
usersInfo = srv.GetUsersInfo(remoteAddr)
}
data := map[string]interface{}{
"apijs": srv.config.DocumentServerHost + srv.config.DocumentServerApi,
"config": config,
"actionLink": editorParameters.ActionLink,
"docType": config.DocumentType,
"usersForProtect": usersForProtect,
"usersForMentions": usersForMentions,
"usersInfo": usersInfo,
"dataInsertImage": map[string]interface{}{
"fileType": "svg",
"url": remoteAddr + "/static/images/logo.svg",
},
"dataDocument": map[string]interface{}{
"fileType": "docx",
"url": remoteAddr + "/static/assets/document-templates/sample/sample.docx",
},
"dataSpreadsheet": map[string]interface{}{
"fileType": "csv",
"url": remoteAddr + "/static/assets/document-templates/sample/csv.csv",
},
}
editorTemplate.Execute(w, data) // nolint: errcheck
}

View File

@ -0,0 +1,37 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"fmt"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Files(w http.ResponseWriter, r *http.Request) {
srv.logger.Debug("A new files call")
files, err := srv.Managers.StorageManager.GetStoredFiles(r.Host)
if err != nil {
srv.logger.Errorf("could not fetch files: %s", err.Error())
shared.SendCustomErrorResponse(w, fmt.Sprintf("could not fetch files: %s", err.Error()))
return
}
shared.SendResponse(w, files)
}

View File

@ -0,0 +1,85 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Forgotten(w http.ResponseWriter, r *http.Request) {
srv.logger.Debug("A new forgotten call")
if !srv.config.ForgottenEnabled {
shared.SendCustomErrorResponse(w, "The forgotten page is disabled")
return
}
if r.Method == http.MethodDelete {
filename := r.URL.Query().Get("fileName")
if filename == "" {
shared.SendCustomErrorResponse(w, "No filename")
} else {
r, err := srv.Managers.CommandManager.CommandRequest("deleteForgotten", filename, nil)
if err != nil {
srv.logger.Errorf("could not delete forgotten file: %s", err.Error())
shared.SendDocumentServerRespose(w, true)
} else {
defer r.Body.Close()
w.WriteHeader(http.StatusNoContent)
shared.SendDocumentServerRespose(w, false)
}
}
return
}
var forgottenList models.ForgottenList
res, err := srv.Managers.CommandManager.CommandRequest("getForgottenList", "", nil)
if err != nil {
srv.logger.Errorf("could not fetch forgotten files: %s", err.Error())
}
defer res.Body.Close()
if err = json.NewDecoder(res.Body).Decode(&forgottenList); err != nil {
srv.logger.Errorf("could not parse forgotten files: %s", err.Error())
}
var files []models.ForgottenFile
for _, key := range forgottenList.Keys {
var file models.ForgottenFile
res, err = srv.CommandRequest("getForgotten", key, nil)
if err != nil {
srv.logger.Errorf("could not fetch forgotten file[%s]: %s", file.Key, err.Error())
} else {
defer res.Body.Close()
if err = json.NewDecoder(res.Body).Decode(&file); err != nil {
srv.logger.Errorf("could not parse forgotten file[%s]: %s", file.Key, err.Error())
} else {
file.Type = srv.Managers.ConversionManager.GetFileType(file.Url)
files = append(files, file)
}
}
}
data := map[string]interface{}{
"Files": files,
}
forgottenTemplate.Execute(w, data) // nolint: errcheck
}

View File

@ -0,0 +1,38 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"fmt"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
)
func (srv *DefaultServerEndpointsHandler) Formats(w http.ResponseWriter, r *http.Request) {
srv.logger.Debug("A new formats call")
fm, err := utils.NewFormatManager()
if err != nil {
srv.logger.Errorf("could not fetch formats: %s", err.Error())
shared.SendCustomErrorResponse(w, fmt.Sprintf("could not fetch formats: %s", err.Error()))
return
}
shared.SendResponse(w, fm.GetFormats())
}

View File

@ -0,0 +1,57 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"net/http"
"strconv"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) History(w http.ResponseWriter, r *http.Request) {
filename := r.URL.Query().Get("fileName")
file := r.URL.Query().Get("file")
version, err := strconv.Atoi(r.URL.Query().Get("ver"))
if err != nil {
srv.logger.Errorf("Could not parse file version: %s", err.Error())
shared.SendDocumentServerRespose(w, true)
return
}
srv.logger.Debugf("A new history call (%s)", filename)
if filename == "" {
srv.logger.Errorf("filename parameter is blank")
shared.SendDocumentServerRespose(w, true)
return
}
fileUrl := srv.StorageManager.GenerateFilestoreUri(filename, managers.FileMeta{
Version: version,
DestinationPath: file,
})
if fileUrl == "" {
srv.logger.Errorf("file url is blank")
shared.SendDocumentServerRespose(w, true)
return
}
http.Redirect(w, r, fileUrl, http.StatusSeeOther)
}

View File

@ -0,0 +1,51 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) HistoryObj(w http.ResponseWriter, r *http.Request) {
var body map[string]string
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
srv.logger.Error("HistoryObj body decoding error")
shared.SendCustomErrorResponse(w, err.Error())
return
}
fileName := body["fileName"]
if fileName == "" {
srv.logger.Error("No filename in historyObj request")
shared.SendCustomErrorResponse(w, "No filename")
return
}
remoteAddr := generateUrl(r)
refHist, setHist, err := srv.Managers.HistoryManager.GetHistory(fileName, remoteAddr)
if err != nil {
srv.logger.Warnf("could not get file history: %s", err.Error())
shared.SendCustomErrorResponse(w, err.Error())
}
refHist.HistoryData = setHist
shared.SendResponse(w, refHist)
}

View File

@ -0,0 +1,42 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"net/http"
)
func (srv *DefaultServerEndpointsHandler) Index(w http.ResponseWriter, r *http.Request) {
srv.logger.Debug("A new index call")
files, err := srv.Managers.StorageManager.GetStoredFiles(r.Host)
if err != nil {
srv.logger.Errorf("could not fetch files: %s", err.Error())
}
data := map[string]interface{}{
"Extensions": srv.specification.Extensions,
"Users": srv.Managers.UserManager.GetUsers(),
"Files": files,
"Preloader": srv.config.DocumentServerHost + srv.config.DocumentServerPreloader,
"ForgottenEnabled": srv.config.ForgottenEnabled,
"Languages": srv.config.Languages,
"ServerVersion": srv.config.Version,
}
indexTemplate.Execute(w, data) // nolint: errcheck
}

View File

@ -0,0 +1,24 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import "go.uber.org/fx"
var DefaultServerEndpointsHandlerModule = fx.Options(
fx.Provide(NewDefaultServerEndpointsHandler),
)

View File

@ -0,0 +1,111 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
)
func (srv *DefaultServerEndpointsHandler) Reference(w http.ResponseWriter, r *http.Request) {
var body models.Reference
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
srv.logger.Error("Reference body decoding error")
shared.SendDocumentServerRespose(w, true)
return
}
remoteAddr := generateUrl(r)
var fileName /*, userAddress*/ string
var fileKey map[string]string
err := json.Unmarshal([]byte(body.ReferenceData.FileKey), &fileKey)
if err != nil {
srv.logger.Error("FileKey decoding error")
shared.SendDocumentServerRespose(w, true)
return
}
path, _ := srv.GenerateFilePath(fileKey["fileName"])
if body.ReferenceData.InstanceId == remoteAddr && srv.PathExists(path) {
fileName = fileKey["fileName"]
}
if fileName == "" && body.Link != "" {
if strings.Contains(body.Link, remoteAddr) {
res := map[string]interface{}{
"url": body.Link,
}
shared.SendResponse(w, res)
return
}
urlObj, _ := url.Parse(body.Link)
params, _ := url.ParseQuery(urlObj.RawQuery)
if len(params["filename"]) != 0 {
fileName = params["filename"][0]
}
path, _ := srv.GenerateFilePath(fileName)
if !srv.PathExists(path) {
shared.SendCustomErrorResponse(w, "File is not exist")
return
}
}
if fileName == "" && body.Path != "" {
filePath := utils.GetFileName(body.Path)
path, _ := srv.GenerateFilePath(filePath)
if srv.PathExists(path) {
fileName = filePath
}
}
if fileName == "" {
shared.SendCustomErrorResponse(w, "File is not found")
return
}
docKey, _ := srv.GenerateFileHash(fileName)
data := models.Reference{
FileType: srv.GetFileType(fileName),
Key: docKey,
Url: srv.GeneratePublicFileUri(fileName, remoteAddr, managers.FileMeta{}),
ReferenceData: models.ReferenceData{
FileKey: fmt.Sprintf("{\"fileName\":\"%s\"}", fileName),
InstanceId: remoteAddr,
},
Link: remoteAddr + "/editor?filename=" + url.QueryEscape(fileName),
Path: fileName,
}
secret := strings.TrimSpace(srv.config.JwtSecret)
if secret != "" && srv.config.JwtEnabled {
token, _ := srv.JwtSign(data, []byte(secret))
data.Token = token
}
shared.SendResponse(w, data)
}

View File

@ -0,0 +1,54 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Remove(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodDelete {
if err := srv.StorageManager.RemoveAll(); err != nil {
shared.SendDocumentServerRespose(w, true)
return
}
r := map[string]interface{}{
"success": true,
}
shared.SendResponse(w, r)
return
}
filename := r.URL.Query().Get("filename")
if filename == "" {
shared.SendDocumentServerRespose(w, true)
return
}
if err := srv.StorageManager.RemoveFile(filename); err != nil {
srv.logger.Error(err.Error())
shared.SendDocumentServerRespose(w, true)
return
}
srv.logger.Debug("A new remove call")
shared.SendDocumentServerRespose(w, false)
}

View File

@ -0,0 +1,68 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"encoding/json"
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
)
func (srv *DefaultServerEndpointsHandler) Rename(w http.ResponseWriter, r *http.Request) {
var body map[string]string
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
srv.logger.Error("Rename body decoding error")
shared.SendCustomErrorResponse(w, err.Error())
return
}
newFileName, ext, docKey := body["newfilename"], body["ext"], body["dockey"]
if newFileName == "" || docKey == "" {
srv.logger.Error("No filename or dockey")
shared.SendCustomErrorResponse(w, "No filename or dockey")
return
}
if curExt := utils.GetFileExt(newFileName, true); curExt != ext {
newFileName += "." + ext
}
meta := map[string]string{
"title": newFileName,
}
commandResponse, err := srv.CommandManager.CommandRequest("meta", docKey, meta)
if err != nil {
srv.logger.Error("Command request error")
shared.SendCustomErrorResponse(w, err.Error())
return
}
defer commandResponse.Body.Close()
var res map[string]interface{}
if err := json.NewDecoder(commandResponse.Body).Decode(&res); err != nil {
srv.logger.Error("Command response body decoding error")
shared.SendCustomErrorResponse(w, err.Error())
return
}
result := map[string]interface{}{
"result": res,
}
shared.SendResponse(w, result)
}

View File

@ -0,0 +1,110 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"path"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
)
func (srv *DefaultServerEndpointsHandler) Restore(w http.ResponseWriter, r *http.Request) {
result := map[string]interface{}{
"success": false,
}
var body map[string]interface{}
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
srv.logger.Error("Restore body decoding error")
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
fileName := fmt.Sprintf("%v", body["fileName"])
if fileName == "" {
srv.logger.Error("Restore filename is empty")
result["error"] = "Empty filename"
shared.SendResponse(w, result)
return
}
version := fmt.Sprintf("%v", body["version"])
key, err := srv.GenerateFileHash(fileName)
if err != nil {
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
filePath, err := srv.GenerateFilePath(fileName)
if err != nil {
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
rootPath, _ := srv.GetRootFolder()
historyPath := path.Join(rootPath, fileName+shared.ONLYOFFICE_HISTORY_POSTFIX)
newVersion := srv.HistoryManager.CountVersion(historyPath)
versionPath := path.Join(historyPath, version, "prev"+utils.GetFileExt(fileName, false))
newVersionPath := path.Join(historyPath, fmt.Sprint(newVersion))
if !srv.Managers.StorageManager.PathExists(versionPath) {
result["error"] = "Version path does not exist"
shared.SendResponse(w, result)
return
}
err = srv.Managers.StorageManager.CreateDirectory(newVersionPath)
if err != nil {
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
currFile, _ := srv.Managers.StorageManager.ReadFile(filePath)
err = srv.Managers.StorageManager.CreateFile(
bytes.NewBuffer(currFile),
path.Join(newVersionPath, "prev"+utils.GetFileExt(fileName, false)))
if err != nil {
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
err = srv.Managers.StorageManager.CreateFile(bytes.NewBuffer([]byte(key)), path.Join(newVersionPath, "key.txt"))
if err != nil {
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
verFile, _ := srv.Managers.StorageManager.ReadFile(versionPath)
err = srv.Managers.StorageManager.CreateFile(bytes.NewBuffer(verFile), filePath)
if err != nil {
result["error"] = err.Error()
shared.SendResponse(w, result)
return
}
result["success"] = true
shared.SendResponse(w, result)
}

View File

@ -0,0 +1,96 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package dapi
import (
"fmt"
"net/http"
"time"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
)
func (srv *DefaultServerEndpointsHandler) Upload(w http.ResponseWriter, r *http.Request) {
err := r.ParseMultipartForm(32 << 20)
if err != nil {
srv.logger.Error(err.Error())
return
}
file, handler, err := r.FormFile("uploadedFile")
w.Header().Set("Content-Type", "application/json")
if err != nil {
srv.logger.Error(err.Error())
return
}
srv.logger.Debug("A new upload call")
if !srv.DocumentManager.IsDocumentConvertable(handler.Filename) {
srv.logger.Errorf("File %s is not supported", handler.Filename)
shared.SendCustomErrorResponse(w, "File type is not supported")
return
}
fileName, err := srv.StorageManager.GenerateVersionedFilename(handler.Filename)
if err != nil {
srv.logger.Error(err.Error())
shared.SendCustomErrorResponse(w, err.Error())
return
}
fpath, err := srv.StorageManager.GenerateFilePath(fileName)
if err != nil {
srv.logger.Error(err.Error())
shared.SendCustomErrorResponse(w, err.Error())
return
}
if err = srv.StorageManager.CreateFile(file, fpath); err != nil {
srv.logger.Error(err.Error())
shared.SendCustomErrorResponse(w, err.Error())
return
}
_, uid := shared.GetCookiesInfo(r.Cookies())
user, err := srv.UserManager.GetUserById(uid)
if err != nil {
srv.logger.Errorf("could not find user with id: %s", uid)
shared.SendCustomErrorResponse(w, err.Error())
return
}
err = srv.HistoryManager.CreateMeta(fileName, models.History{
ServerVersion: srv.config.Version,
Changes: []models.Changes{
{
Created: time.Now().UTC().Format("2006-02-1 15:04:05"),
User: models.User{
Id: user.Id,
Username: user.Username,
},
},
},
})
if err != nil {
srv.logger.Errorf("could not create meta")
}
fmt.Fprintf(w, "{\"filename\":\"%s\"}", fileName)
}

View File

@ -0,0 +1,56 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package config
import (
"context"
"github.com/ONLYOFFICE/document-server-integration/server"
"go.uber.org/fx"
"go.uber.org/zap"
)
func Initialize(
lifecycle fx.Lifecycle,
server *server.Server,
logger *zap.SugaredLogger,
) {
lifecycle.Append(
fx.Hook{
OnStart: func(c context.Context) error {
go server.Run()
logger.Infof("Go server is up")
return nil
},
OnStop: func(c context.Context) error {
logger.Info("Shutting down the server")
err := logger.Sync()
if err != nil {
return err
}
err = server.Http.Shutdown(c)
if err != nil {
return err
}
return nil
},
},
)
}

View File

@ -0,0 +1,68 @@
/**
*
* (c) Copyright Ascensio System SIA 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package handlers
import (
"sync"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"go.uber.org/zap"
)
type CallbackHandler interface {
GetCode() int
Handle(body *models.Callback) error
}
type CallbackRegistry struct {
Locker *sync.Mutex
logger *zap.SugaredLogger
CallbackHandlers map[int]CallbackHandler
}
func New(logger *zap.SugaredLogger) *CallbackRegistry {
reg := &CallbackRegistry{
Locker: &sync.Mutex{},
logger: logger,
CallbackHandlers: make(map[int]CallbackHandler),
}
return reg
}
func (cr *CallbackRegistry) RegisterCallbackHandler(chandler CallbackHandler) error {
if _, exists := cr.CallbackHandlers[chandler.GetCode()]; exists {
return &HandlerExistsError{
Code: chandler.GetCode(),
}
}
cr.CallbackHandlers[chandler.GetCode()] = chandler
return nil
}
func (cr *CallbackRegistry) HandleIncomingCode(cbody *models.Callback) error {
for _, handler := range cr.CallbackHandlers {
if handler.GetCode() == cbody.Status {
cr.logger.Debugf("Processing an incoming callback request with code %d", cbody.Status)
if err := handler.Handle(cbody); err != nil {
return err
}
}
}
return nil
}

Some files were not shown because too many files have changed in this diff Show More