Compare commits

..

934 Commits

Author SHA1 Message Date
e198dd7e6c feature(nodejs): replace design for mobile version with new one 2024-04-05 14:59:53 +05:00
3375315cc0 feature(nodejs): show navigation bar at top even if there are no files in user directory 2024-04-04 13:08:47 +05:00
a070b6e82b nodejs: rename back (eda1876f59) 2024-04-03 14:27:57 +03:00
43d260cd7a Merge pull request #534 from ONLYOFFICE/feature/nodejs-forced-conversion
Feature/nodejs forced conversion
2024-04-03 14:05:24 +03:00
14bb9fc8a4 Merge pull request #556 from ONLYOFFICE/fix/wopi-mobile-default-action
fix(nodejs): mobileEdit default action for mobile wopi page. Fix Bug 65920
2024-04-03 13:07:02 +03:00
57ca15153f Merge pull request #551 from ONLYOFFICE/feature/fetching-formats
Feature/fetching formats
2024-04-03 12:31:53 +03:00
bbde4dc87b Merge pull request #525 from ONLYOFFICE/nodejs-update-dependencies
build(nodejs): updated dependencies
2024-04-03 12:19:33 +03:00
5b46195f72 fix(nodejs): mobileEdit default action for mobile wopi page. Fix Bug 65920 2024-04-02 12:55:33 +07:00
81c94c9fbd refactor(nodejs): load formats script and remove redundant variables 2024-04-01 12:24:14 +05:00
cc3c640868 refactor: merge format and format-manager files into formats file 2024-04-01 12:21:18 +05:00
20e6664a6b nodejs: absolute url in request to discovery (1e72167e7d)
Revert "nodejs: absolute host is not needed with urllib" (2460f2c7ac)
2024-03-28 13:35:50 +03:00
61af52a534 nodejs: fix favicon on wopi action 2024-03-28 10:53:12 +03:00
6236f90a50 Merge pull request #554 from ONLYOFFICE/feature/for-bug-59054
Feature/for bug 59054
2024-03-27 13:00:27 +03:00
5118352714 nodejs: debug mobile editors opening (Fix Bug 59054) 2024-03-27 12:57:58 +03:00
aa5a660001 nodejs: fix wopi editor size (Fix Bug 59054) 2024-03-27 12:57:52 +03:00
bf1f987333 nodejs: wopi refactoring 2024-03-27 12:56:08 +03:00
f1f834fb0c refactor: create and use new method for finding formats by extension 2024-03-26 17:57:52 +05:00
53c3e97b5c fix(nodejs): linter offence 2024-03-25 14:25:03 +05:00
eda1876f59 refactor(nodejs): rename convext variable and remove redundant internalext variable 2024-03-25 14:18:55 +05:00
64eab6c4a2 refactor(nodejs): add flag for keeping original file and replace conditional expression with it 2024-03-25 14:09:36 +05:00
acb9a0e4c9 refactor(java-spring): add formatslist dto object and replace jsonobject with it 2024-03-25 12:51:13 +05:00
909f638a92 Merge pull request #552 from ONLYOFFICE/fix/nodejs-wopi-putfile
fix(nodejs): handle document creation in putFile. Fix Bug 66817
2024-03-22 10:02:57 +03:00
6d28e3f8d8 Merge branch 'release/v8.1.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-03-21 14:23:41 +03:00
1b8f60d5dd nodejs: update formats 2024-03-21 14:21:29 +03:00
0414319893 nodejs: fill permission in embedded mode 2024-03-21 14:05:31 +03:00
12ad0d9e7e fix(nodejs): handle document creation in putFile. Fix Bug 66817 2024-03-21 17:18:58 +07:00
f3b35a878c refactor(java-spring): move formats method to indexcontroller and change return type to responseentity 2024-03-21 13:23:31 +05:00
c712f596e1 Merge remote-tracking branch 'remotes/origin/release/v8.1.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-03-20 12:52:55 +03:00
ad39fb7c19 nodejs: wopi formsubmit icon
# Conflicts:
#	CHANGELOG.md
2024-03-20 12:51:24 +03:00
7d2eb086ce Merge pull request #545 from ONLYOFFICE/feature/delete-all-files
Feature/delete all files
2024-03-20 11:01:40 +03:00
0a61708f67 Merge remote-tracking branch 'remotes/origin/develop' into feature/delete-all-files
# Conflicts:
#	CHANGELOG.md
2024-03-20 10:58:41 +03:00
389198aec6 Merge pull request #544 from ONLYOFFICE/feature/auto-conversion-error
Feature/auto conversion error
2024-03-20 10:02:53 +03:00
0d302ee8f6 nodejs: error message when error:1 2024-03-19 18:06:43 +03:00
d3a548bf3f fix(ruby): conversion error code to integer 2024-03-19 17:19:48 +07:00
fadae60e89 fix: linter offenses 2024-03-19 13:43:17 +05:00
426b15b8f1 Merge remote-tracking branch 'origin/develop' into feature/fetching-formats 2024-03-19 13:01:48 +05:00
601146c847 refactor(nodejs): change formats retrieval method on frontend 2024-03-19 12:59:54 +05:00
c4980c19e7 Revert "docxf and oform since v7.0"
This reverts commit beb9885b03.

# Conflicts:
#	web/documentserver-example/php/doceditor.php
2024-03-18 18:24:47 +03:00
0bfb036be6 refactor(csharp-mvc): change formats retrieval method on frontend 2024-03-18 18:03:10 +05:00
88b36049d2 refactor(csharp): change formats retrieval method on frontend 2024-03-18 18:02:29 +05:00
f1a1ec15ad Merge branch 'release/v8.1.0' into develop
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/nodejs/app.js
#	web/documentserver-example/nodejs/helpers/users.js
2024-03-18 14:38:55 +03:00
495ba9814f nodejs: close editor
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/nodejs/app.js
#	web/documentserver-example/nodejs/helpers/users.js
2024-03-18 14:35:26 +03:00
558365325c nodejs: format max length
# Conflicts:
#	web/documentserver-example/nodejs/helpers/users.js
2024-03-18 14:34:52 +03:00
683f1d33c4 nodejs: close editor 2024-03-18 14:30:25 +03:00
e8c98ba12a nodejs: format max length 2024-03-18 14:28:30 +03:00
e389cf41b8 fix(ruby): linter offence 2024-03-18 16:27:59 +05:00
80291baa40 goback: change state for users (408d80fff6) 2024-03-18 14:21:12 +03:00
b9113f93f6 fix: linter offenses 2024-03-18 16:03:00 +05:00
af778a8636 fix(ruby): linter offenses 2024-03-18 15:26:22 +05:00
47f4f022aa Merge remote-tracking branch 'remotes/origin/develop' into feature/delete-all-files
# Conflicts:
#	CHANGELOG.md
2024-03-15 16:48:58 +03:00
b2202111ac fix changelog 2024-03-15 16:47:29 +03:00
1da215b1eb Merge remote-tracking branch 'remotes/origin/develop' into feature/auto-conversion-error
# Conflicts:
#	CHANGELOG.md
2024-03-15 16:46:37 +03:00
8c8d14b48c refactor(java-spring): change formats retrieval method on frontend 2024-03-15 15:50:14 +05:00
5217a64e83 refactor(java): change formats retrieval method on frontend 2024-03-15 15:38:14 +05:00
456789191d build(nodejs): returned some dependencies versions with breaking changes 2024-03-15 17:33:00 +07:00
e1e9efa305 refactor(ruby): change formats retrieval method on frontend 2024-03-15 15:29:58 +05:00
a3016f3f96 Merge remote-tracking branch 'remotes/origin/master' into develop 2024-03-15 13:18:37 +03:00
333981cdad Merge pull request #549 from ONLYOFFICE/release/1.8.0
Release/1.8.0
2024-03-15 13:02:53 +03:00
cee60a340a nodejs: code alert 177 (e85cb5137b) 2024-03-15 12:55:59 +03:00
6c09b3f62a nodejs: wopi formsubmit icon 2024-03-15 11:18:45 +03:00
4b7ba35f83 nodejs: send email and image for protect request 2024-03-15 11:06:48 +03:00
abab30176f refactor(python): change formats retrieval method on frontend 2024-03-14 19:11:37 +05:00
1abcf78b85 refactor(php): change formats retrieval method on frontend 2024-03-14 19:08:12 +05:00
a952858ab8 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop 2024-03-14 15:07:47 +03:00
65ff78fba7 Merge pull request #548 from ONLYOFFICE/fix/ruby-conversion-progress
fix(ruby): conversion percent type validation. Fix Bug 66869
2024-03-14 15:07:11 +03:00
717996af87 Merge pull request #547 from ONLYOFFICE/fix/ruby-historyobj
fix(ruby): historyobj method. Fix Bug 66862
2024-03-14 15:06:45 +03:00
66389fe69c fix(ruby): conversion percent type validation. Fix Bug 66869 2024-03-14 17:24:02 +07:00
a63d8d4284 fix(ruby): previous in history data 2024-03-14 16:30:22 +07:00
ed39928d1f Merge pull request #546 from ONLYOFFICE/fix/ruby-saveas-url-in-docker
fix(ruby): replacing file_url host in saveas. Fix Bug 66874
2024-03-14 11:13:50 +03:00
5bc7ffde73 fix(ruby): historyobj method. Fix Bug 66862 2024-03-13 18:27:58 +07:00
5258fd0674 feat(csharp-mvc): handling auto-conversion error(-9) 2024-03-13 15:39:42 +05:00
ca274bc465 feat(csharp): handling auto-conversion error(-9) 2024-03-13 15:39:07 +05:00
b1d66e16a5 feat(java-spring): handling auto-conversion error(-9) 2024-03-13 15:38:24 +05:00
359cda0f67 feat(java): handling auto-conversion error(-9) 2024-03-13 15:37:13 +05:00
24a3441b1e feat(ruby): handling auto-conversion error(-9) 2024-03-13 15:36:13 +05:00
c6eff10be1 fix(ruby): replacing file_url host in saveas. Fix Bug 66874 2024-03-13 17:36:06 +07:00
a7fca1a53b feat(python): handling auto-conversion error(-9) 2024-03-13 15:35:06 +05:00
5b6a2ba318 refactor(csharp): remove console.log 2024-03-13 13:44:47 +05:00
bb4aed6efb fix(python): uncontrolled data used in path expression 2024-03-13 13:38:53 +05:00
01d8c0acde Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop
# Conflicts:
#	web/documentserver-example/ruby/Gemfile.lock
2024-03-12 11:22:07 +03:00
8fdbdb926b Merge pull request #543 from ONLYOFFICE/fix/ruby-gem-conflict
fix(ruby): resolved gem conflict. Fix Bug 66514
2024-03-12 11:21:04 +03:00
31cf6ca486 Merge pull request #529 from ONLYOFFICE/fix/ruby-gemfile-lock
build(ruby): updated gemfile.lock to 0 vulnerabilities
2024-03-12 11:20:10 +03:00
fbe24234d2 refactor(python): create method for deleting user folder and call it inside remove http method 2024-03-12 12:15:22 +05:00
ac894171fb changelog: delete all files 2024-03-12 11:23:53 +05:00
0174d2a465 fix(ruby): resolved gem conflict. Fix Bug 66514 2024-03-11 18:08:26 +07:00
0f000c1457 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop 2024-03-11 13:28:12 +03:00
97b0cdd042 fix(ruby): nginx body size 2024-03-11 13:26:29 +03:00
143c0a095f fix(python): nginx body size 2024-03-11 13:25:05 +03:00
04c004acdb fix(php): nginx body size 2024-03-11 13:25:04 +03:00
1699dc22b5 nodejs: fix rename var (9048082cb7) 2024-03-09 16:54:56 +03:00
cc62ff8a61 Merge pull request #531 from ONLYOFFICE/feature/php-forced-conversion
Feature/php forced conversion
2024-03-07 15:59:54 +03:00
fd21292dbd refactor(nodejs): change parameter name and remove redundant checking 2024-03-07 16:24:51 +05:00
d43294bd8a feat(csharp-mvc): implement delete all files method 2024-03-07 15:56:02 +05:00
81f5bdd528 feat(csharp): implement delete all files method 2024-03-07 15:42:23 +05:00
c1da8e14c3 feat(java-spring): implement delete all files method 2024-03-06 14:41:29 +05:00
767b5588ab feat(java): implement delete all files method 2024-03-06 14:27:21 +05:00
8858c3c256 feat(ruby): implement delete all files method 2024-03-06 14:24:52 +05:00
89f1c18d06 feat(python): implement delete all files method 2024-03-06 13:52:06 +05:00
81ad7f7a64 feat(php): implement delete all files method 2024-03-06 13:42:41 +05:00
23ba4ff5b3 Merge pull request #541 from ONLYOFFICE/feature/fix-domain
Feature/fix domain
2024-03-06 09:32:36 +03:00
423233e93f update submodule 2024-03-05 16:42:41 +03:00
5f3eaa05f9 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop
# Conflicts:
#	web/documentserver-example/php/assets/js/jscript.js
2024-03-05 16:33:14 +03:00
283d93667e ruby: change document-server to documentserver 2024-03-05 16:24:39 +03:00
158ac4161c python: change document-server to documentserver 2024-03-05 16:24:27 +03:00
bf3df5c89d php: change document-server to documentserver 2024-03-05 16:24:04 +03:00
d8251f3280 fix config paths 2024-03-05 16:16:31 +03:00
e4db31fbd5 Merge remote-tracking branch 'remotes/origin/feature/readme' into develop
# Conflicts:
#	Readme.md
2024-03-05 16:04:45 +03:00
b633f5ff19 Merge pull request #536 from Afrowave/python-example-update
CHORE: Add the Python example reference on the README.
2024-03-05 15:24:12 +03:00
0c8110d2aa Merge pull request #540 from ONLYOFFICE/fix/php-posExt-of-loaded-file
fix(php): ext of loaded file without dot. Fix Bug 66718
2024-03-05 09:51:06 +03:00
f9f8dada69 Merge pull request #539 from ONLYOFFICE/fix/php-user-in-open-source-request
fix(php): checking user in editor request. fix bug 66716
2024-03-05 09:50:33 +03:00
36535f89bb fix(php): ext of loaded file without dot. Fix Bug 66718 2024-03-05 13:46:14 +07:00
09031033aa fix(php): checking user in editor request. fix bug 66716 2024-03-05 13:30:34 +07:00
f657e5ab4a Merge pull request #537 from ONLYOFFICE/fix/csharp-mvc-document-formats-type
fix(csharp-mvc): empty strings tolerant json deserialization.
2024-03-04 15:12:50 +03:00
e42f7fd271 fix(csharp-mvc): empty strings tolerant json deserialization. Fix bug 66688 2024-03-04 13:53:31 +07:00
0f0549c535 Merge remote-tracking branch 'origin/python-example-update' into python-example-update 2024-03-02 15:53:10 +03:00
e896f03acc CHORE: Add the Python example reference on the README. 2024-03-02 15:53:06 +03:00
a74d6b8676 CHORE: Add the Python example reference on the README. 2024-03-02 15:39:19 +03:00
672aae3791 refactor(nodejs): rename variables, ids, and classes regarding forced conversion 2024-03-01 16:29:04 +05:00
999e147539 fix(nodejs): disable file type buttons after selection 2024-03-01 15:25:14 +05:00
e57ad73d4f feat(php): allow to explicitly select output file type when getting auto-conversion error(-9) 2024-03-01 13:03:59 +05:00
690ab5471b Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop 2024-02-28 17:40:09 +03:00
f9fa10e70a nodejs: fix when siteUrl is '/' (Fix Bug 66578) 2024-02-28 17:39:48 +03:00
2460f2c7ac nodejs: absolute host is not needed with urllib (1e72167e7d) 2024-02-28 17:22:31 +03:00
e3342a030c nodejs: fix mobile size (Fix Bug 34620) 2024-02-28 14:40:21 +03:00
47b07a5c8b Merge pull request #528 from ONLYOFFICE/fix/java-spring-document-formats-type
fix(java-spring): empty strings as null in json deserialization.
2024-02-27 15:02:14 +03:00
e7630f516d build(ruby): updated gemfile.lock to 0 vulnerabilities 2024-02-27 16:47:26 +07:00
3e6bee4cc1 fix(java-spring): empty strings as null in json deserialization. fix bug 66552 2024-02-27 15:14:16 +07:00
2b1f7b0548 Merge pull request #527 from ONLYOFFICE/fix/java-document-formats-type
fix(java): empty strings as null in json dererialization. fix bug 66534
2024-02-27 08:57:14 +03:00
ba195952b2 Merge pull request #526 from ONLYOFFICE/fix/ruby-correct-server-url
Fix/ruby correct server url
2024-02-27 08:56:10 +03:00
4ac8d9ee16 fix(ruby): correct server url for images 2024-02-27 08:55:10 +03:00
c46292c595 fix(java): empty strings as null in json dererialization. fix bug 66534 2024-02-26 17:43:55 +07:00
19a38df423 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop
# Conflicts:
#	web/documentserver-example/nodejs/app.js
2024-02-26 12:39:33 +03:00
b771b70ced Merge pull request #523 from ONLYOFFICE/fix/nodejs-editor-fileExt-vulnerability
fix(nodejs): editor fileExt validation. fix bug 66576
2024-02-26 12:37:56 +03:00
67a21fbe35 Merge pull request #524 from ONLYOFFICE/ruby-update-gemfile-lock
build(ruby): update gemfile.lock
2024-02-26 12:13:04 +03:00
08dc8ae6a7 build(ruby): updating gemfile.lock for containers 2024-02-22 17:28:13 +07:00
dcf2fb43e0 build(nodejs): updated dependencies (found 0 vulnerabilities) 2024-02-22 15:47:38 +07:00
dca6f4173e build(ruby): update gemfile.lock 2024-02-22 15:23:07 +07:00
c91d765296 fix(nodejs): editor fileExt validation. fix bug 66576 2024-02-22 14:49:46 +07:00
9615f5a93a Merge pull request #522 from ONLYOFFICE/fix/php-reference-link
fix(php): fix bug 66518
2024-02-21 15:46:08 +03:00
a9f0068600 fix(php): fix bug 66518 2024-02-21 16:53:19 +07:00
9f2a72aafa Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop
# Conflicts:
#	web/documentserver-example/php/templates/docEditor.tpl
2024-02-20 15:04:31 +03:00
a71e7b1896 Merge pull request #520 from ONLYOFFICE/fix/php-container-links
fix(php): nginx headers, correct serverPath and forgotten comma
2024-02-20 15:00:17 +03:00
d8cb434ad2 Merge pull request #521 from ONLYOFFICE/feat/php-make-restart
feat(php): make restart
2024-02-20 14:55:33 +03:00
96af86846b feat(php): make restart 2024-02-20 17:26:40 +07:00
a83c22e537 fix(php): nginx headers, correct serverPath and forgotten comma 2024-02-20 14:41:29 +07:00
fa5fb2f182 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop 2024-02-19 13:56:26 +03:00
4be1eaf917 Merge pull request #519 from ONLYOFFICE/fix/php-max-filesize
fix(php): upload file max size. fix bug 64359
2024-02-19 13:55:07 +03:00
f9bd8db640 fix(php): upload file max size. fix bug 64359 2024-02-19 13:54:25 +03:00
0ba4facdb7 Merge pull request #518 from ONLYOFFICE/fix/saveas-vulnerability
fix(nodejs): checking file domain. fix bug 65593
2024-02-19 13:51:55 +03:00
03625022ca fix(nodejs): checking file domain. fix bug 65593 2024-02-19 15:06:16 +07:00
f154ffc981 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop
# Conflicts:
#	web/documentserver-example/php/src/helpers/Users.php
2024-02-16 18:50:23 +03:00
be7ca0006a Merge pull request #517 from ONLYOFFICE/fix/php-user-image
fix(php): add image to users class
2024-02-16 18:49:07 +03:00
39a6581292 fix(php): add image to users class
Fix Bug 66516
2024-02-16 18:48:38 +03:00
90142299e5 Merge pull request #516 from ONLYOFFICE/feature/tabs-menu
feat(nodejs): move links to header
2024-02-15 15:12:37 +03:00
0f288d539e feat(nodejs): move links to header 2024-02-15 12:35:12 +03:00
d00237226b python: fix link (Fix Bug 66427) 2024-02-15 11:41:23 +03:00
2ead6e1f7e feat(nodejs): move links to header 2024-02-15 11:23:34 +03:00
98d48f373a nginx headers 2024-02-15 11:18:42 +03:00
92e7294f81 using ds v8.0 2024-02-15 11:16:46 +03:00
ea9ac4bb42 Merge pull request #506 from ONLYOFFICE/feature/delete-all-files
feat(nodejs): add a button to clear all files
2024-02-14 22:27:36 +03:00
5775f44f27 Merge remote-tracking branch 'remotes/origin/develop' into feature/delete-all-files
# Conflicts:
#	CHANGELOG.md
2024-02-14 22:26:45 +03:00
4ce10d82a1 Merge pull request #513 from ONLYOFFICE/python-reference-fix
fix(python): link in reference body
2024-02-14 22:22:38 +03:00
3e9e4281c5 Merge pull request #515 from ONLYOFFICE/fix/wopi-edit
fix(nodejs): correct edited exts from discovery info
2024-02-14 22:22:10 +03:00
3eac4912e1 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop 2024-02-14 22:19:11 +03:00
283139450c Form template rename as PDF form 2024-02-14 16:45:07 +03:00
e8df1c2821 fix(nodejs): correct edited exts from discovery info 2024-02-14 15:29:27 +07:00
da3224de7b Merge pull request #514 from ONLYOFFICE/fix/client-max-body-size
Fix/client max body size
2024-02-13 16:00:52 +03:00
819aa2b03f fix(python): nginx body size 2024-02-13 17:52:28 +07:00
f1aafa5fd6 fix(php): nginx body size 2024-02-13 17:44:05 +07:00
ff2bcd0ef6 feat(nodejs): add a button to clear all files 2024-02-13 11:12:36 +03:00
a17c349fb8 Merge pull request #512 from ONLYOFFICE/feature/rename-lock-file
Rename lock file
2024-02-13 09:53:36 +03:00
2268bd1cf4 nodejs: refactoring creating file 2024-02-12 13:37:26 +03:00
605c21c0be fix(python): link in reference body 2024-02-12 16:30:50 +07:00
941c00c476 nodejs: fix serbian lang 2024-02-12 10:37:27 +03:00
3f0495321c Rename npm-shrinkwrap.json to package-lock.json 2024-02-09 12:35:25 +03:00
18fd30700f copyright 2024 2024-02-09 12:22:50 +03:00
9721187083 Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop 2024-02-09 12:21:37 +03:00
bce5e3760a do not convert to oform 2024-02-09 12:21:24 +03:00
e4d43eda2a Revert "Remove and make"
This reverts commit ac6632d25b.
2024-02-09 08:56:51 +00:00
ac6632d25b Remove and make 2024-02-09 08:51:58 +00:00
b3d3b81274 copyright 2024 2024-02-01 12:39:36 +03:00
dab4841c1d inserting svg 2024-02-01 12:35:46 +03:00
0ec909346d Merge remote-tracking branch 'remotes/origin/release/v8.0.0' into release/1.8.0
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/nodejs/public/assets/document-formats
2024-01-31 09:44:13 +03:00
a7cf7ae378 Merge branch 'release/1.8.0' into develop
# Conflicts:
#	CHANGELOG.md
2024-01-30 18:12:51 +03:00
0bcd7088e6 1.8.0 2024-01-30 18:11:47 +03:00
d256b63263 Merge branch 'feature/filling-pdf' into release/1.8.0 2024-01-30 18:03:34 +03:00
89132ae29a nodejs: pdf editor without creation (Fix Bug 64607 ) 2024-01-30 18:02:13 +03:00
c15438a0d7 nodejs: pdf as new documentType 2024-01-30 18:02:12 +03:00
319a689fe2 nodejs: filling pdf 2024-01-30 16:51:02 +03:00
e85cb5137b nodejs: fix serbian lang 2024-01-23 16:22:41 +03:00
163daa37c9 Merge pull request #508 from ONLYOFFICE/fix/send-notify
fix(php): correct sendNotify agrument
2024-01-23 14:01:56 +03:00
541a1e55b4 Merge pull request #507 from ONLYOFFICE/fix/edit-converted
fix(php): correct ext substring
2024-01-23 13:39:14 +03:00
d692abda4b fix(php): correct sendNotify agrument 2024-01-19 18:08:02 +07:00
f0d7892526 fix(php): correct ext substring 2024-01-19 17:59:18 +07:00
79a2b7e8eb Merge branch 'feature/pdf-type' into release/v8.0.0 2024-01-19 12:28:10 +03:00
3a2f30bfcd Merge branch 'release/v8.0.0' into develop
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/csharp-mvc/web.appsettings.config
#	web/documentserver-example/csharp/settings.config
#	web/documentserver-example/java-spring/src/main/resources/application.properties
#	web/documentserver-example/java/src/main/resources/settings.properties
2024-01-19 12:27:44 +03:00
9f75edf22a nodejs: pdf editor without creation (Fix Bug 64607 ) 2024-01-19 12:24:51 +03:00
179766cc49 nodejs: change submitForm status 2024-01-19 12:24:50 +03:00
bc4c1dd87c nodejs: pdf as new documentType 2024-01-19 12:24:50 +03:00
766adeeb51 nodejs: filling pdf 2024-01-19 12:24:50 +03:00
7423edd7d9 ar skin language 2024-01-18 17:06:52 +03:00
03cc008de8 Merge pull request #505 from ONLYOFFICE/fix/saveas-exception
fix(python): correct saveAs url  (Fix Bug 65801)
2024-01-16 12:36:00 +03:00
5e76f08c83 fix(python): correct saveAs url 2024-01-16 14:50:46 +07:00
4ca824f1d7 Merge branch 'release/v8.0.0' into develop 2024-01-15 15:07:42 +03:00
b17b9fed56 nodejs: encode WOPISrc param 2024-01-15 15:06:05 +03:00
a2c8499622 update formats (add missed records) 2024-01-10 16:54:20 +03:00
ec268cacf7 nodejs: wopi frame without sandbox attribute (Fix Bug 65575) 2024-01-09 17:22:18 +03:00
c683d17bda Merge pull request #496 from ONLYOFFICE/feature/force-converting
Force converting problem files
2024-01-09 15:41:10 +03:00
7918671725 nodejs: handling conversion -9 error 2024-01-09 11:08:15 +03:00
408d80fff6 Merge pull request #502 from ONLYOFFICE/feature/users-different-goback
Users different goback
2024-01-09 11:04:15 +03:00
1b0e8df99f Merge remote-tracking branch 'remotes/origin/develop' into feature/users-different-goback
# Conflicts:
#	CHANGELOG.md
2024-01-09 11:01:08 +03:00
50104f1122 different goback to changelog 2024-01-09 11:00:16 +03:00
b90f333fdd csharp-mvc: add goback Users.cs 2023-12-29 12:47:37 +07:00
9e2aae1658 csharp: add goback Users.cs 2023-12-29 12:23:39 +07:00
0168355600 Merge pull request #494 from ONLYOFFICE/feature/converting
Converting
2023-12-28 12:26:02 +03:00
480b8af172 converting to changelog 2023-12-28 11:58:06 +03:00
f5d767e59d nodejs: wopi layout fix 2023-12-28 11:58:06 +03:00
62ad307327 nodejs: converting dialog window 2023-12-28 11:58:05 +03:00
b3b605230f nodejs: convert button on index page 2023-12-28 11:57:14 +03:00
ae2425f7e4 Merge pull request #503 from ONLYOFFICE/feature/formats-request
Getiing formats object on node
2023-12-28 10:45:30 +03:00
5849c9bb69 nodejs: getiing formats object 2023-12-27 13:35:03 +03:00
8ba1d5e8d7 update formats (add missed records) 2023-12-26 12:32:27 +03:00
91f3bda0b4 ruby: add goback users.rb 2023-12-22 15:15:26 +03:00
185605a1eb python: add goback users.py 2023-12-22 15:15:08 +03:00
6563a26d2d php: add goback users.php 2023-12-22 15:14:49 +03:00
d9061c57a3 nodejs: add goback users.js 2023-12-22 15:09:37 +03:00
b9c2c2e770 java: add goback user.java 2023-12-22 15:08:35 +03:00
a55d7b2d9d java-spring : add goback user.java 2023-12-22 15:08:09 +03:00
e0489a6922 Merge pull request #499 from ONLYOFFICE/feature/remove-history-close-restore
Remove Close History and Restore
2023-12-19 12:30:44 +03:00
dc14a9aa90 csharp-mvc: remove historyClose and restore 2023-12-19 15:41:22 +07:00
92206ed637 csharp: remove historyClose and restore 2023-12-19 15:31:28 +07:00
09f6ba00b2 ruby: add changes after pr #501 2023-12-18 10:09:54 +03:00
43f1555c68 python: add changes after pr #501 2023-12-18 10:09:47 +03:00
83535632bb php: add changes after pr #501 2023-12-18 10:09:40 +03:00
f1d41a4bf2 java: add changes after pr #501 2023-12-18 10:09:19 +03:00
f43e7414bb java-spring: add changes after pr #501 2023-12-18 10:09:11 +03:00
4455521e00 nodejs: add changes after pr #501 2023-12-18 10:08:32 +03:00
7b91694107 Merge branch 'develop' into feature/remove-history-close-restore 2023-12-15 18:16:04 +03:00
8edb65692a Merge pull request #501 from ONLYOFFICE/feature/fix-editros-files
Remove history methods for anonymous users
2023-12-15 17:55:20 +03:00
a36f270829 Merge remote-tracking branch 'remotes/origin/develop' into feature/fix-editros-files
# Conflicts:
#	web/documentserver-example/php/templates/docEditor.tpl
2023-12-15 17:54:25 +03:00
f726ae534c Merge pull request #500 from ONLYOFFICE/feature/add-onRequestUsers-onRequestSendNotify
Add functions RequestUsers and RequestSendNotify
2023-12-15 17:50:31 +03:00
69b266489f csharp-mvc: add onRequestUsers and onRequestSendNotify in Editor.aspx 2023-12-15 20:03:15 +07:00
7c18d08bc6 csharp: add onRequestUsers and onRequestSendNotify in DocEditor.aspx 2023-12-15 19:57:55 +07:00
6717612fc1 ruby: add onRequestUsers and onRequestSendNotify in editor.html.erb 2023-12-14 12:09:32 +03:00
7f678c9ed8 ruby: remove history methods for anonymous users (fe352ebad1)
old commit:
fe352ebad1
2023-12-12 10:35:35 +03:00
ee951fbfbc python: remove history methods for anonymous users (18cf21efe4)
old commit:
18cf21efe4
2023-12-12 10:32:42 +03:00
91f32c1387 php: remove history methods for anonymous users (39820cec0a)
old commit:
39820cec0a
2023-12-12 10:30:42 +03:00
7051437928 java: remove history methods for anonymous users (52a722cf89)
old commit:
52a722cf89
2023-12-12 10:25:45 +03:00
0967c1c3ac java-spring: remove history methods for anonymous users (bc5393e28c)
old commit:
bc5393e28c
2023-12-12 10:19:25 +03:00
cf097501c6 Fix Bug 34620 - resize on mobile
This reverts commit d3a08acec3.
2023-12-11 15:33:07 +03:00
0b0e0dad8c python: add onRequestUsers and onRequestSendNotify in editor.html 2023-12-11 12:55:06 +03:00
d97291719a php: add onRequestUsers and onRequestSendNotify in docEditor.tpl 2023-12-11 12:41:40 +03:00
75ca703f8a java-spring: add onRequestUsers and onRequestSendNotify in editor.html 2023-12-11 11:59:52 +03:00
01618fee17 java: add onRequestUsers and onRequestSendNotify in editor.jsp 2023-12-11 11:54:36 +03:00
78a8b56b48 java: delete spaces from editor.jsp 2023-12-07 13:47:25 +03:00
3b9bad4a26 Merge branch 'develop' into feature/remove-history-close-restore 2023-12-07 11:34:27 +03:00
435b8013f6 style: updates to styling 2023-12-07 10:58:41 +03:00
a9063af6e1 fix sr-Latn-RS 2023-12-06 12:56:12 +03:00
bde236075c ruby: remove historyClose and restore 2023-12-05 16:08:45 +03:00
f74f34504f python: remove historyClose and restore 2023-12-05 16:08:29 +03:00
3243a04a1b php: remove historyClose and restore 2023-12-05 15:25:20 +03:00
6598aa585a java: remove historyClose and restore 2023-12-05 15:25:05 +03:00
e02744e56b nodejs: remove historyClose and restore 2023-12-05 14:59:14 +03:00
ec596753c6 java-spring: remove historyClose and restore 2023-12-05 14:58:24 +03:00
685a62bb9c Merge pull request #497 from ONLYOFFICE/feature/version-on-front
Feature/version on front
2023-12-05 13:37:43 +03:00
2603acae16 ruby: Layout/ExtraSpacing correct 2023-12-05 13:34:30 +03:00
11489ac8ba ruby: fix sr-Latn-CS 2023-12-05 13:26:42 +03:00
e65f6f27be Merge remote-tracking branch 'remotes/origin/develop' into feature/version-on-front
# Conflicts:
#	CHANGELOG.md
2023-12-05 13:21:41 +03:00
a0a1b036e3 version to changelog 2023-12-05 13:19:57 +03:00
f846197396 csharp: add version Index.aspx 2023-12-04 16:29:37 +07:00
97f95fb850 csharp: add version Default.aspx 2023-12-04 16:17:37 +07:00
7d8a1a8b6d sr-Latn-CS skin language 2023-12-01 18:07:41 +03:00
23389056e8 ruby: add version application.html.erb 2023-12-01 10:52:44 +03:00
457e38c35a python: add version index.html 2023-12-01 10:52:14 +03:00
11075304a5 php: add version index.tpl 2023-12-01 10:51:59 +03:00
7af14e75e8 nodejs: add version index.ejs 2023-12-01 10:51:31 +03:00
c8ccb3b502 java: add version index.jsp 2023-12-01 10:50:57 +03:00
449ad0759b java-spring: add version index.html 2023-12-01 10:50:26 +03:00
32e4cb6d64 Merge pull request #498 from ONLYOFFICE/fix/hash-code-overflow (Fix Bug 65288)
node: fixed overflow when hashing сyrillic characters
2023-12-01 10:40:13 +03:00
83b1dc07e1 node: fixed overflow when hashing сyrillic characters 2023-11-30 18:19:38 +03:00
b61e05d203 Merge pull request #490 from ONLYOFFICE/feature/ruby-rubocop
Feature/ruby rubocop
2023-11-30 17:39:34 +03:00
9cf058078c ruby: fix lint problems after merging develop 2023-11-30 14:05:57 +03:00
d72834687e Merge branch 'develop' into feature/ruby-rubocop 2023-11-30 13:31:47 +03:00
af1dc6d9b5 ruby: add rubocop-rails 2023-11-30 09:28:05 +03:00
e5560b25d7 ruby: Rails/Present correct 2023-11-30 09:04:24 +03:00
d894663a4a ruby: Rails/NegateInclude correct 2023-11-30 09:02:38 +03:00
b262a34540 ruby: Rails/ToFormattedS correct 2023-11-30 09:02:38 +03:00
3d0ae07de4 ruby: Rails/TimeZone correct 2023-11-30 09:02:38 +03:00
efb4616ca6 ruby: Rails/HttpStatus correct 2023-11-30 09:02:38 +03:00
037c5682f8 ruby: Rails/Blank correct 2023-11-30 09:02:38 +03:00
7c1939e8c9 ruby: updated rubocop configuration file 2023-11-30 09:02:38 +03:00
6312833dd3 Merge pull request #491 from ONLYOFFICE/flake-make
Flake8 configuration file
2023-11-29 10:22:06 +03:00
ce58acbca9 Merge pull request #493 from ONLYOFFICE/fix/open-history-without-changes
Fix/open history without changes
2023-11-29 10:21:28 +03:00
d40f932863 python: deleted unnecessary lines from workflows 2023-11-29 10:11:43 +07:00
d6d1981296 getting history in changelog 2023-11-28 10:11:09 +03:00
b9fc1304d9 Merge pull request #469 from ONLYOFFICE/feature/restore-history
Feature/restore history
2023-11-28 10:09:11 +03:00
dac1cdcdc1 format 2023-11-28 10:08:01 +03:00
248beed471 Merge remote-tracking branch 'remotes/origin/develop' into feature/restore-history
# Conflicts:
#	CHANGELOG.md
2023-11-28 10:05:46 +03:00
9d5feaaf99 python: flake8 and mypy separated 2023-11-28 13:49:12 +07:00
d397db61cd python: lint workflow python version fix 2023-11-27 17:36:21 +07:00
969240ad53 python: intalling dependencies by make in lint workflow 2023-11-27 17:30:09 +07:00
8fd9113c47 python: mypy in lint workflow 2023-11-27 15:36:56 +07:00
068687ba91 Merge pull request #495 from ONLYOFFICE/feature/auto-convert
Convert after uploading only tagged formats
2023-11-27 11:35:51 +03:00
495d97bd3a - auto-convert in changelog 2023-11-27 11:35:33 +03:00
160c0bef3c ruby: fix opening history without changes 2023-11-27 10:58:03 +03:00
0b5b0d9c27 python: fix opening history without changes 2023-11-27 10:58:03 +03:00
b903bfc0cb java: fix opening history without changes 2023-11-27 10:57:59 +03:00
580f8f3e89 csharp: convert after uploading only tagged formats 2023-11-27 10:45:29 +03:00
b19abbcb36 csharp-mvc: convert after uploading only tagged formats 2023-11-27 10:44:17 +03:00
4de6f4d828 python: removing irrelevant changes 2023-11-27 14:36:18 +07:00
ad4b2d136c java-spring: fix opening history without changes 2023-11-24 13:41:43 +03:00
6578d414ea php: fix opening history without changes 2023-11-24 13:28:44 +03:00
5ac60bace6 Merge pull request #492 from ONLYOFFICE/feature/submit-form
Feature/submit form
2023-11-22 11:49:19 +03:00
c06b734045 python: fix forms_data variable 2023-11-22 11:45:02 +03:00
f32f90282c nodejs: fix status check 2023-11-22 11:42:05 +03:00
7ca8a2122f Merge branch 'develop' into feature/restore-history 2023-11-22 11:29:31 +07:00
293bc9b5b0 link in referenceData in changelog 2023-11-21 16:06:03 +03:00
a4cedb5725 Merge pull request #488 from ONLYOFFICE/feature/csharp-mvc-matrix-formats
Feature/csharp mvc matrix formats
2023-11-21 15:59:30 +03:00
8a2fc218d4 repo with formats to changelog 2023-11-21 15:59:08 +03:00
23d8315c37 Merge branch 'develop' into feature/csharp-mvc-matrix-formats 2023-11-21 15:56:31 +03:00
38aae731ba reorder modules 2023-11-21 15:54:33 +03:00
4d49e54129 csharp-mvc: added format caching 2023-11-21 15:19:24 +03:00
c1d1af6fae Merge pull request #487 from ONLYOFFICE/feature/csharp-matrix-formats
Feature/csharp matrix formats
2023-11-21 15:14:21 +03:00
c2466ddebe csharp: added format caching 2023-11-21 15:12:10 +03:00
7ecbc6d458 csharp: replace the previous implementation of formats 2023-11-21 15:12:05 +03:00
2e69ba0d3f python: fix lint 2023-11-21 12:58:17 +03:00
bf72a43605 Merge remote-tracking branch 'remotes/origin/develop' into feature/submit-form
# Conflicts:
#	web/documentserver-example/csharp-mvc/Helpers/Users.cs
#	web/documentserver-example/csharp/Users.cs
#	web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/ExampleData.java
#	web/documentserver-example/java/src/main/java/helpers/Users.java
#	web/documentserver-example/php/src/helpers/ExampleUsers.php
#	web/documentserver-example/python/src/utils/users.py
#	web/documentserver-example/ruby/app/models/users.rb
2023-11-21 12:30:39 +03:00
86c2842198 Merge pull request #489 from ONLYOFFICE/fix/php-get-stored-files
fix/php-get-stored-files
2023-11-21 11:59:46 +03:00
9389607aaf python: flake8 configuration file 2023-11-21 15:39:31 +07:00
3d63728344 Merge branch 'develop' into feature/restore-history 2023-11-21 14:21:58 +07:00
40d1c0c03b python: getting storage path to file uri from config manager 2023-11-21 14:20:35 +07:00
0c2a271357 ruby: added rubocop configuration file 2023-11-20 13:11:01 +03:00
e94d81e228 ruby: Layout/FirstMethodParameterLineBreak correct 2023-11-20 13:04:00 +03:00
4c9c79ae8e ruby: Layout/EmptyLinesAroundClassBody correct 2023-11-20 13:02:20 +03:00
d51dab82c5 ruby: Layout/EndAlignment correct 2023-11-20 13:01:55 +03:00
1e66124a8a ruby: ElseAlignment correct 2023-11-20 13:01:15 +03:00
5fd2878c3d ruby: Layout/FirstHashElementIndentation correct 2023-11-20 13:00:04 +03:00
63ec4db0b3 ruby: Lint/AmbiguousOperatorPrecedence correct 2023-11-20 12:58:23 +03:00
0d3ed49adf ruby: Layout/MultilineOperationIndentation correct 2023-11-20 12:57:33 +03:00
7197a216f8 ruby: Layout/ParameterAlignment correct 2023-11-20 12:56:29 +03:00
716d4dc694 ruby: Layout/FirstHashElementIndentation correct 2023-11-20 12:55:58 +03:00
d744bc2e23 ruby: Layout/ClosingParenthesisIndentation correct 2023-11-20 12:55:19 +03:00
a69f7f343a ruby: Layout/HashAlignment correct 2023-11-20 12:54:56 +03:00
10b40423ad ruby: Layout/CommentIndentation correct 2023-11-20 12:54:30 +03:00
4ea23d1677 ruby: Style/Lambda correct 2023-11-20 12:54:00 +03:00
e0ed22d1f5 ruby: Layout/FirstArgumentIndentation correct 2023-11-20 12:52:31 +03:00
5148fd2601 ruby: Layout/EmptyLines correct 2023-11-20 12:52:02 +03:00
97420e18cf ruby: Style/AccessModifierDeclarations correct 2023-11-20 12:51:34 +03:00
10e1848beb ruby: Style/AccessorGrouping correct 2023-11-20 12:50:59 +03:00
d4b2bf95bc ruby: Layout/LineContinuationSpacing correct 2023-11-20 12:50:33 +03:00
d613a02068 ruby: Layout/FirstHashElementLineBreak correct 2023-11-20 12:50:13 +03:00
4ff7b6e543 ruby: Layout/IndentationWidth correct 2023-11-20 12:49:36 +03:00
066de3359d ruby: Layout/ExtraSpacing correct 2023-11-20 12:49:06 +03:00
4577861f8b ruby: Layout/ClosingParenthesisIndentation correct 2023-11-20 12:48:42 +03:00
94df21fe21 ruby: Style/ClassMethodsDefinitions correct 2023-11-20 12:48:18 +03:00
af38a4ba61 ruby: Layout/LineEndStringConcatenationIndentation correct 2023-11-20 12:47:24 +03:00
7e9356df5e ruby: Layout/MultilineMethodCallBraceLayout correct 2023-11-20 12:46:53 +03:00
5f68d09e2f ruby: Layout/FirstHashElementIndentation correct 2023-11-20 12:46:25 +03:00
18aa9487b3 ruby: Layout/FirstMethodArgumentLineBreak correct 2023-11-20 12:45:27 +03:00
f00f212662 ruby: Lint/SymbolConversion correct 2023-11-20 12:44:59 +03:00
743176bb5c ruby: Layout/TrailingWhitespace correct 2023-11-20 12:44:29 +03:00
58eec51312 ruby: Layout/IndentationConsistency correct 2023-11-20 12:44:03 +03:00
1f5c23a2d1 ruby: Layout/CommentIndentation correct 2023-11-20 12:43:31 +03:00
992dbe18af ruby: Layout/ArgumentAlignment correct 2023-11-20 12:41:52 +03:00
ae738e1be2 ruby: Style/RedundantSelfAssignmentBranch correct 2023-11-20 12:41:28 +03:00
9796abf846 ruby: Layout/FirstArgumentIndentation correct 2023-11-20 12:40:48 +03:00
9471891a89 ruby: Lint/NonAtomicFileOperation correct 2023-11-20 12:40:05 +03:00
9b64957189 ruby: Layout/MultilineMethodParameterLineBreaks correct 2023-11-20 12:39:19 +03:00
6f5a854cd2 ruby: Style/WordArray correct 2023-11-20 12:38:50 +03:00
f441ab1650 ruby: Style/RedundantParentheses correct 2023-11-20 12:38:22 +03:00
fd5a2b7b0e ruby: Style/NegatedIfElseCondition correct 2023-11-20 12:37:42 +03:00
f2504ab740 ruby: Style/FileWrite correct 2023-11-20 12:36:45 +03:00
7710c6d6e8 ruby: Style/QuotedSymbols correct 2023-11-20 12:36:03 +03:00
5b99e3d17a ruby: Style/HashSyntax correct 2023-11-20 12:35:14 +03:00
955b35f382 ruby: Style/MethodCallWithArgsParentheses correct 2023-11-20 12:33:36 +03:00
8580ea8a57 ruby: Style/StringHashKeys correct 2023-11-20 12:32:54 +03:00
cba2eac65d ruby: Lint/NumberConversion correct 2023-11-20 12:32:09 +03:00
f5ccc21f69 ruby: Style/FetchEnvVar correct 2023-11-20 12:31:23 +03:00
03a585685e ruby: Layout/FirstMethodArgumentLineBreak correct 2023-11-20 12:29:36 +03:00
40c520e8fd ruby: Layout/ArgumentAlignment correct 2023-11-20 12:29:02 +03:00
940b4bfc80 ruby: Layout/TrailingWhitespace correct 2023-11-20 12:28:12 +03:00
7fe7753c88 ruby: Layout/MultilineMethodArgumentLineBreaks correct 2023-11-20 12:27:25 +03:00
8fa40ab439 ruby: Style/SymbolArray correct 2023-11-20 12:10:24 +03:00
8f4de5ce0d ruby: Naming/PredicateName correct 2023-11-20 11:53:13 +03:00
94d22003b5 ruby: Naming/MethodName correct 2023-11-20 11:50:10 +03:00
f8d62ab8db ruby: Naming/AccessorMethodName correct 2023-11-20 00:37:46 +03:00
f955096fc0 ruby: Naming/VariableNumber correct 2023-11-20 00:37:46 +03:00
9b0d3e1a20 ruby: Naming/VariableName correct 2023-11-20 00:37:39 +03:00
dafc66d5d8 ruby: Style/Documentation correct 2023-11-19 02:38:42 +03:00
902ad1341c ruby: Naming/RescuedExceptionsVariableName correct 2023-11-16 15:16:47 +03:00
1cd457c5c6 ruby: Lint/DuplicateMethods correct 2023-11-16 13:35:06 +03:00
4536f83d10 ruby: Style/OptionalBooleanParameter correct 2023-11-16 13:33:09 +03:00
acdb60dd3b ruby: Style/ClassVars correct 2023-11-16 12:21:22 +03:00
c5315de84f ruby: Lint/Void correct 2023-11-16 10:16:22 +03:00
c639ba4287 ruby: Style/NegatedIf correct 2023-11-16 10:15:11 +03:00
ea15f12551 ruby: Style/TrailingUnderscoreVariable correct 2023-11-16 09:34:57 +03:00
c0135c52c5 ruby: Layout/TrailingWhitespace correct 2023-11-16 09:34:57 +03:00
f87fc045d3 ruby: Lint/UselessAssignment correct 2023-11-16 09:34:57 +03:00
684fa89c13 ruby: Style/EmptyLineAfterMagicComment correct 2023-11-16 09:34:57 +03:00
f4d838710c ruby: Style/MultilineIfModifier correct 2023-11-16 09:34:57 +03:00
0728a71f01 ruby: Style/EmptyElse correct 2023-11-16 09:34:57 +03:00
9cbb946c8f ruby: Style/MultilineTernaryOperator correct 2023-11-16 09:34:57 +03:00
24ff9ce804 ruby: Style/NegatedIf correct 2023-11-16 09:34:57 +03:00
498268a7a3 ruby: Style/ParenthesesAroundCondition correct 2023-11-16 09:34:57 +03:00
2477fb21c5 ruby: Style/RedundantAssignment correct 2023-11-16 09:34:57 +03:00
a809af8eca ruby: Style/IfUnlessModifier correct 2023-11-16 09:34:57 +03:00
5f053de539 ruby: Style/RedundantParentheses correct 2023-11-16 09:34:57 +03:00
f47f9bf897 ruby: Style/FrozenStringLiteralComment correct 2023-11-16 09:34:57 +03:00
7d09d87891 ruby: Layout/LineLength correct 2023-11-16 09:34:57 +03:00
83843342d4 ruby: Style/HashSyntax correct 2023-11-16 09:34:57 +03:00
a407b2b9c7 ruby: Style/For correct 2023-11-16 09:34:57 +03:00
b29b0c3fa5 ruby: Style/AndOr correct 2023-11-16 09:34:57 +03:00
821df5c700 ruby: Style/RescueStandardError correct 2023-11-16 09:34:57 +03:00
56e96eeac1 ruby: Style/Redundant correct 2023-11-16 09:34:57 +03:00
6525c29107 ruby: Style/NumericPredicate correct 2023-11-16 09:34:57 +03:00
3197702d7b ruby: Style/CommentedKeyword correct 2023-11-16 09:34:57 +03:00
286fb47fb8 ruby: Lint/RedundantStringCoercion correct 2023-11-16 09:34:57 +03:00
44445de6e7 ruby: Layout/CommentIndentation correct 2023-11-16 09:34:57 +03:00
986eeefb4d ruby: Layout/EmptyLinesAroundMethodBody correct 2023-11-16 09:34:57 +03:00
12aba3d66d ruby: Layout/EmptyLines correct 2023-11-16 09:34:57 +03:00
4c92c1c750 ruby: Layout/IndentationWidth correct 2023-11-16 09:34:57 +03:00
4e685d9eab ruby: Layout/ArrayAlignment correct 2023-11-16 09:34:57 +03:00
bb4e2b3b46 ruby: Layout/ExtraSpacing correct 2023-11-16 09:34:57 +03:00
d1b972fb18 ruby: Layout/HashAlignment correct 2023-11-16 09:34:57 +03:00
a17819efb2 ruby: Layout/RescueEnsureAlignment correct 2023-11-16 09:34:57 +03:00
79b98bed53 ruby: Layout/FirstHashElementIndentation correct 2023-11-16 09:34:57 +03:00
27267e2d5b ruby: Layout/ElseAlignment correct 2023-11-16 09:34:57 +03:00
de5fc508f2 ruby: Layout/CaseIndentation correct 2023-11-16 09:34:57 +03:00
dccc970fa1 ruby: Layout/TrailingWhitespace correct 2023-11-16 09:34:57 +03:00
5259cc19fa ruby: Layout/IndentationConsistency correct 2023-11-16 09:34:57 +03:00
8527ac602f ruby: Layout/EmptyLineAfterGuardClause correct 2023-11-16 09:34:57 +03:00
6ff7b4fa8f ruby: Layout/EmptyLines correct 2023-11-16 09:34:57 +03:00
9747867935 ruby: Layout/CommentIndentation correct 2023-11-16 09:34:57 +03:00
42c2c93e81 ruby: Layout/EndAlignment correct 2023-11-16 09:34:57 +03:00
c0d8e0e339 ruby: Layout/IndentationWidth correct 2023-11-16 09:34:49 +03:00
8ebbfa59be Merge pull request #470 from ONLYOFFICE/feature/routing-fix
Feature/routing fix
2023-11-15 10:16:47 +03:00
d06bb98a61 ruby: Style/DefWithParentheses correct 2023-11-14 16:18:58 +03:00
dd3b7ab077 ruby: Style/WordArray correct 2023-11-14 16:18:25 +03:00
7d6933803f ruby: Style/TrailingCommaInArrayLiteral correct 2023-11-14 16:17:39 +03:00
26fc316cee ruby: Style/OrAssignment correct 2023-11-14 16:15:09 +03:00
bd922d202e ruby: Style/ParenthesesAroundCondition correct 2023-11-14 16:13:10 +03:00
c350dd022f ruby: Style/TrailingCommaInHashLiteral correct 2023-11-14 16:12:30 +03:00
f3cfdc353e ruby: Style/MultilineTernaryOperator correct 2023-11-14 16:11:54 +03:00
9b010f8315 ruby: Style/MethodCallWithoutArgsParentheses correct 2023-11-14 16:11:23 +03:00
5171624adc ruby: Style/IfInsideElse correct 2023-11-14 16:10:50 +03:00
3247a75318 ruby: Style/ConditionalAssignment correct 2023-11-14 16:09:49 +03:00
81a43656b2 ruby: Style/SelfAssignment correct 2023-11-14 16:08:52 +03:00
3df552b4b2 ruby: Style/BlockDelimiters correct 2023-11-14 16:08:14 +03:00
e9b4fce50b ruby: Style/GuardClause correct 2023-11-14 16:06:55 +03:00
1989c5f44d ruby: Style/AccessorGrouping correct 2023-11-14 16:05:53 +03:00
23193739f7 ruby: Style/NonNilCheck correct 2023-11-14 16:04:41 +03:00
21d75418c2 ruby: Style/MultipleComparison correct 2023-11-14 16:03:32 +03:00
b630764daf ruby: Style/NegatedIf correct 2023-11-14 16:02:59 +03:00
f9375a7414 ruby: Style/SoleNestedConditional correct 2023-11-14 15:59:48 +03:00
52d72371d5 ruby: Style/Semicolon correct 2023-11-14 15:58:46 +03:00
519f6d6f32 ruby: Style/NilComparison correct 2023-11-14 15:54:50 +03:00
eb6861059e ruby: Style/StringConcatenation correct 2023-11-14 15:00:52 +03:00
f5801a7f8c ruby: Style/IfUnlessModifier correct 2023-11-14 14:53:05 +03:00
15b905613c ruby: Style/EmptyMethod correct 2023-11-14 14:47:16 +03:00
5255f0e462 ruby: Style/SymbolArray correct 2023-11-14 14:46:08 +03:00
5e29215a11 ruby: Style/StringLiterals correct 2023-11-14 14:38:10 +03:00
de32be3945 ruby: Lint/RedundantStringCoercion correct 2023-11-14 14:30:45 +03:00
63c04c85b0 ruby: Lint/ParenthesesAsGroupedExpression correct 2023-11-14 14:01:39 +03:00
2d3fc72283 ruby: Layout/FirstArrayElementIndentation correct 2023-11-14 13:53:42 +03:00
b6e71e42c1 ruby: Layout/ParameterAlignment correct 2023-11-14 13:53:08 +03:00
dcf78b13f2 ruby: Layout/ArgumentAlignment correct 2023-11-14 13:52:39 +03:00
d8b0bd55cf ruby: Layout/FirstHashElementIndentation correct 2023-11-14 13:52:07 +03:00
8ddbb6ba18 ruby: Layout/EmptyLinesAroundBeginBody correct 2023-11-14 13:51:36 +03:00
831e59b390 ruby: Layout/EmptyLineBetweenDefs correct 2023-11-14 13:50:53 +03:00
95de0fc2c7 ruby: Layout/CaseIndentation correct 2023-11-14 13:50:09 +03:00
b48efac604 ruby: Layout/SpaceAroundOperators correct 2023-11-14 13:48:40 +03:00
c0eb1c8a85 ruby: Layout/SpaceAroundEqualsInParameterDefault correct 2023-11-14 13:48:06 +03:00
118779aac1 ruby: Layout/SpaceInsideBlockBraces correct 2023-11-14 13:47:02 +03:00
276f5c1e20 ruby: Layout/SpaceAfterMethodName correct 2023-11-14 13:42:27 +03:00
64f66d4fa3 ruby: Layout/EmptyLinesAroundClassBody correct 2023-11-14 13:41:38 +03:00
ac3e0faba8 ruby: Layout/MultilineOperationIndentation correct 2023-11-14 13:40:44 +03:00
fde6a09f75 ruby: Layout/SpaceAfterComma correct 2023-11-14 13:39:32 +03:00
f12fb576d8 ruby: Layout/SpaceInsideHashLiteralBraces correct 2023-11-14 13:34:49 +03:00
b5585cf3db ruby: Layout/LeadingCommentSpace correct 2023-11-14 13:33:31 +03:00
f1a69218ae ruby: Layout/IndentationConsistency correct 2023-11-14 13:32:08 +03:00
dbce9946e0 ruby: Layout/TrailingWhitespace correct 2023-11-14 13:29:46 +03:00
3b66092a45 ruby: Layout/IndentationWidth correct 2023-11-14 13:25:32 +03:00
1b91592a9a ruby: Layout/ExtraSpacing correct 2023-11-14 13:10:31 +03:00
e9e6586d6d ruby: Layout/EmptyLinesAroundMethodBody correct 2023-11-14 12:43:19 +03:00
266e249b12 ruby: Layout/TrailingEmptyLines correct 2023-11-14 12:37:38 +03:00
ce9d62ad7d ruby: Layout/EmptyLineAfterGuardClause correct 2023-11-14 12:31:56 +03:00
a1db88e057 php: fixed overwriting of array elements when file creation dates are the same 2023-11-13 18:08:13 +03:00
9ea7e14c37 ruby: saving formsdata 2023-11-13 16:55:14 +03:00
9369b124da csharp-mvc: saving formsdata 2023-11-13 15:26:17 +03:00
5581cc1ad2 csharp: saving formsdata 2023-11-13 15:17:44 +03:00
ccf6fb4098 java-spring: saving formsdata 2023-11-13 14:02:49 +03:00
b26bd01f28 Merge pull request #481 from ONLYOFFICE/feature/referenceData-link
Feature/reference data link
2023-11-13 13:45:21 +03:00
1fda76552f java: saving formsdata 2023-11-13 13:13:09 +03:00
b6b001d7ef php: saving formsdata 2023-11-13 13:13:09 +03:00
6207d03984 python: saving formsdata 2023-11-13 13:13:05 +03:00
888957c967 php: removed unnecessary route and method 'csv' 2023-11-13 16:31:26 +07:00
febce17e86 Merge branch 'develop' into feature/restore-history 2023-11-13 16:16:10 +07:00
63b2202f82 python: storage folder in configuration manager 2023-11-13 16:15:05 +07:00
9f70cca92c php: link in referenceData
# Conflicts:
#	CHANGELOG.md
2023-11-10 17:21:33 +03:00
d2a6ebeb74 ruby: link in referenceData 2023-11-10 17:21:04 +03:00
6c6dd7a954 java: link in referenceData 2023-11-10 13:55:39 +03:00
778121f2af java-spring: link in referenceData 2023-11-10 13:54:55 +03:00
21e61a31af csharp-mvc: link in referenceData 2023-11-10 13:54:01 +03:00
99c046e498 csharp: link in referenceData
# Conflicts:
#	CHANGELOG.md
2023-11-10 13:52:58 +03:00
c2d190e811 python: link in referenceData 2023-11-10 13:52:06 +03:00
88b8af6004 Merge pull request #485 from ONLYOFFICE/feature/user-image
Feature/user image
2023-11-10 13:32:46 +03:00
9487a87b65 Merge remote-tracking branch 'remotes/origin/develop' into feature/user-image
# Conflicts:
#	CHANGELOG.md
2023-11-10 13:32:17 +03:00
1d65ec61ea nodejs: saving formsdata 2023-11-10 13:06:25 +03:00
9e351e4190 csharp-mvc: replace the previous implementation of formats 2023-11-10 12:46:30 +03:00
9b9049a2fc csharp-mvc: add format module 2023-11-10 12:32:38 +03:00
e5e84cdd67 Merge remote-tracking branch 'remotes/origin/develop' into feature/submit-form 2023-11-10 12:30:05 +03:00
6350e33c64 csharp-mvc: add document-formats submodule 2023-11-10 11:10:06 +03:00
15d2f6fa79 Merge pull request #486 from ONLYOFFICE/feature/auto-convert
Convert after uploading only tagged formats
2023-11-09 15:56:52 +03:00
0057b81adc csharp-mvc: moved the submodule to the assets/document-templates subfolder 2023-11-09 09:56:55 +03:00
28c8410e7d csharp: add format module 2023-11-09 09:51:43 +03:00
c91fbf6320 csharp: add document-formats submodule 2023-11-08 15:24:14 +03:00
030985bbeb csharp: moved the submodule to the assets/document-templates subfolder 2023-11-08 15:02:58 +03:00
7c57b0f575 python: code refactoring 2023-11-08 13:08:07 +07:00
d75a4c529d ruby: renaming asset method to assets 2023-11-08 12:17:42 +07:00
2ee051e9fc java-spring: 'uid-' prefix was returned to User class id field 2023-11-08 11:38:04 +07:00
f7386df050 ruby: convert after uploading only tagged formats 2023-11-07 13:01:27 +07:00
d3185253a8 python: convert after uploading only tagged formats 2023-11-07 12:56:06 +07:00
e18d36f18d php: convert after uploading only tagged formats 2023-11-07 12:43:05 +07:00
794e578a37 merging fix 2023-11-07 12:00:51 +07:00
c86c6bf17e Merge branch 'develop' into feature/user-image 2023-11-07 11:25:40 +07:00
0494d24e29 Merge branch 'develop' into feature/restore-history 2023-11-07 10:21:57 +07:00
34e60cd33f Merge pull request #484 from ONLYOFFICE/feature/remove-logo-parameter
java-spring: remove logo parameter in config and Logo.java class
2023-11-06 14:48:49 +03:00
089819cdc4 setUsers for region protection in changelog 2023-11-06 14:43:33 +03:00
146f6224f2 Merge pull request #480 from ONLYOFFICE/feature/region-protect
Feature/region protect
2023-11-06 14:42:21 +03:00
65b9bfec01 java-spring: remove logo parameter in config and Logo.java class 2023-11-06 09:55:45 +03:00
f620da3b98 java: empty usersInfo for anonymous 2023-11-06 12:02:38 +07:00
62e2f7426c csharp: user avatar 2023-11-06 11:41:09 +07:00
672a351402 csharp-mvc: user image 2023-11-06 10:54:39 +07:00
dfe61c5013 java: user avatar 2023-11-03 20:47:43 +07:00
13c93ce2de java-spring: user avatar 2023-11-03 19:44:33 +07:00
b175ebc761 Merge pull request #482 from ONLYOFFICE/feature/php-convert
php: fix convert (50dca2e2c0)
2023-11-02 17:21:50 +03:00
20aea45ac7 php: user avatar 2023-11-02 17:17:41 +07:00
a220cdd627 ruby: user avatar 2023-11-01 13:23:51 +07:00
20ca2d0cbd python: lint fix 2023-11-01 11:17:34 +07:00
e1d8418055 Merge branch 'develop' into feature/region-protect 2023-11-01 11:12:26 +07:00
6e6e5c472e Merge branch 'develop' into feature/routing-fix 2023-11-01 11:04:37 +07:00
9d3d5243b2 python: lint fix 2023-11-01 10:59:41 +07:00
440b51c7ff Merge branch 'develop' into feature/restore-history 2023-11-01 10:51:44 +07:00
1d747b834d Merge branch 'feature/user-image' of https://github.com/ONLYOFFICE/document-server-integration into feature/user-image 2023-11-01 10:25:20 +07:00
a5a1df45b1 python: user avatar 2023-11-01 10:18:58 +07:00
43fc58f6c7 Merge pull request #475 from ONLYOFFICE/feature/referenceData-open
Feature/reference data open
2023-10-31 14:27:49 +03:00
84824d1ed4 onRequestOpen to changelog 2023-10-31 14:26:29 +03:00
1620e8277d Merge remote-tracking branch 'remotes/origin/develop' into feature/referenceData-open
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/python/src/views/actions.py
2023-10-31 14:25:00 +03:00
09c1b9e45c onRequestOpen to changelog 2023-10-31 13:28:06 +03:00
c7409e3f35 java-spring: added JsonIgnoreProperties annotation to ignore the "windowName" field 2023-10-31 13:02:14 +03:00
5c09e1cb53 Merge pull request #474 from ONLYOFFICE/feature/flake8-pylint
Feature/flake8 pylint
2023-10-31 12:54:52 +03:00
03ffae8115 php: fix convert (50dca2e2c0) 2023-10-31 13:54:06 +07:00
6a059bb498 Merge branch 'develop' into feature/flake8-pylint 2023-10-30 16:19:08 +07:00
2459863430 Merge pull request #468 from ONLYOFFICE/release/1.7.0
Release/1.7.0
2023-10-30 12:17:35 +03:00
c78814ced4 removed pylint 2023-10-30 16:15:57 +07:00
e444fd02e5 Merge branch 'develop' into feature/region-protect 2023-10-30 15:52:23 +07:00
0a76dba089 csharp: setUsers for region protection 2023-10-30 15:45:16 +07:00
7666394f1d csharp-mvc: setUsers for region protection 2023-10-30 15:28:45 +07:00
b8c6f72e74 java: setUsers for region protection 2023-10-30 14:38:45 +07:00
f501612067 java-spring: setUsers for region protection 2023-10-30 14:15:09 +07:00
3cf0c1a6a5 Merge remote-tracking branch 'remotes/origin/release/1.7.0' into develop 2023-10-27 18:44:25 +03:00
52c11fa3a1 using documentserver v7.5 2023-10-27 18:39:40 +03:00
86d2fc1399 Merge pull request #478 from ONLYOFFICE/chore/php-readme
php: update readme
# Conflicts:
#	web/documentserver-example/php/README.md
2023-10-27 18:36:09 +03:00
d2f77d857d Merge pull request #477 from ONLYOFFICE/chore/python-readme
python: update readme
# Conflicts:
#	web/documentserver-example/python/readme.md
2023-10-27 18:34:31 +03:00
5b7fe48354 Merge pull request #478 from ONLYOFFICE/chore/php-readme
php: update readme
2023-10-27 18:31:40 +03:00
6311aa0a6f Merge pull request #479 from ONLYOFFICE/chore/php-version
php: bump php version and pin composer version
2023-10-27 18:30:37 +03:00
043fb2c0cf returned documentserver version 7.3.3.50 to compose 2023-10-27 16:49:54 +03:00
c2bb7985de php: setUsers for region protection 2023-10-27 18:42:16 +07:00
eaf0245216 python: setUsers for region protection 2023-10-27 18:22:46 +07:00
ace724bc21 ruby: setUsers for region protection 2023-10-27 18:03:13 +07:00
4f0e00b597 fixed the file name 2023-10-27 11:49:12 +03:00
1ab93ccb28 nodejs: fix searching server address (969a8c6cfe) 2023-10-27 11:44:46 +03:00
1f6a4b5d52 Merge branch 'feature/external-reference' into develop 2023-10-27 11:28:29 +03:00
36463aae8c nodejs: return external link in reference request 2023-10-27 11:28:00 +03:00
6aa57e3dfb php: bump php version and pin composer version 2023-10-27 09:21:37 +04:00
880423545f php: update readme 2023-10-27 09:18:51 +04:00
af0c7f343a Merge pull request #477 from ONLYOFFICE/chore/python-readme
python: update readme
2023-10-26 17:37:55 +03:00
8b5a2aceb0 deleted comments that duplicate the context 2023-10-26 17:11:29 +03:00
31a436047c Merge pull request #476 from ONLYOFFICE/deps/python
python: pin python with pip versions
2023-10-26 16:45:47 +03:00
73c60fba7d ruby: onRequestOpen for referenceData source file 2023-10-26 16:45:32 +03:00
dd4021a95b Merge remote-tracking branch 'remotes/origin/feature/user-image' into develop 2023-10-26 16:34:33 +03:00
67000fd0ed nodejs: avatar to changelog 2023-10-26 16:32:41 +03:00
4387282949 java: onRequestOpen for referenceData source file 2023-10-26 16:30:48 +03:00
4bce33e3c2 nodejs: set required users only 2023-10-26 16:27:35 +03:00
e913cb3d27 nodejs: setUsers info 2023-10-26 16:27:26 +03:00
2f87f3b7c9 nodejs: set current avatar 2023-10-26 16:26:59 +03:00
4e3f87f692 java-spring: onRequestOpen for referenceData source file 2023-10-26 16:20:30 +03:00
8d94e42421 python: onRequestOpen for referenceData source file 2023-10-26 15:55:11 +03:00
5b17ba41c3 mvc: onRequestOpen for referenceData source file 2023-10-26 15:55:11 +03:00
7ecec4219a csharp: onRequestOpen for referenceData source file 2023-10-26 15:55:11 +03:00
5ab7261d31 php: onRequestOpen for referenceData source file 2023-10-26 15:54:30 +03:00
8696f26555 nodejs: fix directUrl property (815b5fb) 2023-10-26 15:33:03 +03:00
cd0647e0f7 python: update readme 2023-10-26 13:03:18 +04:00
038b2ffc57 python: delete readme.md to be able to rename it in uppercase 2023-10-26 12:59:59 +04:00
6990bc40d2 python: pin python with pip versions 2023-10-26 12:58:24 +04:00
bbeaea6d2e ruby: code refactoring 2023-10-26 13:34:14 +07:00
b093666d90 python: code refactoring 2023-10-26 13:03:10 +07:00
7825d0ae48 java-spring: code refactoring 2023-10-26 12:57:07 +07:00
c6d3c8d684 Merge branch 'develop' into feature/routing-fix 2023-10-26 12:45:22 +07:00
0d3cda32fa php: code refactoring 2023-10-26 11:33:38 +07:00
e5d4be0d61 python: code refactoring 2023-10-26 11:27:01 +07:00
5f2c5cea58 ruby: code refactoring 2023-10-26 11:15:26 +07:00
4ec7e46736 Merge pull request #473 from ONLYOFFICE/chore/ruby-readme
ruby: update readme
# Conflicts:
#	web/documentserver-example/ruby/README.md
2023-10-25 13:11:37 +03:00
1353df7977 Merge pull request #473 from ONLYOFFICE/chore/ruby-readme
ruby: update readme
2023-10-25 13:09:35 +03:00
0a3785a3a4 python: merging lint fix 2023-10-25 13:55:29 +07:00
bcc49a4f41 Merge branch 'develop' into feature/flake8-pylint 2023-10-25 13:52:17 +07:00
fdf55a0da2 python: pylint workflow import-error(E0401) ignore 2023-10-25 13:10:12 +07:00
c23a8ac47d python: lint workflow fix 2023-10-25 12:48:34 +07:00
b7212b035a pylint: configuration file 2023-10-25 12:42:51 +07:00
39f39b0316 pylint: W0613 unused-argument 2023-10-25 11:44:00 +07:00
c3b2785c3f pylint: W3101 missing-timeout 2023-10-25 11:29:54 +07:00
6bd081c44d pylint: R1705 no-else-return 2023-10-25 11:19:19 +07:00
28211493bc pylint: C0209 consider-using-f-string 2023-10-25 11:12:39 +07:00
687b811eef pylint: C0411 wrong-import-order 2023-10-25 10:56:00 +07:00
eaa06d1919 ruby: download last version 2023-10-24 15:19:43 +03:00
ac24eb73f7 small fixes 2023-10-24 14:56:00 +03:00
9c26b4e563 Update README.md 2023-10-24 14:02:38 +03:00
f897ffaede Merge pull request #472 from ONLYOFFICE/chore/pin-bundler
ruby: pin bundler version
2023-10-24 13:04:40 +03:00
ef067c9497 Merge pull request #471 from ONLYOFFICE/fix/bundler-flags
ruby: use bundler configuration instead of flags
2023-10-24 13:04:19 +03:00
3658988225 ruby: update readme 2023-10-24 11:30:09 +04:00
b5251b0e92 nodejs: fix mobile size for chrome on iOS (f096fd4d93) 2023-10-24 10:16:16 +03:00
14025def10 pylint: W0622 redefined-builtin 2023-10-24 13:51:44 +07:00
de4414fbb1 pylint: R1711 useless-return 2023-10-24 13:19:32 +07:00
b49341f64e ruby: pin bundler version 2023-10-24 09:49:09 +04:00
8fd0cfcd47 ruby: use bundler configuration instead of flags 2023-10-24 09:38:00 +04:00
feaa30bf2d pylint: C0325: Unnecessary parens 2023-10-24 12:36:22 +07:00
304995c3e1 flake8: E501 line too long (> 120 characters) 2023-10-24 11:23:55 +07:00
f096fd4d93 nodejs: fix mobile size for chrome on iOS (Fix Bug 59054) 2023-10-23 18:02:51 +03:00
d3a08acec3 Revert "Fix Bug 34620 - resize on mobile"
This reverts commit a9d261a0ad.

# Conflicts:
#	web/documentserver-example/nodejs/views/editor.ejs
2023-10-23 16:35:34 +03:00
71215e342f Merge remote-tracking branch 'remotes/origin/develop' into feature/restore-history
# Conflicts:
#	CHANGELOG.md
2023-10-23 13:45:19 +03:00
3c54bed7be fix changelog (after 73acfe8721 with 969a8c6cfe) 2023-10-23 13:38:33 +03:00
8c433b2867 nodejs: date format fix (Fix Bug 64155)
# Conflicts:
#	web/documentserver-example/nodejs/helpers/docManager.js
2023-10-23 13:33:58 +03:00
fa50ffbc28 nodejs: date format fix (Fix Bug 64155)
# Conflicts:
#	web/documentserver-example/nodejs/helpers/docManager.js
2023-10-23 13:19:29 +03:00
a39256af77 Merge pull request #463 from ONLYOFFICE/feature/upload-name
Feature/upload name
2023-10-23 12:59:55 +03:00
7257b0098e artifact on master branch only 2023-10-23 12:59:32 +03:00
8ea98a421d flake8: W293 blank line contains whitespace 2023-10-23 16:57:31 +07:00
f3fe76387b Merge remote-tracking branch 'remotes/origin/develop' into feature/upload-name 2023-10-23 12:56:09 +03:00
11c9af2f80 flake8: W292 no newline at end of file 2023-10-23 16:54:22 +07:00
c3d7106072 flake8: W291 trailing whitespace 2023-10-23 16:52:33 +07:00
cf01b7f426 flake8: F841 local variable is assigned to but never used 2023-10-23 16:47:12 +07:00
8ce5c2d8d1 flake8: F401 imported but unused 2023-10-23 16:35:13 +07:00
51a28a7889 flake8: E713 test for membership should be 'not in' 2023-10-23 16:03:36 +07:00
c3074066f3 flake8: E711 comparison to None should be 'if cond is (not) None:' 2023-10-23 15:59:29 +07:00
8704be3daf flake8: E703 statement ends with a semicolon 2023-10-23 15:56:08 +07:00
88ec714801 flake8: E701 multiple statements on one line (colon) 2023-10-23 15:54:36 +07:00
75d6e79e6d flake8: E275 missing whitespace after keyword 2023-10-23 15:51:58 +07:00
e3a7399125 flake8: E272 multiple spaces before keyword 2023-10-23 15:49:57 +07:00
ddbfdf83bb flake8: E261 at least two spaces before inline comment 2023-10-23 15:48:33 +07:00
2fd48b9a37 flake8: E251 unexpected spaces around keyword / parameter equals 2023-10-23 15:32:53 +07:00
4b185e418c flake8: E231 missing whitespace after ',' or ':' 2023-10-23 15:27:48 +07:00
3d5d20da13 flake8: E225 missing whitespace around operator 2023-10-23 15:24:27 +07:00
93541a2702 flake8: E222 multiple spaces after operator 2023-10-23 15:22:11 +07:00
88f058f7b6 flake8: E211 whitespace before '(' 2023-10-23 15:19:50 +07:00
f1670c38df flake8: E203 whitespace before ':' 2023-10-23 15:11:07 +07:00
11fedb58bd flake8: E202 whitespace before '}' 2023-10-23 15:04:03 +07:00
650b514d82 flake8: E201 whitespace after '{' 2023-10-23 15:02:42 +07:00
5363a794b7 flake8: E126 continuation line over-indented for hanging indent 2023-10-23 14:58:41 +07:00
359c732b8a flake8: E122 continuation line missing indentation or outdented 2023-10-23 14:52:23 +07:00
952bd2b2f1 flake8: E121 continuation line under-indented for hanging indent 2023-10-23 14:49:56 +07:00
5ab8c4466a flake8: E131 continuation line unaligned for hanging indent 2023-10-23 14:45:20 +07:00
d8a7eeb1a0 flake8: E128 continuation line under-indented for visual indent 2023-10-23 14:35:21 +07:00
226689611e flake8: E124 closing bracket does not match visual indentation 2023-10-23 14:31:51 +07:00
0eb8c85f6f flake8: E111 indentation is not a multiple of 4 2023-10-23 14:23:31 +07:00
1c6312ed46 flake8: E3 blank lines 2023-10-23 14:15:14 +07:00
0e5e2b125d java-spring: lint fix 2023-10-20 21:00:39 +07:00
4b822dafe9 Merge branch 'develop' into feature/restore-history 2023-10-20 18:54:16 +07:00
cf64a80daa nodejs: set required users only 2023-10-20 14:53:17 +03:00
d29805a5ed nodejs: setUsers info 2023-10-20 14:53:11 +03:00
2a75ea80b8 nodejs: set current avatar 2023-10-20 14:37:04 +03:00
964aedf57b nodejs: fix lint (b01553af60) 2023-10-20 14:33:45 +03:00
38988ab5fd node: lint fix 2023-10-20 18:33:36 +07:00
1b1f276354 Merge branch 'feature/upload-name' of https://github.com/ONLYOFFICE/document-server-integration into feature/upload-name 2023-10-20 18:27:27 +07:00
3e9a98f0d8 max name length =50 and this value in constant var 2023-10-20 18:22:38 +07:00
05b1b98204 nodejs: email is not required for protection 2023-10-20 13:35:24 +03:00
b01553af60 nodejs: move comment (715ab7d690) 2023-10-20 12:54:39 +03:00
81a75db351 java: revert comment 2023-10-20 12:29:10 +03:00
ed0386e483 long name to сhangelog (Fix Bug 59381) 2023-10-20 12:14:01 +03:00
49d220d673 Merge remote-tracking branch 'remotes/origin/develop' into feature/upload-name
# Conflicts:
#	CHANGELOG.md
2023-10-20 12:11:45 +03:00
c3922de50c fix: actions 2023-10-19 18:35:43 +05:00
f697a08e96 csharp: exclude script (084e9cfca2) 2023-10-19 14:23:10 +03:00
c3b2f70cec mvc: exclude script (12f5528d90) 2023-10-19 14:22:44 +03:00
38e07e094a php: iis link 2023-10-19 14:21:50 +03:00
73acfe8721 Merge remote-tracking branch 'remotes/origin/release/1.7.0' into develop
# Conflicts:
#	CHANGELOG.md
2023-10-19 12:52:24 +03:00
29f7beff3c changelog reorder 2023-10-19 12:42:06 +03:00
0a8df9cb5d 1.7.0 2023-10-19 12:40:03 +03:00
39820cec0a php: getting history via api 2023-10-19 14:19:15 +07:00
56ccbf4c32 Merge pull request #466 from ONLYOFFICE/fix/nginx-dependencies
make the proxy service dependent on the document-server and example services
2023-10-19 09:57:59 +03:00
b19482b676 ruby: make the proxy service dependent on the document-server and example services 2023-10-19 09:52:35 +04:00
fe49436ca9 python: make the proxy service dependent on the document-server and example services 2023-10-19 09:52:28 +04:00
5bc2b1ed2a php: make the proxy service dependent on the document-server and example services 2023-10-19 09:52:17 +04:00
e9893c7c51 python: correct url/uri fix 2023-10-19 12:42:48 +07:00
fe352ebad1 ruby: getting history via api 2023-10-19 12:15:35 +07:00
18cf21efe4 python: getting history via api 2023-10-18 11:21:58 +07:00
825aafda25 nodejs: date format fix 2023-10-13 17:31:47 +07:00
31635a2e68 Merge remote-tracking branch 'remotes/origin/release/v7.5.0' into develop 2023-10-12 13:51:38 +03:00
08b752411b Merge pull request #465 from ONLYOFFICE/hotfix/history-user-id
nodejs: userId in history fixed
2023-10-12 13:46:23 +03:00
c6a2007c6a nodejs: userId in history fixed 2023-10-12 13:21:58 +03:00
770989fec0 Merge pull request #464 from ONLYOFFICE/feature/select-word
Feature/select word
2023-10-12 11:57:57 +03:00
50f1a95eb0 onRequestSelectDocument in changelog 2023-10-12 11:57:34 +03:00
c0051304d9 Merge remote-tracking branch 'remotes/origin/develop' into feature/select-word
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx
#	web/documentserver-example/csharp/DocEditor.aspx
#	web/documentserver-example/csharp/DocEditor.aspx.cs
#	web/documentserver-example/java-spring/src/main/resources/templates/editor.html
#	web/documentserver-example/java/src/main/java/controllers/EditorServlet.java
#	web/documentserver-example/java/src/main/webapp/editor.jsp
#	web/documentserver-example/php/src/views/DocEditorView.php
#	web/documentserver-example/php/templates/docEditor.tpl
#	web/documentserver-example/python/src/views/actions.py
#	web/documentserver-example/python/templates/editor.html
#	web/documentserver-example/ruby/app/views/home/editor.html.erb
2023-10-12 11:54:43 +03:00
7293ddfbb6 Merge branch 'feature/upload-name' of https://github.com/ONLYOFFICE/document-server-integration into feature/upload-name 2023-10-12 14:47:00 +07:00
8d52ba9f79 php lint fix 2023-10-12 14:46:33 +07:00
2fe1619389 Merge branch 'develop' into feature/upload-name 2023-10-12 14:44:29 +07:00
80028ead64 Merge branch 'feature/upload-name' of https://github.com/ONLYOFFICE/document-server-integration into feature/upload-name 2023-10-12 14:40:00 +07:00
f57b430744 lint fix 2023-10-12 14:38:40 +07:00
9f37223162 Merge pull request #462 from ONLYOFFICE/feature/select-cell
Feature/select cell
2023-10-12 09:53:07 +03:00
73ef86edc9 Merge remote-tracking branch 'remotes/origin/develop' into feature/select-cell
# Conflicts:
#	CHANGELOG.md
2023-10-12 09:52:46 +03:00
d36c70b6f5 Merge branch 'develop' into feature/select-word 2023-10-11 13:49:39 +07:00
78cc152c93 Merge branch 'develop' into feature/select-word 2023-10-11 13:42:34 +07:00
62ad36955e php: removed routing changes 2023-10-11 13:38:34 +07:00
75ab636a66 php: removed wrong route and unused method assets 2023-10-11 13:37:06 +07:00
3b3a3ac314 python: removed routing changes 2023-10-11 13:30:21 +07:00
7b275b15b7 python: added assets route for sample download 2023-10-11 13:27:27 +07:00
9c20e50eb3 ruby: removed routing changes 2023-10-11 13:15:56 +07:00
641cd912bb ruby: added asset route for sample download 2023-10-11 13:12:54 +07:00
77d6ab7174 java-spring: removed mapping changes 2023-10-11 12:51:05 +07:00
583e162520 Merge branch 'develop' into feature/upload-name 2023-10-11 11:24:24 +07:00
376ed20a6d csharp: trimming long name of uploading file 2023-10-11 11:13:44 +07:00
6eb54c5386 csharp-mvc: trimming long name of uploading file 2023-10-11 11:10:28 +07:00
1871e0ae4a java: trimming long name of uploading file 2023-10-11 10:57:44 +07:00
a6c805791e end of name fix 2023-10-11 10:49:37 +07:00
bf20f7b263 java-spring: trimming long name of uploading file 2023-10-10 13:10:08 +07:00
cb6aedcab1 php: trimming long name of uploading file 2023-10-10 12:28:29 +07:00
d0a702e7e7 python: trimming long name of uploading file 2023-10-10 12:08:50 +07:00
d06fd45119 ruby: trimming long name of uploading file 2023-10-10 12:02:42 +07:00
53e780579b nodejs: trimming long name of uploading file 2023-10-10 11:46:53 +07:00
5f19bdcff0 Merge branch 'develop' into feature/select-cell 2023-10-10 10:47:06 +07:00
54ece9b580 java-spring: removed mapping changes 2023-10-10 10:45:03 +07:00
170105efd3 java-spring: mapping fix for csv and assets 2023-10-10 10:40:12 +07:00
64302b3d9f key in referenceData to changelog 2023-10-09 13:37:58 +03:00
d790c2954f Merge remote-tracking branch 'remotes/origin/release/v7.5.0' into develop 2023-10-09 13:37:45 +03:00
847e4ce6d9 nodejs: fix datetime format in history (56e46466b2) (Fix Bug 64155) 2023-10-09 13:30:49 +03:00
5645c24b63 Merge pull request #461 from ONLYOFFICE/feature/referenceData-key
Feature/reference data key
2023-10-09 12:35:57 +03:00
1f6178c68a csharp: added key in referenceData 2023-10-09 15:50:52 +07:00
86ad08d2ca csharp-mvc: added key in referenceData 2023-10-09 15:29:17 +07:00
d65633427f java: added key in referenceData 2023-10-09 15:16:19 +07:00
61398f93f1 java-spring: added key in referenceData 2023-10-09 15:00:05 +07:00
a5cc51b1cd changelog update 2023-10-09 14:39:37 +07:00
178c8e3b56 php: added key in referenceData 2023-10-09 14:38:29 +07:00
aa5bb183e3 python: added key in referenceData 2023-10-09 14:30:21 +07:00
bc6fd8f796 ruby: added key in referenceData 2023-10-09 14:25:02 +07:00
725d56f7f6 php: removed wrong route and unused method "assets" 2023-10-06 19:48:48 +07:00
8f031df9f1 ruby: assets route fix 2023-10-05 13:28:01 +07:00
9457754666 java-spring: onRequestSelectDocument / setRequestedDocument add mapping fix 2023-10-05 11:14:31 +07:00
3cd045ed1a php: selectDocument event fix 2023-10-04 12:03:23 +07:00
035dda6093 ruby: selectDocument event fix 2023-10-04 11:31:35 +07:00
7b4cc42b4d python: select document event and assets route fix 2023-10-04 09:36:54 +07:00
eda8ab61e9 csharp-mvc: onRequestSelectDocument / setRequestedDocument 2023-10-03 11:51:00 +07:00
50d2248cd6 csharp: onRequestSelectDocument / setRequestedDocument 2023-10-03 11:38:17 +07:00
88a006ac49 java-spring: spreadsheet method and mapping fix 2023-10-02 17:27:25 +07:00
42854f325a csharp-mvc: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-09-29 20:35:32 +07:00
09c0f31fd6 csharp: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-09-29 20:01:23 +07:00
e49372123b update icons 2023-09-29 14:23:44 +03:00
2bf4187fd4 Merge remote-tracking branch 'remotes/origin/release/v7.5.0' into develop 2023-09-29 14:20:53 +03:00
152083ed4e nodejs: update icons 2023-09-29 14:20:34 +03:00
f5b91299ba Merge pull request #459 from ONLYOFFICE/hotfix/update-packages
ruby: update rails to 7.0.8
2023-09-28 14:47:47 +03:00
c274923072 ruby: update nokogiri to 1.14.3 2023-09-28 14:39:58 +03:00
6eafce5462 ruby: update rails to 7.0.8 2023-09-28 10:55:26 +03:00
2c52f96cac nodejs: onRequestSelectDocument event fix 2023-09-28 13:11:29 +07:00
415a35b0b6 java: onRequestSelectDocument / setRequestedDocument 2023-09-28 13:00:25 +07:00
e280291f80 java-spring: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-09-28 12:14:33 +07:00
77546c2f76 java: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-09-27 13:58:35 +07:00
756a0d0722 ruby: onRequestSelectDocument / setRequestedDocument 2023-09-27 11:24:54 +07:00
13be3dd788 php: onRequestSelectDocument / setRequestedDocument 2023-09-27 10:55:11 +07:00
a627ddf2c7 python: onRequestSelectDocument / setRequestedDocument 2023-09-27 10:43:23 +07:00
4cad298394 ruby: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-09-26 11:49:55 +07:00
84123e713a php: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-09-25 17:21:56 +07:00
7eddfa4703 Merge remote-tracking branch 'remotes/origin/release/v7.5.0' into develop 2023-09-25 12:48:01 +03:00
d594870c87 Merge pull request #385 from ONLYOFFICE/dependabot/npm_and_yarn/web/documentserver-example/nodejs/fast-xml-parser-4.2.4
build(deps): bump fast-xml-parser from 3.19.0 to 4.2.4 in /web/documentserver-example/nodejs
2023-09-25 12:47:23 +03:00
ce0bbca5b2 nodejs: update fast-xml-parser 2023-09-25 12:46:58 +03:00
4b8d076bf3 Merge remote-tracking branch 'remotes/origin/develop' into feature/select-cell
# Conflicts:
#	CHANGELOG.md
2023-09-25 14:28:21 +07:00
e6831fa52f nodejs: XMLParser usage fixed 2023-09-22 11:31:29 +03:00
ffa686e0a2 update fast-xml-parser package version to 4.3.0 2023-09-22 11:09:45 +03:00
730cc09520 build(deps): bump fast-xml-parser in /web/documentserver-example/nodejs
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 3.19.0 to 4.2.4.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-22 09:32:30 +03:00
c19d561c1c Merge pull request #458 from ONLYOFFICE/fix/archive-names
Fixed archive names
2023-09-21 10:01:16 +03:00
01e9dcf1a8 fixed the sample archive names 2023-09-20 17:58:00 +03:00
df8fbec801 python: onRequestSelectSpreadsheet method 2023-09-20 10:48:53 +07:00
2e36067513 Merge pull request #456 from ONLYOFFICE/feature/java-matrix-formats
Feature/java matrix formats
2023-09-14 12:41:53 +03:00
84c6f4c726 java: 3rd-Party.license 2023-09-14 12:40:00 +03:00
df5f311949 Merge remote-tracking branch 'remotes/origin/develop' into feature/java-matrix-formats
# Conflicts:
#	.gitmodules
#	CHANGELOG.md
2023-09-14 12:37:01 +03:00
95b357a53b Merge pull request #457 from ONLYOFFICE/feature/java-spring-matrix-formats
Feature/java spring matrix formats
2023-09-14 12:34:43 +03:00
b75074ba2f java: matrix-format to changelog 2023-09-13 15:28:09 +03:00
d39ad1c677 java-spring: matrix-format to changelog 2023-09-13 15:27:05 +03:00
64a63f2c35 java-spring: changed getFileExtension return without dot 2023-09-13 15:23:02 +03:00
00c7194ef4 java-spring: replace format properties on formats matrix 2023-09-13 15:22:56 +03:00
bbdd0878e9 java-spring: added Format.java, FormatService.java 2023-09-13 15:22:48 +03:00
fb8f47062c java-spring: added submodule document-formats 2023-09-13 15:22:04 +03:00
5a63bd47c1 java: changed getFileExtension return without dot 2023-09-13 11:27:06 +03:00
5e2f812fee java: refactoring Format.java, FormatManager.java, FileType.java 2023-09-13 11:24:51 +03:00
0f3bb28d92 java: added lombok dependency 2023-09-13 11:17:43 +03:00
cb21d73641 format to changelog 2023-09-12 21:37:27 +03:00
89912eac76 Merge pull request #439 from ONLYOFFICE/feature/java-matrix-formats
java: add support for formats
2023-09-12 21:36:35 +03:00
c20687e241 java: added submodule document-formats 2023-09-12 17:34:46 +03:00
5f3b0c61eb java: delete submodule document-formats 2023-09-12 17:33:52 +03:00
45051d2c29 java: fixed FormatManager 2023-09-12 17:24:29 +03:00
940ea2797e Merge branch 'develop' into feature/java-matrix-formats
# Conflicts:
#	.gitmodules
2023-09-12 16:39:32 +03:00
ef53346f16 nodejs: fix lint (6315ccbf45) 2023-09-11 22:34:11 +03:00
3415c1ec4f Merge pull request #455 from ONLYOFFICE/feature/config-paths
Paths to the config files
2023-09-11 22:26:20 +03:00
33600df8a9 added paths to the config files 2023-09-11 18:57:19 +03:00
6315ccbf45 Merge remote-tracking branch 'remotes/origin/feature/referenceData-link' into develop 2023-09-07 11:18:14 +03:00
969a8c6cfe nodejs: link in referenceData 2023-09-07 11:05:57 +03:00
f4dd6d665f Merge pull request #454 from ONLYOFFICE/refactoring/java-spring-dto
Refactoring/java spring dto
2023-09-07 10:54:10 +03:00
427d13af24 Merge pull request #453 from ONLYOFFICE/feature/java-example-docker
Java instructions for Docker
2023-09-07 10:28:06 +03:00
6bdadd6053 Merge remote-tracking branch 'remotes/origin/develop' into refactoring/java-spring-dto 2023-09-07 10:26:03 +03:00
95579f2376 java-spring: added dto/SaveAs.java 2023-09-07 10:25:30 +03:00
8c518fd109 java-spring: added dto/Rename.java 2023-09-07 10:24:53 +03:00
aa245e2aae java-spring: added dto/Reference.java and dto/ReferenceData.java 2023-09-07 10:24:18 +03:00
6511507093 java-spring: added dto/Restore.java 2023-09-07 10:23:34 +03:00
8f14876b81 java and java spring: updated Docker instructions 2023-09-06 15:55:07 +03:00
09f24a3b87 fix changelog 2023-09-05 14:42:58 +03:00
14b014cb7f Merge pull request #452 from ONLYOFFICE/feature/java-spring-refactoring-history
Feature/java spring refactoring history
2023-09-05 14:39:41 +03:00
2d83d3ec87 Merge pull request #451 from ONLYOFFICE/feature/java-refactoring-history
Feature/java refactoring history
2023-09-05 14:39:14 +03:00
05904fd68a java: link to Oracle 2023-09-05 13:57:13 +03:00
a56b411c93 java-spring: changed restore version without reload page 2023-09-04 15:32:15 +03:00
bc5393e28c java-spring: added api (history, historyData) for getting history 2023-09-04 15:29:23 +03:00
a3fa30b192 fixed: directUrl for historyData 2023-09-04 15:19:34 +03:00
24b9a35651 java: changed restore version without reload page 2023-09-04 13:11:20 +03:00
52a722cf89 java: added api (history, historyData) for getting history 2023-09-04 13:10:54 +03:00
4fa9d4c9fd nodejs: remove /files route (8bcc15e320) 2023-09-02 11:18:34 +03:00
35613ddccb nodejs: change get files route 2023-09-02 11:04:18 +03:00
2fa83dcc94 Merge branch 'feature/select-word' into develop 2023-09-01 12:24:33 +03:00
c1af2ba5b4 nodejs: onRequestSelectDocument / setRequestedDocument 2023-09-01 12:24:25 +03:00
fa84f451c2 Merge pull request #432 from ONLYOFFICE/feature/ruby-matrix-formats
ruby: add support for formats
2023-09-01 11:58:34 +03:00
87e9da1212 Merge pull request #444 from ONLYOFFICE/refactor/php-linting
php: many changes to satisfy linter
2023-09-01 09:40:05 +03:00
22dbacaa63 ruby: replace the previous implementation of formats 2023-08-31 11:44:52 +04:00
d192d1e0e8 ruby: add tests for the format module 2023-08-31 11:44:52 +04:00
5b115f7dbc ruby: add format module 2023-08-31 11:44:52 +04:00
41a22934a0 ruby: add document-formats submodule 2023-08-31 11:44:51 +04:00
94f4e83d79 php: update lint action 2023-08-31 11:40:28 +04:00
8ed0c4771d php: many changes to satisfy linter
- Delete unused imports.
- Rename methods and variables from snake case to camel case.
- Shorten code lines.
2023-08-31 11:40:25 +04:00
0445184cbc php: add rules to lint variable names 2023-08-31 11:37:14 +04:00
e4750e7a61 php: set targets for the lint recipe 2023-08-31 11:37:14 +04:00
a78450453d Merge pull request #450 from ONLYOFFICE/feature/csharp-restore
Feature/csharp restore
2023-08-30 22:50:03 +03:00
ca139938e9 csharp: restore to changelog 2023-08-30 22:47:52 +03:00
8ae9dc6fff Merge remote-tracking branch 'remotes/origin/develop' into feature/csharp-restore 2023-08-30 22:47:14 +03:00
9c0121e69f Merge pull request #449 from ONLYOFFICE/feature/csharp-mvc-restore
Feature/csharp mvc restore
2023-08-30 22:46:25 +03:00
e11861b30f csharp-mvc: restore to changelog 2023-08-30 22:46:08 +03:00
21842b772d Merge remote-tracking branch 'remotes/origin/feature/select-cell' into develop 2023-08-30 22:19:14 +03:00
17a1485d52 nodejs: onRequestSelectSpreadsheet/setRequestedSpreadsheet 2023-08-30 22:18:51 +03:00
07c752ed81 nodejs: refactoring 2023-08-30 22:12:59 +03:00
8c704687a7 php: not used function (fd4dfea7d7) 2023-08-30 12:18:34 +03:00
b691eb5717 Merge pull request #436 from ONLYOFFICE/feature/python-matrix-formats
python: add support for formats
2023-08-30 11:24:44 +03:00
dc35b240d1 Merge pull request #448 from ONLYOFFICE/hotfix/restore-paths
fixed restore file paths
2023-08-29 16:45:29 +03:00
527e5053e6 nodejs: fixed restore file paths (Fix Bug 63842) 2023-08-29 16:44:41 +03:00
1839a5c26b nodejs: fix linter 2023-08-29 15:12:52 +03:00
ccb81a60e1 python: replace the previous implementation of formats 2023-08-25 10:06:09 +04:00
b73a70e6d0 python: add tests for the format module 2023-08-25 10:06:09 +04:00
89e64fe71e python: add format module 2023-08-25 10:06:06 +04:00
2ffc44f339 python: add document-formats submodule 2023-08-25 10:06:05 +04:00
4e515a66ef python: add tests for the memoize module 2023-08-25 10:05:59 +04:00
a758f9a6d8 python: add memoize module 2023-08-25 10:05:52 +04:00
0131724cab Merge pull request #445 from ONLYOFFICE/feature/python-msgspec
python: add msgspec
2023-08-24 18:26:33 +03:00
a178dbc612 python: 3rd party licenses 2023-08-24 18:25:48 +03:00
4064f73c89 nodejs: Fix Bug 63800 template image (9048082cb7) 2023-08-24 16:03:33 +03:00
561af8444c Merge remote-tracking branch 'remotes/origin/feature/auto-convert' into develop 2023-08-23 15:16:48 +03:00
091bf10374 nodejs: convert after uploading only tagged formats 2023-08-23 15:16:23 +03:00
63461b3eb6 csharp-mvc: fixed urls for version data 2023-08-23 13:45:58 +03:00
bd20af2096 csharp-mvc: added version restore 2023-08-23 13:03:23 +03:00
2611fae25c csharp-mvc: use ajax for display version history 2023-08-23 12:16:23 +03:00
c740e21e83 csharp: fixed urls for version data 2023-08-23 11:44:41 +03:00
8193d5b9f2 csharp: jwt to version data 2023-08-22 16:41:21 +03:00
1f109c2b88 csharp: added version restore 2023-08-22 16:20:52 +03:00
a676da0a61 python: add msgspec 2023-08-22 12:43:16 +04:00
5f0fcfebd2 csharp: use ajax for display version history 2023-08-21 21:31:06 +03:00
292640aa95 Merge pull request #441 from ONLYOFFICE/feature/php-matrix-formats
php: add support for formats
2023-08-18 14:28:24 +03:00
9aedba8be3 php: 3rd party licenses 2023-08-18 14:26:03 +03:00
c98e8d03d2 Merge pull request #431 from ONLYOFFICE/feature/ruby-internal-network
ruby: add support for internal network
2023-08-17 17:02:21 +03:00
5951870870 Merge pull request #434 from ONLYOFFICE/feature/python-internal-network
python: add support for internal network
2023-08-16 15:06:04 +03:00
9bc6964274 Merge pull request #443 from ONLYOFFICE/feature/php-internal-network
php: add support for internal network
2023-08-16 15:04:41 +03:00
fb16b88dd1 java: replace the previous implementation of formats 2023-08-16 15:21:33 +04:00
d259cf3ff7 java: add format module 2023-08-16 15:21:33 +04:00
558c7892d3 java: add document-formats submodule 2023-08-16 15:21:33 +04:00
2051f3028e Merge remote-tracking branch 'remotes/origin/release/v7.5.0' into develop 2023-08-16 13:40:15 +03:00
869f8e7ba7 Merge remote-tracking branch 'remotes/origin/feature/referenceData-open' into develop 2023-08-16 13:36:58 +03:00
815b5fb428 nodejs: onRequestOpen for referenceData source file 2023-08-16 13:20:19 +03:00
13a1a6ba2c Merge pull request #440 from ONLYOFFICE/feature/java-spring-templates
java-spring: move document-templates to the assets directory
2023-08-15 11:44:41 +03:00
a3b93fee99 java-spring: update paths to the new location of templates 2023-08-15 12:42:49 +04:00
36cca57dd8 java-spring: move document-templates to the assets directory 2023-08-15 12:42:48 +04:00
53f315c5ee php: add public and private document-server urls to the compose 2023-08-15 10:45:58 +04:00
7c0d8cd59d php: add support for the internal network for the track endpoint 2023-08-15 10:45:58 +04:00
3405af796c php: add tests for the proxy module 2023-08-15 10:45:58 +04:00
b4905eb94e php: add proxy module 2023-08-15 10:45:58 +04:00
5a3330beb2 php: add support for specifying public and private document-server urls 2023-08-15 10:45:58 +04:00
5d16a50f0f php: remove the final keyword for a few classes 2023-08-15 10:45:58 +04:00
d8b6b0bbb5 Merge pull request #433 from ONLYOFFICE/feature/ruby-templates
ruby: move document-templates to the assets directory
2023-08-14 16:43:31 +03:00
7b6c9b5683 ruby: update paths to the new location of templates 2023-08-14 17:36:24 +04:00
d4bed077e0 ruby: move document-templates to the assets directory 2023-08-14 17:36:24 +04:00
8aba537cea Merge pull request #442 from ONLYOFFICE/feature/php-docker
php: add support for containerization
2023-08-14 15:23:51 +03:00
9cc6612bb2 Merge branch 'feature/submit-form' into develop 2023-08-14 11:25:50 +03:00
4bae7d8bf5 nodejs: submitForm to chamgelog 2023-08-14 11:25:14 +03:00
59c9061306 nodejs: fix max length (a06aa8c8b3) 2023-08-14 11:16:23 +03:00
2fb011185a Revert "nodejs: hide submit button"
This reverts commit 94cb70c0db.

# Conflicts:
#	web/documentserver-example/nodejs/app.js
#	web/documentserver-example/nodejs/helpers/users.js
2023-08-14 11:07:23 +03:00
49a58e687d nodejs: 1.6.0 (50a4ddbd11) 2023-08-14 10:43:43 +03:00
42e1b0635a Merge pull request #427 from ONLYOFFICE/feature/java-restore-endpoint
java: add restore endpoint
2023-08-14 09:59:33 +03:00
e9d8b60c13 java: add restore endpoint 2023-08-11 20:39:59 +04:00
33119ca2ad php: replace the previous implementation of formats 2023-08-11 20:35:30 +04:00
913c1350c2 php: add tests for the format module 2023-08-11 20:35:25 +04:00
fa34f5a44e php: add format module 2023-08-11 20:35:19 +04:00
5784171806 php: add serializer 2023-08-11 20:27:56 +04:00
8829f969d3 php: add docker files 2023-08-11 20:25:42 +04:00
ab48645ba8 php: add the recipe to work with docker 2023-08-11 20:25:42 +04:00
5d0f1b62d0 Merge pull request #430 from ONLYOFFICE/feature/java-spring-restore-endpoint
java-spring: add restore endpoint
2023-08-11 17:23:24 +03:00
78747c1cae Merge pull request #438 from ONLYOFFICE/feature/java-templates
java: move document-templates to the assets directory
2023-08-08 15:07:10 +03:00
2955dc004f java: update paths to the new location of templates 2023-08-08 14:47:51 +04:00
85981abd00 java: move document-templates to the assets directory 2023-08-08 14:47:51 +04:00
7542c6ca6e Merge pull request #435 from ONLYOFFICE/feature/python-templates
python: move document-templates to the assets directory
2023-08-08 12:32:04 +03:00
ab0553d988 Merge remote-tracking branch 'remotes/origin/develop' into release/v7.5.0 2023-08-08 12:14:21 +03:00
57e498ebba Merge remote-tracking branch 'remotes/origin/feature/referenceData-key' into develop 2023-08-08 12:06:57 +03:00
ce1052139e nodejs: fix forcesave (Fix Bug 63570) (bf04979c31) 2023-08-08 11:52:29 +03:00
350ea4e678 Merge pull request #426 from ONLYOFFICE/feature/php-project-structure
php: normalize project structure
2023-08-04 22:43:29 +03:00
979391e413 Merge remote-tracking branch 'remotes/origin/feature/referenceData-key' into release/v7.5.0 2023-08-04 13:41:56 +03:00
2b454e23d5 php: simplify the test receipt 2023-08-03 17:14:48 +04:00
9ed5f19d6b php: update urls to the new favicon location 2023-08-03 17:14:48 +04:00
851b2e48c7 php: move favicon files to the images directory 2023-08-03 17:14:48 +04:00
be40222d1a php: rename project namespace 2023-08-03 17:14:48 +04:00
d701f1565b php: update autoload map 2023-08-03 17:14:48 +04:00
2f39fb3bc6 php: update urls to new other files location 2023-08-03 17:14:48 +04:00
626f051aab php: move other files to the source directory 2023-08-03 17:14:48 +04:00
acd4bf87e7 php: update urls to the new global files location 2023-08-03 17:14:48 +04:00
9a9e122eec php: move global files to the source directory 2023-08-03 17:14:48 +04:00
340eaa31f4 php: update urls to the new scripts location 2023-08-03 17:14:48 +04:00
6433f502ad php: move scripts to the assets directory 2023-08-03 17:14:48 +04:00
cbfbf77f0f php: update urls to the new styles location 2023-08-03 17:14:48 +04:00
173641a7af php: move styles to the assets directory 2023-08-03 17:14:48 +04:00
ce37d1de20 php: update urls to the new images location 2023-08-03 17:14:48 +04:00
ce80e89028 php: move images to the assets directory 2023-08-03 17:14:48 +04:00
63365e176e java-spring: add restore endpoint 2023-08-03 12:34:14 +04:00
10e67c787c ruby: add public and private document-server urls to the compose 2023-08-02 10:17:14 +04:00
565a27d981 ruby: add support for the internal network for the track endpoint 2023-08-02 10:17:14 +04:00
7304c1e67a ruby: add tests for proxy manager 2023-08-02 10:17:14 +04:00
f9ba90d3ac ruby: add proxy manager to resolve the document-server url 2023-08-02 10:17:14 +04:00
d2f40c5395 ruby: add tests for specifying public and private document-server urls 2023-08-02 10:17:14 +04:00
ca0b7adcee ruby: add support for specifying public and private document-server urls 2023-08-02 10:17:14 +04:00
7304166d8f nodejs: key in referenceData 2023-07-12 12:00:37 +03:00
538 changed files with 16436 additions and 10196 deletions

View File

@ -3,10 +3,10 @@ name: Artifact Csharp MVC
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/csharp-mvc/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/csharp-mvc/**']
jobs:
@ -21,11 +21,9 @@ jobs:
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/csharp-mvc
mkdir -p ./deploy/'DotNet (Csharp MVN) Example'
mkdir -p ./deploy/'DotNet (Csharp MVC) Example'
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp MVC) Example'
cd ./deploy/'DotNet (Csharp MVC) Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'DotNet (Csharp MVC) Example'/assets/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact Csharp
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/csharp/**']
pull_request:
branches: [master, main, develop]
branches: [master]
paths: ['web/documentserver-example/csharp/**']
jobs:
@ -18,14 +18,11 @@ jobs:
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/csharp
mkdir -p ./deploy/'DotNet (Csharp) Example'
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp) Example'
cd ./deploy/'DotNet (Csharp) Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'DotNet (Csharp) Example'/assets/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact Java
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/java/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/java/**']
jobs:
@ -18,14 +18,12 @@ jobs:
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/java
mkdir -p ./deploy/'Java Example'
rsync -av --exclude='deploy' ./ ./deploy/'Java Example'
cd ./deploy/'Java Example'/src/main/resources/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'Java Example'/src/main/resources/assets/document-formats/.git
rm -rf ./deploy/'Java Example'/src/main/resources/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact Nodejs
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/nodejs/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/nodejs/**']
jobs:
@ -18,14 +18,12 @@ jobs:
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/nodejs
mkdir -p ./deploy/'Node.js Example'
rsync -av --exclude='deploy' ./ ./deploy/'Node.js Example'
cd ./deploy/'Node.js Example'/public/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'Node.js Example'/public/assets/document-formats/.git
rm -rf ./deploy/'Node.js Example'/public/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact PHP
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/php/**']
jobs:
@ -18,14 +18,12 @@ jobs:
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/php
mkdir -p ./deploy/'PHP Example'
rsync -av --exclude='deploy' ./ ./deploy/'PHP Example'
cd ./deploy/'PHP Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'PHP Example'/assets/document-formats/.git
rm -rf ./deploy/'PHP Example'/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact Python
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/python/**']
jobs:
@ -18,14 +18,12 @@ jobs:
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/python
mkdir -p ./deploy/'Python Example'
rsync -av --exclude='deploy' ./ ./deploy/'Python Example'
cd ./deploy/'Python Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'Python Example'/assets/document-formats/.git
rm -rf ./deploy/'Python Example'/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact Ruby
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/ruby/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/ruby/**']
jobs:
@ -18,14 +18,12 @@ jobs:
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/ruby
mkdir -p ./deploy/'Ruby Example'
rsync -av --exclude='deploy' ./ ./deploy/'Ruby Example'
cd ./deploy/'Ruby Example'/public/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'Ruby Example'/public/assets/document-formats/.git
rm -rf ./deploy/'Ruby Example'/public/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -3,10 +3,10 @@ name: Artifact Java Spring
on:
workflow_dispatch:
push:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/java-spring/**']
pull_request:
branches: [master, main]
branches: [master]
paths: ['web/documentserver-example/java-spring/**']
jobs:
@ -23,9 +23,8 @@ jobs:
cd ./web/documentserver-example/java-spring
mkdir -p ./deploy/'Java Spring Example'
rsync -av --exclude='deploy' ./ ./deploy/'Java Spring Example'
cd ./deploy/'Java Spring Example'/src/main/resources/assets
rm -rf ./.git/
rm .git
rm -rf ./deploy/'Java Spring Example'/src/main/resources/assets/document-formats/.git
rm -rf ./deploy/'Java Spring Example'/src/main/resources/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -26,4 +26,4 @@ jobs:
tools: cs2pr, phpcs
- name: Lint
run: phpcs .
run: phpcs src index.php

View File

@ -21,20 +21,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install pylint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
make dev
- name: Lint Flake8
run: |
flake8 ./**/*.py --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./**/*.py --count --max-complexity=10 --max-line-length=79 --statistics
- name: Lint Pylint
run: |
pylint ./**/*.py
make lint
# TODO: Configure mypy
# - name: Types mypy
# run: |
# make types

View File

@ -16,16 +16,22 @@ jobs:
run:
working-directory: ./web/documentserver-example/ruby
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Install dependencies
run: |
bundle install
- name: Rubocop
run: |
gem install rubocop
rubocop
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
- name: Update Submodules
run: |
git submodule update --init --recursive
- name: Install Dependencies
run: |
bundle update
- name: Rubocop
run: |
bundle exec rubocop

View File

@ -13,8 +13,10 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Zip
run: sudo apt-get install zip
- name: Clone Submodules
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
- name: Get Info
run: |
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
@ -25,91 +27,66 @@ jobs:
- name: Build Csharp MVC Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/csharp-mvc
mkdir -p ./'DotNet (Csharp MVC) Example'
rsync -av --exclude='DotNet (Csharp MVC) Example' ./ ./'DotNet (Csharp MVC) Example'
cd ./'DotNet (Csharp MVC) Example'/assets
rm -rf ./.git/
rm .git
rm -rf .git
- name: Build Csharp Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/csharp
mkdir -p ./'DotNet (Csharp) Example'
rsync -av --exclude='DotNet (Csharp) Example' ./ ./'DotNet (Csharp) Example'
cd ./'DotNet (Csharp) Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./'DotNet (Csharp) Example'/assets/.git
- name: Build Java Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/java
mkdir -p ./'Java Example'
rsync -av --exclude='Java Example' ./ ./'Java Example'
cd ./'Java Example'/src/main/resources/assets
rm -rf ./.git/
rm .git
rm -rf ./'Java Example'/src/main/resources/assets/document-formats/.git
rm -rf ./'Java Example'/src/main/resources/assets/document-templates/.git
- name: Build Nodejs Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/nodejs
mkdir -p ./'Node.js Example'
rsync -av --exclude='Node.js Example' ./ ./'Node.js Example'
cd ./'Node.js Example'/public/assets
rm -rf ./.git/
rm .git
rm -rf ./'Node.js Example'/public/assets/document-formats/.git
rm -rf ./'Node.js Example'/public/assets/document-templates/.git
- name: Build PHP Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/php
mkdir -p ./'PHP Example'
rsync -av --exclude='PHP Example' ./ ./'PHP Example'
cd ./'PHP Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./'PHP Example'/assets/document-formats/.git
rm -rf ./'PHP Example'/assets/document-templates/.git
- name: Build Python Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/python
mkdir -p ./'Python Example'
rsync -av --exclude='Python Example' ./ ./'Python Example'
cd ./'Python Example'/assets
rm -rf ./.git/
rm .git
rm -rf ./'Python Example'/assets/document-formats/.git
rm -rf ./'Python Example'/assets/document-templates/.git
- name: Build Ruby Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/ruby
mkdir -p ./'Ruby Example'
rsync -av --exclude='Ruby Example' ./ ./'Ruby Example'
cd ./'Ruby Example'/public/assets
rm -rf ./.git/
rm .git
rm -rf ./'Ruby Example'/public/assets/document-formats/.git
rm -rf ./'Ruby Example'/public/assets/document-templates/.git
- name: Build Spring Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/java-spring
mkdir -p ./'Java Spring Example'
rsync -av --exclude='Java Spring Example' ./ ./'Java Spring Example'
cd ./'Java Spring Example'/src/main/resources/assets
rm -rf ./.git/
rm .git
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: Pack Artifacts
run: |
cd ${{ github.workspace }}/web/documentserver-example/csharp-mvc

60
.gitmodules vendored
View File

@ -1,23 +1,3 @@
[submodule "web/documentserver-example/java/src/main/resources/assets"]
path = web/documentserver-example/java/src/main/resources/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp-mvc/assets"]
path = web/documentserver-example/csharp-mvc/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp/assets"]
path = web/documentserver-example/csharp/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/ruby/public/assets"]
path = web/documentserver-example/ruby/public/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/java-spring/src/main/resources/assets"]
path = web/documentserver-example/java-spring/src/main/resources/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/nodejs/public/assets/document-templates"]
path = web/documentserver-example/nodejs/public/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
@ -25,7 +5,14 @@
[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 = master
branch = feature/v8.0
[submodule "web/documentserver-example/csharp-mvc/assets/document-templates"]
path = web/documentserver-example/csharp-mvc/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp-mvc/assets/document-formats"]
path = web/documentserver-example/csharp-mvc/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/php/assets/document-templates"]
path = web/documentserver-example/php/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
@ -38,7 +25,38 @@
path = web/documentserver-example/python/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/java/src/main/resources/assets/document-templates"]
path = web/documentserver-example/java/src/main/resources/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/ruby/assets/document-templates"]
path = web/documentserver-example/ruby/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/java-spring/src/main/resources/assets/document-templates"]
path = web/documentserver-example/java-spring/src/main/resources/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/python/assets/document-formats"]
path = web/documentserver-example/python/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = master
[submodule "web/documentserver-example/ruby/assets/document-formats"]
path = web/documentserver-example/ruby/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = master
[submodule "web/documentserver-example/java/src/main/resources/assets/document-formats"]
path = web/documentserver-example/java/src/main/resources/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = master
[submodule "web/documentserver-example/java-spring/src/main/resources/assets/document-formats"]
path = web/documentserver-example/java-spring/src/main/resources/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = master
[submodule "web/documentserver-example/csharp/assets/document-templates"]
path = web/documentserver-example/csharp/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp/assets/document-formats"]
path = web/documentserver-example/csharp/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats

View File

@ -113,6 +113,10 @@ Prime JWT - is intended to be fast and easy to use. Prime JWT has a single e
License: Apache 2.0
License File: prime-jwt.license
Project Lombok - Spice up your java: Automatic Resource Management, automatic generation of getters, setters, equals, hashCode and toString, and more! (https://projectlombok.org/LICENSE)
License: MIT
License File: lombok.license
web/documentserver-example/java-spring
@ -307,6 +311,14 @@ PHPUnit - The PHP Unit Testing framework. (https://github.com/sebastianb
License: BSD 3-Clause
License File: phpunit.license
property-access - Provides functions to read and write from/to an object or array using a simple string notation. (https://github.com/symfony/property-access/blob/6.3/LICENSE)
License: MIT
License File: property-access.license
serializer - Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON. (https://github.com/symfony/serializer/blob/6.3/LICENSE)
License: MIT
License File: serializer.license
web/documentserver-example/python
@ -346,6 +358,10 @@ jQuery.UI - jQuery UI is an open source library of interface components —
License: MIT
License File: jQuery.UI.license
msgspec - A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML. (https://github.com/jcrist/msgspec/blob/0.18.1/LICENSE)
License: BSD 3-Clause
License File: msgspec.license
mypy - Optional static typing for Python. (https://github.com/python/mypy/blob/master/LICENSE)
License: MIT
License File: mypy.license

View File

@ -1,14 +1,53 @@
# Change Log
- fill permission in embedded mode
- delete all files
- handling conversion -9 error
- nodejs: wopi formsubmit icon
- nodejs: tabs menu
- change insert image
- different goback for users
- nodejs: converting function on index page
- nodejs: close editor
## 1.8.0
- nodejs: pdf, djvu, xps, oxps as pdf documentType
- nodejs: filling pdf
- version number to page meta
- ar skin languages
- sr-Latn-RS skin languages
- getting history via api
- using a repo with a list of formats
- convert after uploading only tagged formats
- link in referenceData
- setUsers for region protection
- onRequestOpen method
- user avatar
- trimming long name of uploading file
- onRequestSelectDocument method
- onRequestSelectSpreadsheet method
- key in referenceData
- restore from history
## 1.7.0
- nodejs: onRequestSelectDocument method
- nodejs: onRequestSelectSpreadsheet method
- nodejs: onRequestOpen
- nodejs: submitForm
- nodejs: key in referenceData
- nodejs: change reference source
- php: using a repo with a list of formats
- nodejs: using a repo with a list of formats
- nodejs: delete file without reloading the page
- nodejs: getting history by a separate request
- nodejs: restore from history
- php: using a repo with a list of formats
- php: restore from history
- python: restore from history
- ruby: restore from history
- php: restore from history
- csharp-mvc: getting history by a separate request
- csharp-mvc: restore from history
- csharp: getting history by a separate request
- csharp: restore from history
## 1.6.0
- nodejs: setUsers for region protection

View File

@ -1,19 +1,21 @@
## Integration examples
Test examples are simple document management systems that can be built into your application for testing.
These test examples are simple document management systems that can be built into your application for testing.
Do NOT use these integration examples on your own server without proper code modifications!
In case you enabled any of the test examples, disable it before going for production.
These examples show the way to integrate [ONLYOFFICE Docs][2] into your own website or application using one of the programming languages.
The package contains examples written in .Net (C# MVC), .Net (C#), Java, Node.js, PHP and Ruby.
The package contains examples written in .Net (C# MVC), .Net (C#), Java, Java Spring, Node.js, PHP, Python and Ruby.
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`
* [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`
* [PHP](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php) - `web/documentserver-example/php/config.php`
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/config/application.rb`
* [PHP](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php) - `web/documentserver-example/php/src/configuration/ConfigurationManager.php`
* [Python](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/python) - `web/documentserver-example/python/src/configuration/configuration.py`
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/app/configuration/configuration.rb`
More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview")

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,8 +1 @@
<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 0H21.674C22.4697 0 23.2327 0.316071 23.7953 0.87868L29.1213 6.20465C29.6839 6.76726 30 7.53032 30 8.32597V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#3779A6"/>
<path d="M22.9167 0L30.0001 7.08333H25.9167C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#1D5880"/>
<path d="M6.17627 14.7059H23.8233V15.8823H6.17627V14.7059Z" fill="white"/>
<path d="M6.17627 18.5294H23.8233V19.7059H6.17627V18.5294Z" fill="white"/>
<path d="M6.17627 22.3529H23.8233V23.5294H6.17627V22.3529Z" fill="white"/>
<path d="M6.17627 26.1765H23.8233V27.3529H6.17627V26.1765Z" fill="white"/>
</svg>
<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>

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 387 B

View File

@ -1,6 +1 @@
<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 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#27ABA3"/>
<path d="M22.9165 0L29.9998 7.08333H25.9165C24.2597 7.08333 22.9165 5.74019 22.9165 4.08333V0Z" fill="#008078"/>
<rect x="6.5" y="15.5" width="17" height="5" stroke="white"/>
<rect x="6.5" y="23.5" width="17" height="5" stroke="white"/>
</svg>
<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="#27ABA3"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#008078"/><path fill-rule="evenodd" clip-rule="evenodd" d="M24 14H6v7h18v-7zm-.8182 5.9978H6.81818V15H23.1818v4.9978zM24 23H6v7h18v-7zm-.8182 5.9978H6.81818V24H23.1818v4.9978z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 463 B

View File

@ -1,8 +1 @@
<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 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#F36700"/>
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#AB531F"/>
<path d="M6.17627 16.1275H23.8233V17.3039H6.17627V16.1275Z" fill="white"/>
<path d="M6.17627 28.7745L6.17627 16.1275L7.35274 16.1275L7.35274 28.7745H6.17627Z" fill="white"/>
<path d="M23.8233 16.1275V28.7745H22.6469V16.1275L23.8233 16.1275Z" fill="white"/>
<path d="M6.17627 27.598H23.8233V28.7745H6.17627L6.17627 27.598Z" fill="white"/>
</svg>
<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>

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 366 B

View File

@ -1,6 +1 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30 7.44186L22 0H3C1.22739 0 0 0.822551 0 2.32558V37.2093C0 38.7123 1.22739 40 3 40H27C28.7726 40 30 38.7123 30 37.2093V7.44186Z" fill="#D0D5DA"/>
<path d="M24.1042 7.27273H29.9631L22 0V5.32334C22 6.4105 22.949 7.27273 24.1042 7.27273Z" fill="#646464"/>
<path d="M16.9562 22.3485H12.9746V17.803H10.9839L14.9654 14.1667L18.947 17.803H16.9562V22.3485Z" fill="#646464"/>
<path d="M20.9378 23.7121C20.9378 24.1666 20.4401 24.6212 19.9424 24.6212H9.98848C9.49078 24.6212 8.99309 24.1666 8.99309 23.7121V22.3485C8.99309 21.8939 9.49078 21.4394 9.98848 21.4394H10.9839V20.0757H9.49078C8.49539 20.0757 7.5 20.9848 7.5 21.8939V24.1666C7.5 25.0757 8.61982 25.9848 9.49078 25.9848H20.4401C21.3111 25.9848 22.4309 25.0757 22.4309 24.1666V21.8939C22.4309 20.9848 21.4355 20.0757 20.4401 20.0757H18.947V21.4394H19.9424C20.4401 21.4394 20.9378 21.8939 20.9378 22.3485V23.7121Z" 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 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>

Before

Width:  |  Height:  |  Size: 992 B

After

Width:  |  Height:  |  Size: 797 B

View File

@ -1,12 +1 @@
<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 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#78A73B"/>
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#5A7D2B"/>
<path d="M6.17644 15.2941H23.8235V16.4706H6.17644V15.2941Z" fill="white"/>
<path d="M6.17644 19.1177H23.8235V20.2941H6.17644V19.1177Z" fill="white"/>
<path d="M6.17644 22.9412H23.8235V24.1177H6.17644V22.9412Z" fill="white"/>
<path d="M6.17644 26.7647H23.8235V27.9412H6.17644V26.7647Z" fill="white"/>
<path d="M5.88232 27.9412L5.88232 15.2941L7.0588 15.2941L7.0588 27.9412H5.88232Z" fill="white"/>
<path d="M11.4706 27.9412L11.4706 15.2941L12.647 15.2941V27.9412H11.4706Z" fill="white"/>
<path d="M17.0588 27.9412L17.0588 15.2941L18.2353 15.2941V27.9412H17.0588Z" fill="white"/>
<path d="M22.647 27.9412V15.2941H23.8235V27.9412H22.647Z" fill="white"/>
</svg>
<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>

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -502,6 +502,17 @@
justify-content: space-between;
align-items: center;
}
.buttonsMobile.indent {
margin-bottom: 0;
flex-wrap: nowrap;
}
.button.file-type:hover,
.button.file-type {
height: 28px;
width: 100px;
margin-bottom: 10px !important;
font-size: 9px;
}
.button.gray{
margin: 0;
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -230,6 +230,33 @@ label .checkbox {
color: #FF6F3D;
}
.button.file-type {
font-size: 11px;
color: #FFFFFF;
padding: 8px 8px;
margin-right: 10px;
}
.button.file-type.disable {
cursor: default;
}
.button.file-type.pale {
opacity: 30%;
}
.button.file-type.document {
background: #446995;
}
.button.file-type.spreadsheet {
background: #40865C;
}
.button.file-type.presentation {
background: #AA5252;
}
.upload-panel {
float: left;
padding: 24px 0;
@ -592,6 +619,29 @@ footer table tr td:first-child {
width: 4%;
}
.storedHeader {
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.storedHeaderClearAll {
padding-right: 52px;
}
.clear-all {
display: inline-block;
width: 100px;
padding: 2px;
outline: 1px solid #E5E5E5;
text-align: center;
cursor:pointer;
text-transform: uppercase;
background-color: #F5F5F5;
color: #666666;
}
.select-user {
color: #444444;
font-family: Open Sans;
@ -741,6 +791,16 @@ html {
margin-left: 25px;
}
.buttonsMobile.indent{
padding-left: 35px;
margin-top: 10px;
margin-bottom: 10px;
}
.invisible {
display: none;
}
.tooltip {
background: #FFFFFF;
border-radius: 5px;

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -31,6 +31,12 @@ namespace OnlineEditorsExampleMVC.Helpers
{
public class DocManagerHelper
{
//get server version
public static string GetVersion()
{
return WebConfigurationManager.AppSettings["version"];
}
// get max file size
public static long MaxFileSize
{
@ -51,24 +57,24 @@ namespace OnlineEditorsExampleMVC.Helpers
// get file extensions that can be viewed
public static List<string> ViewedExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.viewed-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.ViewableExtensions(); }
}
public static List<string> FillFormExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.fillform-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.FillableExtensions(); }
}
// get file extensions that can be edited
public static List<string> EditedExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.edited-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.EditableExtensions(); }
}
// get file extensions that can be converted
public static List<string> ConvertExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.convert-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.ConvertibleExtensions(); }
}
// get current user host address
@ -177,7 +183,12 @@ namespace OnlineEditorsExampleMVC.Helpers
// get a file name with an index if the file with such a name already exists
public static string GetCorrectName(string fileName, string userAddress = null)
{
int maxName;
int.TryParse(WebConfigurationManager.AppSettings["filename-max"], out maxName);
var baseName = Path.GetFileNameWithoutExtension(fileName);
if (baseName.Length > maxName){
baseName = baseName.Substring(0, maxName) + "[...]";
}
var ext = Path.GetExtension(fileName).ToLower();
var name = baseName + ext;
@ -215,7 +226,7 @@ namespace OnlineEditorsExampleMVC.Helpers
public static string CreateDemo(string fileExt, bool withContent)
{
var demoName = (withContent ? "sample." : "new.") + fileExt; // create sample or new template file with the necessary extension
var demoPath = "assets\\" + (withContent ? "sample\\" : "new\\"); // get the path to the sample document
var demoPath = "assets\\document-templates\\" + (withContent ? "sample\\" : "new\\"); // get the path to the sample document
var fileName = GetCorrectName(demoName); // get a file name with an index if the file with such a name already exists

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -229,6 +229,10 @@ namespace OnlineEditorsExampleMVC.Helpers
switch (errorCode)
{
case -9:
// public const int c_nErrorConversionOutputFormatError = -9;
errorMessage = String.Format(errorMessageTemplate, "Error conversion output format");
break;
case -8:
// public const int c_nErrorFileVKey = -8;
errorMessage = String.Format(errorMessageTemplate, "Error document VKey");

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -256,6 +256,22 @@ namespace OnlineEditorsExampleMVC.Helpers
var action = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(actions[0]));
var user = action["userid"].ToString(); // get the user id
DocManagerHelper.CreateMeta(fileName, user, "Filling Form", userAddress); // create meta data for the forcesaved file
string formsDataUrl = fileData["formsdataurl"].ToString();
if (!string.IsNullOrEmpty(formsDataUrl))
{
string formsName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + ".txt", userAddress);
string formsPath = DocManagerHelper.StoragePath(formsName, userAddress);
var bytesForms = DownloadFile(formsDataUrl);
SaveFile(bytesForms, formsPath);
}
else
{
throw new Exception("Document editing service did not return formsDataUrl");
}
}
} catch (Exception)
{

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -31,7 +31,9 @@ namespace OnlineEditorsExampleMVC.Helpers
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can create files from templates using data from the editor",
"Can see the information about all users"
"Can see the information about all users",
"Has an avatar",
"Can submit forms"
};
static List<string> descr_user_2 = new List<string>()
@ -41,7 +43,9 @@ namespace OnlineEditorsExampleMVC.Helpers
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
"This file is marked as favorite",
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
"Can see the information about users from Group2 and users who dont belong to any group",
"Has an avatar",
"Cant submit forms"
};
static List<string> descr_user_3 = new List<string>()
@ -54,7 +58,10 @@ namespace OnlineEditorsExampleMVC.Helpers
"Cant download the file",
"Cant print the file",
"Can create new files from the editor",
"Can see the information about Group2 users"
"Can see the information about Group2 users",
"Cant submit forms",
"Can't close history",
"Can't restore the file version"
};
static List<string> descr_user_0 = new List<string>()
@ -71,6 +78,7 @@ namespace OnlineEditorsExampleMVC.Helpers
"Can't view chat",
"Can't protect file",
"View file without collaboration",
"Cant submit forms"
};
private static List<User> users = new List<User>() {
@ -85,7 +93,9 @@ namespace OnlineEditorsExampleMVC.Helpers
null,
new List<string>(),
descr_user_1,
true
true,
true,
new Goback(null, false)
),
new User(
"uid-2",
@ -103,12 +113,14 @@ namespace OnlineEditorsExampleMVC.Helpers
true,
new List<string>(),
descr_user_2,
false
false,
true,
new Goback("Go to Documents", null)
),
new User(
"uid-3",
"Hamish Mitchell",
"mitchell@example.com",
null,
"group-3",
new List<string>() { "group-2" },
new Dictionary<string,object>()
@ -121,7 +133,9 @@ namespace OnlineEditorsExampleMVC.Helpers
false,
new List<string>() { "copy", "download", "print" },
descr_user_3,
false
false,
false,
null
),
new User(
"uid-0",
@ -134,7 +148,9 @@ namespace OnlineEditorsExampleMVC.Helpers
null,
new List<string>() { "protect" },
descr_user_0,
false
false,
false,
null
)
};
@ -171,6 +187,43 @@ namespace OnlineEditorsExampleMVC.Helpers
}
return usersData;
}
public static List<Dictionary<string, object>> getUsersInfo(string id)
{
List<Dictionary<string, object>> usersData = new List<Dictionary<string, object>>();
if (id != "uid-0") {
foreach (User user in users)
{
usersData.Add(new Dictionary<string, object>()
{
{"id", user.id},
{"name", user.name },
{"email", user.email },
{"image", user.avatar ? DocManagerHelper.GetServerUrl(false) + "/Content/images/" + user.id + ".png" : null}
});
}
}
return usersData;
}
// get a list of users with their names and emails for protect
public static List<Dictionary<string, object>> getUsersForProtect(string id)
{
List<Dictionary<string, object>> usersData = new List<Dictionary<string, object>>();
foreach (User user in users)
{
if (!user.id.Equals(id) && user.name != null)
{
usersData.Add(new Dictionary<string, object>()
{
{"name", user.name },
{"email", user.email },
{"id", user.id}
});
}
}
return usersData;
}
}
public class User
@ -186,8 +239,11 @@ namespace OnlineEditorsExampleMVC.Helpers
public List<string> descriptions;
public bool templates;
public List<string> userInfoGroups;
public bool avatar;
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)
public 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)
{
this.id = id;
this.name = name;
@ -200,6 +256,22 @@ namespace OnlineEditorsExampleMVC.Helpers
this.descriptions = descriptions;
this.templates = templates;
this.userInfoGroups = userInfoGroups;
this.avatar = avatar;
this.goback = goback;
}
}
public class Goback
{
public string text;
public bool? blank;
public Goback(){}
public Goback(string text, bool? blank)
{
this.text = text;
this.blank = blank;
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -17,7 +17,6 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Web;
@ -89,7 +88,7 @@ namespace OnlineEditorsExampleMVC.Models
editorsMode = "fillForms";
canEdit = true;
}
var submitForm = editorsMode.Equals("fillForms") && id.Equals("uid-1") && false; // check if the Submit form button is displayed or not
var submitForm = editorsMode.Equals("fillForms") && id.Equals("uid-1"); // check if the Submit form button is displayed or not
var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // set the mode parameter: change it to view if the document can't be edited
// favorite icon state
@ -158,7 +157,7 @@ namespace OnlineEditorsExampleMVC.Models
{ "download", !user.deniedPermissions.Contains("download") },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "view" || editorsMode == "filter" || editorsMode == "blockcontent") },
{ "print", !user.deniedPermissions.Contains("print") },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "blockcontent" },
{ "modifyFilter", editorsMode != "filter" },
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", canEdit && (editorsMode == "edit" || editorsMode == "review") },
@ -191,7 +190,8 @@ namespace OnlineEditorsExampleMVC.Models
{
{ "id", !user.id.Equals("uid-0") ? user.id : null },
{ "name", user.name },
{ "group", user.group }
{ "group", user.group },
{ "image", user.avatar ? DocManagerHelper.GetServerUrl(false) + "/Content/images/" + user.id + ".png" : null}
}
},
{
@ -214,10 +214,12 @@ namespace OnlineEditorsExampleMVC.Models
{ "forcesave", false }, // adds the request for the forced file saving to the callback handler
{ "submitForm", submitForm }, // if the Submit form button is displayed or not
{
"goback", new Dictionary<string, object> // settings for the Open file location menu button and upper right corner button
"goback", user.goback != null ? new Dictionary<string, object> // settings for the Open file location menu button and upper right corner button
{
{ "url", DocManagerHelper.GetServerUrl(false) } // the absolute URL to the website address which will be opened when clicking the Open file location menu button
}
{ "url", DocManagerHelper.GetServerUrl(false) }, // the absolute URL to the website address which will be opened when clicking the Open file location menu button
{ "text", user.goback.text },
{ "blank", user.goback.blank }
} : new Dictionary<string, object>{}
}
}
}
@ -236,125 +238,8 @@ namespace OnlineEditorsExampleMVC.Models
return jss.Serialize(config);
}
// get the document history
public void GetHistory(out string history, out string historyData)
{
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
var jss = new JavaScriptSerializer();
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(FileName, null));
history = null;
historyData = null;
if (DocManagerHelper.GetFileVersion(histDir) > 0) // if the file was modified (the file version is greater than 0)
{
var currentVersion = DocManagerHelper.GetFileVersion(histDir);
var hist = new List<Dictionary<string, object>>();
var histData = new Dictionary<string, object>();
for (var i = 1; i <= currentVersion; i++) // run through all the file versions
{
var obj = new Dictionary<string, object>();
var dataObj = new Dictionary<string, object>();
var verDir = DocManagerHelper.VersionDir(histDir, i); // get the path to the given file version
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
obj.Add("key", key);
obj.Add("version", i);
if (i == 1) // check if the version number is equal to 1
{
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
if (File.Exists(infoPath))
{
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
obj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
obj.Add("user", new Dictionary<string, object>() {
{ "id", info["id"] },
{ "name", info["name"] },
});
}
}
var ext = Path.GetExtension(FileName).ToLower();
dataObj.Add("fileType", ext.Replace(".", ""));
dataObj.Add("key", key);
// write file url to the data object
string prevFileUrl;
string directPrevFileUrl;
if (Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath))
{
prevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
directPrevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext, false)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
else {
prevFileUrl = i == currentVersion ? FileUri
: DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext);
directPrevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext, false)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
dataObj.Add("url", prevFileUrl);
if (IsEnabledDirectUrl)
{
dataObj.Add("directUrl", directPrevFileUrl);
}
dataObj.Add("version", i);
if (i > 1) // check if the version number is greater than 1 (the file was modified)
{
// get the path to the changes.json file
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(DocManagerHelper.VersionDir(histDir, i - 1), "changes.json")));
var changesArray = (ArrayList)changes["changes"];
var change = changesArray.Count > 0
? (Dictionary<string, object>)changesArray[0]
: new Dictionary<string, object>();
// write information about changes to the object
obj.Add("changes", change.Count > 0 ? changes["changes"] : null);
obj.Add("serverVersion", changes["serverVersion"]);
obj.Add("created", change.Count > 0 ? change["created"] : null);
obj.Add("user", change.Count > 0 ? change["user"] : null);
var prev = (Dictionary<string, object>)histData[(i - 2).ToString()]; // get the history data from the previous file version
dataObj.Add("previous", IsEnabledDirectUrl ? new Dictionary<string, object>() { // write information about previous file version to the data object with direct url
{ "fileType", prev["fileType"] },
{ "key", prev["key"] }, // write key and url information about previous file version
{ "url", prev["url"] },
{ "directUrl", prev["directUrl"] },
} : new Dictionary<string, object>() { // write information about previous file version to the data object without direct url
{ "fileType", prev["fileType"] },
{ "key", prev["key"] }, // write key and url information about previous file version
{ "url", prev["url"] },
});
// write the path to the diff.zip archive with differences in this file version
var changesUrl = DocManagerHelper.GetHistoryDownloadUrl(FileName, (i - 1).ToString(), "diff.zip");
dataObj.Add("changesUrl", changesUrl);
}
if(JwtManager.Enabled)
{
var token = JwtManager.Encode(dataObj);
dataObj.Add("token", token);
}
hist.Add(obj); // add object dictionary to the hist list
histData.Add((i - 1).ToString(), dataObj); // write data object information to the history data
}
// write history information about the current file version to the history object
history = jss.Serialize(new Dictionary<string, object>()
{
{ "currentVersion", currentVersion },
{ "history", hist }
});
historyData = jss.Serialize(histData);
}
}
// get a document which will be compared with the current document
public void GetCompareFileData(out string compareConfig)
public void GetDocumentData(out string compareConfig)
{
var jss = new JavaScriptSerializer();
@ -406,20 +291,20 @@ namespace OnlineEditorsExampleMVC.Models
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "Content\\images\\logo.png"
+ "Content\\images\\logo.svg"
};
var directMailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(false))
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "Content\\images\\logo.png"
+ "Content\\images\\logo.svg"
};
// create a logo config
var logoConfig = new Dictionary<string, object>
{
{ "fileType", "png"},
{ "fileType", "svg"},
{ "url", mailMergeUrl.ToString()}
};
@ -438,7 +323,7 @@ namespace OnlineEditorsExampleMVC.Models
}
// get a mail merge config
public void GetMailMergeConfig(out string dataMailMergeRecipients)
public void GetSpreadsheetConfig(out string dataSpreadsheet)
{
var jss = new JavaScriptSerializer();
@ -479,7 +364,7 @@ namespace OnlineEditorsExampleMVC.Models
mailMergeConfig.Add("token", mailmergeToken); // and add it to the mail merge config
}
dataMailMergeRecipients = jss.Serialize(mailMergeConfig);
dataSpreadsheet = jss.Serialize(mailMergeConfig);
}
//get a users for mentions
@ -490,5 +375,22 @@ namespace OnlineEditorsExampleMVC.Models
var user = Users.getUser(id);
usersForMentions = !user.id.Equals("uid-0") ? jss.Serialize(Users.getUsersForMentions(user.id)) : null;
}
public void GetUsersInfo(HttpRequest request, out string usersInfo)
{
var jss = new JavaScriptSerializer();
var id = request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
usersInfo = jss.Serialize(Users.getUsersInfo(user.id));
}
//get a users for protect
public void GetUsersProtect(HttpRequest request, out string usersForProtect)
{
var jss = new JavaScriptSerializer();
var id = request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
usersForProtect = !user.id.Equals("uid-0") ? jss.Serialize(Users.getUsersForProtect(user.id)) : null;
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -16,8 +16,14 @@
*
*/
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using static OnlineEditorsExampleMVC.Models.FileUtility;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Converters;
namespace OnlineEditorsExampleMVC.Models
{
@ -35,38 +41,188 @@ namespace OnlineEditorsExampleMVC.Models
{
var ext = Path.GetExtension(fileName).ToLower();
if (ExtsDocument.Contains(ext)) return FileType.Word; // word type for document extensions
if (ExtsSpreadsheet.Contains(ext)) return FileType.Cell; // cell type for spreadsheet extensions
if (ExtsPresentation.Contains(ext)) return FileType.Slide; // slide type for presentation extensions
if (FormatManager.DocumentExtensions().Contains(ext)) return FileType.Word; // word type for document extensions
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
}
}
// document extensions
public static readonly List<string> ExtsDocument = new List<string>
{
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht", ".xml",
".pdf", ".djvu", ".fb2", ".epub", ".xps", ".oxps", ".oform"
};
public class EmptyTolerantStringEnumConverter : StringEnumConverter
{
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.String && string.IsNullOrWhiteSpace(reader.Value.ToString()))
return Activator.CreateInstance(objectType);
// spreadsheet extensions
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};
return base.ReadJson(reader, objectType, existingValue, serializer);
}
}
// presentation extensions
public static readonly List<string> ExtsPresentation = new List<string>
public class Format
{
public string Name { get; }
[JsonConverter(typeof(EmptyTolerantStringEnumConverter))]
public FileType Type { get; }
public List<string> Actions { get; }
public List<string> Convert { get; }
public List<string> Mime { get; }
public Format(string name, FileType type, List<string> actions, List<string> convert, List<string> mime)
{
Name = name;
Type = type;
Actions = actions;
Convert = convert;
Mime = mime;
}
public string Extension()
{
return "." + Name;
}
}
public static class FormatManager
{
private static List<Format> cachedFormats;
public static List<string> FillableExtensions()
{
return Fillable()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Fillable()
{
return All()
.Where(format => format.Actions.Contains("fill"))
.ToList();
}
public static List<string> ViewableExtensions()
{
return Viewable()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Viewable()
{
return All()
.Where(format => format.Actions.Contains("view"))
.ToList();
}
public static List<string> EditableExtensions()
{
return Editable()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Editable()
{
return All()
.Where(format => format.Actions.Contains("edit") || format.Actions.Contains("lossy-edit"))
.ToList();
}
public static List<string> ConvertibleExtensions()
{
return Convertible()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Convertible()
{
return All()
.Where(format => format.Actions.Contains("auto-convert"))
.ToList();
}
public static List<string> SpreadsheetExtensions()
{
return Spreadsheets()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Spreadsheets()
{
return All()
.Where(format => format.Type == FileType.Cell)
.ToList();
}
public static List<string> PresentationExtensions()
{
return Presentations()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Presentations()
{
return All()
.Where(format => format.Type == FileType.Slide)
.ToList();
}
public static List<string> DocumentExtensions()
{
return Documents()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Documents()
{
return All()
.Where(format => format.Type == FileType.Word)
.ToList();
}
public static List<string> AllExtensions()
{
return All()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> All()
{
if (cachedFormats == null)
{
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp", ".otp"
};
var path = GetPath();
var lines = File.ReadLines(path, Encoding.UTF8);
var contents = string.Join(Environment.NewLine, lines);
var formats = JsonConvert.DeserializeObject<Format[]>(contents);
cachedFormats = formats.ToList();
}
return cachedFormats;
}
private static string GetPath()
{
string path = Path.Combine(GetDirectory(), "onlyoffice-docs-formats.json");
if (File.Exists(path))
{
return path;
}
else
{
throw new FileNotFoundException("The JSON file does not exist.");
}
}
private static string GetDirectory()
{
string directory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets", "document-formats");
return Path.GetFullPath(directory);
}
}
}

View File

@ -145,7 +145,6 @@
<Content Include="Content\images\icon_xlsx.svg" />
<Content Include="Content\images\info.svg" />
<Content Include="Content\images\loader16.gif" />
<Content Include="Content\images\logo.png" />
<Content Include="Content\images\logo.svg" />
<Content Include="Content\images\mobile-fill-forms.svg" />
<Content Include="Content\images\mobile.svg" />
@ -159,7 +158,6 @@
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="LICENSE" />
<Content Include="Scripts\jquery-1.8.2.js" />
<Content Include="Scripts\jquery-ui.js" />
<Content Include="Scripts\jquery.blockUI.js" />
<Content Include="Scripts\jquery.dropdownToggle.js" />
@ -182,17 +180,23 @@
<Content Include="WebEditor.ashx" />
</ItemGroup>
<ItemGroup>
<Content Include="assets\AUTHORS.md" />
<Content Include="assets\LICENSE" />
<Content Include="assets\new\new.docx" />
<Content Include="assets\new\new.docxf" />
<Content Include="assets\new\new.pptx" />
<Content Include="assets\new\new.xlsx" />
<Content Include="assets\sample\csv.csv" />
<Content Include="assets\sample\sample.docx" />
<Content Include="assets\sample\sample.docxf" />
<Content Include="assets\sample\sample.pptx" />
<Content Include="assets\sample\sample.xlsx" />
<Content Include="assets\document-templates\AUTHORS.md" />
<Content Include="assets\document-templates\LICENSE" />
<Content Include="assets\document-templates\new\new.docx" />
<Content Include="assets\document-templates\new\new.docxf" />
<Content Include="assets\document-templates\new\new.pptx" />
<Content Include="assets\document-templates\new\new.xlsx" />
<Content Include="assets\document-templates\README.md" />
<Content Include="assets\document-templates\sample\csv.csv" />
<Content Include="assets\document-templates\sample\sample.docx" />
<Content Include="assets\document-templates\sample\sample.docxf" />
<Content Include="assets\document-templates\sample\sample.pptx" />
<Content Include="assets\document-templates\sample\sample.xlsx" />
<Content Include="assets\document-formats\AUTHORS.md" />
<Content Include="assets\document-formats\CHANGELOG.md" />
<Content Include="assets\document-formats\LICENSE" />
<Content Include="assets\document-formats\onlyoffice-docs-formats.json" />
<Content Include="assets\document-formats\README.md" />
<None Include="packages.config" />
</ItemGroup>
<PropertyGroup>

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExampleMVC")]
[assembly: AssemblyCopyright("Ascensio System SIA 2023")]
[assembly: AssemblyCopyright("Ascensio System SIA 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -14,7 +14,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
Download the [.Net (C# MVC) example](https://api.onlyoffice.com/editors/demopreview) from our site.
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the *settings.config* file:
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the *web.appsettings.config* file:
```
<add key="storage-path" value=""/>
<add key="files.docservice.url.site" value="https://documentserver/" />

View File

@ -0,0 +1,66 @@
/**
*
* (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.
*
*/
class Format {
constructor(name, type, actions, convert, mime) {
this.name = name;
this.type = type;
this.actions = actions;
this.convert = convert;
this.mime = mime;
}
isAutoConvertible() {
return this.actions.includes('auto-convert');
}
isEditable() {
return this.actions.includes('edit') || this.actions.includes('lossy-edit');
}
isFillable() {
return this.actions.includes('fill');
}
}
class FormatManager {
formats = [];
constructor(formats) {
if(Array.isArray(formats)) this.formats = formats;
}
findByExtension(extension) {
return this.formats.find(format => format.name == extension);
}
isAutoConvertible(extension) {
let format = this.findByExtension(extension);
return format !== undefined && format.isAutoConvertible();
}
isEditable(extension) {
let format = this.findByExtension(extension);
return format !== undefined && format.isEditable();
}
isFillable(extension) {
let format = this.findByExtension(extension);
return format !== undefined && format.isFillable();
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -17,6 +17,27 @@
*/
var directUrl;
var formatManager;
window.onload = function () {
fetch("webeditor.ashx?type=formats")
.then((response) => response.json())
.then((data) => {
if (data.formats) {
let formats = [];
data.formats.forEach(format => {
formats.push(new Format(
format.Name,
format.Type,
format.Actions,
format.Convert,
format.Mime
));
});
formatManager = new FormatManager(formats);
}
})
}
if (typeof jQuery != "undefined") {
jq = jQuery.noConflict();
@ -87,7 +108,7 @@ if (typeof jQuery != "undefined") {
});
var timer = null;
var checkConvert = function (filePass) {
var checkConvert = function (filePass, fileType) {
filePass = filePass ? filePass : null;
if (timer != null) {
clearTimeout(timer);
@ -103,7 +124,7 @@ if (typeof jQuery != "undefined") {
var posExt = fileName.lastIndexOf('.');
posExt = 0 <= posExt ? fileName.substring(posExt).trim().toLowerCase() : '';
if (ConverExtList.indexOf(posExt) == -1) {
if (!formatManager.isAutoConvertible(posExt)) {
jq("#step2").addClass("done").removeClass("current");
loadScripts();
return;
@ -116,7 +137,7 @@ if (typeof jQuery != "undefined") {
contentType: "text/xml",
type: "post",
dataType: "json",
data: JSON.stringify({ filename: fileName, filePass: filePass }),
data: JSON.stringify({ filename: fileName, filePass: filePass, fileExt: fileType }),
url: UrlConverter,
complete: function (data) {
var responseText = data.responseText;
@ -132,6 +153,12 @@ if (typeof jQuery != "undefined") {
}
return;
} else {
if (response.error.includes("Error conversion output format")) {
jq("#select-file-type").removeClass("invisible");
jq("#step2").removeClass("current");
jq("#hiddenFileName").attr("placeholder", filePass);
return;
}
jq(".current").removeClass("current");
jq(".step:not(.done)").addClass("error");
jq("#mainProgress .error-message").show().find("span").text(response.error);
@ -143,7 +170,7 @@ if (typeof jQuery != "undefined") {
jq("#hiddenFileName").val(response.filename);
if (response.step && response.step < 100) {
checkConvert(filePass);
checkConvert(filePass, fileType);
} else {
jq("#step2").addClass("done").removeClass("current");
loadScripts();
@ -178,10 +205,10 @@ if (typeof jQuery != "undefined") {
jq("#beginView, #beginEmbedded").removeClass("disable");
var fileName = jq("#hiddenFileName").val();
var posExt = fileName.lastIndexOf('.');
var posExt = fileName.lastIndexOf('.') + 1;
posExt = 0 <= posExt ? fileName.substring(posExt).trim().toLowerCase() : '';
if (EditedExtList.indexOf(posExt) != -1 || FillExtList.indexOf(posExt) != -1) {
if (formatManager.isEditable(posExt) || formatManager.isFillable(posExt)) {
jq("#beginEdit").removeClass("disable");
}
};
@ -213,6 +240,15 @@ if (typeof jQuery != "undefined") {
});
};
jq(document).on("click", ".file-type:not(.disable)", function () {
const currentElement = jq(this);
var fileType = currentElement.attr("data");
var filePass = jq("#hiddenFileName").attr("placeholder");
jq('.file-type').addClass(["disable", "pale"]);
currentElement.removeClass("pale");
checkConvert(filePass, fileType);
});
jq(document).on("click", "#enterPass", function () {
var filePass = jq("#filePass").val();
if (filePass) {
@ -294,6 +330,23 @@ if (typeof jQuery != "undefined") {
});
});
jq(document).on("click", ".clear-all", function () {
if (confirm("Delete all the files?")) {
var requestAddress = "webeditor.ashx"
+ "?type=remove";
jq.ajax({
async: true,
contentType: "text/xml",
url: requestAddress,
complete: function (data) {
if (JSON.parse(data.responseText).success) {
window.location.reload(true);
}
}
});
}
});
function showUserTooltip (isMobile) {
if ( jq("div#portal-info").is(":hidden") ) {
jq("div#portal-info").show();

View File

@ -14,7 +14,7 @@
<meta name="mobile-web-app-capable" content="yes" />
<!--
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -129,17 +129,21 @@
};
// the user is trying to select document for comparing by clicking the Document from Storage button
var onRequestCompareFile = function () {
<% string compareFileData; %>
<% Model.GetCompareFileData(out compareFileData); %>
docEditor.setRevisedFile(<%=compareFileData%>); // select a document for comparing
var onRequestSelectDocument = function (event) {
<% string documentData; %>
<% Model.GetDocumentData(out documentData); %>
var data = <%=documentData%>;
data.c = event.data.c;
docEditor.setRequestedDocument(data); // select a document for comparing
};
// the user is trying to select recipients data by clicking the Mail merge button
var onRequestMailMergeRecipients = function (event) {
<% string dataMailMergeRecipients; %>
<% Model.GetMailMergeConfig(out dataMailMergeRecipients); %>
docEditor.setMailMergeRecipients(<%= dataMailMergeRecipients%>); // insert recipient data for mail merge into the file
var onRequestSelectSpreadsheet = function (event) {
<% string dataSpreadsheet; %>
<% Model.GetSpreadsheetConfig(out dataSpreadsheet); %>
var data = <%= dataSpreadsheet%>;
data.c = event.data.c;
docEditor.setRequestedSpreadsheet(data); // insert recipient data for mail merge into the file
};
var onRequestSaveAs = function (event) { // the user is trying to save file by clicking Save Copy as... button
@ -178,18 +182,125 @@
}
};
var onRequestOpen = function (event) { // user open external data source
innerAlert("onRequestOpen");
var windowName = event.data.windowName;
requestReference(event.data, function (data) {
if (data.error) {
var winEditor = window.open("", windowName);
winEditor.close();
innerAlert(data.error, true);
return;
}
var link = data.link;
window.open(link, windowName);
});
};
var onRequestReferenceData = function (event) { // user refresh external data source
event.data.directUrl = !!config.document.directUrl;
innerAlert("onRequestReferenceData");
requestReference(event.data, function (data) {
docEditor.setReferenceData(data);
});
};
var requestReference = function (data, callback) {
innerAlert(data);
data.directUrl = !!config.document.directUrl;
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor.ashx?type=reference");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(event.data));
xhr.send(JSON.stringify(data));
xhr.onload = function () {
console.log(xhr.responseText);
docEditor.setReferenceData(JSON.parse(xhr.responseText));
callback(JSON.parse(xhr.responseText));
}
};
var onRequestHistory = function () {
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=gethistory&filename=<%= Model.FileName %>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
xhr.onload = function () {
console.log(xhr.responseText);
docEditor.refreshHistory(JSON.parse(xhr.responseText));
}
};
var onRequestHistoryData = function (event) {
var ver = event.data;
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=getversiondata&filename=<%= Model.FileName %>&version=" + ver + "&directUrl=" + !!config.document.directUrl);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
xhr.onload = function () {
console.log(xhr.responseText);
docEditor.setHistoryData(JSON.parse(xhr.responseText)); // send the link to the document for viewing the version history
}
};
var onRequestRestore = function (event) {
var fileName = "<%= Model.FileName %>";
var version = event.data.version;
var data = {
fileName: fileName,
version: version
};
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor.ashx?type=restore&directUrl=" + !!config.document.directUrl);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(data));
xhr.onload = function () {
docEditor.refreshHistory(JSON.parse(xhr.responseText));
}
}
<% string usersForMentions; %>
<% Model.GetUsersMentions(Request, out usersForMentions); %>
<% string usersInfo; %>
<% Model.GetUsersInfo(Request, out usersInfo); %>
<% string usersForProtect; %>
<% Model.GetUsersProtect(Request, out usersForProtect); %>
var onRequestUsers = function (event) {
if (event && event.data){
var c = event.data.c;
}
switch (c) {
case "info":
users = [];
var allUsers = <%= usersInfo %>;
for (var i = 0; i < event.data.id.length; i++) {
for (var j = 0; j < allUsers.length; j++) {
if (allUsers[j].id == event.data.id[i]) {
users.push(allUsers[j]);
break;
}
}
}
break;
case "protect":
var users = <%= usersForProtect %>;
break;
default:
users = <%= usersForMentions %>;
}
docEditor.setUsers({
"c": c,
"users": users,
});
};
var onRequestSendNotify = function (event) {
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
var data = JSON.stringify(event.data);
innerAlert("onRequestSendNotify: " + data);
};
config = <%= Model.GetDocConfig(Request, Url) %>;
config.width = "100%";
@ -203,56 +314,37 @@
"onMakeActionLink": onMakeActionLink,
"onMetaChange": onMetaChange,
"onRequestInsertImage": onRequestInsertImage,
"onRequestCompareFile": onRequestCompareFile,
"onRequestMailMergeRecipients": onRequestMailMergeRecipients,
"onRequestSelectDocument": onRequestSelectDocument,
"onRequestSelectSpreadsheet": onRequestSelectSpreadsheet,
};
<% string hist, histData; %>
<% Model.GetHistory(out hist, out histData); %>
<% string usersForMentions; %>
<% Model.GetUsersMentions(Request, out usersForMentions); %>
if (config.editorConfig.user.id) {
<% if (!string.IsNullOrEmpty(hist) && !string.IsNullOrEmpty(histData))
{ %>
// the user is trying to show the document version history
config.events['onRequestHistory'] = function () {
docEditor.refreshHistory(<%= hist %>); // show the document version history
};
// the user is trying to click the specific document version in the document version history
config.events['onRequestHistoryData'] = function (event) {
var ver = event.data;
var histData = <%= histData %>;
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
};
// the user is trying to go back to the document from viewing the document version history
// 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
config.events['onRequestHistoryData'] = onRequestHistoryData;
// the user is trying to go back to the document from viewing the document version history
if (config.editorConfig.user.id !== "uid-3") {
config.events['onRequestHistoryClose'] = function () {
document.location.reload();
};
<% } %>
config.events['onRequestRestore'] = onRequestRestore;
}
// add mentions for not anonymous users
<% if (!string.IsNullOrEmpty(usersForMentions))
{ %>
config.events['onRequestUsers'] = function () {
docEditor.setUsers({ // set a list of users to mention in the comments
"users": <%= usersForMentions %>
});
};
config.events['onRequestUsers'] = onRequestUsers;
<% } %>
// the user is mentioned in a comment
config.events['onRequestSendNotify'] = function (event) {
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
var data = JSON.stringify(event.data);
innerAlert("onRequestSendNotify: " + data);
};
config.events['onRequestSendNotify'] = onRequestSendNotify;
// prevent file renaming for anonymous users
config.events['onRequestRename'] = onRequestRename;
config.events['onRequestReferenceData'] = onRequestReferenceData;
// prevent switch the document from the viewing into the editing mode for anonymous users
config.events['onRequestEditRights'] = onRequestEditRights;
config.events['onRequestOpen'] = onRequestOpen;
}
if (config.editorConfig.createUrl) {
@ -260,12 +352,6 @@
};
var сonnectEditor = function () {
if ((config.document.fileType === "docxf" || config.document.fileType === "oform")
&& DocsAPI.DocEditor.version().split(".")[0] < 7) {
innerAlert("Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online.");
return;
}
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};

View File

@ -13,9 +13,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width" />
<meta name="server-version" content=<%= DocManagerHelper.GetVersion() %> />
<!--
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -67,7 +68,7 @@
<a class="try-editor slide" data-type="pptx">Presentation</a>
</li>
<li>
<a class="try-editor form" data-type="docxf">Form template</a>
<a class="try-editor form" data-type="docxf">PDF form</a>
</li>
</ul>
<label class="side-option">
@ -150,7 +151,14 @@
if (storedFiles.Any())
{ %>
<div class="stored-list">
<span class="header-list">Your documents</span>
<div class="storedHeader">
<div class="storedHeaderText">
<span class="header-list">Your documents</span>
</div>
<div class="storedHeaderClearAll">
<div class="clear-all">Clear all</div>
</div>
</div>
<table class="tableHeader" cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
@ -294,6 +302,15 @@
<div class="describeUpload">After these steps are completed, you can work with your document.</div>
<span id="step1" class="step">1. Loading the file.</span>
<span class="step-descr">The loading speed depends on file size and additional elements it contains.</span>
<div id="select-file-type" class="invisible">
<br />
<span class="step">Please select the current document type</span>
<div class="buttonsMobile indent">
<div class="button file-type document" data="docx">Document</div>
<div class="button file-type spreadsheet" data="xlsx">Spreadsheet</div>
<div class="button file-type presentation" data="pptx">Presentation</div>
</div>
</div>
<br />
<span id="step2" class="step">2. Conversion.</span>
<span class="step-descr">The file is converted to OOXML so that you can edit it.</span>
@ -356,9 +373,6 @@
<%: Scripts.Render("~/bundles/jquery", "~/bundles/scripts") %>
<script language="javascript" type="text/javascript">
var FillExtList = '<%= string.Join(",", DocManagerHelper.FillFormExts.ToArray()) %>';
var ConverExtList = '<%= string.Join(",", DocManagerHelper.ConvertExts.ToArray()) %>';
var EditedExtList = '<%= string.Join(",", DocManagerHelper.EditedExts.ToArray()) %>';
var UrlConverter = '<%= Url.Content("~/webeditor.ashx?type=convert") %>';
var UrlEditor = '<%= Url.Action("editor", "Home") %>';
</script>

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width" />
<!--
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -17,6 +17,7 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
@ -50,6 +51,15 @@ namespace OnlineEditorsExampleMVC
case "downloadhistory":
DownloadHistory(context);
break;
case "gethistory":
GetHistory(context);
break;
case "getversiondata":
GetVersionData(context);
break;
case "restore":
Restore(context);
break;
case "convert":
Convert(context);
break;
@ -77,6 +87,9 @@ namespace OnlineEditorsExampleMVC
case "reference":
Reference(context);
break;
case "formats":
Formats(context);
break;
}
}
@ -230,7 +243,13 @@ namespace OnlineEditorsExampleMVC
var fileUri = DocManagerHelper.GetDownloadUrl(fileName);
var extension = (Path.GetExtension(fileName).ToLower() ?? "").Trim('.');
var internalExtension = "ooxml";
string conversionExtension = "ooxml";
object fileExt;
if (body.TryGetValue("fileExt", out fileExt) && !String.IsNullOrEmpty(fileExt.ToString()))
{
conversionExtension = fileExt.ToString();
}
// check if the file with such an extension can be converted
if (DocManagerHelper.ConvertExts.Contains("." + extension))
@ -248,7 +267,7 @@ namespace OnlineEditorsExampleMVC
// get the url and file type of the converted file
Dictionary<string, string> newFileData;
var result = ServiceConverter.GetConvertedData(downloadUri.ToString(), extension, internalExtension, key, true, out newFileData, filePass, lang);
var result = ServiceConverter.GetConvertedData(downloadUri.ToString(), extension, conversionExtension, key, true, out newFileData, filePass, lang);
if (result != 100)
{
context.Response.Write("{ \"step\" : \"" + result + "\", \"filename\" : \"" + fileName + "\"}");
@ -383,8 +402,17 @@ namespace OnlineEditorsExampleMVC
context.Response.ContentType = "text/plain";
try
{
var fileName = Path.GetFileName(context.Request["fileName"]);
Remove(fileName); // remove a file and its history if it exists
string fileName = context.Request["fileName"];
if (!String.IsNullOrEmpty(fileName))
{
fileName = Path.GetFileName(context.Request["fileName"]);
Remove(fileName); // remove a file and its history if it exists
}
else
{
RemoveUserDirectory(); // remove the user's directory
}
context.Response.Write("{ \"success\": true }");
}
@ -404,6 +432,14 @@ namespace OnlineEditorsExampleMVC
if (Directory.Exists(histDir)) Directory.Delete(histDir, true);
}
// remove the user's directory
private static void RemoveUserDirectory()
{
var path = DocManagerHelper.StoragePath("", null); // get the path to the user directory
if (Directory.Exists(path)) Directory.Delete(path, true);
}
// get files information
private static void Files(HttpContext context)
{
@ -443,7 +479,7 @@ namespace OnlineEditorsExampleMVC
private static void Assets(HttpContext context)
{
var fileName = Path.GetFileName(context.Request["filename"]);
var filePath = HttpRuntime.AppDomainAppPath + "assets/sample/" + fileName;
var filePath = HttpRuntime.AppDomainAppPath + "assets/document-templates/sample/" + fileName;
download(filePath, context);
}
@ -451,7 +487,7 @@ namespace OnlineEditorsExampleMVC
private static void GetCsv(HttpContext context)
{
var fileName = "csv.csv";
var filePath = HttpRuntime.AppDomainAppPath + "assets/sample/" + fileName;
var filePath = HttpRuntime.AppDomainAppPath + "assets/document-templates/sample/" + fileName;
download(filePath, context);
}
@ -513,6 +549,173 @@ namespace OnlineEditorsExampleMVC
get { return false; }
}
private static void GetHistory(HttpContext context)
{
var jss = new JavaScriptSerializer();
var fileName = context.Request["filename"];
var history = GetHistory(fileName);
context.Response.Write(jss.Serialize(history));
}
private static void GetVersionData(HttpContext context)
{
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
var jss = new JavaScriptSerializer();
var fileName = context.Request["filename"];
int version;
if (!int.TryParse(context.Request["version"], out version))
{
context.Response.Write("{ \"error\": \"Version number invalid!\"}");
return;
}
var versionData = new Dictionary<string, object>();
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(fileName, null));
var lastVersion = DocManagerHelper.GetFileVersion(histDir);
var verDir = DocManagerHelper.VersionDir(histDir, version);
var key = version == lastVersion
? ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress()
+ "/" + fileName + "/"
+ File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode())
: File.ReadAllText(Path.Combine(verDir, "key.txt"));
var ext = Path.GetExtension(fileName).ToLower();
versionData.Add("fileType", ext.Replace(".", ""));
versionData.Add("key", key);
// write file url to the data object
string prevFileUrl;
string directPrevFileUrl;
if (Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath))
{
prevFileUrl = version == lastVersion ? DocManagerHelper.GetDownloadUrl(fileName)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
directPrevFileUrl = version == lastVersion ? DocManagerHelper.GetDownloadUrl(fileName, false)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
else
{
prevFileUrl = version == lastVersion ? DocManagerHelper.GetFileUri(fileName, true)
: DocManagerHelper.GetHistoryDownloadUrl(fileName, version.ToString(), "prev" + ext);
directPrevFileUrl = version == lastVersion ? DocManagerHelper.GetFileUri(fileName, false)
: DocManagerHelper.GetHistoryDownloadUrl(fileName, version.ToString(), "prev" + ext, false);
}
versionData.Add("url", prevFileUrl);
var isEnableDirectUrl = string.Equals(DocManagerHelper.GetDirectUrl(), "true");
if (isEnableDirectUrl)
{
versionData.Add("directUrl", directPrevFileUrl); // write direct url to the data object
}
versionData.Add("version", version);
if (version > 1)
{
var prevVerDir = DocManagerHelper.VersionDir(histDir, version - 1);
var prevUrl = Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath)
? DocManagerHelper.GetDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""))
: DocManagerHelper.GetHistoryDownloadUrl(fileName, (version - 1).ToString(), "prev" + ext);
var prevKey = File.ReadAllText(Path.Combine(prevVerDir, "key.txt"));
Dictionary<string, object> dataPrev = new Dictionary<string, object>() { // write information about previous file version to the data object
{ "fileType", ext.Replace(".", "") },
{ "key", prevKey }, // write key and url information about previous file version
{ "url", prevUrl }
};
string directPrevUrl;
if (isEnableDirectUrl)
{
directPrevUrl = Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath)
? DocManagerHelper.GetDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""), false)
: DocManagerHelper.GetHistoryDownloadUrl(fileName, version.ToString(), "prev" + ext, false);
dataPrev.Add("directUrl", directPrevUrl);
}
versionData.Add("previous", dataPrev);
if (File.Exists(Path.Combine(prevVerDir, "diff.zip")))
{
var changesUrl = DocManagerHelper.GetHistoryDownloadUrl(fileName, (version - 1).ToString(), "diff.zip");
versionData.Add("changesUrl", changesUrl);
}
}
if (JwtManager.Enabled)
{
var token = JwtManager.Encode(versionData);
versionData.Add("token", token);
}
context.Response.Write(jss.Serialize(versionData));
}
private static void Restore(HttpContext context)
{
string fileData;
try
{
using (var receiveStream = context.Request.InputStream)
using (var readStream = new StreamReader(receiveStream))
{
fileData = readStream.ReadToEnd();
if (string.IsNullOrEmpty(fileData)) return;
}
}
catch (Exception e)
{
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
}
var jss = new JavaScriptSerializer();
var body = jss.Deserialize<Dictionary<string, object>>(fileData);
var fileName = (string)body["fileName"];
var version = (int)body["version"];
var key = ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress()
+ "/" + fileName + "/"
+ File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode());
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(fileName, null));
var currentVersionDir = DocManagerHelper.VersionDir(histDir, DocManagerHelper.GetFileVersion(histDir));
var verDir = DocManagerHelper.VersionDir(histDir, version);
if (!Directory.Exists(currentVersionDir)) Directory.CreateDirectory(currentVersionDir);
var ext = Path.GetExtension(fileName).ToLower();
File.Copy(DocManagerHelper.StoragePath(fileName, null), Path.Combine(currentVersionDir, "prev" + ext));
File.WriteAllText(Path.Combine(currentVersionDir, "key.txt"), key);
var changesPath = Path.Combine(DocManagerHelper.VersionDir(histDir, version - 1), "changes.json");
if (File.Exists(changesPath))
{
File.Copy(changesPath, Path.Combine(currentVersionDir, "changes.json"));
}
File.Copy(Path.Combine(verDir, "prev" + ext), DocManagerHelper.StoragePath(fileName, null), true);
var fileInfo = new FileInfo(DocManagerHelper.StoragePath(fileName, null));
fileInfo.LastWriteTimeUtc = DateTime.UtcNow;
var history = GetHistory(fileName);
context.Response.Write(jss.Serialize(history));
}
// download a history file
private static void DownloadHistory(HttpContext context)
{
@ -635,6 +838,27 @@ namespace OnlineEditorsExampleMVC
}
}
if (fileName == "" && body.ContainsKey("link"))
{
string link = body["link"].ToString();
if (!link.Contains(DocManagerHelper.GetServerUrl(false)))
{
context.Response.Write(jss.Serialize(new Dictionary<string, string>() {
{ "url", link },
{ "directUrl", link }
}));
return;
}
Uri linkUri = new Uri(link);
fileName = HttpUtility.ParseQueryString(linkUri.Query).Get("fileName");
if (string.IsNullOrEmpty(fileName) || !File.Exists(DocManagerHelper.StoragePath(fileName, null)))
{
context.Response.Write("{ \"error\": \"File is not exist\"}");
return;
}
}
if (fileName == "")
{
try
@ -663,6 +887,7 @@ namespace OnlineEditorsExampleMVC
var data = new Dictionary<string, object>() {
{ "fileType", (Path.GetExtension(fileName) ?? "").ToLower().Trim('.') },
{ "key", ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + fileName + "/" + File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode())},
{ "url", DocManagerHelper.GetDownloadUrl(fileName)},
{ "directUrl", directUrl ? DocManagerHelper.GetDownloadUrl(fileName, false) : null },
{ "referenceData", new Dictionary<string, string>()
@ -675,7 +900,8 @@ namespace OnlineEditorsExampleMVC
{ "instanceId", DocManagerHelper.GetServerUrl(false) }
}
},
{ "path", fileName }
{ "path", fileName },
{ "link", DocManagerHelper.GetServerUrl(false) + "Editor?fileName=" + fileName }
};
if (JwtManager.Enabled)
@ -687,6 +913,89 @@ namespace OnlineEditorsExampleMVC
context.Response.Write(jss.Serialize(data));
}
// get the document history
private static Dictionary<string, object> GetHistory(string fileName)
{
var jss = new JavaScriptSerializer();
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(fileName, null));
var history = new Dictionary<string, object>();
var currentVersion = DocManagerHelper.GetFileVersion(histDir);
var currentKey = ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress()
+ "/" + fileName + "/"
+ File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode());
var versionList = new List<Dictionary<string, object>>();
for (var versionNum = 1; versionNum <= currentVersion; versionNum++)
{
var versionObj = new Dictionary<string, object>();
var verDir = DocManagerHelper.VersionDir(histDir, versionNum); // get the path to the given file version
var key = versionNum == currentVersion ? currentKey : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
versionObj.Add("key", key);
versionObj.Add("version", versionNum);
var changesPath = Path.Combine(DocManagerHelper.VersionDir(histDir, versionNum - 1), "changes.json");
if (versionNum == 1 || !File.Exists(changesPath)) // check if the version number is equal to 1
{
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
if (File.Exists(infoPath))
{
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
versionObj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
versionObj.Add("user", new Dictionary<string, object>()
{
{ "id", info["id"] },
{ "name", info["name"] },
});
}
}
else if (versionNum > 1) // check if the version number is greater than 1 (the file was modified)
{
// get the path to the changes.json file
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(changesPath));
var changesArray = (ArrayList)changes["changes"];
var change = changesArray.Count > 0
? (Dictionary<string, object>)changesArray[0]
: new Dictionary<string, object>();
// write information about changes to the object
versionObj.Add("changes", change.Count > 0 ? changes["changes"] : null);
versionObj.Add("serverVersion", changes["serverVersion"]);
versionObj.Add("created", change.Count > 0 ? change["created"] : null);
versionObj.Add("user", change.Count > 0 ? change["user"] : null);
}
versionList.Add(versionObj);
}
history.Add("currentVersion", currentVersion);
history.Add("history", versionList);
return history;
}
// return all the supported formats
private static void Formats(HttpContext context)
{
try
{
Dictionary<string, object> data = new Dictionary<string, object>
{
{ "formats", FormatManager.All() }
};
context.Response.ContentType = "application/json";
var jss = new JavaScriptSerializer();
context.Response.Write(jss.Serialize(data));
}
catch (Exception e)
{
context.Response.Write("{ \"error\": \"" + e.Message + "\"}");
}
}
}
}

View File

@ -1,15 +1,12 @@
<?xml version="1.0"?>
<appSettings>
<clear />
<add key="version" value="1.6.0"/>
<add key="version" value="1.8.0"/>
<add key="filesize-max" value="52428800"/>
<add key="storage-path" value=""/>
<add key="filename-max" value="50"/>
<add key="files.docservice.fillform-docs" value=".docx|.oform"/>
<add key="files.docservice.viewed-docs" value=".djvu|.oxps|.pdf|.xps"/>
<add key="files.docservice.edited-docs" value=".csv|.docm|.docx|.docxf|.dotm|.dotx|.epub|.fb2|.html|.odp|.ods|.odt|.otp|.ots|.ott|.potm|.potx|.ppsm|.ppsx|.pptm|.pptx|.rtf|.txt|.xlsm|.xlsx|.xltm|.xltx"/>
<add key="files.docservice.convert-docs" value=".doc|.dot|.dps|.dpt|.epub|.et|.ett|.fb2|.fodp|.fods|.fodt|.htm|.html|.mht|.mhtml|.odp|.ods|.odt|.otp|.ots|.ott|.pot|.pps|.ppt|.rtf|.stw|.sxc|.sxi|.sxw|.wps|.wpt|.xls|.xlsb|.xlt|.xml"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.secret" value="" />
<add key="files.docservice.header" value="Authorization" />
@ -18,7 +15,7 @@
<add key="files.docservice.verify-peer-off" value="true"/>
<add key="files.docservice.languages" value="en:English|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|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
<add key="files.docservice.languages" value="en:English|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Latn-RS:Serbian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
<add key="files.docservice.url.site" value="http://documentserver/"/>

View File

@ -1,8 +1 @@
<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 0H21.674C22.4697 0 23.2327 0.316071 23.7953 0.87868L29.1213 6.20465C29.6839 6.76726 30 7.53032 30 8.32597V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#3779A6"/>
<path d="M22.9167 0L30.0001 7.08333H25.9167C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#1D5880"/>
<path d="M6.17627 14.7059H23.8233V15.8823H6.17627V14.7059Z" fill="white"/>
<path d="M6.17627 18.5294H23.8233V19.7059H6.17627V18.5294Z" fill="white"/>
<path d="M6.17627 22.3529H23.8233V23.5294H6.17627V22.3529Z" fill="white"/>
<path d="M6.17627 26.1765H23.8233V27.3529H6.17627V26.1765Z" fill="white"/>
</svg>
<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>

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 387 B

View File

@ -1,6 +1 @@
<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 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#27ABA3"/>
<path d="M22.9165 0L29.9998 7.08333H25.9165C24.2597 7.08333 22.9165 5.74019 22.9165 4.08333V0Z" fill="#008078"/>
<rect x="6.5" y="15.5" width="17" height="5" stroke="white"/>
<rect x="6.5" y="23.5" width="17" height="5" stroke="white"/>
</svg>
<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="#27ABA3"/><path d="M23 0l7 7h-4c-1.6569 0-3-1.34315-3-3V0z" fill="#008078"/><path fill-rule="evenodd" clip-rule="evenodd" d="M24 14H6v7h18v-7zm-.8182 5.9978H6.81818V15H23.1818v4.9978zM24 23H6v7h18v-7zm-.8182 5.9978H6.81818V24H23.1818v4.9978z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 463 B

View File

@ -1,8 +1 @@
<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 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#F36700"/>
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#AB531F"/>
<path d="M6.17627 16.1275H23.8233V17.3039H6.17627V16.1275Z" fill="white"/>
<path d="M6.17627 28.7745L6.17627 16.1275L7.35274 16.1275L7.35274 28.7745H6.17627Z" fill="white"/>
<path d="M23.8233 16.1275V28.7745H22.6469V16.1275L23.8233 16.1275Z" fill="white"/>
<path d="M6.17627 27.598H23.8233V28.7745H6.17627L6.17627 27.598Z" fill="white"/>
</svg>
<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>

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 366 B

View File

@ -1,6 +1 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30 7.44186L22 0H3C1.22739 0 0 0.822551 0 2.32558V37.2093C0 38.7123 1.22739 40 3 40H27C28.7726 40 30 38.7123 30 37.2093V7.44186Z" fill="#D0D5DA"/>
<path d="M24.1042 7.27273H29.9631L22 0V5.32334C22 6.4105 22.949 7.27273 24.1042 7.27273Z" fill="#646464"/>
<path d="M16.9562 22.3485H12.9746V17.803H10.9839L14.9654 14.1667L18.947 17.803H16.9562V22.3485Z" fill="#646464"/>
<path d="M20.9378 23.7121C20.9378 24.1666 20.4401 24.6212 19.9424 24.6212H9.98848C9.49078 24.6212 8.99309 24.1666 8.99309 23.7121V22.3485C8.99309 21.8939 9.49078 21.4394 9.98848 21.4394H10.9839V20.0757H9.49078C8.49539 20.0757 7.5 20.9848 7.5 21.8939V24.1666C7.5 25.0757 8.61982 25.9848 9.49078 25.9848H20.4401C21.3111 25.9848 22.4309 25.0757 22.4309 24.1666V21.8939C22.4309 20.9848 21.4355 20.0757 20.4401 20.0757H18.947V21.4394H19.9424C20.4401 21.4394 20.9378 21.8939 20.9378 22.3485V23.7121Z" 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 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>

Before

Width:  |  Height:  |  Size: 992 B

After

Width:  |  Height:  |  Size: 797 B

View File

@ -1,12 +1 @@
<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 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#78A73B"/>
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#5A7D2B"/>
<path d="M6.17644 15.2941H23.8235V16.4706H6.17644V15.2941Z" fill="white"/>
<path d="M6.17644 19.1177H23.8235V20.2941H6.17644V19.1177Z" fill="white"/>
<path d="M6.17644 22.9412H23.8235V24.1177H6.17644V22.9412Z" fill="white"/>
<path d="M6.17644 26.7647H23.8235V27.9412H6.17644V26.7647Z" fill="white"/>
<path d="M5.88232 27.9412L5.88232 15.2941L7.0588 15.2941L7.0588 27.9412H5.88232Z" fill="white"/>
<path d="M11.4706 27.9412L11.4706 15.2941L12.647 15.2941V27.9412H11.4706Z" fill="white"/>
<path d="M17.0588 27.9412L17.0588 15.2941L18.2353 15.2941V27.9412H17.0588Z" fill="white"/>
<path d="M22.647 27.9412V15.2941H23.8235V27.9412H22.647Z" fill="white"/>
</svg>
<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>

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -502,6 +502,17 @@
justify-content: space-between;
align-items: center;
}
.buttonsMobile.indent {
margin-bottom: 0;
flex-wrap: nowrap;
}
.button.file-type:hover,
.button.file-type {
height: 28px;
width: 100px;
margin-bottom: 10px !important;
font-size: 9px;
}
.button.gray{
margin: 0;
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -230,6 +230,33 @@ label .checkbox {
color: #FF6F3D;
}
.button.file-type {
font-size: 11px;
color: #FFFFFF;
padding: 8px 8px;
margin-right: 10px;
}
.button.file-type.disable {
cursor: default;
}
.button.file-type.pale {
opacity: 30%;
}
.button.file-type.document {
background: #446995;
}
.button.file-type.spreadsheet {
background: #40865C;
}
.button.file-type.presentation {
background: #AA5252;
}
.upload-panel {
float: left;
padding: 24px 0;
@ -596,6 +623,29 @@ footer a:hover {
width: 4%;
}
.storedHeader {
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.storedHeaderClearAll {
padding-right: 52px;
}
.clear-all {
display: inline-block;
width: 100px;
padding: 2px;
outline: 1px solid #E5E5E5;
text-align: center;
cursor:pointer;
text-transform: uppercase;
background-color: #F5F5F5;
color: #666666;
}
.select-user {
color: #444444;
font-family: Open Sans;
@ -745,6 +795,16 @@ html {
margin-left: 25px;
}
.buttonsMobile.indent{
padding-left: 35px;
margin-top: 10px;
margin-bottom: 10px;
}
.invisible {
display: none;
}
.tooltip {
background: #FFFFFF;
border-radius: 5px;

View File

@ -13,10 +13,11 @@
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="server-version" content=<%= GetVersion() %> />
<title>ONLYOFFICE</title>
<!--
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -70,7 +71,7 @@
<a class="try-editor slide" data-type="slide">Presentation</a>
</li>
<li>
<a class="try-editor form" data-type="docxf">Form template</a>
<a class="try-editor form" data-type="docxf">PDF form</a>
</li>
</ul>
<label class="side-option">
@ -152,7 +153,14 @@
if (storedFiles.Any())
{ %>
<div class="stored-list">
<span class="header-list">Your documents</span>
<div class="storedHeader">
<div class="storedHeaderText">
<span class="header-list">Your documents</span>
</div>
<div class="storedHeaderClearAll">
<div class="clear-all">Clear all</div>
</div>
</div>
<table class="tableHeader" cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr >
@ -296,6 +304,15 @@
<div class="describeUpload">After these steps are completed, you can work with your document.</div>
<span id="step1" class="step">1. Loading the file.</span>
<span class="step-descr">The loading speed depends on file size and additional elements it contains.</span>
<div id="select-file-type" class="invisible">
<br />
<span class="step">Please select the current document type</span>
<div class="buttonsMobile indent">
<div class="button file-type document" data="docx">Document</div>
<div class="button file-type spreadsheet" data="xlsx">Spreadsheet</div>
<div class="button file-type presentation" data="pptx">Presentation</div>
</div>
</div>
<br />
<span id="step2" class="step">2. Conversion.</span>
<span class="step-descr">The file is converted to OOXML so that you can edit it.</span>
@ -363,12 +380,8 @@
<script language="javascript" type="text/javascript" src="script/jquery.iframe-transport.js"></script>
<script language="javascript" type="text/javascript" src="script/jquery.fileupload.js"></script>
<script language="javascript" type="text/javascript" src="script/jquery.dropdownToggle.js"></script>
<script language="javascript" type="text/javascript" src="script/formats.js"></script>
<script language="javascript" type="text/javascript" src="script/jscript.js"></script>
<script language="javascript" type="text/javascript">
var FillFormExtList = '<%= string.Join(",", FillFormsExts.ToArray()) %>';
var ConverExtList = '<%= string.Join(",", ConvertExts.ToArray()) %>';
var EditedExtList = '<%= string.Join(",", EditedExts.ToArray()) %>';
</script>
</body>
</html>

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -30,49 +30,15 @@ using ASC.Api.DocumentConverter;
namespace OnlineEditorsExample
{
internal static class FileType
{
// the spreadsheet extension list
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};
// the presentation extension list
public static readonly List<string> ExtsPresentation = new List<string>
{
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp", ".otp"
};
// the document extension list
public static readonly List<string> ExtsDocument = new List<string>
{
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht", ".xml",
".pdf", ".djvu", ".fb2", ".epub", ".xps", ".oxps", ".oform"
};
// get an internal file extension
public static string GetInternalExtension(string extension)
{
extension = Path.GetExtension(extension).ToLower(); // get file extension
if (ExtsDocument.Contains(extension)) return ".docx"; // .docx for text document extensions
if (ExtsSpreadsheet.Contains(extension)) return ".xlsx"; // .xlsx for spreadsheet extensions
if (ExtsPresentation.Contains(extension)) return ".pptx"; // .pptx for presentation extensions
return string.Empty;
}
}
public partial class _Default : Page
{
//get server version
public static string GetVersion()
{
return WebConfigurationManager.AppSettings["version"];
}
// get the virtual path
public static string VirtualPath
{
@ -115,24 +81,24 @@ namespace OnlineEditorsExample
// file extensions that can be viewed
private static List<string> ViewedExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.viewed-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.ViewableExtensions(); }
}
public static List<string> FillFormsExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.fillform-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.FillableExtensions(); }
}
// file extensions that can be edited
public static List<string> EditedExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.edited-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.EditableExtensions(); }
}
// file extensions that can be converted
public static List<string> ConvertExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.convert-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
get { return FormatManager.ConvertibleExtensions(); }
}
private static string _fileName;
@ -284,9 +250,9 @@ namespace OnlineEditorsExample
{
var ext = Path.GetExtension(fileName).ToLower();
if (FileType.ExtsDocument.Contains(ext)) return "word"; // word for text document extensions
if (FileType.ExtsSpreadsheet.Contains(ext)) return "cell"; // cell for spreadsheet extensions
if (FileType.ExtsPresentation.Contains(ext)) return "slide"; // slide for presentation extensions
if (FormatManager.DocumentExtensions().Contains(ext)) return "word"; // word for text document extensions
if (FormatManager.SpreadsheetExtensions().Contains(ext)) return "cell"; // cell for spreadsheet extensions
if (FormatManager.PresentationExtensions().Contains(ext)) return "slide"; // slide for presentation extensions
return "word"; // the default document type is word
}
@ -471,7 +437,14 @@ namespace OnlineEditorsExample
var lang = context.Request.Cookies.GetOrDefault("ulang", null);
var extension = (Path.GetExtension(_fileName).ToLower() ?? "").Trim('.');
var internalExtension = "ooxml";
string conversionExtension = "ooxml"; // set the default conversion extension as ooxml
object fileExt;
// change the conversion extension if it was provided in the request body
if (body.TryGetValue("fileExt", out fileExt) && !String.IsNullOrEmpty(fileExt.ToString()))
{
conversionExtension = fileExt.ToString();
}
// check if the file with such an extension can be converted
if (ConvertExts.Contains("." + extension))
@ -488,7 +461,7 @@ namespace OnlineEditorsExample
// get the url and file type of the converted file
Dictionary<string, string> newFileData;
var result = ServiceConverter.GetConvertedData(fileUrl.ToString() , extension, internalExtension, key, true, out newFileData, filePass, lang);
var result = ServiceConverter.GetConvertedData(fileUrl.ToString() , extension, conversionExtension, key, true, out newFileData, filePass, lang);
if (result != 100)
{
return "{ \"step\" : \"" + result + "\", \"filename\" : \"" + _fileName + "\"}";
@ -538,7 +511,12 @@ namespace OnlineEditorsExample
// get the correct file name if such a name already exists
public static string GetCorrectName(string fileName, string userAddress = null)
{
int maxName;
int.TryParse(WebConfigurationManager.AppSettings["filename-max"], out maxName);
var baseName = Path.GetFileNameWithoutExtension(fileName); // get file name without extension
if (baseName.Length > maxName){
baseName = baseName.Substring(0, maxName) + "[...]";
}
var ext = Path.GetExtension(fileName).ToLower(); // get file extension
var name = baseName + ext; // get full file name
@ -633,5 +611,12 @@ namespace OnlineEditorsExample
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
return "&directUrl=" + (isEnabledDirectUrl != null ? isEnabledDirectUrl : "false");
}
// get direct url flag
public static bool IsEnabledDirectUrl()
{
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
return isEnabledDirectUrl != null ? Convert.ToBoolean(isEnabledDirectUrl) : false;
}
}
}

View File

@ -15,7 +15,7 @@
<title>ONLYOFFICE</title>
<!--
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -145,13 +145,17 @@
};
// the user is trying to select document for comparing by clicking the Document from Storage button
var onRequestCompareFile = function () {
docEditor.setRevisedFile(<%= CompareFileData %>); // select a document for comparing
var onRequestSelectDocument = function (event) {
var data = <%= DocumentData %>;
data.c = event.data.c;
docEditor.setRequestedDocument(data); // select a document for comparing
};
// the user is trying to select recipients data by clicking the Mail merge button
var onRequestMailMergeRecipients = function (event) {
docEditor.setMailMergeRecipients(<%= DataMailMergeRecipients %>); // insert recipient data for mail merge into the file
var onRequestSelectSpreadsheet = function (event) {
var data = <%= DataSpreadsheet %>;
data.c = event.data.c;
docEditor.setRequestedSpreadsheet(data); // insert recipient data for spreadsheet into the file
};
var onRequestSaveAs = function (event) { // the user is trying to save file by clicking Save Copy as... button
@ -190,19 +194,80 @@
}
};
var onRequestReferenceData = function (event) { // user refresh external data source
var onRequestOpen = function (event) { // user open external data source
innerAlert("onRequestOpen");
var windowName = event.data.windowName;
event.data.directUrl = !!config.document.directUrl;
requestReference(event.data, function (data) {
if (data.error) {
var winEditor = window.open("", windowName);
winEditor.close();
innerAlert(data.error, true);
return;
}
var link = data.link;
window.open(link, windowName);
});
};
var onRequestReferenceData = function (event) { // user refresh external data source
innerAlert("onRequestReferenceData");
requestReference(event.data, function (data) {
docEditor.setReferenceData(data);
});
};
var requestReference = function (data, callback) {
innerAlert(data);
data.directUrl = !!config.document.directUrl;
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor.ashx?type=reference");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(event.data));
xhr.send(JSON.stringify(data));
xhr.onload = function () {
console.log(xhr.responseText);
docEditor.setReferenceData(JSON.parse(xhr.responseText));
callback(JSON.parse(xhr.responseText));
}
};
var onRequestUsers = function (event) {
if (event && event.data){
var c = event.data.c;
}
switch (c) {
case "info":
users = [];
var allUsers = <%= UsersInfo %>;
for (var i = 0; i < event.data.id.length; i++) {
for (var j = 0; j < allUsers.length; j++) {
if (allUsers[j].id == event.data.id[i]) {
users.push(allUsers[j]);
break;
}
}
}
break;
case "protect":
var users = <%= UsersForProtect %>;
break;
default:
users = <%= UsersForMentions %>;
}
docEditor.setUsers({
"c": c,
"users": users,
});
};
var onRequestSendNotify = function (event) {
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
var data = JSON.stringify(event.data);
innerAlert("onRequestSendNotify: " + data);
};
config = <%= DocConfig %>;
config.width = "100%";
@ -216,47 +281,71 @@
'onMakeActionLink': onMakeActionLink,
'onMetaChange': onMetaChange,
'onRequestInsertImage': onRequestInsertImage,
'onRequestCompareFile': onRequestCompareFile,
"onRequestMailMergeRecipients": onRequestMailMergeRecipients,
'onRequestSelectDocument': onRequestSelectDocument,
"onRequestSelectSpreadsheet": onRequestSelectSpreadsheet,
};
if (config.editorConfig.user.id) {
<% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData))
{ %>
config.events['onRequestHistory'] = function () { // the user is trying to show the document version history
docEditor.refreshHistory(<%= History %>); // show the document version history
};
config.events['onRequestHistoryData'] = function (event) { // the user is trying to click the specific document version in the document version history
var ver = event.data;
var histData = <%= HistoryData %>;
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
};
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=gethistory&filename=<%= FileName %>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
xhr.onload = function () {
console.log(xhr.responseText);
docEditor.refreshHistory(JSON.parse(xhr.responseText));
}
};
config.events['onRequestHistoryData'] = function (event) { // the user is trying to click the specific document version in the document version history
var ver = event.data;
let xhr = new XMLHttpRequest();
xhr.open("GET", "webeditor.ashx?type=getversiondata&filename=<%= FileName %>&version=" + ver + "&directUrl=" + !!config.document.directUrl);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
xhr.onload = function () {
console.log(xhr.responseText);
docEditor.setHistoryData(JSON.parse(xhr.responseText)); // send the link to the document for viewing the version history
}
};
if (config.editorConfig.user.id !== "uid-3") {
config.events['onRequestHistoryClose'] = function () { // the user is trying to go back to the document from viewing the document version history
document.location.reload();
};
<% } %>
config.events['onRequestRestore'] = function (event) {
var fileName = "<%= FileName %>";
var version = event.data.version;
var data = {
fileName: fileName,
version: version
};
let xhr = new XMLHttpRequest();
xhr.open("POST", "webeditor.ashx?type=restore&directUrl=" + !!config.document.directUrl);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(data));
xhr.onload = function () {
docEditor.refreshHistory(JSON.parse(xhr.responseText));
}
};
}
// add mentions for not anonymous users
<% if (!string.IsNullOrEmpty(UsersForMentions))
{ %>
config.events['onRequestUsers'] = function () {
docEditor.setUsers({ // set a list of users to mention in the comments
"users": <%= UsersForMentions %>
});
};
config.events['onRequestUsers'] = onRequestUsers;
<% } %>
// the user is mentioned in a comment
config.events['onRequestSendNotify'] = function (event) {
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
var data = JSON.stringify(event.data);
innerAlert("onRequestSendNotify: " + data);
};
config.events['onRequestSendNotify'] = onRequestSendNotify;
// prevent file renaming for anonymous users
config.events['onRequestRename'] = onRequestRename;
config.events['onRequestReferenceData'] = onRequestReferenceData;
// prevent switch the document from the viewing into the editing mode for anonymous users
config.events['onRequestEditRights'] = onRequestEditRights;
config.events['onRequestOpen'] = onRequestOpen;
}
if (config.editorConfig.createUrl) {
@ -264,12 +353,6 @@
};
var сonnectEditor = function () {
if ((config.document.fileType === "docxf" || config.document.fileType === "oform")
&& DocsAPI.DocEditor.version().split(".")[0] < 7) {
innerAlert("Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online.");
return;
}
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -17,7 +17,6 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Web;
@ -61,12 +60,12 @@ namespace OnlineEditorsExample
}
protected string DocConfig { get; private set; }
protected string History { get; private set; }
protected string HistoryData { get; private set; }
protected string InsertImageConfig { get; private set; }
protected string CompareFileData { get; private set; }
protected string DataMailMergeRecipients { get; private set; }
protected string DocumentData { get; private set; }
protected string DataSpreadsheet { get; private set; }
protected string UsersForMentions { get; private set; }
protected string UsersInfo { get; private set; }
protected string UsersForProtect { get; private set; }
protected string DocumentType { get { return _Default.DocumentType(FileName); } }
// get callback url
@ -155,7 +154,7 @@ namespace OnlineEditorsExample
editorsMode = "fillForms";
canEdit = true;
}
var submitForm = editorsMode.Equals("fillForms") && id.Equals("uid-1") && false; // check if the Submit form button is displayed or hidden
var submitForm = editorsMode.Equals("fillForms") && id.Equals("uid-1"); // check if the Submit form button is displayed or hidden
var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // get the editor opening mode (edit or view)
var jss = new JavaScriptSerializer();
@ -195,7 +194,7 @@ namespace OnlineEditorsExample
{
{ "title", FileName },
{ "url", getDownloadUrl(FileName) },
{ "directUrl", IsEnabledDirectUrl() ? directUrl : "" },
{ "directUrl", _Default.IsEnabledDirectUrl() ? directUrl : "" },
{ "fileType", ext.Trim('.') },
{ "key", Key },
{
@ -226,7 +225,7 @@ namespace OnlineEditorsExample
{ "download", !user.deniedPermissions.Contains("download") },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode =="view" || editorsMode == "filter" || editorsMode == "blockcontent") },
{ "print", !user.deniedPermissions.Contains("print") },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "blockcontent" },
{ "modifyFilter", editorsMode != "filter" },
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", canEdit && (editorsMode == "edit" || editorsMode == "review") },
@ -259,7 +258,8 @@ namespace OnlineEditorsExample
{
{ "id", !user.id.Equals("uid-0") ? user.id : null },
{ "name", user.name },
{ "group", user.group }
{ "group", user.group },
{ "image", user.avatar ? _Default.GetServerUrl(false) + "/App_Themes/images/"+ user.id + ".png" : null }
}
},
{
@ -282,10 +282,12 @@ namespace OnlineEditorsExample
{ "forcesave", false }, // adds the request for the forced file saving to the callback handler
{ "submitForm", submitForm }, // if the Submit form button is displayed or not
{
"goback", new Dictionary<string, object> // settings for the Open file location menu button and upper right corner button
"goback", user.goback != null ? new Dictionary<string, object> // settings for the Open file location menu button and upper right corner button
{
{ "url", _Default.GetServerUrl(false) + "default.aspx" } // the absolute URL to the website address which will be opened when clicking the Open file location menu button
}
{ "url", _Default.GetServerUrl(false) + "default.aspx" }, // the absolute URL to the website address which will be opened when clicking the Open file location menu button
{ "text", user.goback.text },
{ "blank", user.goback.blank }
} : new Dictionary<string, object>{}
}
}
}
@ -311,143 +313,26 @@ namespace OnlineEditorsExample
// a document which will be compared with the current document
Dictionary<string, object> compareFile = GetCompareFile();
CompareFileData = jss.Serialize(compareFile);
DocumentData = jss.Serialize(compareFile);
// recipient data for mail merging
Dictionary<string, object> mailMergeConfig = GetMailMergeConfig();
DataMailMergeRecipients = jss.Serialize(mailMergeConfig);
// recipient data for spreadsheet
Dictionary<string, object> spreadsheetConfig = GetSpreadsheetConfig();
DataSpreadsheet = jss.Serialize(spreadsheetConfig);
// get users for mentions
List<Dictionary<string, object>> usersData = Users.getUsersForMentions(user.id);
UsersForMentions = !user.id.Equals("uid-0") ? jss.Serialize(usersData) : null;
Dictionary<string, object> hist;
Dictionary<string, object> histData;
// get the document history
GetHistory(out hist, out histData);
if (hist != null && histData != null)
{
History = jss.Serialize(hist);
HistoryData = jss.Serialize(histData);
}
List<Dictionary<string, object>> usersInfo = Users.getUsersInfo(user.id);
UsersInfo = jss.Serialize(usersData);
// get users for protect
List<Dictionary<string, object>> usersProtectData = Users.getUsersForProtect(user.id);
UsersForProtect = !user.id.Equals("uid-0") ? jss.Serialize(usersProtectData) : null;
}
catch { }
}
// get the document history
private void GetHistory(out Dictionary<string, object> history, out Dictionary<string, object> historyData)
{
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
var jss = new JavaScriptSerializer();
var histDir = _Default.HistoryDir(_Default.StoragePath(FileName, null));
history = null;
historyData = null;
if (_Default.GetFileVersion(histDir) > 0) // if the file was modified (the file version is greater than 0)
{
var currentVersion = _Default.GetFileVersion(histDir);
var hist = new List<Dictionary<string, object>>();
var histData = new Dictionary<string, object>();
for (var i = 1; i <= currentVersion; i++) // run through all the file versions
{
var obj = new Dictionary<string, object>();
var dataObj = new Dictionary<string, object>();
var verDir = _Default.VersionDir(histDir, i); // get the path to the given file version
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
obj.Add("key", key);
obj.Add("version", i);
if (i == 1) // check if the version number is equal to 1
{
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
if (File.Exists(infoPath)) {
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
obj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
obj.Add("user", new Dictionary<string, object>() {
{ "id", info["id"] },
{ "name", info["name"] },
});
}
}
var ext = Path.GetExtension(FileName).ToLower();
dataObj.Add("fileType", ext.Replace(".", ""));
dataObj.Add("key", key);
// write file url to the data object
var directPrevFileUrl = i == currentVersion ? _Default.FileUri(FileName, false) : MakePublicHistoryUrl(FileName, i.ToString(), "prev" + ext, false);
var prevFileUrl = i == currentVersion ? FileUri : MakePublicHistoryUrl(FileName, i.ToString(), "prev" + ext);
if (Path.IsPathRooted(storagePath))
{
prevFileUrl = i == currentVersion ? getDownloadUrl(FileName) : getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
directPrevFileUrl = i == currentVersion ? getDownloadUrl(FileName, false) : getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
dataObj.Add("url", prevFileUrl); // write file url to the data object
if (IsEnabledDirectUrl())
{
dataObj.Add("directUrl", directPrevFileUrl); // write direct url to the data object
}
dataObj.Add("version", i);
if (i > 1) // check if the version number is greater than 1 (the file was modified)
{
// get the path to the changes.json file
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(_Default.VersionDir(histDir, i - 1), "changes.json")));
var changesArray = (ArrayList)changes["changes"];
var change = changesArray.Count > 0
? (Dictionary<string, object>)changesArray[0]
: new Dictionary<string, object>();
// write information about changes to the object
obj.Add("changes", change.Count > 0 ? changes["changes"] : null);
obj.Add("serverVersion", changes["serverVersion"]);
obj.Add("created", change.Count > 0 ? change["created"] : null);
obj.Add("user", change.Count > 0 ? change["user"] : null);
var prev = (Dictionary<string, object>)histData[(i - 2).ToString()]; // get the history data from the previous file version
Dictionary<string, object> dataPrev = new Dictionary<string, object>() { // write information about previous file version to the data object
{ "fileType", prev["fileType"] },
{ "key", prev["key"] }, // write key and url information about previous file version
{ "url", prev["url"] }
};
if (IsEnabledDirectUrl())
{
dataPrev.Add("directUrl", prev["directUrl"]);
}
dataObj.Add("previous", dataPrev);
// write the path to the diff.zip archive with differences in this file version
var changesUrl = MakePublicHistoryUrl(FileName, (i - 1).ToString(), "diff.zip");
dataObj.Add("changesUrl", changesUrl);
}
if (JwtManager.Enabled)
{
var token = JwtManager.Encode(dataObj);
dataObj.Add("token", token);
}
hist.Add(obj); // add object dictionary to the hist list
histData.Add((i - 1).ToString(), dataObj); // write data object information to the history data
}
// write history information about the current file version to the history object
history = new Dictionary<string, object>()
{
{ "currentVersion", currentVersion },
{ "history", hist }
};
historyData = histData;
}
}
// get a logo config
private Dictionary<string, object> GetLogoConfig()
{
@ -455,21 +340,21 @@ namespace OnlineEditorsExample
var InsertImageUrl = new UriBuilder(_Default.GetServerUrl(true));
InsertImageUrl.Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "App_Themes\\images\\logo.png";
+ "App_Themes\\images\\logo.svg";
var DirectImageUrl = new UriBuilder(_Default.GetServerUrl(false));
DirectImageUrl.Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "App_Themes\\images\\logo.png";
+ "App_Themes\\images\\logo.svg";
// create a logo config
Dictionary<string, object> logoConfig = new Dictionary<string, object>
{
{ "fileType", "png"},
{ "fileType", "svg"},
{ "url", InsertImageUrl.ToString()}
};
if (IsEnabledDirectUrl())
if (_Default.IsEnabledDirectUrl())
{
logoConfig.Add("directUrl", DirectImageUrl.ToString());
}
@ -506,7 +391,7 @@ namespace OnlineEditorsExample
{ "url", compareFileUrl.ToString() }
};
if (IsEnabledDirectUrl())
if (_Default.IsEnabledDirectUrl())
{
dataCompareFile.Add("directUrl", DirectFileUrl.ToString());
}
@ -520,43 +405,43 @@ namespace OnlineEditorsExample
return dataCompareFile;
}
// get a mail merge config
private Dictionary<string, object> GetMailMergeConfig()
// get a spreadsheet config
private Dictionary<string, object> GetSpreadsheetConfig()
{
// get the path to the recipients data for mail merging
var mailmergeUrl = new UriBuilder(_Default.GetServerUrl(true));
mailmergeUrl.Path =
// get the path to the recipients data for spreadsheet
var spreadsheetUrl = new UriBuilder(_Default.GetServerUrl(true));
spreadsheetUrl.Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx";
mailmergeUrl.Query = "type=csv";
spreadsheetUrl.Query = "type=csv";
var DirectMailMergeUrl = new UriBuilder(_Default.GetServerUrl(false));
DirectMailMergeUrl.Path =
var DirectSpreadsheetUrl = new UriBuilder(_Default.GetServerUrl(false));
DirectSpreadsheetUrl.Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx";
DirectMailMergeUrl.Query = "type=csv";
DirectSpreadsheetUrl.Query = "type=csv";
// create a mail merge config
Dictionary<string, object> mailMergeConfig = new Dictionary<string, object>
// create a spreadsheet config
Dictionary<string, object> spreadsheetConfig = new Dictionary<string, object>
{
{ "fileType", "csv" },
{ "url", mailmergeUrl.ToString() }
{ "url", spreadsheetUrl.ToString() }
};
if (IsEnabledDirectUrl())
if (_Default.IsEnabledDirectUrl())
{
mailMergeConfig.Add("directUrl", DirectMailMergeUrl.ToString());
spreadsheetConfig.Add("directUrl", DirectSpreadsheetUrl.ToString());
}
if (JwtManager.Enabled) // if the secret key to generate token exists
{
var mailmergeToken = JwtManager.Encode(mailMergeConfig); // encode mailMergeConfig into the token
mailMergeConfig.Add("token", mailmergeToken); // and add it to the mail merge config
var spreadsheetToken = JwtManager.Encode(spreadsheetConfig); // encode spreadsheetConfig into the token
spreadsheetConfig.Add("token", spreadsheetToken); // and add it to the spreadsheet config
}
return mailMergeConfig;
return spreadsheetConfig;
}
// get image url for templates
@ -589,21 +474,6 @@ namespace OnlineEditorsExample
return _Default.GetServerUrl(true) + fullPath.Substring(root.Length).Replace(Path.DirectorySeparatorChar, '/');
}
// create the public history url
private string MakePublicHistoryUrl(string filename, string version, string file, Boolean isServer = true)
{
var userAddress = isServer ? "&userAddress=" + HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)) : "";
var fileUrl = new UriBuilder(_Default.GetServerUrl(isServer));
fileUrl.Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx";
fileUrl.Query = "type=downloadhistory&fileName=" + HttpUtility.UrlEncode(filename)
+ "&ver=" + version + "&file=" + file
+ userAddress;
return fileUrl.ToString();
}
// create demo document
private static void Try(string type, string sample, HttpRequest request)
{
@ -626,7 +496,7 @@ namespace OnlineEditorsExample
return;
}
var demoName = (string.IsNullOrEmpty(sample) ? "new" : "sample") + ext; // create demo document name with the necessary extension
var demoPath = "assets\\" + (string.IsNullOrEmpty(sample) ? "new\\" : "sample\\"); // and put this file into the assets directory
var demoPath = "assets\\document-templates\\" + (string.IsNullOrEmpty(sample) ? "new\\" : "sample\\"); // and put this file into the assets directory
FileName = _Default.GetCorrectName(demoName); // get file name with an index if such a file name already exists
@ -652,12 +522,5 @@ namespace OnlineEditorsExample
{ "name", uname }
}));
}
// get direct url flag
private static bool IsEnabledDirectUrl()
{
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
return isEnabledDirectUrl != null ? Convert.ToBoolean(isEnabledDirectUrl) : false;
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -231,6 +231,10 @@ namespace ASC.Api.DocumentConverter
switch (errorCode)
{
case -9:
// public const int c_nErrorConversionOutputFormatError = -9;
errorMessage = String.Format(errorMessageTemplate, "Error conversion output format");
break;
case -8:
// public const int c_nErrorFileVKey = -8;
errorMessage = String.Format(errorMessageTemplate, "Error document VKey");

View File

@ -0,0 +1,192 @@
/**
*
* (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.
*
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace OnlineEditorsExample
{
public class Format
{
public string Name { get; }
public string Type { get; }
public List<string> Actions { get; }
public List<string> Convert { get; }
public List<string> Mime { get; }
public Format(string name, string type, List<string> actions, List<string> convert, List<string> mime)
{
Name = name;
Type = type;
Actions = actions;
Convert = convert;
Mime = mime;
}
public string Extension()
{
return "." + Name;
}
}
public class FormatManager
{
private static List<Format> cachedFormats;
public static List<string> FillableExtensions()
{
return Fillable()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Fillable()
{
return All()
.Where(format => format.Actions.Contains("fill"))
.ToList();
}
public static List<string> ViewableExtensions()
{
return Viewable()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Viewable()
{
return All()
.Where(format => format.Actions.Contains("view"))
.ToList();
}
public static List<string> EditableExtensions()
{
return Editable()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Editable()
{
return All()
.Where(format => format.Actions.Contains("edit") || format.Actions.Contains("lossy-edit"))
.ToList();
}
public static List<string> ConvertibleExtensions()
{
return Convertible()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Convertible()
{
return All()
.Where(format => format.Actions.Contains("auto-convert"))
.ToList();
}
public static List<string> SpreadsheetExtensions()
{
return Spreadsheets()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Spreadsheets()
{
return All()
.Where(format => format.Type == "cell")
.ToList();
}
public static List<string> PresentationExtensions()
{
return Presentations()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Presentations()
{
return All()
.Where(format => format.Type == "slide")
.ToList();
}
public static List<string> DocumentExtensions()
{
return Documents()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> Documents()
{
return All()
.Where(format => format.Type == "word")
.ToList();
}
public static List<string> AllExtensions()
{
return All()
.Select(format => format.Extension())
.ToList();
}
public static List<Format> All()
{
if (cachedFormats == null) {
var path = GetPath();
var lines = File.ReadLines(path, Encoding.UTF8);
var contents = string.Join(Environment.NewLine, lines);
var formats = JsonConvert.DeserializeObject<Format[]>(contents);
cachedFormats = formats.ToList();
}
return cachedFormats;
}
private static string GetPath()
{
string path = Path.Combine(GetDirectory(), "onlyoffice-docs-formats.json");
if (File.Exists(path))
{
return path;
}
else
{
throw new FileNotFoundException("The JSON file does not exist.");
}
}
private static string GetDirectory()
{
string directory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets", "document-formats");
return Path.GetFullPath(directory);
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -119,6 +119,7 @@
<DependentUpon>DocEditor.aspx</DependentUpon>
</Compile>
<Compile Include="DocumentConverter.cs" />
<Compile Include="FormatManager.cs" />
<Compile Include="JwtManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Default.aspx.cs">
@ -144,11 +145,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="App_Themes\images\loader16.gif" />
<Content Include="App_Themes\images\logo.png" />
<Content Include="App_Themes\jquery-ui.css" />
<Content Include="App_Themes\stylesheet.css" />
<Content Include="DocEditor.aspx" />
<Content Include="script\jquery-1.9.0.min.js" />
<Content Include="script\jquery-ui.min.js" />
<Content Include="script\jquery.blockUI.js" />
<Content Include="script\jquery.dropdownToggle.js" />
@ -158,17 +157,23 @@
<Content Include="WebEditor.ashx" />
</ItemGroup>
<ItemGroup>
<Content Include="assets\AUTHORS.md" />
<Content Include="assets\LICENSE" />
<Content Include="assets\new\new.docx" />
<Content Include="assets\new\new.docxf" />
<Content Include="assets\new\new.pptx" />
<Content Include="assets\new\new.xlsx" />
<Content Include="assets\sample\csv.csv" />
<Content Include="assets\sample\sample.docx" />
<Content Include="assets\sample\sample.docxf" />
<Content Include="assets\sample\sample.pptx" />
<Content Include="assets\sample\sample.xlsx" />
<Content Include="assets\document-formats\AUTHORS.md" />
<Content Include="assets\document-formats\CHANGELOG.md" />
<Content Include="assets\document-formats\LICENSE" />
<Content Include="assets\document-formats\onlyoffice-docs-formats.json" />
<Content Include="assets\document-formats\README.md" />
<Content Include="assets\document-templates\AUTHORS.md" />
<Content Include="assets\document-templates\LICENSE" />
<Content Include="assets\document-templates\new\new.docx" />
<Content Include="assets\document-templates\new\new.docxf" />
<Content Include="assets\document-templates\new\new.pptx" />
<Content Include="assets\document-templates\new\new.xlsx" />
<Content Include="assets\document-templates\README.md" />
<Content Include="assets\document-templates\sample\csv.csv" />
<Content Include="assets\document-templates\sample\sample.docx" />
<Content Include="assets\document-templates\sample\sample.docxf" />
<Content Include="assets\document-templates\sample\sample.pptx" />
<Content Include="assets\document-templates\sample\sample.xlsx" />
<None Include="packages.config" />
</ItemGroup>
<PropertyGroup>

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExample")]
[assembly: AssemblyCopyright("Ascensio System SIA 2023")]
[assembly: AssemblyCopyright("Ascensio System SIA 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -258,6 +258,22 @@ namespace OnlineEditorsExample
var action = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(actions[0]));
var user = action["userid"].ToString(); // get the user id
DocEditor.CreateMeta(fileName, user, "Filling Form", userAddress); // create meta data for the forcesaved file
string formsDataUrl = fileData["formsdataurl"].ToString();
if (!string.IsNullOrEmpty(formsDataUrl))
{
string formsName = _Default.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + ".txt", userAddress);
string formsPath = _Default.StoragePath(formsName, userAddress);
var bytesForms = DownloadFile(formsDataUrl);
SaveFile(bytesForms, formsPath);
}
else
{
throw new Exception("Document editing service did not return formsDataUrl");
}
}
}
catch (Exception)

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -30,7 +30,9 @@ namespace OnlineEditorsExample
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can create files from templates using data from the editor",
"Can see the information about all users"
"Can see the information about all users",
"Has an avatar",
"Can submit forms"
};
static List<string> descr_user_2 = new List<string>()
@ -40,7 +42,9 @@ namespace OnlineEditorsExample
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
"This file is marked as favorite",
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
"Can see the information about users from Group2 and users who dont belong to any group",
"Has an avatar",
"Cant submit forms"
};
static List<string> descr_user_3 = new List<string>()
@ -53,7 +57,10 @@ namespace OnlineEditorsExample
"Cant download the file",
"Cant print the file",
"Can create new files from the editor",
"Can see the information about Group2 users"
"Can see the information about Group2 users",
"Cant submit forms",
"Can't close history",
"Can't restore the file version"
};
static List<string> descr_user_0 = new List<string>()
@ -70,6 +77,7 @@ namespace OnlineEditorsExample
"Can't view chat",
"Can't protect file",
"View file without collaboration",
"Cant submit forms"
};
private static List<User> users = new List<User>() {
@ -84,7 +92,9 @@ namespace OnlineEditorsExample
null,
new List<string>(),
descr_user_1,
true
true,
true,
new Goback(null, false)
),
new User(
"uid-2",
@ -102,12 +112,14 @@ namespace OnlineEditorsExample
true,
new List<string>(),
descr_user_2,
false
false,
true,
new Goback("Go to Documents",null)
),
new User(
"uid-3",
"Hamish Mitchell",
"mitchell@example.com",
null,
"group-3",
new List<string>() { "group-2" },
new Dictionary<string,object>()
@ -120,7 +132,9 @@ namespace OnlineEditorsExample
false,
new List<string>() { "copy", "download", "print" },
descr_user_3,
false
false,
false,
null
),
new User(
"uid-0",
@ -133,7 +147,9 @@ namespace OnlineEditorsExample
null,
new List<string>() { "protect" },
descr_user_0,
false
false,
false,
null
)
};
@ -171,6 +187,44 @@ namespace OnlineEditorsExample
}
return usersData;
}
public static List<Dictionary<string, object>> getUsersInfo(string id)
{
List<Dictionary<string, object>> usersData = new List<Dictionary<string, object>>();
if(id != "uid-0"){
foreach (User user in users)
{
usersData.Add(new Dictionary<string, object>()
{
{"id", user.id},
{"name", user.name },
{"email", user.email },
{"image", user.avatar ? _Default.GetServerUrl(false) + "/App_Themes/images/"+ user.id + ".png" : null }
});
}
}
return usersData;
}
// get a list of users with their names and emails for protect
public static List<Dictionary<string, object>> getUsersForProtect(string id)
{
List<Dictionary<string, object>> usersData = new List<Dictionary<string, object>>();
foreach (User user in users)
{
if (!user.id.Equals(id) && user.name != null)
{
usersData.Add(new Dictionary<string, object>()
{
{"name", user.name },
{"email", user.email },
{"id", user.id}
});
}
}
return usersData;
}
}
public class User
@ -186,8 +240,10 @@ namespace OnlineEditorsExample
public List<string> descriptions;
public bool templates;
public List<string> userInfoGroups;
public bool avatar;
public 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)
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)
{
this.id = id;
this.name = name;
@ -200,6 +256,22 @@ namespace OnlineEditorsExample
this.descriptions = descriptions;
this.templates = templates;
this.userInfoGroups = userInfoGroups;
this.avatar = avatar;
this.goback = goback;
}
}
public class Goback
{
public string text;
public bool? blank;
public Goback(){}
public Goback(string text, bool? blank)
{
this.text = text;
this.blank = blank;
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -26,7 +26,10 @@ using System.Diagnostics;
using System.Web.Configuration;
using System.Linq;
using System.Net;
using System.Collections;
using System.Net.Sockets;
using ASC.Api.DocumentConverter;
using Newtonsoft.Json;
namespace OnlineEditorsExample
{
@ -48,6 +51,15 @@ namespace OnlineEditorsExample
case "downloadhistory":
DownloadHistory(context);
break;
case "gethistory":
GetHistory(context);
break;
case "getversiondata":
GetVersionData(context);
break;
case "restore":
Restore(context);
break;
case "convert":
Convert(context);
break;
@ -75,6 +87,9 @@ namespace OnlineEditorsExample
case "reference":
Reference(context);
break;
case "formats":
Formats(context);
break;
}
}
@ -210,12 +225,22 @@ namespace OnlineEditorsExample
context.Response.ContentType = "text/plain";
try
{
var fileName = Path.GetFileName(context.Request["fileName"]);
var path = _Default.StoragePath(fileName, HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)));
var histDir = _Default.HistoryDir(path);
string fileName = context.Request["fileName"];
string userAddress = HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress));
if (File.Exists(path)) File.Delete(path); // delete file
if (Directory.Exists(histDir)) Directory.Delete(histDir, true); // delete file history
if (!String.IsNullOrEmpty(fileName))
{
fileName = Path.GetFileName(fileName);
var path = _Default.StoragePath(fileName, userAddress);
var histDir = _Default.HistoryDir(path);
if (File.Exists(path)) File.Delete(path); // delete file
if (Directory.Exists(histDir)) Directory.Delete(histDir, true); // delete file history
} else
{
string userDir = _Default.StoragePath("", userAddress);
if (Directory.Exists(userDir)) Directory.Delete(userDir, true); // delete the user's directory
}
context.Response.Write("{ \"success\": true }");
}
@ -264,7 +289,7 @@ namespace OnlineEditorsExample
private static void Assets(HttpContext context)
{
var fileName = Path.GetFileName(context.Request["filename"]);
var filePath = HttpRuntime.AppDomainAppPath + "assets/sample/" + fileName;
var filePath = HttpRuntime.AppDomainAppPath + "assets/document-templates/sample/" + fileName;
download(filePath, context);
}
@ -272,7 +297,7 @@ namespace OnlineEditorsExample
private static void GetCsv(HttpContext context)
{
var fileName = "csv.csv";
var filePath = HttpRuntime.AppDomainAppPath + "assets/sample/" + fileName;
var filePath = HttpRuntime.AppDomainAppPath + "assets/document-templates/sample/" + fileName;
download(filePath, context);
}
@ -333,6 +358,164 @@ namespace OnlineEditorsExample
get { return false; }
}
private static void GetHistory(HttpContext context)
{
var jss = new JavaScriptSerializer();
var fileName = context.Request["filename"];
var history = GetHistory(fileName);
context.Response.Write(jss.Serialize(history));
}
private static void GetVersionData(HttpContext context)
{
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
var jss = new JavaScriptSerializer();
var fileName = context.Request["filename"];
int version;
if (!int.TryParse(context.Request["version"], out version))
{
context.Response.Write("{ \"error\": \"Version number invalid!\"}");
return;
}
var versionData = new Dictionary<string, object>();
var histDir = _Default.HistoryDir(_Default.StoragePath(fileName, null));
var lastVersion = _Default.GetFileVersion(histDir);
var verDir = _Default.VersionDir(histDir, version);
var lastVersionUri = _Default.FileUri(fileName, true);
var key = version == lastVersion
? ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
+ "/" + Path.GetFileName(lastVersionUri)
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode())
: File.ReadAllText(Path.Combine(verDir, "key.txt"));
var ext = Path.GetExtension(fileName).ToLower();
versionData.Add("fileType", ext.Replace(".", ""));
versionData.Add("key", key);
var directPrevFileUrl = version == lastVersion ? _Default.FileUri(fileName, false) : MakePublicHistoryUrl(fileName, version.ToString(), "prev" + ext, false);
var prevFileUrl = version == lastVersion ? lastVersionUri : MakePublicHistoryUrl(fileName, version.ToString(), "prev" + ext);
if (Path.IsPathRooted(storagePath))
{
prevFileUrl = version == lastVersion ? DocEditor.getDownloadUrl(fileName) : DocEditor.getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
directPrevFileUrl = version == lastVersion ? DocEditor.getDownloadUrl(fileName, false) : DocEditor.getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
versionData.Add("url", prevFileUrl);
if (_Default.IsEnabledDirectUrl())
{
versionData.Add("directUrl", directPrevFileUrl); // write direct url to the data object
}
versionData.Add("version", version);
if (version > 1)
{
var prevVerDir = _Default.VersionDir(histDir, version - 1);
var prevUrl = MakePublicHistoryUrl(fileName, (version - 1).ToString(), "prev" + ext);
if (Path.IsPathRooted(storagePath))
prevUrl = DocEditor.getDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""));
var prevKey = File.ReadAllText(Path.Combine(prevVerDir, "key.txt"));
Dictionary<string, object> dataPrev = new Dictionary<string, object>() { // write information about previous file version to the data object
{ "fileType", ext.Replace(".", "") },
{ "key", prevKey }, // write key and url information about previous file version
{ "url", prevUrl }
};
string directPrevUrl;
if (_Default.IsEnabledDirectUrl())
{
directPrevUrl = Path.IsPathRooted(storagePath)
? DocEditor.getDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""), false)
: MakePublicHistoryUrl(fileName, (version - 1).ToString(), "prev" + ext, false);
dataPrev.Add("directUrl", directPrevUrl); // write direct url to the data object
}
versionData.Add("previous", dataPrev);
if (File.Exists(Path.Combine(prevVerDir, "diff.zip")))
{
var changesUrl = MakePublicHistoryUrl(fileName, (version - 1).ToString(), "diff.zip");
versionData.Add("changesUrl", changesUrl);
}
}
if (JwtManager.Enabled)
{
var token = JwtManager.Encode(versionData);
versionData.Add("token", token);
}
context.Response.Write(jss.Serialize(versionData));
}
private void Restore(HttpContext context)
{
string fileData;
try
{
using (var receiveStream = context.Request.InputStream)
using (var readStream = new StreamReader(receiveStream))
{
fileData = readStream.ReadToEnd();
if (string.IsNullOrEmpty(fileData)) return;
}
}
catch (Exception e)
{
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
}
var jss = new JavaScriptSerializer();
var body = jss.Deserialize<Dictionary<string, object>>(fileData);
var fileName = (string)body["fileName"];
var version = (int)body["version"];
var lastVersionUri = _Default.FileUri(fileName, true);
var key = ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
+ "/" + Path.GetFileName(lastVersionUri)
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode());
var histDir = _Default.HistoryDir(_Default.StoragePath(fileName, null));
var currentVersionDir = _Default.VersionDir(histDir, _Default.GetFileVersion(histDir));
var verDir = _Default.VersionDir(histDir, version);
if (!Directory.Exists(currentVersionDir)) Directory.CreateDirectory(currentVersionDir);
var ext = Path.GetExtension(fileName).ToLower();
File.Copy(_Default.StoragePath(fileName, null), Path.Combine(currentVersionDir, "prev" + ext));
File.WriteAllText(Path.Combine(currentVersionDir, "key.txt"), key);
var changesPath = Path.Combine(_Default.VersionDir(histDir, version - 1), "changes.json");
if (File.Exists(changesPath))
{
File.Copy(changesPath, Path.Combine(currentVersionDir, "changes.json"));
}
File.Copy(Path.Combine(verDir, "prev" + ext), _Default.StoragePath(fileName, null), true);
var fileInfo = new FileInfo(_Default.StoragePath(fileName, null));
fileInfo.LastWriteTimeUtc = DateTime.UtcNow;
var history = GetHistory(fileName);
context.Response.Write(jss.Serialize(history));
}
private static void DownloadHistory(HttpContext context)
{
try
@ -453,6 +636,27 @@ namespace OnlineEditorsExample
}
}
if (fileName == "" && body.ContainsKey("link"))
{
string link = body["link"].ToString();
if (!link.Contains(_Default.GetServerUrl(false)))
{
context.Response.Write(jss.Serialize(new Dictionary<string, string>() {
{ "url", link },
{ "directUrl", link }
}));
return;
}
Uri linkUri = new Uri(link);
fileName = HttpUtility.ParseQueryString(linkUri.Query).Get("fileID");
if (string.IsNullOrEmpty(fileName) || !File.Exists(_Default.StoragePath(fileName, null)))
{
context.Response.Write("{ \"error\": \"File is not exist\"}");
return;
}
}
if (fileName == "")
{
try
@ -481,6 +685,9 @@ namespace OnlineEditorsExample
var data = new Dictionary<string, object>() {
{ "fileType", (Path.GetExtension(fileName) ?? "").ToLower().Trim('.') },
{ "key", ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
+ "/" + Path.GetFileName(_Default.FileUri(fileName, true))
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode()) },
{ "url", DocEditor.getDownloadUrl(fileName)},
{ "directUrl", directUrl ? DocEditor.getDownloadUrl(fileName, false) : null},
{ "referenceData", new Dictionary<string, string>()
@ -493,7 +700,8 @@ namespace OnlineEditorsExample
{"instanceId", _Default.GetServerUrl(false) }
}
},
{ "path", fileName }
{ "path", fileName },
{ "link", _Default.GetServerUrl(false) + "doceditor.aspx?fileID=" + fileName }
};
if (JwtManager.Enabled)
@ -504,5 +712,104 @@ namespace OnlineEditorsExample
context.Response.Write(jss.Serialize(data));
}
// get the document history
private static Dictionary<string, object> GetHistory(string fileName)
{
var jss = new JavaScriptSerializer();
var histDir = _Default.HistoryDir(_Default.StoragePath(fileName, null));
var history = new Dictionary<string, object>();
var currentVersion = _Default.GetFileVersion(histDir);
var currentFileUri = _Default.FileUri(fileName, true);
var currentKey = ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
+ "/" + Path.GetFileName(currentFileUri)
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode());
var versionList = new List<Dictionary<string, object>>();
for (var versionNum = 1; versionNum <= currentVersion; versionNum++)
{
var versionObj = new Dictionary<string, object>();
var verDir = _Default.VersionDir(histDir, versionNum); // get the path to the given file version
var key = versionNum == currentVersion ? currentKey : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
versionObj.Add("key", key);
versionObj.Add("version", versionNum);
var changesPath = Path.Combine(_Default.VersionDir(histDir, versionNum - 1), "changes.json");
if (versionNum == 1 || !File.Exists(changesPath)) // check if the version number is equal to 1
{
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
if (File.Exists(infoPath))
{
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
versionObj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
versionObj.Add("user", new Dictionary<string, object>()
{
{ "id", info["id"] },
{ "name", info["name"] },
});
}
}
else if (versionNum > 1) // check if the version number is greater than 1 (the file was modified)
{
// get the path to the changes.json file
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(changesPath));
var changesArray = (ArrayList)changes["changes"];
var change = changesArray.Count > 0
? (Dictionary<string, object>)changesArray[0]
: new Dictionary<string, object>();
// write information about changes to the object
versionObj.Add("changes", change.Count > 0 ? changes["changes"] : null);
versionObj.Add("serverVersion", changes["serverVersion"]);
versionObj.Add("created", change.Count > 0 ? change["created"] : null);
versionObj.Add("user", change.Count > 0 ? change["user"] : null);
}
versionList.Add(versionObj);
}
history.Add("currentVersion", currentVersion);
history.Add("history", versionList);
return history;
}
// create the public history url
private static string MakePublicHistoryUrl(string filename, string version, string file, Boolean isServer = true)
{
var userAddress = isServer ? "&userAddress=" + HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)) : "";
var fileUrl = new UriBuilder(_Default.GetServerUrl(isServer));
fileUrl.Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx";
fileUrl.Query = "type=downloadhistory&fileName=" + HttpUtility.UrlEncode(filename)
+ "&ver=" + version + "&file=" + file
+ userAddress;
return fileUrl.ToString();
}
// return all the supported formats
private static void Formats(HttpContext context)
{
try
{
Dictionary<string, object> data = new Dictionary<string, object>
{
{ "formats", FormatManager.All() }
};
context.Response.ContentType = "application/json";
var jss = new JavaScriptSerializer();
context.Response.Write(jss.Serialize(data));
}
catch (Exception e)
{
context.Response.Write("{ \"error\": \"" + e.Message + "\"}");
}
}
}
}

View File

@ -0,0 +1,66 @@
/**
*
* (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.
*
*/
class Format {
constructor(name, type, actions, convert, mime) {
this.name = name;
this.type = type;
this.actions = actions;
this.convert = convert;
this.mime = mime;
}
isAutoConvertible() {
return this.actions.includes('auto-convert');
}
isEditable() {
return this.actions.includes('edit') || this.actions.includes('lossy-edit');
}
isFillable() {
return this.actions.includes('fill');
}
}
class FormatManager {
formats = [];
constructor(formats) {
if(Array.isArray(formats)) this.formats = formats;
}
findByExtension(extension) {
return this.formats.find(format => format.name == extension);
}
isAutoConvertible(extension) {
let format = this.findByExtension(extension);
return format !== undefined && format.isAutoConvertible();
}
isEditable(extension) {
let format = this.findByExtension(extension);
return format !== undefined && format.isEditable();
}
isFillable(extension) {
let format = this.findByExtension(extension);
return format !== undefined && format.isFillable();
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -17,6 +17,27 @@
*/
var directUrl;
var formatManager;
window.onload = function () {
fetch("webeditor.ashx?type=formats")
.then((response) => response.json())
.then((data) => {
if (data.formats) {
let formats = [];
data.formats.forEach(format => {
formats.push(new Format(
format.Name,
format.Type,
format.Actions,
format.Convert,
format.Mime
));
});
formatManager = new FormatManager(formats);
}
})
}
if (typeof jQuery != "undefined") {
jq = jQuery.noConflict();
@ -87,7 +108,7 @@ if (typeof jQuery != "undefined") {
});
var timer = null;
var checkConvert = function (filePass) {
var checkConvert = function (filePass, fileType) {
filePass = filePass ? filePass : null;
if (timer != null) {
clearTimeout(timer);
@ -103,7 +124,7 @@ if (typeof jQuery != "undefined") {
var posExt = fileName.lastIndexOf('.');
posExt = 0 <= posExt ? fileName.substring(posExt).trim().toLowerCase() : '';
if (ConverExtList.indexOf(posExt) == -1) {
if (!formatManager.isAutoConvertible(posExt)) {
jq("#step2").addClass("done").removeClass("current");
loadScripts();
return;
@ -116,7 +137,7 @@ if (typeof jQuery != "undefined") {
contentType: "text/xml",
type: "post",
dataType: "json",
data: JSON.stringify({ filename: fileName, filePass: filePass }),
data: JSON.stringify({ filename: fileName, filePass: filePass, fileExt: fileType }),
url: requestAddress,
complete: function (data) {
var responseText = data.responseText;
@ -132,6 +153,12 @@ if (typeof jQuery != "undefined") {
}
return;
} else {
if (response.error.includes("Error conversion output format")) {
jq("#select-file-type").removeClass("invisible");
jq("#step2").removeClass("current");
jq("#hiddenFileName").attr("placeholder", filePass);
return;
}
jq(".current").removeClass("current");
jq(".step:not(.done)").addClass("error");
jq("#mainProgress .error-message").show().find("span").text(response.error);
@ -143,7 +170,7 @@ if (typeof jQuery != "undefined") {
jq("#hiddenFileName").val(response.filename);
if (response.step && response.step < 100) {
checkConvert(filePass);
checkConvert(filePass, fileType);
} else {
jq("#step2").addClass("done").removeClass("current");
loadScripts();
@ -178,10 +205,10 @@ if (typeof jQuery != "undefined") {
jq("#beginView, #beginEmbedded").removeClass("disable");
var fileName = jq("#hiddenFileName").val();
var posExt = fileName.lastIndexOf('.');
var posExt = fileName.lastIndexOf('.') + 1;
posExt = 0 <= posExt ? fileName.substring(posExt).trim().toLowerCase() : '';
if (EditedExtList.indexOf(posExt) != -1 || FillFormExtList.indexOf(posExt) != -1) {
if (formatManager.isEditable(posExt) || formatManager.isFillable(posExt)) {
jq("#beginEdit").removeClass("disable");
}
};
@ -213,6 +240,15 @@ if (typeof jQuery != "undefined") {
});
};
jq(document).on("click", ".file-type:not(.disable)", function () {
const currentElement = jq(this);
var fileType = currentElement.attr("data");
var filePass = jq("#hiddenFileName").attr("placeholder");
jq('.file-type').addClass(["disable", "pale"]);
currentElement.removeClass("pale");
checkConvert(filePass, fileType);
});
jq(document).on("click", "#enterPass", function () {
var filePass = jq("#filePass").val();
if (filePass) {
@ -293,6 +329,24 @@ if (typeof jQuery != "undefined") {
});
});
jq(document).on("click", ".clear-all", function () {
if (confirm("Delete all the files?")) {
var requestAddress = "webeditor.ashx"
+ "?type=remove";
jq.ajax({
async: true,
contentType: "text/xml",
url: requestAddress,
complete: function (data) {
if (JSON.parse(data.responseText).success) {
window.location.reload(true);
}
}
});
}
});
function showUserTooltip (isMobile) {
if ( jq("div#portal-info").is(":hidden") ) {
jq("div#portal-info").show();

View File

@ -1,15 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<clear />
<add key="version" value="1.6.0"/>
<add key="version" value="1.8.0"/>
<add key="filesize-max" value="52428800"/>
<add key="storage-path" value=""/>
<add key="filename-max" value="50"/>
<add key="files.docservice.fillform-docs" value=".docx|.oform"/>
<add key="files.docservice.viewed-docs" value=".djvu|.oxps|.pdf|.xps"/>
<add key="files.docservice.edited-docs" value=".csv|.docm|.docx|.docxf|.dotm|.dotx|.epub|.fb2|.html|.odp|.ods|.odt|.otp|.ots|.ott|.potm|.potx|.ppsm|.ppsx|.pptm|.pptx|.rtf|.txt|.xlsm|.xlsx|.xltm|.xltx"/>
<add key="files.docservice.convert-docs" value=".doc|.dot|.dps|.dpt|.epub|.et|.ett|.fb2|.fodp|.fods|.fodt|.htm|.html|.mht|.mhtml|.odp|.ods|.odt|.otp|.ots|.ott|.pot|.pps|.ppt|.rtf|.stw|.sxc|.sxi|.sxw|.wps|.wpt|.xls|.xlsb|.xlt|.xml"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.secret" value="" />
<add key="files.docservice.header" value="Authorization" />
@ -17,7 +14,7 @@
<add key="files.docservice.token.useforrequest" value="true" />
<add key="files.docservice.languages" value="en:English|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|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
<add key="files.docservice.languages" value="en:English|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Latn-RS:Serbian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
<add key="files.docservice.url.site" value="http://documentserver/"/>

View File

@ -20,7 +20,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
Download the [Java-Spring 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 port and the path to the storage folder in the *\src\main\resources\application.properties* file:
To connect the editors to your website, specify the path to the editors installation, server port and the path to the storage folder in the *src/main/resources/application.properties* file:
```
files.storage=
@ -128,22 +128,18 @@ See the detailed guide to learn how to install Document Server [for Linux](https
### Step 2. Install the prerequisites and run the website with the editors
1. Install **Java**:
```
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java11-installer
```
1. Install **Java** following the instructions [here](https://docs.oracle.com/en/java/javase/20/install/installation-jdk-linux-platforms.html#GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8).
2. Download the archive with the Java-Spring example and unpack the archive or clone git repository:
a) archive with Java-Spring:
```
wget https://api.onlyoffice.com/app_data/editor/Java%20Spring%20Example.zip
wget https://api.onlyoffice.com/app_data/editor/Java.Spring.Example.zip
```
```
unzip Java\ Spring\ Example.zip
unzip Java.Spring.Example.zip
```
b) git repository:
```
@ -162,7 +158,7 @@ See the detailed guide to learn how to install Document Server [for Linux](https
```
cd document-server-integration/web/documentserver-example/java-spring
```
4. Edit the *application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.
4. Edit the *src/main/resources/application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.
```
nano src/main/resources/application.properties
@ -210,13 +206,51 @@ Make sure that the Document Server has access to the server with the example ins
## For Docker
1. Edit the *application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed ([installation instructions](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx)).
### 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 Docker](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx).
### Step 2. Install the prerequisites and run the website with the editors
1. Install **Java** following the instructions [here](https://docs.oracle.com/en/java/javase/20/install/installation-jdk-linux-platforms.html#GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8).
2. Download the archive with the Java-Spring example and unpack the archive or clone git repository:
a) archive with Java-Spring:
```
wget https://api.onlyoffice.com/app_data/editor/Java.Spring.Example.zip
```
```
unzip Java.Spring.Example.zip
```
b) git repository:
```
git clone https://github.com/ONLYOFFICE/document-server-integration.git
```
3. Change the current directory for the project directory:
a) from archive
```
cd Java\ Spring\ Example/
```
b) from git repository
```
cd document-server-integration/web/documentserver-example/java-spring
```
4. Edit the *src/main/resources/application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed:
```
nano src/main/resources/application.properties
```
2. Edit the following lines:
5. Edit the following lines:
```
files.storage=
@ -226,17 +260,23 @@ Make sure that the Document Server has access to the server with the example ins
where the **documentserver** is the name of the server with the ONLYOFFICE Docs installed, **port** is any available port and **files.storage** is the path where files will be created and stored (in the project folder by default). You can set an absolute path.
3. Run the next command in the java example directory:
6. Run the next command in the java example directory:
```
docker-compose up
```
4. Open your browser using **server.address** and **server.port**:
7. Open your browser using **server.address** and **server.port**:
```
http://server.address:server.port/
```
### Step 3. 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.
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
## Important security info
Please keep in mind the following security aspects when you are using test examples:

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -19,6 +19,7 @@
package com.onlyoffice.integration;
import com.onlyoffice.integration.documentserver.serializers.FilterState;
import com.onlyoffice.integration.entities.Goback;
import com.onlyoffice.integration.services.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -46,7 +47,8 @@ public class ExampleData {
"Can't rename files from the editor",
"Can't view chat",
"Can't protect file",
"View file without collaboration"
"View file without collaboration",
"Cant submit forms"
);
// the description for user 1
@ -58,7 +60,9 @@ public class ExampleData {
"The file favorite state is undefined",
"Can create a file from a template with data from the editor",
"Can see the information about all users",
"Can view chat"
"Can view chat",
"Has an avatar",
"Can submit forms"
);
// the description for user 2
@ -71,7 +75,9 @@ public class ExampleData {
"This file is favorite",
"Can create a file from an editor",
"Can see the information about users from Group2 and users who dont belong to any group",
"Can view chat"
"Can view chat",
"Has an avatar",
"Cant submit forms"
);
// the description for user 3
@ -86,30 +92,33 @@ public class ExampleData {
"He cant print the file",
"Can create a file from an editor",
"Can see the information about Group2 users",
"Can view chat"
"Can view chat",
"Cant submit forms",
"Can't close history",
"Can't restore the file version"
);
// create user 1 with the specified parameters
userService.createUser("John Smith", "smith@example.com", descriptionUserFirst,
"", List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), null, true, true);
List.of(FilterState.NULL.toString()), null, true, true, true, new Goback(null, false));
// create user 2 with the specified parameters
userService.createUser("Mark Pottato", "pottato@example.com", descriptionUserSecond,
"group-2", List.of("", "group-2"), List.of(FilterState.NULL.toString()),
List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true, true,
true);
true, true, new Goback("Go to Documents", null));
// create user 3 with the specified parameters
userService.createUser("Hamish Mitchell", "mitchell@example.com", descriptionUserThird,
userService.createUser("Hamish Mitchell", null, descriptionUserThird,
"group-3", List.of("group-2"), List.of("group-2", "group-3"), List.of("group-2"),
new ArrayList<>(), List.of("group-2"), false, true, true);
new ArrayList<>(), List.of("group-2"), false, true, true, false, null);
// create user 0 with the specified parameters
userService.createUser("Anonymous", null, descriptionUserZero, "",
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
new ArrayList<>(), null, false, false);
new ArrayList<>(), null, false, false, false, null);
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -20,12 +20,13 @@ package com.onlyoffice.integration.controllers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
import com.onlyoffice.integration.documentserver.models.enums.Action;
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
import com.onlyoffice.integration.entities.User;
import com.onlyoffice.integration.dto.Mentions;
import com.onlyoffice.integration.dto.UserInfo;
import com.onlyoffice.integration.dto.Protect;
import com.onlyoffice.integration.documentserver.models.enums.Type;
import com.onlyoffice.integration.documentserver.models.filemodel.FileModel;
import com.onlyoffice.integration.services.UserServices;
@ -73,9 +74,6 @@ public class EditorController {
@Autowired
private UserServices userService;
@Autowired
private HistoryManager historyManager;
@Autowired
private ObjectMapper objectMapper;
@ -121,6 +119,8 @@ public class EditorController {
}
User user = optionalUser.get();
user.setImage(user.getAvatar() ? storagePathBuilder.getServerUrl(true) + "/css/img/uid-"
+ user.getId() + ".png" : null);
// get file model with the default file parameters
FileModel fileModel = fileConfigurer.getFileModel(
@ -140,9 +140,6 @@ public class EditorController {
// add file model with the default parameters to the original model
model.addAttribute("model", fileModel);
// get file history and add it to the model
model.addAttribute("fileHistory", historyManager.getHistory(fileModel.getDocument()));
// create the document service api URL and add it to the model
model.addAttribute("docserviceApiUrl", docserviceSite + docserviceApiUrl);
@ -150,13 +147,19 @@ public class EditorController {
model.addAttribute("dataInsertImage", getInsertImage(directUrl));
// get a document for comparison and add it to the model
model.addAttribute("dataCompareFile", getCompareFile(directUrl));
model.addAttribute("dataDocument", getCompareFile(directUrl));
// get recipients data for mail merging and add it to the model
model.addAttribute("dataMailMergeRecipients", getMailMerge(directUrl));
model.addAttribute("dataSpreadsheet", getSpreadsheet(directUrl));
// get user data for mentions and add it to the model
model.addAttribute("usersForMentions", getUserMentions(uid));
model.addAttribute("usersInfo", getUsersInfo(uid));
// get user data for protect and add it to the model
model.addAttribute("usersForProtect", getUserProtect(uid));
return "editor.html";
}
@ -176,14 +179,44 @@ public class EditorController {
return usersForMentions;
}
private List<UserInfo> getUsersInfo(final String uid) { // get user data for mentions
List<UserInfo> usersInfo = new ArrayList<>();
if (uid != null && !uid.equals("4")) {
List<User> list = userService.findAll();
for (User u : list) {
String image = u.getAvatar() ? storagePathBuilder.getServerUrl(true) + "/css/img/uid-"
+ u.getId() + ".png" : null;
usersInfo.add(new UserInfo(u.getId(), u.getName(), u.getEmail(), image));
}
}
return usersInfo;
}
private List<Protect> getUserProtect(final String uid) { // get user data for protect
List<Protect> usersForProtect = new ArrayList<>();
if (uid != null && !uid.equals("4")) {
List<User> list = userService.findAll();
for (User u : list) {
if (u.getId() != Integer.parseInt(uid) && u.getId() != ANONYMOUS_USER_ID) {
// user data includes user names, IDs and emails
usersForProtect.add(new Protect(u.getId(), u.getName(), u.getEmail()));
}
}
}
return usersForProtect;
}
@SneakyThrows
private String getInsertImage(final Boolean directUrl) { // get an image that will be inserted into the document
Map<String, Object> dataInsertImage = new HashMap<>();
dataInsertImage.put("fileType", "png");
dataInsertImage.put("url", storagePathBuilder.getServerUrl(true) + "/css/img/logo.png");
dataInsertImage.put("fileType", "svg");
dataInsertImage.put("url", storagePathBuilder.getServerUrl(true) + "/css/img/logo.svg");
if (directUrl) {
dataInsertImage.put("directUrl", storagePathBuilder
.getServerUrl(false) + "/css/img/logo.png");
.getServerUrl(false) + "/css/img/logo.svg");
}
// check if the document token is enabled
@ -200,40 +233,40 @@ public class EditorController {
// get a document that will be compared with the current document
@SneakyThrows
private String getCompareFile(final Boolean directUrl) {
Map<String, Object> dataCompareFile = new HashMap<>();
dataCompareFile.put("fileType", "docx");
dataCompareFile.put("url", storagePathBuilder.getServerUrl(true) + "/assets?name=sample.docx");
Map<String, Object> dataDocument = new HashMap<>();
dataDocument.put("fileType", "docx");
dataDocument.put("url", storagePathBuilder.getServerUrl(true) + "/assets?name=sample.docx");
if (directUrl) {
dataCompareFile.put("directUrl", storagePathBuilder
dataDocument.put("directUrl", storagePathBuilder
.getServerUrl(false) + "/assets?name=sample.docx");
}
// check if the document token is enabled
if (jwtManager.tokenEnabled()) {
// create token from the dataCompareFile object
dataCompareFile.put("token", jwtManager.createToken(dataCompareFile));
// create token from the dataDocument object
dataDocument.put("token", jwtManager.createToken(dataDocument));
}
return objectMapper.writeValueAsString(dataCompareFile);
return objectMapper.writeValueAsString(dataDocument);
}
@SneakyThrows
private String getMailMerge(final Boolean directUrl) {
Map<String, Object> dataMailMergeRecipients = new HashMap<>(); // get recipients data for mail merging
dataMailMergeRecipients.put("fileType", "csv");
dataMailMergeRecipients.put("url", storagePathBuilder.getServerUrl(true) + "/csv");
private String getSpreadsheet(final Boolean directUrl) {
Map<String, Object> dataSpreadsheet = new HashMap<>(); // get recipients data for mail merging
dataSpreadsheet.put("fileType", "csv");
dataSpreadsheet.put("url", storagePathBuilder.getServerUrl(true) + "/csv");
if (directUrl) {
dataMailMergeRecipients.put("directUrl", storagePathBuilder.getServerUrl(false) + "/csv");
dataSpreadsheet.put("directUrl", storagePathBuilder.getServerUrl(false) + "/csv");
}
// check if the document token is enabled
if (jwtManager.tokenEnabled()) {
// create token from the dataMailMergeRecipients object
dataMailMergeRecipients.put("token", jwtManager.createToken(dataMailMergeRecipients));
// create token from the dataSpreadsheet object
dataSpreadsheet.put("token", jwtManager.createToken(dataSpreadsheet));
}
return objectMapper.writeValueAsString(dataMailMergeRecipients);
return objectMapper.writeValueAsString(dataSpreadsheet);
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -22,11 +22,17 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.onlyoffice.integration.documentserver.callbacks.CallbackHandler;
import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
import com.onlyoffice.integration.dto.Converter;
import com.onlyoffice.integration.dto.ConvertedData;
import com.onlyoffice.integration.dto.Reference;
import com.onlyoffice.integration.dto.ReferenceData;
import com.onlyoffice.integration.dto.Rename;
import com.onlyoffice.integration.dto.Restore;
import com.onlyoffice.integration.dto.SaveAs;
import com.onlyoffice.integration.dto.Track;
import com.onlyoffice.integration.entities.User;
import com.onlyoffice.integration.documentserver.models.enums.DocumentType;
@ -35,11 +41,14 @@ import com.onlyoffice.integration.documentserver.util.file.FileUtility;
import com.onlyoffice.integration.documentserver.util.service.ServiceConverter;
import com.onlyoffice.integration.documentserver.managers.document.DocumentManager;
import com.onlyoffice.integration.documentserver.managers.callback.CallbackManager;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -49,23 +58,32 @@ import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Optional;
@ -105,6 +123,8 @@ public class FileController {
private ServiceConverter serviceConverter;
@Autowired
private CallbackManager callbackManager;
@Autowired
private HistoryManager historyManager;
// create user metadata
private String createUserMetadata(final String uid, final String fullFileName) {
@ -131,6 +151,28 @@ public class FileController {
.body(resource);
}
private ResponseEntity<Resource> downloadSample(final String fileName) {
String serverPath = System.getProperty("user.dir");
String contentType = "application/octet-stream";
String[] fileLocation = new String[] {serverPath, "src", "main", "resources", "assets", "document-templates",
"sample", fileName};
Path filePath = Paths.get(String.join(File.separator, fileLocation));
Resource resource;
try {
resource = new UrlResource(filePath.toUri());
if (resource.exists()) {
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType(contentType))
.header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"" + resource.getFilename() + "\"")
.body(resource);
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
return null;
}
// download data from the specified history file
private ResponseEntity<Resource> downloadFileHistory(final String fileName,
final String version,
@ -175,7 +217,8 @@ public class FileController {
throw new IOException("Could not update a file"); // if the file cannot be updated, an error occurs
}
fullFileName = fileUtility.getFileNameWithoutExtension(fileNamePath) + fileExtension; // get full file name
fullFileName = fileUtility.getFileNameWithoutExtension(fileNamePath)
+ "." + fileExtension; // get full file name
return createUserMetadata(uid, fullFileName); // create user metadata and return it
} catch (Exception e) {
@ -205,15 +248,15 @@ public class FileController {
// get document type (word, cell or slide)
DocumentType type = fileUtility.getDocumentType(fileName);
// convert to .ooxml
String internalFileExt = "ooxml";
// get an auto-conversion extension from the request body or set it to the ooxml extension
String conversionExtension = body.getFileExt() != null ? body.getFileExt() : "ooxml";
try {
// check if the file with such an extension can be converted
if (fileUtility.getConvertExts().contains(fileExt)) {
String key = serviceConverter.generateRevisionId(fileUri); // generate document key
ConvertedData response = serviceConverter // get the URL to the converted file
.getConvertedData(fileUri, fileExt, internalFileExt, key, filePass, true, lang);
.getConvertedData(fileUri, fileExt, conversionExtension, key, filePass, true, lang);
String newFileUri = response.getUri();
String newFileType = "." + response.getFileType();
@ -248,24 +291,33 @@ public class FileController {
return createUserMetadata(uid, fileName);
} catch (Exception e) {
e.printStackTrace();
// if the operation of file converting is unsuccessful, an error occurs
return "{ \"error\": \"" + e.getMessage() + "\"}";
}
// if the operation of file converting is unsuccessful, an error occurs
return "{ \"error\": \"" + "The file can't be converted.\"}";
}
@PostMapping("/delete")
@ResponseBody
public String delete(@RequestBody final Converter body) { // delete a file
try {
String fullFileName = fileUtility.getFileName(body.getFileName()); // get full file name
String filename = body.getFileName();
boolean success = false;
// delete a file from the storage and return the status of this operation (true or false)
boolean fileSuccess = storageMutator.deleteFile(fullFileName);
if (filename != null) {
String fullFileName = fileUtility.getFileName(filename); // get full file name
// delete file history and return the status of this operation (true or false)
boolean historySuccess = storageMutator.deleteFileHistory(fullFileName);
// delete a file from the storage and return the status of this operation (true or false)
boolean fileSuccess = storageMutator.deleteFile(fullFileName);
return "{ \"success\": \"" + (fileSuccess && historySuccess) + "\"}";
// delete file history and return the status of this operation (true or false)
boolean historySuccess = storageMutator.deleteFileHistory(fullFileName);
success = fileSuccess && historySuccess;
} else {
// delete the user's folder and return the boolean status
success = storageMutator.deleteUserFolder();
}
return "{ \"success\": \"" + (success) + "\"}";
} catch (Exception e) {
// if the operation of file deleting is unsuccessful, an error occurs
return "{ \"error\": \"" + e.getMessage() + "\"}";
@ -355,14 +407,12 @@ public class FileController {
@GetMapping("/assets")
public ResponseEntity<Resource> assets(@RequestParam("name")
final String name) { // get sample files from the assests
String fileName = Path.of("assets", "sample", fileUtility.getFileName(name)).toString();
return downloadFile(fileName);
return downloadSample(name);
}
@GetMapping("/csv")
public ResponseEntity<Resource> csv() { // download a csv file
String fileName = Path.of("assets", "sample", "csv.csv").toString();
return downloadFile(fileName);
return downloadSample("csv.csv");
}
@GetMapping("/files")
@ -403,19 +453,16 @@ public class FileController {
@PostMapping("/saveas")
@ResponseBody
public String saveAs(@RequestBody final JSONObject body, @CookieValue("uid") final String uid) {
String title = (String) body.get("title");
String saveAsFileUrl = (String) body.get("url");
public String saveAs(@RequestBody final SaveAs body, @CookieValue("uid") final String uid) {
try {
String fileName = documentManager.getCorrectName(title);
String fileName = documentManager.getCorrectName(body.getTitle());
String curExt = fileUtility.getFileExtension(fileName);
if (!fileUtility.getFileExts().contains(curExt)) {
return "{\"error\":\"File type is not supported\"}";
}
URL url = new URL(saveAsFileUrl);
URL url = new URL(body.getUrl());
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
InputStream stream = connection.getInputStream();
@ -434,25 +481,14 @@ public class FileController {
@PostMapping("/rename")
@ResponseBody
public String rename(@RequestBody final JSONObject body) {
String newfilename = (String) body.get("newfilename");
String dockey = (String) body.get("dockey");
String origExt = "." + (String) body.get("ext");
String curExt = newfilename;
if (newfilename.indexOf(".") != -1) {
curExt = (String) fileUtility.getFileExtension(newfilename);
}
if (origExt.compareTo(curExt) != 0) {
newfilename += origExt;
}
public String rename(@RequestBody final Rename body) {
String fileName = body.getFileName();
HashMap<String, String> meta = new HashMap<>();
meta.put("title", newfilename);
meta.put("title", fileName + "." + body.getFileType());
try {
callbackManager.commandRequest("meta", dockey, meta);
callbackManager.commandRequest("meta", body.getFileKey(), meta);
return "result ok";
} catch (Exception e) {
e.printStackTrace();
@ -462,7 +498,7 @@ public class FileController {
@PostMapping("/reference")
@ResponseBody
public String reference(@RequestBody final JSONObject body) {
public String reference(@RequestBody final Reference body) {
try {
JSONParser parser = new JSONParser();
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
@ -470,12 +506,11 @@ public class FileController {
String userAddress = "";
String fileName = "";
if (body.containsKey("referenceData")) {
LinkedHashMap referenceDataObj = (LinkedHashMap) body.get("referenceData");
String instanceId = (String) referenceDataObj.get("instanceId");
if (body.getReferenceData() != null) {
ReferenceData referenceData = body.getReferenceData();
if (instanceId.equals(storagePathBuilder.getServerUrl(false))) {
JSONObject fileKey = (JSONObject) parser.parse((String) referenceDataObj.get("fileKey"));
if (referenceData.getInstanceId().equals(storagePathBuilder.getServerUrl(false))) {
JSONObject fileKey = (JSONObject) parser.parse(referenceData.getFileKey());
userAddress = (String) fileKey.get("userAddress");
if (userAddress.equals(InetAddress.getLocalHost().getHostAddress())) {
fileName = (String) fileKey.get("fileName");
@ -483,10 +518,26 @@ public class FileController {
}
}
String link = body.getLink();
if (fileName.equals("") && link != null) {
if (!link.contains(storagePathBuilder.getServerUrl(true))) {
HashMap<String, String> data = new HashMap<>();
data.put("url", link);
data.put("directUrl", link);
return gson.toJson(data);
}
UriComponents uriComponents = UriComponentsBuilder.fromUriString(body.getLink()).build();
fileName = uriComponents.getQueryParams().getFirst("fileName");
boolean fileExists = new File(storagePathBuilder.getFileLocation(fileName)).exists();
if (!fileExists) {
return "{ \"error\": \"File is not exist\"}";
}
}
if (fileName.equals("")) {
try {
String path = (String) body.get("path");
String path = (String) body.getPath();
path = fileUtility.getFileName(path);
File f = new File(storagePathBuilder.getFileLocation(path));
if (f.exists()) {
@ -501,8 +552,6 @@ public class FileController {
return "{ \"error\": \"File not found\"}";
}
boolean directUrl = (boolean) body.get("directUrl");
HashMap<String, Object> fileKey = new HashMap<>();
fileKey.put("fileName", fileName);
fileKey.put("userAddress", InetAddress.getLocalHost().getHostAddress());
@ -512,11 +561,17 @@ public class FileController {
referenceData.put("fileKey", gson.toJson(fileKey));
HashMap<String, Object> data = new HashMap<>();
data.put("fileType", fileUtility.getFileExtension(fileName).replace(".", ""));
data.put("fileType", fileUtility.getFileExtension(fileName));
data.put("key", serviceConverter.generateRevisionId(
storagePathBuilder.getStorageLocation()
+ "/" + fileName + "/"
+ new File(storagePathBuilder.getFileLocation(fileName)).lastModified()
));
data.put("url", documentManager.getDownloadUrl(fileName, true));
data.put("directUrl", directUrl ? documentManager.getDownloadUrl(fileName, false) : null);
data.put("directUrl", body.getDirectUrl() ? documentManager.getDownloadUrl(fileName, false) : null);
data.put("referenceData", referenceData);
data.put("path", fileName);
data.put("link", storagePathBuilder.getServerUrl(true) + "/editor?fileName=" + fileName);
if (jwtManager.tokenEnabled()) {
String token = jwtManager.createToken(data);
@ -528,4 +583,101 @@ public class FileController {
return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
}
}
@GetMapping("/history")
@ResponseBody
public String history(@RequestParam("fileName") final String fileName) {
return historyManager.getHistory(fileName);
}
@GetMapping("/historydata")
@ResponseBody
public String history(@RequestParam("fileName") final String fileName,
@RequestParam("version") final String version,
@RequestParam(value = "directUrl", defaultValue = "false") final Boolean directUrl) {
return historyManager.getHistoryData(fileName, version, directUrl);
}
@PutMapping("/restore")
@ResponseBody
public String restore(@RequestBody final Restore body, @CookieValue("uid") final Integer uid) {
try {
String sourceStringFile = storagePathBuilder.getFileLocation(body.getFileName());
File sourceFile = new File(sourceStringFile);
Path sourcePathFile = sourceFile.toPath();
String historyDirectory = storagePathBuilder.getHistoryDir(sourcePathFile.toString());
Integer bumpedVersion = storagePathBuilder.getFileVersion(historyDirectory, false);
String bumpedVersionStringDirectory = documentManager.versionDir(historyDirectory, bumpedVersion, true);
File bumpedVersionDirectory = new File(bumpedVersionStringDirectory);
if (!bumpedVersionDirectory.exists()) {
bumpedVersionDirectory.mkdir();
}
Path bumpedKeyPathFile = Paths.get(bumpedVersionStringDirectory, "key.txt");
String bumpedKeyStringFile = bumpedKeyPathFile.toString();
File bumpedKeyFile = new File(bumpedKeyStringFile);
String bumpedKey = serviceConverter.generateRevisionId(
storagePathBuilder.getStorageLocation()
+ "/"
+ body.getFileName()
+ "/"
+ Long.toString(sourceFile.lastModified())
);
FileWriter bumpedKeyFileWriter = new FileWriter(bumpedKeyFile);
bumpedKeyFileWriter.write(bumpedKey);
bumpedKeyFileWriter.close();
User user = userService.findUserById(uid).get();
Path bumpedChangesPathFile = Paths.get(bumpedVersionStringDirectory, "changes.json");
String bumpedChangesStringFile = bumpedChangesPathFile.toString();
File bumpedChangesFile = new File(bumpedChangesStringFile);
JSONObject bumpedChangesUser = new JSONObject();
// Don't add the `uid-` prefix.
// https://github.com/ONLYOFFICE/document-server-integration/issues/437#issuecomment-1663526562
bumpedChangesUser.put("id", user.getId());
bumpedChangesUser.put("name", user.getName());
JSONObject bumpedChangesChangesItem = new JSONObject();
bumpedChangesChangesItem.put("created", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
bumpedChangesChangesItem.put("user", bumpedChangesUser);
JSONArray bumpedChangesChanges = new JSONArray();
bumpedChangesChanges.add(bumpedChangesChangesItem);
JSONObject bumpedChanges = new JSONObject();
bumpedChanges.put("serverVersion", null);
bumpedChanges.put("changes", bumpedChangesChanges);
String bumpedChangesContent = bumpedChanges.toJSONString();
FileWriter bumpedChangesFileWriter = new FileWriter(bumpedChangesFile);
bumpedChangesFileWriter.write(bumpedChangesContent);
bumpedChangesFileWriter.close();
String sourceExtension = fileUtility.getFileExtension(body.getFileName());
String previousBasename = "prev." + sourceExtension;
Path bumpedFile = Paths.get(bumpedVersionStringDirectory, previousBasename);
Files.move(sourcePathFile, bumpedFile);
String recoveryVersionStringDirectory = documentManager.versionDir(
historyDirectory,
body.getVersion(),
true
);
Path recoveryPathFile = Paths.get(recoveryVersionStringDirectory, previousBasename);
String recoveryStringFile = recoveryPathFile.toString();
FileInputStream recoveryStream = new FileInputStream(recoveryStringFile);
storageMutator.createFile(sourcePathFile, recoveryStream);
recoveryStream.close();
JSONObject responseBody = new JSONObject();
responseBody.put("error", null);
responseBody.put("success", true);
return responseBody.toJSONString();
} catch (Exception error) {
error.printStackTrace();
JSONObject responseBody = new JSONObject();
responseBody.put("error", error.getMessage());
responseBody.put("success", false);
return responseBody.toJSONString();
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -22,8 +22,10 @@ import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
import com.onlyoffice.integration.documentserver.util.Misc;
import com.onlyoffice.integration.documentserver.util.file.FileUtility;
import com.onlyoffice.integration.documentserver.util.service.FormatService;
import com.onlyoffice.integration.entities.User;
import com.onlyoffice.integration.services.UserServices;
import com.onlyoffice.integration.dto.FormatsList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
@ -33,6 +35,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import java.util.Arrays;
@ -61,6 +64,9 @@ public class IndexController {
@Autowired
private UserServices userService;
@Autowired
private FormatService formatService;
@Value("${files.docservice.url.site}")
private String docserviceSite;
@ -76,6 +82,9 @@ public class IndexController {
@Value("${files.docservice.languages}")
private String langs;
@Value("${server.version}")
private String serverVersion;
@GetMapping("${url.index}")
public String index(@RequestParam(value = "directUrl", required = false) final Boolean directUrl,
final Model model) {
@ -124,6 +133,7 @@ public class IndexController {
model.addAttribute("users", users);
model.addAttribute("languages", languages);
model.addAttribute("directUrl", directUrl);
model.addAttribute("serverVersion", serverVersion);
return "index.html";
}
@ -132,16 +142,16 @@ public class IndexController {
@ResponseBody
public HashMap<String, String> configParameters() { // get configuration parameters
HashMap<String, String> configuration = new HashMap<>();
configuration.put("FillExtList", String.join(",", fileUtility
.getFillExts())); // put a list of the extensions that can be filled to config
configuration.put("ConverExtList", String.join(",", fileUtility
.getConvertExts())); // put a list of the extensions that can be converted to config
configuration.put("EditedExtList", String.join(",", fileUtility
.getEditedExts())); // put a list of the extensions that can be edited to config
configuration.put("UrlConverter", urlConverter);
configuration.put("UrlEditor", urlEditor);
return configuration;
}
@GetMapping("/formats")
@ResponseBody
public ResponseEntity<FormatsList> formats() { // return all the supported formats
FormatsList list = new FormatsList(formatService.getFormats());
return ResponseEntity.ok(list);
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -120,7 +120,7 @@ public class DefaultCallbackManager implements CallbackManager {
String newFileName = fileName;
String curExt = fileUtility.getFileExtension(fileName); // get current file extension
String downloadExt = "." + body.getFiletype(); // get an extension of the downloaded file
String downloadExt = body.getFiletype(); // get an extension of the downloaded file
// todo: Refactoring
// convert downloaded file to the file with the current extension if these extensions aren't equal
@ -132,14 +132,14 @@ public class DefaultCallbackManager implements CallbackManager {
null).getUri(); // convert a file and get URL to a new file
if (newFileUri.isEmpty()) {
newFileName = documentManager
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName)
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "."
+ downloadExt); // get the correct file name if it already exists
} else {
downloadUri = newFileUri;
}
} catch (Exception e) {
newFileName = documentManager
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt);
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "." + downloadExt);
}
}
@ -163,7 +163,7 @@ public class DefaultCallbackManager implements CallbackManager {
storageMutator.createDirectory(ver); // create the file version directory
lastVersion.toFile().renameTo(new File(versionDir + File.separator + "prev" + curExt));
lastVersion.toFile().renameTo(new File(versionDir + File.separator + "prev." + curExt));
saveFile(byteArrayFile, toSave); // save document file
@ -269,7 +269,7 @@ public class DefaultCallbackManager implements CallbackManager {
String fileName = fileNameParam;
String curExt = fileUtility.getFileExtension(fileName); // get current file extension
String downloadExt = "." + body.getFiletype(); // get an extension of the downloaded file
String downloadExt = body.getFiletype(); // get an extension of the downloaded file
Boolean newFileName = false;
@ -304,10 +304,10 @@ public class DefaultCallbackManager implements CallbackManager {
// get the correct file name if it already exists
fileName = documentManager
.getCorrectName(fileUtility
.getFileNameWithoutExtension(fileName) + "-form" + downloadExt);
.getFileNameWithoutExtension(fileName) + "-form." + downloadExt);
} else {
fileName = documentManager
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form" + curExt);
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form." + curExt);
}
forcesavePath = storagePathBuilder.getFileLocation(fileName); // create forcesave path if it doesn't exist
List<Action> actions = body.getActions();
@ -315,6 +315,24 @@ public class DefaultCallbackManager implements CallbackManager {
String user = action.getUserid(); // get the user ID
// create meta data for the forcesaved file
storageMutator.createMeta(fileName, user, "Filling Form");
try {
String formsDataUrl = body.getFormsdataurl();
if (formsDataUrl != null && !formsDataUrl.isEmpty()) {
String formsName = documentManager.getCorrectName(fileUtility
.getFileNameWithoutExtension(fileName) + ".txt");
String formsPath = storagePathBuilder.getFileLocation(formsName);
byte[] byteArrayFormsData = getDownloadFile(formsDataUrl);
saveFile(byteArrayFormsData, Paths.get(formsPath));
} else {
throw new RuntimeException("Document editing service did not return formsDataUrl");
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
if (newFileName) {
fileName = documentManager

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
* (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.
@ -69,7 +69,7 @@ public class DefaultDocumentManager implements DocumentManager {
// get URL to the created file
public String getCreateUrl(final String fileName, final Boolean sample) {
String fileExt = fileUtility.getFileExtension(fileName).replace(".", "");
String fileExt = fileUtility.getFileExtension(fileName);
String url = storagePathBuilder.getServerUrl(true)
+ "/create?fileExt=" + fileExt + "&sample=" + sample;
return url;
@ -79,13 +79,13 @@ public class DefaultDocumentManager implements DocumentManager {
public String getCorrectName(final String fileName) {
String baseName = fileUtility.getFileNameWithoutExtension(fileName); // get file name without extension
String ext = fileUtility.getFileExtension(fileName); // get file extension
String name = baseName + ext; // create a full file name
String name = baseName + "." + ext; // create a full file name
Path path = Paths.get(storagePathBuilder.getFileLocation(name));
// run through all the files with such a name in the storage directory
for (int i = 1; Files.exists(path); i++) {
name = baseName + " (" + i + ")" + ext; // and add an index to the base name
name = baseName + " (" + i + ")." + ext; // and add an index to the base name
path = Paths.get(storagePathBuilder.getFileLocation(name));
}
@ -217,8 +217,14 @@ public class DefaultDocumentManager implements DocumentManager {
public String createDemo(final String fileExt, final Boolean sample, final String uid, final String uname) {
String demoName = (sample ? "sample." : "new.")
+ fileExt; // create sample or new template file with the necessary extension
String demoPath = "assets" + File.separator + (sample ? "sample" : "new")
+ File.separator + demoName; // get the path to the sample document
String demoPath =
"assets"
+ File.separator
+ "document-templates"
+ File.separator
+ (sample ? "sample" : "new")
+ File.separator
+ demoName;
// get a file name with an index if the file with such a name already exists
String fileName = getCorrectName(demoName);

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