Compare commits

..

355 Commits

Author SHA1 Message Date
7a7503be6a [macos] Fixed run example (#94) 2020-11-09 13:05:06 +03:00
1184402f94 fix table 2020-10-01 11:37:15 +03:00
5c0d8b8dd9 Merge branch 'release/v6.0.0' into develop
# Conflicts:
#	Readme.md
#	web/documentserver-example/nodejs/licenses/urllib.license
2020-09-30 19:12:05 +03:00
cadeb19ece Merge branch 'master' into release/v6.0.0
# Conflicts:
#	LICENSE.txt
2020-09-30 18:58:24 +03:00
001b9a2cf6 Merge branch hotfix/v5.6.4 into develop 2020-09-15 13:40:43 +00:00
5e852e024d Merge branch 'hotfix/apache' into develop
# Conflicts:
#	3rd-Party.txt
#	licences/3rd-Party.txt
#	web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx
#	web/documentserver-example/csharp-mvc/Views/Home/Index.aspx
#	web/documentserver-example/java/src/main/webapp/editor.jsp
#	web/documentserver-example/java/src/main/webapp/index.jsp
#	web/documentserver-example/js/LICENSE.txt
#	web/documentserver-example/js/OnlineEditorsExampleJS.html
#	web/documentserver-example/nodejs/licenses/formidable.license
#	web/documentserver-example/nodejs/licenses/jsonwebtoken.license
#	web/documentserver-example/nodejs/licenses/mime.license
#	web/documentserver-example/nodejs/licenses/urllib.license
#	web/documentserver-example/php/LICENSE.txt
#	web/documentserver-example/php/doceditor.php
#	web/documentserver-example/php/functions.php
#	web/documentserver-example/php/index.php
#	web/documentserver-example/php/webeditor-ajax.php
#	web/documentserver-example/ruby/LICENSE.txt
#	web/documentserver-example/ruby/app/assets/javascripts/jscript.js
#	web/documentserver-example/ruby/app/assets/stylesheets/editor.scss
#	web/documentserver-example/ruby/app/assets/stylesheets/stylesheet.scss
#	web/welcome/index.html
2020-09-04 09:59:10 +03:00
875dfaaec4 Merge pull request #82 from ONLYOFFICE/hotfix/apache
Apache License
2020-09-03 20:50:34 +03:00
c9def721d2 3rd-party license 2020-09-03 13:08:44 +03:00
8050ec572a apache 2020-09-02 12:06:52 +03:00
6918016dda Apache License 2020-08-31 15:22:12 +03:00
fb039100e1 Update Readme.md 2020-07-23 18:51:17 +03:00
4a6b549eaa Update Readme.md (#80)
* Update Readme.md

- add API methods for text examples
2020-07-23 18:37:46 +03:00
3d09910cf3 [format] Add fb2 to convertedDocs 2020-07-22 11:58:18 +03:00
5cefe5c3b2 Merge pull request #79 from ONLYOFFICE/feature/action-link
Feature/action link
2020-06-30 15:43:33 +03:00
0cf0171721 fixed an issue when creating a second action link 2020-06-18 11:44:21 +03:00
f8a1587109 Merge pull request #74 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/ffi-1.12.2
build(deps): bump ffi from 1.9.18 to 1.12.2 in /web/documentserver-example/ruby
2020-06-09 12:13:09 +03:00
44142da370 Merge branch 'develop' into dependabot/bundler/web/documentserver-example/ruby/ffi-1.12.2 2020-06-09 12:12:19 +03:00
ecbae22fcc ruby: get link to bookmark 2020-05-21 14:39:10 +03:00
b3a79deef8 python: get link to bookmark 2020-05-21 12:51:07 +03:00
c4f278d58a java: get link to bookmark 2020-05-21 12:51:07 +03:00
b0ea8ed388 csharp-mvc: get link to bookmark 2020-05-21 12:50:48 +03:00
220516c930 csharp: get link to bookmark 2020-05-18 16:31:16 +03:00
3be28877ab fixed header name 2020-05-18 16:30:56 +03:00
b3a96f15ab php: get link to bookmark 2020-05-18 14:19:25 +03:00
14a68befd2 v5.5.2 2020-04-27 17:01:53 +03:00
b1af12a78d v5.5.1r2 2020-04-15 14:18:33 +03:00
83bab147d0 v5.5.1 2020-04-09 12:40:23 +03:00
80670a0d64 Update copyright year 2020-04-06 11:59:41 +03:00
75f137470b nodejs: get link to bookmark 2020-03-19 13:39:29 +03:00
870a3ee799 [run] Platform
Add platform for run

(cherry picked from commit 8b9f07e46e)
2020-03-13 11:29:22 +03:00
c3c1689170 nodejs: fix upload files
(cherry picked from commit af7101844a)
2020-03-13 11:29:09 +03:00
a271b847d5 nodejs: add run-develop
(cherry picked from commit b58bf412fa)
2020-03-13 11:28:52 +03:00
45ea1a8c1d v5.5.0 2020-03-04 18:33:54 +03:00
1b90f16eb5 build(deps): bump ffi in /web/documentserver-example/ruby
Bumps [ffi](https://github.com/ffi/ffi) from 1.9.18 to 1.12.2.
- [Release notes](https://github.com/ffi/ffi/releases)
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/1.9.18...1.12.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-04 15:33:27 +00:00
422429e742 v5.5.0 2020-03-04 18:09:04 +03:00
29072e3d5c bump 2020 2020-03-04 10:13:12 +03:00
b82c2c68d5 Merge pull request #71 from ONLYOFFICE/feature/python
Feature/python
2020-03-04 10:09:03 +03:00
67d6eaa18b python: env vars 2020-03-03 19:03:05 +03:00
cb91ba1620 bump 2020 2020-03-03 14:39:29 +03:00
0e91256847 python: 2020 2020-03-03 14:32:11 +03:00
ce16625091 python: converted filename was not sent to client 2020-03-03 13:27:15 +03:00
4d538fc35d python: footer copyright 2020-03-03 13:26:36 +03:00
36c9583a2c nodejs: remove trade 2020-03-03 11:55:24 +03:00
1bde1f66d3 change name 2020-03-03 11:55:24 +03:00
fddc08c24b csharp: removed c#7 features 2020-03-03 11:40:00 +03:00
06305ee262 python: zip build script 2020-03-03 11:08:30 +03:00
e55e27cee8 python: reload on dialog close 2020-03-03 11:03:57 +03:00
8fa77cb9ba python: copyrights & cleanup 2020-03-03 11:00:23 +03:00
f038327928 python: sorting by date 2020-03-03 10:45:08 +03:00
0adaf8a84b python: lower file extension 2020-03-03 10:35:52 +03:00
85cb88b0fc python: fixed editors language 2020-03-03 10:26:49 +03:00
4c8ac0457f Merge pull request #69 from ONLYOFFICE/feature/ruby-v2.6.5
Feature/ruby v2.6.5
2020-03-02 17:36:46 +03:00
3ba6072b3e Merge pull request #68 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/nokogiri-1.10.8
build(deps): bump nokogiri from 1.8.1 to 1.10.8 in /web/documentserver-example/ruby
2020-02-27 15:52:34 +03:00
ad966cfc28 Merge branch 'feature/ruby-v2.6.5' into dependabot/bundler/web/documentserver-example/ruby/nokogiri-1.10.8
# Conflicts:
#	web/documentserver-example/ruby/Gemfile.lock
2020-02-27 15:50:48 +03:00
1f9b2b8230 build(deps): bump nokogiri in /web/documentserver-example/ruby
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.1 to 1.10.8.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.8.1...v1.10.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-25 08:22:59 +00:00
61826dc813 Merge branch 'feature/pkg' into release/v5.5.0 2020-02-12 12:00:19 +03:00
3dc4a6d6a3 Fix pkg building 2020-02-12 11:37:44 +03:00
4de89aa858 Preparation for pkg
Add abillity setup storage folder outside the repo
2020-02-12 11:37:04 +03:00
8b9f07e46e [run] Platform
Add platform for run
2020-01-14 15:14:10 +03:00
af7101844a nodejs: fix upload files 2020-01-09 14:07:00 +03:00
b58bf412fa nodejs: add run-develop 2019-12-25 18:33:49 +03:00
a1c524df00 python: changed docserv default link 2019-12-25 11:28:12 +03:00
710d4f4059 Fixed displaying mobile version cb5324381e 2019-12-13 13:20:39 +03:00
be25001479 Fixed displaying mobile version cb5324381e 2019-12-13 13:09:28 +03:00
7466aba10f ruby: 'raise_in_transactional_callbacks' deprecated since rails 5.0.0 2019-11-21 14:43:53 +03:00
c4fc8c85e2 ruby: 'render :text' deprecated since rails 5.1.0 2019-11-21 14:41:48 +03:00
007efef742 ruby: rails manifest.js 2019-11-21 14:40:53 +03:00
a4bf9d76f6 ruby: updated dependencies to support ruby v2.6.5 2019-11-21 14:36:56 +03:00
7c5faa7c8a Merge pull request #66 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/loofah-2.3.1
build(deps): bump loofah from 2.1.1 to 2.3.1 in /web/documentserver-example/ruby
2019-11-21 14:33:02 +03:00
3497eeea9f build(deps): bump loofah in /web/documentserver-example/ruby
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.1.1 to 2.3.1.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.1.1...v2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-08 16:23:59 +00:00
7717cb35f8 python: 3rd party licenses 2019-11-07 18:25:35 +03:00
1c59409ce2 python: blockcontent mode 2019-11-07 17:50:30 +03:00
bd4c3543d7 csharp-mvc: blockcontent mode 2019-11-07 17:40:52 +03:00
8770526316 csharp: blockcontent mode 2019-11-07 17:36:49 +03:00
51ecf3afeb java: blockcontent mode 2019-11-07 17:23:29 +03:00
8887edefb3 ruby: blockcontent mode 2019-11-07 17:09:08 +03:00
7ab292bc13 php: blockcontent mode 2019-11-07 16:41:16 +03:00
6ab006e409 changed favicon 2019-11-06 10:29:09 +03:00
582ed3f61b changed logo 2019-11-06 10:28:24 +03:00
d06cffabfb Merge pull request #65 from ONLYOFFICE/dependabot/npm_and_yarn/web/documentserver-example/nodejs/debug-2.6.9
build(deps): bump debug from 2.2.0 to 2.6.9 in /web/documentserver-example/nodejs
2019-11-05 18:38:22 +03:00
5545568e04 python: readme 2019-11-05 17:57:33 +03:00
6ba9b33606 python: version history 2019-11-05 17:51:22 +03:00
178477f9fb build(deps): bump debug in /web/documentserver-example/nodejs
Bumps [debug](https://github.com/visionmedia/debug) from 2.2.0 to 2.6.9.
- [Release notes](https://github.com/visionmedia/debug/releases)
- [Changelog](https://github.com/visionmedia/debug/blob/2.6.9/CHANGELOG.md)
- [Commits](https://github.com/visionmedia/debug/compare/2.2.0...2.6.9)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-02 01:35:08 +00:00
8d657a0101 python: jwt support 2019-11-01 15:47:59 +03:00
c1454eff13 python: document list 2019-11-01 10:58:20 +03:00
f7867e4bc3 python: document editing 2019-10-28 12:58:31 +03:00
f94e057492 python: upload, convert, create sample 2019-10-25 17:05:20 +03:00
a5371faa27 python: django template 2019-10-25 16:54:23 +03:00
34527f0b3e python: static files 2019-10-25 16:46:45 +03:00
b9dd792672 [all] Rename
Rename web-apps-pro -> web-apps
2019-10-24 12:27:30 +03:00
13c3164ca1 java: header null ref error 2019-10-23 13:22:14 +03:00
ceed4ac712 [img] Change image 2019-10-21 14:01:18 +03:00
6a16a9392a [img] Rename image 2019-10-21 14:00:48 +03:00
48043e5d70 [all] Rename
Rename web-apps -> web-apps-pro
2019-10-18 15:41:55 +03:00
d7809b848e v5.4.1 2019-10-02 12:07:23 +03:00
d5466f1070 v5.4.1 2019-10-02 12:02:38 +03:00
f639971861 object.assign is not available on IE 2019-09-26 15:21:09 +03:00
95ee0bf128 php: save old file version 2019-09-25 19:02:24 +03:00
03efbf468e Merge branch 'develop' of https://github.com/ONLYOFFICE/document-server-integration into develop 2019-09-25 18:50:28 +03:00
60cb77136a ruby: version history 2019-09-25 18:50:11 +03:00
d1d7d1e416 ruby: unique document key for each version 2019-09-25 17:05:32 +03:00
a60e7b9b6b php: comment, fillforms, filter modes 2019-09-25 15:17:33 +03:00
79d5682a02 Fix #63 - backUrl with custom port 2019-09-25 15:09:50 +03:00
96994fd0dc Fix #63 - backUrl with custom port 2019-09-25 15:06:25 +03:00
668a0e323a ruby: document list, different view/edit options 2019-09-25 14:46:30 +03:00
057d38d063 ruby: body overflow style issue 2019-09-25 14:08:25 +03:00
1ecf16085e ruby: jwt support 2019-09-25 11:54:16 +03:00
945c09f5d4 ruby: send POST instead of GET on convert request 2019-09-25 11:53:01 +03:00
b642053bc3 ruby: user and lang selectors 2019-09-25 11:52:12 +03:00
fef0179c7e ruby: create empty sample, new upload style 2019-09-25 09:54:18 +03:00
c0366c0134 Merge remote-tracking branch 'remotes/origin/hotfix/v5.4.1' into develop 2019-09-23 16:32:48 +03:00
584fb155b7 nodejs: fix style with blockcontent mode 2019-09-23 16:32:14 +03:00
95a15661d0 php: lang selector 2019-09-19 17:30:44 +03:00
ca17dd1128 php: jwt support 2019-09-19 17:24:41 +03:00
e375404e25 php: json parse error on convert 2019-09-19 14:35:59 +03:00
a58c1483b3 php: version history 2019-09-19 14:14:57 +03:00
9b6e90718a java: version history 2019-09-18 17:41:11 +03:00
14f8419f00 java: different edit/view options 2019-09-12 14:19:08 +03:00
0899644f32 java: user and lang selectors 2019-09-12 11:12:01 +03:00
036c0fb19a java: create empty sample, new upload style 2019-09-10 16:42:28 +03:00
5382c43ec5 csharp-mvc: document key 2019-09-10 12:50:43 +03:00
8af7c45e7d csharp-mvc: version history 2019-09-10 12:50:24 +03:00
aa289a6d85 csharp: history folder on convert 2019-09-10 11:30:03 +03:00
b93aeebe3c csharp-mvc: different edit/view options 2019-09-09 18:21:35 +03:00
fe38ca4a08 csharp-mvc: user and lang selectors 2019-09-09 17:31:10 +03:00
df74cdeb66 csharp-mvc: create empty sample, new upload style 2019-09-09 17:02:40 +03:00
1f022f12a1 csharp: version history 2019-09-09 15:28:32 +03:00
1217de89b3 Add 'blockcontent' mode 2019-09-04 18:15:06 +03:00
cd94eb0401 csharp: different edit/view options 2019-09-03 16:11:14 +03:00
118a4d74b0 v5.4.0 2019-09-03 14:37:39 +03:00
31c23fbf49 csharp: user and lang selectors 2019-09-03 13:43:04 +03:00
95b4556884 csharp: create empty sample, new upload style 2019-09-03 11:54:37 +03:00
96bfe3c58a csharp-mvc: format 2019-09-02 15:02:18 +03:00
0f549db065 csharp: format 2019-09-02 14:53:06 +03:00
c064b8fa57 csharp-mvc: document list 2019-08-28 17:14:17 +03:00
490a6cd8b6 csharp-mvc: jwt support 2019-08-28 16:30:01 +03:00
097a99b947 csharp: jwt support 2019-08-28 15:57:09 +03:00
88fa94c090 Update new file templates 2019-08-02 14:28:32 +03:00
507bf0098a Fixed package.json. Added new line at end of the file. 2019-07-31 18:17:27 +03:00
9bbcdf599d Use npm-shrinkwrap 2019-07-31 17:53:16 +03:00
d4f07aee2a update empty files (v16) 2019-07-30 12:59:49 +03:00
d12897930c Expanded list of languages
https://helpcenter.onlyoffice.com/tipstricks/available-languages.aspx
2019-06-13 17:03:40 +03:00
314dfb7811 v5.3.1 2019-06-06 12:33:52 +03:00
f5b4a1f78d v5.3.0 2019-05-27 17:21:45 +03:00
9459d4a7c1 v5.3.0 2019-05-27 17:05:25 +03:00
120a0712da Update Readme.md
UTM for Project info
2019-05-16 18:13:12 +03:00
a536fdf6ab nodejs: max key length - 120 2019-02-22 15:54:07 +03:00
71103b802e java: send jwt token in body 2019-02-21 14:27:59 +03:00
0b33ce14f7 node: fix Bug 36489 - Files with non ascii symbols were unable to download 2019-02-21 11:47:51 +03:00
a945870c6a java: jwt in headers 2019-02-20 14:55:35 +03:00
cafaa27e92 java: json passed to docserver contained escaped parameters 2019-02-20 14:50:38 +03:00
d22d2ace22 Merge pull request #57 from flaminestone/feature/delete_dockerfile
Delete dockerfile, and move building to docker-compose
2019-02-13 16:27:48 +03:00
430a16b543 Delete dockerfile, and move building to docker-compose 2019-02-13 16:17:41 +03:00
d2a89f4a5f Merge pull request #56 from flaminestone/feature/add_docker_compose_for_java
Add docker-compose file for easy building
2019-02-13 13:43:35 +03:00
efda987b55 Add docker-compose file for easy building 2019-02-13 13:34:20 +03:00
20827e4d76 v5.2.8 2019-02-05 16:23:22 +03:00
16473b4e06 2019 2019-01-22 18:17:07 +03:00
30d26df97d Merge remote-tracking branch 'remotes/origin/hotfix/v5.2.8' into develop 2019-01-22 09:28:29 +03:00
9fb0289af4 onAppReady (Fixed #54) 2019-01-22 09:23:29 +03:00
fa8e2cf975 [[copyright] Update Copyright
2018 -> 2019. Limited -> SIA
2019-01-17 17:32:01 +03:00
68f6be2e43 nodejs: check file existence 2018-12-03 18:38:33 +03:00
87381123e3 v5.2.3 2018-10-30 13:01:36 +03:00
7d79efe1f1 release/v5.2.0 2018-09-27 19:07:46 +03:00
04c3ff5895 Fix Bug 38447 long loading page 2018-08-30 15:57:09 +03:00
e3eb837f45 fix link in header 2018-08-30 15:54:27 +03:00
c96205b4da fix link in header 2018-08-30 14:30:17 +03:00
2c5ee77c08 php: pure php config 2018-08-30 14:27:10 +03:00
4dc137cf96 ppsx is not editable 2018-08-17 10:44:27 +03:00
f8003e75ec java: 3rd party license 2018-08-06 17:16:32 +03:00
cb2414140a java: jwt in conversion 2018-08-06 16:37:32 +03:00
d1f63976cb java: conversion params to body 2018-08-06 16:13:13 +03:00
4276caf87d java: fix process error 2018-08-06 16:12:10 +03:00
d5571a3f2e java: jwt in config 2018-08-06 15:03:58 +03:00
3582109cf7 java: jwt in track 2018-08-06 15:02:46 +03:00
10ecddbe61 java: building configuration on server 2018-08-03 15:25:19 +03:00
5a4dea7bfc java: deleted extra parameters 2018-08-03 12:18:42 +03:00
911da29ecb java: fix switch view mode to edit 2018-08-03 12:13:24 +03:00
37fe8eb4d5 java: fix string compare 2018-08-02 16:42:12 +03:00
633fd6efc9 java: format 2018-08-02 13:59:19 +03:00
a758d3f294 nodejs: version count to hint 2018-07-20 13:07:24 +03:00
0245c992a3 nodejs: fillForms only mode 2018-07-20 12:29:50 +03:00
04cad3f10f nodejs: fix unique key 2018-05-24 16:05:44 +03:00
cb60398051 nodejs: correct result 2018-05-24 16:05:44 +03:00
f46b6a7c8c nodejs: fix content type in conversion request 2018-05-24 16:05:14 +03:00
4872a74d13 nodejs: disable cache in ajax 2018-05-24 16:05:06 +03:00
b00ed15051 Java: formating 2018-05-24 16:03:43 +03:00
0cbc290fbe java: using GetServerUrl 2018-05-24 16:03:42 +03:00
cb065bc4db v5.1.4 2018-05-24 15:34:47 +03:00
4712057faa Merge pull request #48 from flaminestone/develop
Thx
2018-05-24 14:21:21 +03:00
2e9842d559 nodejs: jwt in request body 2018-05-11 15:44:27 +03:00
0078c05a74 Add folder for bin files after build and add README.md file 2018-05-03 18:13:56 +03:00
aa8a143338 java: change version 2018-04-27 15:21:00 +03:00
a999b20588 java: fix path separator 2018-04-27 15:20:05 +03:00
cab5f62201 v5.1.3 2018-04-26 18:26:25 +03:00
95d33f3ee7 v5.1.3 2018-04-26 18:23:53 +03:00
83c03c97db php: fix filename in url (178133a292) 2018-04-24 17:42:27 +03:00
7b1c56ea2c php: replace download url 2018-04-24 17:32:31 +03:00
178133a292 php: fix filename in url 2018-04-24 16:55:16 +03:00
f9232788b2 php: using current scheme 2018-04-24 16:54:38 +03:00
c0f8caaf0b nodejs: comment only for spreadsheet editor 2018-04-19 19:06:40 +03:00
fbb23a5872 recognize type of otf 2018-04-16 15:58:00 +03:00
ec764e0f0e OpenDocument template 2018-04-16 15:58:00 +03:00
d08d887392 v5.1.2 2018-04-11 14:28:01 +03:00
b039b16fd9 v5.1.2 2018-04-11 14:26:31 +03:00
1df7cc54c1 Merge branch 'develop' of github.com:ONLYOFFICE/document-server-integration into develop 2018-04-06 15:00:12 +03:00
cf6d11bf4e nodejs: comment only for presentation editor 2018-04-06 14:57:07 +03:00
8793235481 v5.1.1 2018-04-05 15:56:59 +03:00
232fc0d156 Java: fix encoding space 2018-04-05 11:12:24 +03:00
b1352bd897 remove unusing code 2018-03-29 11:52:01 +03:00
d8e1d4d6b7 Merge pull request #44 from ONLYOFFICE/feature/otf
Feature/otf
2018-03-28 16:36:50 +03:00
fc2db9b47f v5.1.0 2018-03-28 12:09:01 +03:00
c0b8e2e578 v5.1.0 2018-03-28 12:06:45 +03:00
fa4c3e3258 nodejs: upload big file 2018-03-27 17:34:17 +03:00
6d1bda75b9 recognize type of otf 2018-03-27 10:41:35 +03:00
db9287263c OpenDocument template 2018-03-19 12:31:58 +03:00
6e1cef27cc nodejs: Add var body; 2018-03-16 14:40:26 +03:00
ceb4db9de6 https://documentserver/ 2018-03-15 14:13:47 +03:00
68c2ae0444 use strict (9c4fc0347f) 2018-03-15 13:31:31 +03:00
30bdc7497a zip with subfolder 2018-03-15 13:30:35 +03:00
67a53ea5c8 Fix Bug 37017 - single file uploads 2018-03-06 16:28:28 +03:00
043ab4251c Merge pull request #42 from ONLYOFFICE/feature/update-year-2018
Update copyright and footer info to 2018 year
2018-03-01 14:08:20 +03:00
20412f0c80 Update copyright and footer info to 2018 year 2018-03-01 12:41:44 +03:00
3792599e41 php: argument default value (php 7.1) 2018-02-19 12:38:01 +03:00
48a5f7ce72 php: argument default value (php 7.1) 2018-02-13 17:35:44 +03:00
f3ee251088 php: create folder with logs 2018-02-13 17:21:22 +03:00
2497acb9f5 php: remove undefined variable 2018-02-13 17:16:54 +03:00
6038381f72 switching favicon in editor 2018-01-24 17:35:02 +03:00
7cd8333186 removed authorization key 2018-01-24 17:35:01 +03:00
39301f65b6 Merge remote-tracking branch 'remotes/origin/hotfix/v5.0.5' into develop
# Conflicts:
#	web/documentserver-example/js/OnlineEditorsExampleJS.html
2017-11-27 17:29:39 +03:00
5209ea55c0 Document Editors (#40) 2017-11-13 17:54:09 +03:00
fb1715eebc Document Editors (#39)
* Document Editors

* Update OnlineEditorsExampleJS.html
2017-10-31 19:05:29 +03:00
59e78960ea v5.0.3 2017-10-31 18:49:25 +03:00
102f34c49e Document Editors 2017-10-27 17:03:35 +03:00
d0bbc736af Merge pull request #37 from ONLYOFFICE/ShockwaveNN-patch-1
Add info about changing http://documentserver
2017-10-20 16:22:58 +03:00
5115995fb9 Update Readme.md 2017-10-20 14:46:33 +03:00
682ed58528 Add info about chaning http://documentserver 2017-10-20 14:37:44 +03:00
2114b23900 Merge pull request #36 from ONLYOFFICE/fix/do-not-use-doc.onlyoffice.com
Do not use https://doc.onlyoffice.com as example
2017-10-20 14:30:12 +03:00
207f896e25 Do not use https://doc.onlyoffice.com as example
It has JWT enabled and will not work without secret keys.
Users should setup their own http://documentserver
2017-10-20 14:26:57 +03:00
983c8829fa editors: permisions modifyFilter 2017-10-19 16:15:39 +03:00
02afb13601 Merge 2017-10-13 14:44:54 +03:00
494bc6b6a4 csharp: remove storage service 2017-10-09 17:39:51 +03:00
72db6178ac java: remove storage service 2017-10-09 17:35:12 +03:00
5c1d925d42 nodejs: remove storage service 2017-10-09 17:33:30 +03:00
fd4dfea7d7 php: remove storage service 2017-10-09 17:31:49 +03:00
ebd309dabc ruby: remove storage service 2017-10-09 17:29:09 +03:00
f376c50fd9 try convert once 2017-10-09 17:16:24 +03:00
6088e7d685 ruby: gemfile up 2017-10-09 17:01:43 +03:00
d143e3c80d ruby: json response 2017-10-09 16:24:09 +03:00
56d6388603 ruby: change track event 2017-10-09 15:47:21 +03:00
54993942bf java: json response 2017-10-06 16:06:41 +03:00
f2301ecbbf java: fix opening editor 2017-10-06 16:06:01 +03:00
f09f62103c java: formatting 2017-10-06 16:05:44 +03:00
75c1cc0c83 v5.0.1 2017-10-05 14:46:28 +03:00
e1e3357748 nodejs: json response 2017-09-28 18:40:18 +03:00
449020a9a4 php: json response 2017-09-28 18:18:23 +03:00
22f2f0f922 mvc: json response 2017-09-28 17:55:01 +03:00
1aa7e73d79 csharp: json response 2017-09-28 17:47:54 +03:00
6eaa290557 Merge branch 'hotfix/v5.0.1' into develop 2017-09-26 14:14:40 +03:00
ed8df66513 support OpenDocument Flat Document file type 2017-09-26 14:11:18 +03:00
16d942a487 support OpenDocument Flat Document file type 2017-09-26 13:24:34 +03:00
5c6d9ec008 v5.0.0 2017-09-19 17:04:59 +03:00
8e7f7c20e4 nodejs: fix opening history without changes 2017-09-14 16:07:53 +03:00
b3f7e9861f Merge remote-tracking branch 'remotes/origin/release/v5.0.0' into develop
# Conflicts:
#	web/documentserver-example/nodejs/config/default.json
#	web/documentserver-example/nodejs/helpers/fileUtility.js
2017-09-07 15:58:30 +03:00
797696ceea Merge branch 'feature/m-formats' into develop 2017-09-07 15:54:54 +03:00
af30096d71 Fix editable formats list 2017-09-07 15:54:14 +03:00
8a7193a645 support template formats 2017-09-07 15:52:47 +03:00
84f5be3556 change viewed formats list 2017-09-07 15:47:47 +03:00
cff90de454 nodejs: edit link only for editable format 2017-09-07 13:51:33 +03:00
18b7bdb401 support convertation -m formats to -x 2017-09-07 12:28:46 +03:00
75155b4c54 Fix Bug 35704 - commenting in review mode 2017-09-06 11:19:11 +03:00
4c3bc0e7ef convert docm,dot,dotm,dotx,xlsm,xlt,xltm,xltx,pot,potm,potx,ppsm,pptm to OOX format 2017-09-06 11:09:29 +03:00
908affc61c Fix Bug 35704 - commenting in review mode 2017-08-28 17:17:45 +03:00
c5b227d278 remove preselected lang value (Bug 35603) 2017-08-28 16:08:32 +03:00
364d24dda2 Added new formats. 2017-08-18 16:37:03 +03:00
74537582d7 support -m formats 2017-08-04 17:39:02 +03:00
8057ef7cbc nodejs: siteUrl 2017-08-03 19:18:47 +03:00
8bab3ecbc6 nodejs: web-apps-pro for development 2017-08-03 16:33:29 +03:00
7e2a12c836 java: delete using javafx.util.Pair 2017-07-31 16:41:47 +03:00
f4ed512fd0 Fix Bug 35281 - reload files list after closing upload dialog by Close button 2017-07-07 17:27:59 +03:00
e729b21dad Merge tag 'v4.4.1' into develop
v4.4.1
2017-07-05 11:49:04 +03:00
26dec26f78 Merge branch 'release/v4.4.1' 2017-07-05 11:48:53 +03:00
c456b697e1 Merge pull request #31 from ONLYOFFICE/develop
Develop
2017-06-28 18:40:04 +03:00
a17b419791 nodejs: comment only mode 2017-06-28 18:09:17 +03:00
25e0d5692f nodejs: additional parameter for review mode 2017-06-28 17:36:47 +03:00
e8559cf67c nodejs: fix review mode 2017-06-28 17:36:17 +03:00
2882366ed6 Update Readme.md 2017-06-28 17:27:09 +03:00
30829683ed Merge pull request #30 from ONLYOFFICE/fix/pptx-sample-lang
Update `new.pptx` files
2017-06-27 14:02:44 +03:00
0988e10500 Update new.pptx files
Old files were set with Russian language as default lang
for spellchecker.
Updated files were made by Denis Spitsyn.
2017-06-27 13:51:31 +03:00
af7dcbb700 corrected license type to MIT 2017-06-26 18:04:43 +03:00
ba1358c116 Copyright 2017-06-26 16:29:01 +03:00
0325c421bf java: revert some changes 2017-06-23 13:29:41 +03:00
9ee88881bf php: encoding 2017-06-23 11:41:06 +03:00
5d5ef36b48 mvc: include dependencies 2017-06-23 11:40:21 +03:00
6d4cf2089e Merge pull request #29 from ONLYOFFICE/feature/java
Feature/java
2017-06-23 11:38:52 +03:00
e7f492242f java: processing empty parameters 2017-06-13 19:11:08 +03:00
022acfb9cd Merge tag 'v4.3.5' into develop
v4.3.5 v4.3.5
2017-06-05 16:49:44 +03:00
66c19c1b89 qBBBBBBBBBAAAAAMerge branch 'hotfix/v4.3.5' 2017-06-05 16:49:28 +03:00
a32be5a464 java: ignore 2017-06-02 17:46:34 +03:00
f7a83caa64 java: URLEncoder.encode(string) is deprecated 2017-06-02 17:46:34 +03:00
899116b114 java: response from callback "error:0" 2017-06-02 17:46:24 +03:00
7d5d444108 java: closing scanner 2017-06-02 17:45:51 +03:00
bd3cb77bb6 java: project file 2017-06-02 17:14:54 +03:00
5e14e4d04f java: Fixed unused code 2017-06-02 17:14:31 +03:00
bbd8305ad9 nodejs: error when save deleted file 2017-05-18 19:53:56 +03:00
c5b6b7ab1b nodejs: use the date when creating the key 2017-05-18 19:53:23 +03:00
c854249add Merge pull request #27 from ONLYOFFICE/feature/nssm-startup
fixed crash on windows 2008r2
2017-05-16 13:10:59 +03:00
837b56b20f fixed crash on windows 2008r2 2017-05-15 16:36:58 +03:00
80b081883e Fix Bug 34711 - css iPhone4s 2017-04-27 15:46:19 +03:00
7c71d42975 Fix download link for custom EXAMPLE_URL (Issue #24) 2017-04-25 19:28:43 +03:00
a52d5cb3be Fix Bug 33758 - replacing address for document server (exampleUrl) 2017-04-25 18:30:39 +03:00
a9d261a0ad Fix Bug 34620 - resize on mobile 2017-04-25 17:55:45 +03:00
5dea4c77a9 Fix Bug 34739 - encode ' 2017-04-25 17:42:51 +03:00
8eb017b092 nodejs: plugins new format 2017-04-25 17:08:04 +03:00
dd346a380e Merge tag 'v4.3.2' into develop
v4.3.2 v4.3.2
2017-04-17 14:59:31 +03:00
61497a8da7 Merge branch 'hotfix/v4.3.2' 2017-04-17 14:59:29 +03:00
34d568bdbc Fix goback button 2017-04-06 18:42:18 +03:00
905084dc52 Fix goback button 2017-04-06 17:22:13 +03:00
e00b662660 Merge tag 'v4.3.0' into develop
v4.3.0
2017-04-03 12:58:54 +03:00
5ded3f6135 Merge branch 'release/v4.3.0' 2017-04-03 12:58:44 +03:00
a096e96b29 Fix Bug 34518 - "Uncaught SyntaxError: Unexpected token }" 2017-03-27 14:31:58 +03:00
b452a171d1 nodejs: append dependencies 2017-03-21 10:40:03 +03:00
282ea78799 Merge pull request #22 from ONLYOFFICE/feature/forcesave
Feature/forcesave
2017-03-16 15:58:38 +03:00
4824373678 nodejs: forcesave configuration for new sсheme editing 2017-03-16 15:57:07 +03:00
df8a575d75 ignore vscode 2017-03-16 15:54:40 +03:00
e023ec3bb7 nodejs: download forcesaved file, delete forcesaved file after saving 2017-03-16 14:53:12 +03:00
535ba03cdf nodejs: download file via handler 2017-03-16 14:36:34 +03:00
f5d416e371 nodejs: forcesave to history directory 2017-03-16 14:03:22 +03:00
931e05a175 nodejs: jwt for historyData 2017-03-15 17:54:04 +03:00
293919bb6e nodejs: new arguments in setHistoryData 2017-03-15 17:46:34 +03:00
35c4dd6a95 Disabled jwt 2017-03-03 17:34:24 +03:00
32aff45d7d Merge pull request #21 from ONLYOFFICE/feature/token
Feature/token
2017-03-03 16:54:38 +03:00
1b73970ebc node: jwt 2017-03-03 16:48:45 +03:00
c014250479 node: moved config in a separate file 2017-03-02 19:38:24 +03:00
b1e216da88 node: upload request without file 2017-03-02 18:52:20 +03:00
257bf005eb Removed plugins form config 2017-02-28 15:57:08 +03:00
4d7a777730 fix scope 2017-02-21 18:10:54 +03:00
71fd3e8ce8 update packages 2017-02-21 18:06:27 +03:00
fabb6f5f6d add check error on upload
upload to tmp folder (delete if error)
2017-02-21 18:06:06 +03:00
9c4fc0347f add delete all files
if filename exist delete file, other - delete all files
var -> let and const
2017-02-21 16:23:32 +03:00
8ab3069acf update package formidable 2017-02-21 16:19:39 +03:00
96666e9723 Copyright 2017 2017-02-21 11:01:51 +03:00
bec8de63eb remove base ulr 2017-02-20 17:47:19 +03:00
6c01f7a11b add plugins 2017-02-17 19:27:29 +03:00
d83c103a31 update favicon.ico 2017-02-17 15:22:16 +03:00
dac9003e58 Fix Bug 33954 - open mobile editor by user agent 2017-02-15 16:47:30 +03:00
680670294b fileName is not the last parameter 2017-02-15 11:59:42 +03:00
62906cd744 Applying https://github.com/ONLYOFFICE/document-server-integration/pull/20 2017-02-15 11:45:40 +03:00
f4e7a5cd6f check exist history file instead of folder 2017-02-10 13:22:43 +03:00
63cea1cecb Fix Bug 33279 - add onOutdatedVersion event 2017-02-09 18:58:45 +03:00
2e6e8ccfd1 php: replace domain for DocumentServer from config 2017-02-09 17:45:43 +03:00
bc5bb0d142 php: fix convert response with fileuri 2017-02-09 17:44:27 +03:00
0e3b5a4fc9 php: sorting by mtime 2017-02-09 15:35:54 +03:00
7e26d068a5 php: review mode 2017-01-31 18:01:19 +03:00
13c8530cfd nodejs: review mode 2017-01-31 17:53:29 +03:00
c0f47f892b nodejs: using method getServerUrl 2017-01-31 16:51:28 +03:00
389 changed files with 26796 additions and 4048 deletions

8
.gitignore vendored
View File

@ -4,8 +4,10 @@
*.user
/build/deploy
/build/*.log
/web/documentserver-example/csharp-mvc/packages
/web/documentserver-example/nodejs/node_modules
/web/documentserver-example/nodejs/public/files
/web/documentserver-example/nodejs/files
/web/documentserver-example/nodejs/config/local.json
**/.idea
/web/documentserver-example/nodejs/example
**/.vscode/
**/.idea
/web/documentserver-example/java/target/

263
3rd-Party.license Normal file
View File

@ -0,0 +1,263 @@
Document Server integration example uses code from the following 3rd party projects.
web/documentserver-example/csharp
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
web/documentserver-example/csharp-mvc
Entity Framework - Entity Framework is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. (https://docs.microsoft.com/en-us/ef/ef6/resources/licenses/ef5/enu)
License: MICROSOFT SOFTWARE SUPPLEMENTAL TERMS, MICROSOFT SOFTWARE LICENSE TERMS
License File: EntityFramework.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Microsoft.Web.Infrastructure - This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time. (https://www.microsoft.com/web/webpi/eula/aspnetmvc3update-eula.htm)
License: MS-EULA License
License File: Microsoft.Web.Infrastructure.license
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://licenses.nuget.org/MIT)
License: MIT
License File: Newtonsoft.Json.license
WebGrease - Web Grease is a suite of tools for optimizing javascript, css files and images. (https://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm)
License: MICROSOFT .NET LIBRARY LICENSE
License File: WebGrease.license
web/documentserver-example/java
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Prime JWT - is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson. (https://github.com/ws-apps/prime-jwt/blob/master/LICENSE)
License: Apache 2.0
License File: prime-jwt.license
web/documentserver-example/nodejs
body-parser - Node.js body parsing middleware. (https://github.com/expressjs/body-parser/blob/master/LICENSE)
License: MIT
License File: body-parser.license
config - Node-config organizes hierarchical configurations for your app deployments. (https://github.com/lorenwest/node-config/blob/master/LICENSE)
License: MIT
License File: config.license
debug - A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. (https://github.com/visionmedia/debug/blob/master/LICENSE)
License: MIT
License File: debug.license
ejs - Embedded JavaScript templates (https://github.com/mde/ejs/blob/main/LICENSE)
License: Apache 2.0
License File: ejs.license
express - Fast, unopinionated, minimalist web framework for node. (https://github.com/mde/ejs/blob/main/LICENSE)
License: MIT
License File: express.license
formidable - A Node.js module for parsing form data, especially file uploads. (https://github.com/node-formidable/formidable/blob/master/LICENSE)
License: MIT
License File: formidable.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
jsonwebtoken - An implementation of JSON Web Tokens. (https://github.com/auth0/node-jsonwebtoken/blob/master/LICENSE)
License: MIT
License File: jsonwebtoken.license
jwa - A JSON Web Algorithms implementation focusing (exclusively, at this point) on the algorithms necessary for JSON Web Signatures. (https://github.com/auth0/node-jwa/blob/master/LICENSE)
License: MIT
License File: jwa.license
log4js - This is a conversion of the log4js framework to work with node. (https://github.com/log4js-node/log4js-node/blob/master/LICENSE)
License: MIT
License File: log4js.license
mime - A comprehensive, compact MIME type module. (https://github.com/broofa/mime/blob/master/LICENSE)
License: MIT
License File: mime.license
serve-favicon - Node.js middleware for serving a favicon. (https://github.com/expressjs/serve-favicon/blob/master/LICENSE)
License: MIT
License File: serve-favicon.license
sync-request - Make synchronous web requests with cross-platform support. (https://github.com/ForbesLindesay/sync-request/blob/master/LICENSE)
License: MIT
License File: sync-request.license
urllib - Request HTTP URLs in a complex world — basic and digest authentication, redirections, cookies, timeout and more. (https://github.com/node-modules/urllib/blob/master/LICENSE)
License: MIT
License File: urllib.license
web/documentserver-example/php
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
web/documentserver-example/ruby
byebug - Byebug is a Ruby debugger. (https://github.com/deivid-rodriguez/byebug/blob/master/LICENSE)
License: BSD-2-Clause
License File: byebug.license
coffee-rails - CoffeeScript adapter for the Rails asset pipeline. (https://github.com/rails/coffee-rails/blob/master/MIT-LICENSE)
License: MIT
License File: coffee-rails.license
jbuilder - Create JSON structures via a Builder-style DSL (https://github.com/rails/jbuilder/blob/master/MIT-LICENSE)
License: MIT
License File: jbuilder.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
jquery-rails - This gem provides jQuery and the jQuery-ujs driver for your Rails 4+ application. (https://github.com/rails/jquery-rails/blob/master/MIT-LICENSE)
License: MIT
License File: jquery-rails.license
rails - Rails is a web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. (https://github.com/rails/rails/blob/v6.0.3.2/MIT-LICENSE)
License: MIT
License File: rails.license
sass-rails - This gem provides official integration for Ruby on Rails projects with the Sass stylesheet language. (https://github.com/rails/sass-rails/blob/master/MIT-LICENSE)
License: MIT
License File: sass-rails.license
sdoc - rdoc generator html with javascript search index. (https://github.com/zzak/sdoc/blob/master/LICENSE)
License: MIT
License File: sdoc.license
sqlite3 - This module allows Ruby programs to interface with the SQLite3 database engine (www.sqlite.org). (https://github.com/sparklemotion/sqlite3-ruby/blob/master/LICENSE)
License: BSD-3-Clause
License File: sqlite3.license
turbolinks - Rails engine for Turbolinks 5 support (https://github.com/turbolinks/turbolinks-rails/blob/master/LICENSE)
License: MIT
License File: turbolinks.license
tzinfo-data - TZInfo::Data contains data from the IANA Time Zone database packaged as Ruby modules for use with TZInfo. (https://github.com/tzinfo/tzinfo-data/blob/master/LICENSE)
License: MIT
License File: tzinfo-data.license
uglifier - Uglifier minifies JavaScript files by wrapping UglifyJS to be accessible in Ruby (https://github.com/lautis/uglifier/blob/master/LICENSE.txt)
License: MIT
License File: uglifier.license
uuid - UUID generator for producing universally unique identifiers based on RFC 4122 (https://github.com/assaf/uuid/blob/master/MIT-LICENSE)
License: MIT
License File: uuid.license
web-console - A debugging tool for your Ruby on Rails applications. (https://github.com/rails/web-console/blob/master/MIT-LICENSE)
License: MIT
License File: web-console.license

View File

@ -1,30 +0,0 @@
Document Server integration example uses code from the following 3rd party projects.
1. jQuery - Query is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. (http://jquery.com/)
License: The MIT License (MIT)
License File: web\documentserver-example\csharp\licenses\MIT-LICENSE.txt
License File: web\documentserver-example\csharp-mvc\licenses\MIT-LICENSE.txt
2. jQuery BlockUI Plugin - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (http://malsup.com/jquery/block/)
License: MIT, GPL
3. jQuery UI - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice. (http://jqueryui.com/)
License: MIT
4. jQuery-File-Upload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload)
License: MIT
5. Open Sans - Open Sans is a humanist sans serif typeface designed by Steve Matteson, Type Director of Ascender Corp. This version contains the complete 897 character set, which includes the standard ISO Latin 1, Latin CE, Greek and Cyrillic character sets. Open Sans was designed with an upright stress, open forms and a neutral, yet friendly appearance. It was optimized for print, web, and mobile interfaces, and has excellent legibility characteristics in its letterforms.
Steve Matteson
License: Apache License, version 2.0

201
LICENSE Normal file
View File

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

View File

@ -1,19 +1,52 @@
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![Release](https://img.shields.io/badge/Release-v4.1.2-blue.svg?style=flat)
## Document Server integration example
These examples show the way to integrate [ONLYOFFICE Document Server][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.
These examples show the way to integrate [ONLYOFFICE Document Server][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.
You should change `http://documentserver` to your server address in these files:
* .Net (C# MVC) - `web/documentserver-example/csharp-mvc/web.appsettings.config`
* .Net (C#) - `web/documentserver-example/csharp/settings.config`
* Java - `web/documentserver-example/java/src/main/resources/settings.properties`
* Node.js - `web/documentserver-example/nodejs/config/default.json`
* PHP - `web/documentserver-example/php/config.php`
* Ruby - `web/documentserver-example/ruby/config/application.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")
## API methods for test examples
The methods described below are available for all of the test examples.
### POST `/upload`
| | |
| ---------------------- | ------------------------------------------------------------ |
| **Summary** | Upload file to test example via request |
| **URL** | /upload |
| **Method** | POST |
| **Request<br>Headers** | `Content-Type: multipart/form-data` |
| **Request<br>Body** | `uploadedFile=@<filepath>`<br> `filepath` - file for uploading<br />Multipart body with the file binary contents |
| **Response** | **Code:** 200 OK <br />**Content on success:**<br /> `{ "filename": <filename>}`<br />**Content on error:**<br /> `{ "error": "Uploaded file not found"}` <br /> Or <br /> `{ "error": "File size is incorrect"}` |
| **Sample** | `curl -X POST -F uploadedFile=@filename.docx http://localhost/upload` |
### DELETE `/file`
| | |
| ------------------ | ------------------------------------------------------------ |
| **Summary** | Delete one file or all files |
| **URL** | /file |
| **Method** | DELETE |
| ****URL Params**** | **Optional:**<br /> `filename=[string]` - file for deleting. <br /> *WARNING! Without this parameter, all files will be deleted* |
| **Response** | **Code:** 200 OK <br /> **Success:**<br /> `{"success":true}` |
| **Sample** | **Delete one file:**<br />`curl -X DELETE http://localhost/file?filename=filename.docx`<br />**Delete all files:**<br />`curl -X DELETE http://localhost/file`<br /> |
## Project Information
Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org")
Official website: [https://www.onlyoffice.com](https://www.onlyoffice.com/?utm_source=github&utm_medium=cpc&utm_campaign=GitHubIntegrationEx)
Code repository: [https://github.com/ONLYOFFICE/document-server-integration](https://github.com/ONLYOFFICE/document-server-integration "https://github.com/ONLYOFFICE/document-server-integration")
SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www.onlyoffice.com")
ONLYOFFICE for developers: [https://www.onlyoffice.com/developer-edition.aspx](https://www.onlyoffice.com/developer-edition.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubIntegrationEx)
## User Feedback and Support

View File

@ -1,13 +1,13 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="App_Data\MSBuild.Community.Tasks.dll" TaskName="MSBuild.Community.Tasks.Zip" />
<PropertyGroup>
<To Condition=" '$(To)' == '' ">..\deploy\</To>
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
</PropertyGroup>
<ItemGroup>

View File

@ -1,47 +1,69 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="MSBuild.Community.Tasks.dll" TaskName="MSBuild.Community.Tasks.Zip" />
<PropertyGroup>
<To Condition=" '$(To)' == '' ">..\deploy\</To>
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<DirJava>$(RootDir)web\documentserver-example\java\</DirJava>
<DirNodeJS>$(RootDir)web\documentserver-example\nodejs\</DirNodeJS>
<DirPHP>$(RootDir)web\documentserver-example\php\</DirPHP>
<DirRuby>$(RootDir)web\documentserver-example\ruby\</DirRuby>
<NameCSharp>$(To).Net (C#) Example</NameCSharp>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<NameMvc>$(To).Net (C# MVC) Example</NameMvc>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<NameJava>$(To)Java Example</NameJava>
<DirJava>$(RootDir)web\documentserver-example\java\</DirJava>
<NameNodeJS>$(To)Node.js Example</NameNodeJS>
<DirNodeJS>$(RootDir)web\documentserver-example\nodejs\</DirNodeJS>
<NamePHP>$(To)PHP Example</NamePHP>
<DirPHP>$(RootDir)web\documentserver-example\php\</DirPHP>
<NameRuby>$(To)Ruby Example</NameRuby>
<DirRuby>$(RootDir)web\documentserver-example\ruby\</DirRuby>
<NamePython>$(To)Python Example</NamePython>
<DirPython>$(RootDir)web\documentserver-example\python\</DirPython>
</PropertyGroup>
<Target Name="Build">
<ItemGroup>
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp)App_Data\*.dll;$(DirCSharp)obj\**;" />
</ItemGroup>
<Zip Files="@(ZipFilesCSharp)" WorkingDirectory="$(DirCSharp)" ZipFileName="$(To).Net (C#) Example.zip" />
<RemoveDir Directories="$(To)" ContinueOnError="true" />
<ItemGroup>
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc)obj\**;$(DirMvc)packages\**;" />
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp)obj\**" />
</ItemGroup>
<Zip Files="@(ZipFilesMVC)" WorkingDirectory="$(DirMvc)" ZipFileName="$(To).Net (C# MVC) Example.zip" />
<Copy SourceFiles="@(ZipFilesCSharp)" DestinationFiles="@(ZipFilesCSharp->'$(NameCSharp)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameCSharp)" WorkingDirectory="$(To)" ZipFileName="$(NameCSharp).zip" />
<ItemGroup>
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc)obj\**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesMVC)" DestinationFiles="@(ZipFilesMVC->'$(NameMvc)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameMvc)" WorkingDirectory="$(To)" ZipFileName="$(NameMvc).zip" />
<ItemGroup>
<ZipFilesJava Include="$(DirJava)**" />
</ItemGroup>
<Zip Files="@(ZipFilesJava)" WorkingDirectory="$(DirJava)" ZipFileName="$(To)Java Example.zip" />
<Copy SourceFiles="@(ZipFilesJava)" DestinationFiles="@(ZipFilesJava->'$(NameJava)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameJava)" WorkingDirectory="$(To)" ZipFileName="$(NameJava).zip" />
<ItemGroup>
<ZipFilesNodeJS Include="$(DirNodeJS)**" Exclude="$(DirNodeJS)node_modules\**;$(DirNodeJS)run.bat" />
<ZipFilesNodeJS Include="$(DirNodeJS)**" Exclude="$(DirNodeJS)node_modules\**" />
</ItemGroup>
<Zip Files="@(ZipFilesNodeJS)" WorkingDirectory="$(DirNodeJS)" ZipFileName="$(To)Node.js Example.zip" />
<Copy SourceFiles="@(ZipFilesNodeJS)" DestinationFiles="@(ZipFilesNodeJS->'$(NameNodeJS)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameNodeJS)" WorkingDirectory="$(To)" ZipFileName="$(NameNodeJS).zip" />
<ItemGroup>
<ZipFilesPHP Include="$(DirPHP)**" />
</ItemGroup>
<Zip Files="@(ZipFilesPHP)" WorkingDirectory="$(DirPHP)" ZipFileName="$(To)PHP Example.zip" />
<Copy SourceFiles="@(ZipFilesPHP)" DestinationFiles="@(ZipFilesPHP->'$(NamePHP)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NamePHP)" WorkingDirectory="$(To)" ZipFileName="$(NamePHP).zip" />
<ItemGroup>
<ZipFilesRuby Include="$(DirRuby)**" />
</ItemGroup>
<Zip Files="@(ZipFilesRuby)" WorkingDirectory="$(DirRuby)" ZipFileName="$(To)Ruby Example.zip" />
<Copy SourceFiles="@(ZipFilesRuby)" DestinationFiles="@(ZipFilesRuby->'$(NameRuby)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameRuby)" WorkingDirectory="$(To)" ZipFileName="$(NameRuby).zip" />
<ItemGroup>
<ZipFilesPython Include="$(DirPython)**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesPython)" DestinationFiles="@(ZipFilesPython->'$(NamePython)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NamePython)" WorkingDirectory="$(To)" ZipFileName="$(NamePython).zip" />
</Target>
</Project>

View File

@ -1,22 +0,0 @@
DocumentServerIntegration uses code from the following 3rd party projects.
1. Ionic.Zip.dll - The Zip, implementation for .NET. (http://dotnetzip.codeplex.com/)
License: MS-PL
License File: DotNetZip.license
2. jQuery - Query is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. (http://jquery.com/)
License: MIT License
License File: jQuery.license
3. jQuery BlockUI Plugin - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (http://malsup.com/jquery/block/)
License: MIT, GPL
4. jQuery UI - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice. (http://jqueryui.com/)
License: MIT

View File

@ -1,33 +0,0 @@
Microsoft Public License (Ms-PL)
This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>
<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://www.nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
</PropertyGroup>
<PropertyGroup>
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
</PropertyGroup>
<PropertyGroup>
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
</PropertyGroup>
<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>
<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />
<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>

View File

@ -0,0 +1,37 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
Entity Framework - Entity Framework is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. (https://docs.microsoft.com/en-us/ef/ef6/resources/licenses/ef5/enu)
License: MICROSOFT SOFTWARE SUPPLEMENTAL TERMS, MICROSOFT SOFTWARE LICENSE TERMS
License File: EntityFramework.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Microsoft.Web.Infrastructure - This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time. (https://www.microsoft.com/web/webpi/eula/aspnetmvc3update-eula.htm)
License: MS-EULA License
License File: Microsoft.Web.Infrastructure.license
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://licenses.nuget.org/MIT)
License: MIT
License File: Newtonsoft.Json.license
WebGrease - Web Grease is a suite of tools for optimizing javascript, css files and images. (https://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm)
License: MICROSOFT .NET LIBRARY LICENSE
License File: WebGrease.license

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Web.Optimization;

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Web.Mvc;

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Web.Mvc;
using System.Web.Routing;

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Web.Http;

View File

@ -1,29 +1,22 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
html {
html {
height: 100%;
width: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

View File

@ -1,30 +1,22 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
html {
html {
height: 100%;
width: 100%;
}
@ -112,13 +104,14 @@ label .checkbox {
.try-editor-list {
list-style: none;
margin: 0;
margin: 0 0 16px;
padding: 0;
}
.try-editor-list li {
float: left;
margin: 25px;
width: 150px;
margin: 0 15px;
width: 100px;
cursor: pointer;
}
.try-editor {
background-color: transparent;
@ -142,6 +135,11 @@ label .checkbox {
background-image: url("images/file_pptx.png");
}
.create-sample {
display: inline-block;
margin-left: 75px;
}
.button, .button:visited, .button:hover, .button:active {
display: inline-block;
font-weight: normal;
@ -184,25 +182,43 @@ label .checkbox {
border: 1px solid #E9EAEA;
}
.upload-panel {
border-right: 1px solid #D1D1D1;
float: left;
margin-right: 25px;
}
.file-upload {
background: url("images/file_upload.png") no-repeat center 0 transparent;
cursor: pointer;
margin-bottom: 8px;
padding: 0 !important;
display: inline-block;
font-size: 14px;
font-weight: bold;
height: 45px;
margin: 0 40px 16px;
overflow: hidden;
padding-top: 100px;
position: relative;
text-align: center;
width: 100px;
}
.file-upload span {
line-height: 21px;
margin: 2px 12px;
.file-upload input {
cursor: pointer;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transform: translate(555px, 60px) scale(8);
}
.create-panel {
float: left;
}
.file-upload input {
cursor: pointer;
font-size: 23px;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transform: translate(-300px, 0) scale(4);
.upload-panel,
.create-panel {
padding: 10px 0;
}
#mainProgress {
@ -280,7 +296,54 @@ label .checkbox {
line-height: 26px;
}
.stored-list {
border-top: 1px solid #D1D1D1;
list-style: none;
margin: 0;
padding: 0;
}
.stored-list li {
border-bottom: 1px solid #D1D1D1;
line-height: 28px;
padding: 0 8px;
}
.stored-edit {
background-color: transparent;
background-position: left center;
background-repeat: no-repeat;
display: inline-block;
line-height: 16px;
max-width: 450px;
margin-bottom: -6px;
overflow: hidden;
padding: 4px 0 1px 34px;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
}
.stored-edit.text {
background-image: url("images/icon_docx.png");
}
.stored-edit.spreadsheet {
background-image: url("images/icon_xlsx.png");
}
.stored-edit.presentation {
background-image: url("images/icon_pptx.png");
}
.stored-edit span {
font-size: 12px;
line-height: 12px;
}
.stored-edit:hover span {
text-decoration: underline;
}
.blockTitle {
@ -311,4 +374,121 @@ label .checkbox {
-moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.5);
padding: 0 !important;
}
}
.clearFix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/*Icon table*/
#tableRow {
vertical-align: top;
}
.tableRow {
background: transparent;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tableRow:hover {
background-color: #ebebeb;
}
.tableHeader {
background: transparent;
color: #333;
cursor: default;
font-family: 'Open Sans', sans-serif;
font-size: 13px;
height: 40px;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.tableHeaderCell {
padding: 2px 1px 2px 5px;
text-align: center;
}
.tableHeaderCellFileName {
text-align: left;
}
.contentCells {
padding: 4px 1px 4px 5px;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
border-bottom: 1px solid #e5e5e5;
white-space: nowrap;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.contentCells a {
text-decoration: none;
}
.contentCells-shift {
padding-right: 30px;
}
.contentCells-icon {
width: 6%;
}
.contentCellsSmall {
padding: 5px 1px 5px 6px;
font-family: 'Open Sans', sans-serif;
font-size: 13px;
border-bottom: 1px solid #e5e5e5;
white-space: nowrap;
text-align: center;
}
.primaryRow {
background-color: #e9e9e9;
}
.secondaryRow {
background-color: #F9F9F9;
}
.select-user {
margin-left: 15px;
}
.user-block-table {
height: 100%;
width: 100%;
}
.user-block-table td {
background-color: #F4F4F4;
border-bottom: 1px solid white;
padding: 12px 0;
}
#user, #language {
width: 130px;
}
.icon-download {
margin-bottom: -5px;
}
.icon-delete {
cursor: pointer;
margin-bottom: -6px;
}

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Web.Mvc;
using OnlineEditorsExampleMVC.Helpers;
@ -36,22 +29,22 @@ namespace OnlineEditorsExampleMVC.Controllers
return View();
}
public ActionResult Editor(string fileName, string mode)
public ActionResult Editor(string fileName, string editorsMode, string editorsType)
{
mode = mode ?? string.Empty;
var file = new FileModel
{
TypeDesktop = mode != "embedded",
Mode = editorsMode,
Type = editorsType,
FileName = fileName
};
return View("Editor", file);
}
public ActionResult Sample(string fileExt)
public ActionResult Sample(string fileExt, bool? sample)
{
var fileName = DocManagerHelper.CreateDemo(fileExt);
var fileName = DocManagerHelper.CreateDemo(fileExt, sample ?? false);
DocManagerHelper.CreateMeta(fileName, Request.Cookies.GetOrDefault("uid", ""), Request.Cookies.GetOrDefault("uname", ""));
Response.Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
return null;
}

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Web;
using System.Web.Http;

View File

@ -1,37 +1,29 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Caching;
using System.Web.Configuration;
using System.Web.Script.Serialization;
using OnlineEditorsExampleMVC.Models;
namespace OnlineEditorsExampleMVC.Helpers
@ -83,6 +75,32 @@ namespace OnlineEditorsExampleMVC.Helpers
return directory + fileName;
}
public static string HistoryDir(string storagePath)
{
return storagePath += "-hist";
}
public static string VersionDir(string histPath, int version)
{
return Path.Combine(histPath, version.ToString());
}
public static string VersionDir(string fileName, string userAddress, int version)
{
return VersionDir(HistoryDir(StoragePath(fileName, userAddress)), version);
}
public static int GetFileVersion(string historyPath)
{
if (!Directory.Exists(historyPath)) return 0;
return Directory.EnumerateDirectories(historyPath).Count();
}
public static int GetFileVersion(string fileName, string userAddress)
{
return GetFileVersion(HistoryDir(StoragePath(fileName, userAddress)));
}
public static string GetCorrectName(string fileName)
{
var baseName = Path.GetFileNameWithoutExtension(fileName);
@ -96,9 +114,20 @@ namespace OnlineEditorsExampleMVC.Helpers
return name;
}
public static string CreateDemo(string fileExt)
public static List<string> GetStoredFiles()
{
var demoName = "sample." + fileExt;
var directory = HttpRuntime.AppDomainAppPath + WebConfigurationManager.AppSettings["storage-path"] + CurUserHostAddress(null) + "\\";
if (!Directory.Exists(directory)) return new List<string>();
var directoryInfo = new DirectoryInfo(directory);
var storedFiles = directoryInfo.GetFiles("*.*", SearchOption.TopDirectoryOnly).Select(fileInfo => fileInfo.Name).ToList();
return storedFiles;
}
public static string CreateDemo(string fileExt, bool withContent)
{
var demoName = (withContent ? "sample." : "new.") + fileExt;
var fileName = GetCorrectName(demoName);
@ -107,6 +136,17 @@ namespace OnlineEditorsExampleMVC.Helpers
return fileName;
}
public static void CreateMeta(string fileName, string uid, string uname)
{
var histDir = HistoryDir(StoragePath(fileName, null));
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", string.IsNullOrEmpty(uid) ? "uid-1" : uid },
{ "name", string.IsNullOrEmpty(uname) ? "John Smith" : uname }
}));
}
public static string GetFileUri(string fileName)
{
var uri = new UriBuilder(HttpContext.Current.Request.Url)
@ -120,6 +160,18 @@ namespace OnlineEditorsExampleMVC.Helpers
return uri.ToString();
}
public static string GetPathUri(string path)
{
var uri = new UriBuilder(HttpContext.Current.Request.Url)
{
Path = HttpRuntime.AppDomainAppVirtualPath + "/"
+ path,
Query = ""
};
return uri.ToString();
}
public static string GetCallback(string fileName)
{
var callbackUrl = new UriBuilder(HttpContext.Current.Request.Url)
@ -129,8 +181,8 @@ namespace OnlineEditorsExampleMVC.Helpers
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=track"
+ "&userAddress=" + HttpUtility.UrlEncode(HttpContext.Current.Request.UserHostAddress)
+ "&fileName=" + HttpUtility.UrlEncode(fileName)
+ "&userAddress=" + HttpUtility.UrlEncode(HttpContext.Current.Request.UserHostAddress)
};
return callbackUrl.ToString();
}

View File

@ -1,37 +1,30 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Configuration;
using System.Xml;
using System.Xml.Linq;
using System.Web.Helpers;
using System.Web.Script.Serialization;
namespace OnlineEditorsExampleMVC.Helpers
{
@ -46,7 +39,6 @@ namespace OnlineEditorsExampleMVC.Helpers
static ServiceConverter()
{
DocumentConverterUrl = WebConfigurationManager.AppSettings["files.docservice.url.converter"] ?? "";
DocumentStorageUrl = WebConfigurationManager.AppSettings["files.docservice.url.storage"] ?? "";
Int32.TryParse(WebConfigurationManager.AppSettings["files.docservice.timeout"], out ConvertTimeout);
ConvertTimeout = ConvertTimeout > 0 ? ConvertTimeout : 120000;
@ -64,21 +56,6 @@ namespace OnlineEditorsExampleMVC.Helpers
/// </summary>
private static readonly string DocumentConverterUrl;
/// <summary>
/// Url to the service of storage
/// </summary>
private static readonly string DocumentStorageUrl;
/// <summary>
/// The parameters for the query conversion
/// </summary>
private const string ConvertParams = "?url={0}&outputtype={1}&filetype={2}&title={3}&key={4}";
/// <summary>
/// Number of tries request conversion
/// </summary>
private const int MaxTry = 3;
#endregion
#region public method
@ -107,74 +84,66 @@ namespace OnlineEditorsExampleMVC.Helpers
out string convertedDocumentUri)
{
convertedDocumentUri = string.Empty;
var responceFromConvertService =
SendRequestToConvertService(documentUri, fromExtension, toExtension, documentRevisionId, isAsync)
.Root;
var errorElement = responceFromConvertService.Element("Error");
if (errorElement != null)
ProcessConvertServiceResponceError(Convert.ToInt32(errorElement.Value));
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri) : fromExtension;
var isEndConvert = Convert.ToBoolean(responceFromConvertService.Element("EndConvert").Value);
var percent = Convert.ToInt32(responceFromConvertService.Element("Percent").Value);
var title = Path.GetFileName(documentUri);
title = string.IsNullOrEmpty(title) ? Guid.NewGuid().ToString() : title;
if (isEndConvert)
{
convertedDocumentUri = responceFromConvertService.Element("FileUrl").Value;
percent = 100;
}
else
{
percent = percent >= 100 ? 99 : percent;
}
documentRevisionId = string.IsNullOrEmpty(documentRevisionId)
? documentUri
: documentRevisionId;
documentRevisionId = GenerateRevisionId(documentRevisionId);
return percent;
}
/// <summary>
/// Placing the document in the storage service
/// </summary>
/// <param name="fileStream">Stream of document</param>
/// <param name="contentLength">Length of stream</param>
/// <param name="contentType">Mime type</param>
/// <param name="documentRevisionId">Key for caching on service, whose used in editor</param>
/// <returns>Uri to document in the storage</returns>
public static string GetExternalUri(
Stream fileStream,
long contentLength,
string contentType,
string documentRevisionId)
{
var urlDocumentService = DocumentStorageUrl + ConvertParams;
var urlTostorage = String.Format(urlDocumentService,
string.Empty,
string.Empty,
string.Empty,
string.Empty,
documentRevisionId);
var request = (HttpWebRequest)WebRequest.Create(urlTostorage);
var request = (HttpWebRequest)WebRequest.Create(DocumentConverterUrl);
request.Method = "POST";
request.ContentType = contentType;
request.ContentLength = contentLength;
request.ContentType = "application/json";
request.Accept = "application/json";
request.Timeout = ConvertTimeout;
const int bufferSize = 2048;
var buffer = new byte[bufferSize];
int readed;
while ((readed = fileStream.Read(buffer, 0, bufferSize)) > 0)
var body = new Dictionary<string, object>() {
{ "async", isAsync },
{ "filetype", fromExtension.Trim('.') },
{ "key", documentRevisionId },
{ "outputtype", toExtension.Trim('.') },
{ "title", title },
{ "url", documentUri }
};
if (JwtManager.Enabled)
{
request.GetRequestStream().Write(buffer, 0, readed);
var payload = new Dictionary<string, object>
{
{ "payload", body }
};
var payloadToken = JwtManager.Encode(payload);
var bodyToken = JwtManager.Encode(body);
request.Headers.Add("Authorization", "Bearer " + payloadToken);
body.Add("token", bodyToken);
}
var bytes = Encoding.UTF8.GetBytes(new JavaScriptSerializer().Serialize(body));
request.ContentLength = bytes.Length;
using (var requestStream = request.GetRequestStream())
{
requestStream.Write(bytes, 0, bytes.Length);
}
string dataResponse;
using (var response = request.GetResponse())
using (var stream = response.GetResponseStream())
{
if (stream == null) throw new WebException("Could not get an answer");
var xDocumentResponse = XDocument.Load(new XmlTextReader(stream));
string externalUri;
GetResponseUri(xDocumentResponse, out externalUri);
return externalUri;
if (stream == null) throw new Exception("Response is null");
using (var reader = new StreamReader(stream))
{
dataResponse = reader.ReadToEnd();
}
}
return GetResponseUri(dataResponse, out convertedDocumentUri);
}
/// <summary>
@ -194,77 +163,44 @@ namespace OnlineEditorsExampleMVC.Helpers
#region private method
/// <summary>
/// Request for conversion to a service
/// Processing document received from the editing service
/// </summary>
/// <param name="documentUri">Uri for the document to convert</param>
/// <param name="fromExtension">Document extension</param>
/// <param name="toExtension">Extension to which to convert</param>
/// <param name="documentRevisionId">Key for caching on service</param>
/// <param name="isAsync">Perform conversions asynchronously</param>
/// <returns>Xml document request result of conversion</returns>
private static XDocument SendRequestToConvertService(string documentUri, string fromExtension, string toExtension, string documentRevisionId, bool isAsync)
/// <param name="jsonDocumentResponse">The resulting json from editing service</param>
/// <param name="responseUri">Uri to the converted document</param>
/// <returns>The percentage of completion of conversion</returns>
private static int GetResponseUri(string jsonDocumentResponse, out string responseUri)
{
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri) : fromExtension;
if (string.IsNullOrEmpty(jsonDocumentResponse)) throw new ArgumentException("Invalid param", "jsonDocumentResponse");
var title = Path.GetFileName(documentUri);
title = string.IsNullOrEmpty(title) ? Guid.NewGuid().ToString() : title;
var responseFromService = Json.Decode(jsonDocumentResponse);
if (jsonDocumentResponse == null) throw new WebException("Invalid answer format");
documentRevisionId = string.IsNullOrEmpty(documentRevisionId)
? documentUri
: documentRevisionId;
documentRevisionId = GenerateRevisionId(documentRevisionId);
var errorElement = responseFromService.error;
if (errorElement != null) ProcessResponseError(Convert.ToInt32(errorElement));
var req = (HttpWebRequest)WebRequest.Create(DocumentConverterUrl);
req.Method = "POST";
req.ContentType = "text/json";
req.Timeout = ConvertTimeout;
var isEndConvert = responseFromService.endConvert;
var bodyString = string.Format("{{\"async\": {0},\"filetype\": \"{1}\",\"key\": \"{2}\",\"outputtype\": \"{3}\",\"title\": \"{4}\",\"url\": \"{5}\"}}",
isAsync.ToString().ToLower(),
fromExtension.Trim('.'),
documentRevisionId,
toExtension.Trim('.'),
title,
documentUri);
var bytes = Encoding.UTF8.GetBytes(bodyString);
req.ContentLength = bytes.Length;
using (var requestStream = req.GetRequestStream())
int resultPercent;
responseUri = string.Empty;
if (isEndConvert)
{
requestStream.Write(bytes, 0, bytes.Length);
responseUri = responseFromService.fileUrl;
resultPercent = 100;
}
else
{
resultPercent = responseFromService.percent;
if (resultPercent >= 100) resultPercent = 99;
}
Stream stream = null;
var countTry = 0;
while (countTry < MaxTry)
{
try
{
countTry++;
stream = req.GetResponse().GetResponseStream();
break;
}
catch (WebException ex)
{
if (ex.Status != WebExceptionStatus.Timeout)
{
throw new HttpException((int) HttpStatusCode.BadRequest, "Bad Request", ex);
}
}
}
if (countTry == MaxTry)
{
throw new WebException("Timeout", WebExceptionStatus.Timeout);
}
return XDocument.Load(new XmlTextReader(stream));
return resultPercent;
}
/// <summary>
/// Generate an error code table
/// </summary>
/// <param name="errorCode">Error code</param>
private static void ProcessConvertServiceResponceError(int errorCode)
private static void ProcessResponseError(int errorCode)
{
var errorMessage = string.Empty;
const string errorMessageTemplate = "Error occurred in the ConvertService.ashx: {0}";
@ -314,45 +250,6 @@ namespace OnlineEditorsExampleMVC.Helpers
throw new Exception(errorMessage);
}
/// <summary>
/// Processing document received from the editing service
/// </summary>
/// <param name="xDocumentResponse">The resulting xml from editing service</param>
/// <param name="responseUri">Uri to the converted document</param>
/// <returns>The percentage of completion of conversion</returns>
private static int GetResponseUri(XDocument xDocumentResponse, out string responseUri)
{
var responceFromConvertService = xDocumentResponse.Root;
if (responceFromConvertService == null) throw new WebException("Invalid answer format");
var errorElement = responceFromConvertService.Element("Error");
if (errorElement != null) ProcessConvertServiceResponceError(Convert.ToInt32(errorElement.Value));
var endConvert = responceFromConvertService.Element("EndConvert");
if (endConvert == null) throw new WebException("Invalid answer format");
var isEndConvert = Convert.ToBoolean(endConvert.Value);
var resultPercent = 0;
responseUri = string.Empty;
if (isEndConvert)
{
var fileUrl = responceFromConvertService.Element("FileUrl");
if (fileUrl == null) throw new WebException("Invalid answer format");
responseUri = fileUrl.Value;
resultPercent = 100;
}
else
{
var percent = responceFromConvertService.Element("Percent");
if (percent != null)
resultPercent = Convert.ToInt32(percent.Value);
resultPercent = resultPercent >= 100 ? 99 : resultPercent;
}
return resultPercent;
}
#endregion
}
}

View File

@ -0,0 +1,105 @@
/**
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.Security.Cryptography;
using System.Text;
using System.Web.Configuration;
using System.Web.Script.Serialization;
namespace OnlineEditorsExampleMVC.Helpers
{
public static class JwtManager
{
private static readonly string Secret;
public static readonly bool Enabled;
private static readonly JavaScriptSerializer Serializer;
static JwtManager()
{
Secret = WebConfigurationManager.AppSettings["files.docservice.secret"] ?? "";
Enabled = !string.IsNullOrEmpty(Secret);
Serializer = new JavaScriptSerializer();
}
public static string Encode(IDictionary<string, object> payload)
{
var header = new Dictionary<string, object>
{
{ "alg", "HS256" },
{ "typ", "JWT" }
};
var encHeader = Base64UrlEncode(Serializer.Serialize(header));
var encPayload = Base64UrlEncode(Serializer.Serialize(payload));
var hashSum = Base64UrlEncode(CalculateHash(encHeader, encPayload));
return string.Format("{0}.{1}.{2}", encHeader, encPayload, hashSum);
}
public static string Decode(string token)
{
if (!Enabled || string.IsNullOrEmpty(token)) return "";
var split = token.Split('.');
if (split.Length != 3) return "";
var hashSum = Base64UrlEncode(CalculateHash(split[0], split[1]));
if (hashSum != split[2]) return "";
return Base64UrlDecode(split[1]);
}
private static byte[] CalculateHash(string encHeader, string encPayload)
{
using (var hasher = new HMACSHA256(Encoding.UTF8.GetBytes(Secret)))
{
var bytes = Encoding.UTF8.GetBytes(string.Format("{0}.{1}", encHeader, encPayload));
return hasher.ComputeHash(bytes);
}
}
private static string Base64UrlEncode(string str)
{
return Base64UrlEncode(Encoding.UTF8.GetBytes(str));
}
private static string Base64UrlEncode(byte[] bytes)
{
return Convert.ToBase64String(bytes)
.TrimEnd('=').Replace('+', '-').Replace('/', '_');
}
private static string Base64UrlDecode(string payload)
{
var b64 = payload.Replace('_', '/').Replace('-', '+');
switch (b64.Length%4)
{
case 2:
b64 += "==";
break;
case 3:
b64 += "=";
break;
}
var bytes = Convert.FromBase64String(b64);
return Encoding.UTF8.GetString(bytes);
}
}
}

View File

@ -0,0 +1,21 @@
using System.Web;
namespace OnlineEditorsExampleMVC.Helpers
{
public static class Utils
{
public static string GetOrDefault(this HttpRequest request, string header, string def)
{
var value = request[header];
if (value != null) return value;
return def;
}
public static string GetOrDefault(this HttpCookieCollection cookies, string cookie, string def)
{
var cook = cookies[cookie];
if (cook != null && !string.IsNullOrEmpty(cook.Value)) return cook.Value;
return def;
}
}
}

View File

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

View File

@ -1,35 +1,36 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using OnlineEditorsExampleMVC.Helpers;
namespace OnlineEditorsExampleMVC.Models
{
public class FileModel
{
public bool TypeDesktop { get; set; }
public string Mode { get; set; }
public string Type { get; set; }
public string FileUri
{
@ -45,14 +46,179 @@ namespace OnlineEditorsExampleMVC.Models
public string Key
{
get { return ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + FileName); }
get { return ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + FileName + "/" + File.GetLastWriteTime(DocManagerHelper.StoragePath(FileName, null)).GetHashCode()); }
}
public string CallbackUrl
{
get
get { return DocManagerHelper.GetCallback(FileName); }
}
public string GetDocConfig(HttpRequest request, UrlHelper url)
{
var jss = new JavaScriptSerializer();
var ext = Path.GetExtension(FileName);
var editorsMode = Mode ?? "edit";
var canEdit = DocManagerHelper.EditedExts.Contains(ext);
var mode = canEdit && editorsMode != "view" ? "edit" : "view";
var actionLink = request.GetOrDefault("actionLink", null);
var actionData = string.IsNullOrEmpty(actionLink) ? null : jss.DeserializeObject(actionLink);
var config = new Dictionary<string, object>
{
{ "type", Type ?? "desktop" },
{ "documentType", DocumentType },
{
"document", new Dictionary<string, object>
{
{ "title", FileName },
{ "url", FileUri },
{ "fileType", ext.Trim('.') },
{ "key", Key },
{
"info", new Dictionary<string, object>
{
{ "author", "Me" },
{ "created", DateTime.Now.ToShortDateString() }
}
},
{
"permissions", new Dictionary<string, object>
{
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "download", true },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") || editorsMode == "blockcontent" },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "modifyFilter", editorsMode != "filter" },
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", editorsMode == "edit" || editorsMode == "review" }
}
}
}
},
{
"editorConfig", new Dictionary<string, object>
{
{ "actionLink", actionData },
{ "mode", mode },
{ "lang", request.Cookies.GetOrDefault("ulang", "en") },
{ "callbackUrl", CallbackUrl },
{
"user", new Dictionary<string, object>
{
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
}
},
{
"embedded", new Dictionary<string, object>
{
{ "saveUrl", FileUri },
{ "embedUrl", FileUri },
{ "shareUrl", FileUri },
{ "toolbarDocked", "top" }
}
},
{
"customization", new Dictionary<string, object>
{
{ "about", true },
{ "feedback", true },
{
"goback", new Dictionary<string, object>
{
{ "url", url.Action("Index", "Home") }
}
}
}
}
}
}
};
if (JwtManager.Enabled)
{
return DocManagerHelper.GetCallback(FileName);
var token = JwtManager.Encode(config);
config.Add("token", token);
}
return jss.Serialize(config);
}
public void GetHistory(out string history, out string historyData)
{
var jss = new JavaScriptSerializer();
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(FileName, null));
history = null;
historyData = null;
if (DocManagerHelper.GetFileVersion(histDir) > 0)
{
var currentVersion = DocManagerHelper.GetFileVersion(histDir);
var hist = new List<Dictionary<string, object>>();
var histData = new Dictionary<string, object>();
for (var i = 0; i <= currentVersion; i++)
{
var obj = new Dictionary<string, object>();
var dataObj = new Dictionary<string, object>();
var verDir = DocManagerHelper.VersionDir(histDir, i + 1);
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt"));
obj.Add("key", key);
obj.Add("version", i);
if (i == 0)
{
var infoPath = Path.Combine(histDir, "createdInfo.json");
if (File.Exists(infoPath))
{
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
obj.Add("created", info["created"]);
obj.Add("user", new Dictionary<string, object>() {
{ "id", info["id"] },
{ "name", info["name"] },
});
}
}
dataObj.Add("key", key);
dataObj.Add("url", i == currentVersion ? FileUri : DocManagerHelper.GetPathUri(Directory.GetFiles(verDir, "prev.*")[0].Substring(HttpRuntime.AppDomainAppPath.Length)));
dataObj.Add("version", i);
if (i > 0)
{
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(DocManagerHelper.VersionDir(histDir, i), "changes.json")));
var change = ((Dictionary<string, object>)((ArrayList)changes["changes"])[0]);
obj.Add("changes", changes["changes"]);
obj.Add("serverVersion", changes["serverVersion"]);
obj.Add("created", change["created"]);
obj.Add("user", change["user"]);
var prev = (Dictionary<string, object>)histData[(i - 1).ToString()];
dataObj.Add("previous", new Dictionary<string, object>() {
{ "key", prev["key"] },
{ "url", prev["url"] },
});
dataObj.Add("changesUrl", DocManagerHelper.GetPathUri(Path.Combine(DocManagerHelper.VersionDir(histDir, i), "diff.zip").Substring(HttpRuntime.AppDomainAppPath.Length)));
}
hist.Add(obj);
histData.Add(i.ToString(), dataObj);
}
history = jss.Serialize(new Dictionary<string, object>()
{
{ "currentVersion", currentVersion },
{ "history", hist }
});
historyData = jss.Serialize(histData);
}
}
}

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System.Collections.Generic;
using System.IO;
@ -50,22 +43,26 @@ namespace OnlineEditorsExampleMVC.Models
public static readonly List<string> ExtsDocument = new List<string>
{
".docx", ".doc", ".odt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx",
".ods", ".csv"
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};
public static readonly List<string> ExtsPresentation = new List<string>
{
".pps", ".ppsx",
".ppt", ".pptx",
".odp"
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp", ".otp"
};
}
}

View File

@ -20,8 +20,6 @@
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">.\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -51,69 +49,80 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="EntityFramework">
<HintPath>packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
<HintPath>bin\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure">
<Private>True</Private>
<HintPath>packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<HintPath>bin\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
<Private>True</Private>
<HintPath>packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
<HintPath>bin\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<HintPath>bin\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.Formatting">
<HintPath>packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Http">
<HintPath>packages\Microsoft.AspNet.WebApi.Core.5.2.0\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost">
<HintPath>packages\Microsoft.AspNet.WebApi.WebHost.5.2.0\lib\net45\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc">
<HintPath>packages\Microsoft.AspNet.Mvc.5.2.0\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Providers">
<HintPath>packages\Microsoft.AspNet.Providers.Core.1.2\lib\net40\System.Web.Providers.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Providers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor">
<HintPath>packages\Microsoft.AspNet.Razor.3.2.0\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.Helpers">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.Helpers.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.WebPages.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
<Private>True</Private>
<HintPath>bin\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath>
<HintPath>bin\WebGrease.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -127,6 +136,8 @@
</Compile>
<Compile Include="Helpers\DocManagerHelper.cs" />
<Compile Include="Helpers\DocumentConverter.cs" />
<Compile Include="Helpers\JwtManager.cs" />
<Compile Include="Helpers\Utils.cs" />
<Compile Include="Models\FileModel.cs" />
<Compile Include="Models\FileUtility.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -137,20 +148,31 @@
<ItemGroup>
<Content Include="Content\editor.css" />
<Content Include="Content\images\alert.png" />
<Content Include="Content\images\block-content-24.png" />
<Content Include="Content\images\close.png" />
<Content Include="Content\images\comment-24.png" />
<Content Include="Content\images\corner.png" />
<Content Include="Content\images\delete-24.png" />
<Content Include="Content\images\desktop-24.png" />
<Content Include="Content\images\done.png" />
<Content Include="Content\images\download-24.png" />
<Content Include="Content\images\embeded-24.png" />
<Content Include="Content\images\file_docx.png" />
<Content Include="Content\images\file_pptx.png" />
<Content Include="Content\images\file_upload.png" />
<Content Include="Content\images\file_xlsx.png" />
<Content Include="Content\images\fill-forms-24.png" />
<Content Include="Content\images\filter-24.png" />
<Content Include="Content\images\loader16.gif" />
<Content Include="Content\images\logo.png" />
<Content Include="Content\images\mobile-24.png" />
<Content Include="Content\images\question_small.png" />
<Content Include="Content\images\review-24.png" />
<Content Include="Content\jquery-ui.css" />
<Content Include="Content\stylesheet.css" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="LICENSE.txt" />
<Content Include="LICENSE" />
<Content Include="ReadMe.txt" />
<Content Include="Scripts\jquery-1.8.2.js" />
<Content Include="Scripts\jquery-ui.js" />
@ -169,9 +191,9 @@
<Content Include="licenses\EntityFramework.license" />
<Content Include="licenses\Microsoft.Web.Infrastructure.license" />
<Content Include="licenses\Newtonsoft.Json.license" />
<Content Include="licenses\jquery.license" />
<Content Include="licenses\WebGrease.license" />
<None Include="packages.config" />
<None Include="web.appsettings.config" />
<Content Include="web.appsettings.config" />
<Content Include="WebEditor.ashx" />
</ItemGroup>
<ItemGroup>
@ -205,13 +227,6 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

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 2016")]
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -2,15 +2,13 @@ For the ONLYOFFICE Applications example to work properly you need to do the foll
1. Download and extract the Example.zip into a directory selected for it, for instance, C:\OnlyofficeExample
2. Use the settings.config file to change the received authorization key for the document service. The file can be found in the unpacked root folder (C:\OnlyofficeExample\web.appsettings.config, in our example). The authorization key is specified in the files.docservice.key field.
2. Run the IIS Manager (C:\Windows\system32\inetsrv\InetMgr.exe or Start -> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager for Windows Server 2003)
3. Run the IIS Manager (C:\Windows\system32\inetsrv\InetMgr.exe or Start -> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager for Windows Server 2003)
3. Add the unpacked Example to the list of sites with the physical path to the C:\OnlyofficeExample (or the one you selected) folder.
4. Add the unpacked Example to the list of sites with the physical path to the C:\OnlyofficeExample (or the one you selected) folder.
4. Make sure that the user account under which the IIS NetworkService process is executed has the write access rights for the C:\OnlyofficeExample\App_Data folder (this is significant for the IIS later than 6.0).
5. Make sure that the user account under which the IIS NetworkService process is executed has the write access rights for the C:\OnlyofficeExample\App_Data folder (this is significant for the IIS later than 6.0).
6. Make the created ONLYOFFIC<49> Applications example available through IP or domain name so that it could be connected from the web by the document service for proper document rendering.
5. Make the created ONLYOFFIC<49> Applications example available through IP or domain name so that it could be connected from the web by the document service for proper document rendering.

View File

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

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
if (typeof jQuery != "undefined") {
jq = jQuery.noConflict();
@ -69,6 +62,8 @@ if (typeof jQuery != "undefined") {
checkConvert();
}
});
initSelectors();
});
var timer = null;
@ -90,11 +85,6 @@ if (typeof jQuery != "undefined") {
return;
}
if (jq("#checkOriginalFormat").is(":checked")) {
loadScripts();
return;
}
timer = setTimeout(function () {
var requestAddress = UrlConverter
+ "&filename=" + encodeURIComponent(jq("#hiddenFileName").val());
@ -161,6 +151,34 @@ if (typeof jQuery != "undefined") {
}
};
var initSelectors = function () {
var userSel = jq("#user");
var langSel = jq("#language");
function getCookie(name) {
let matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : null;
}
function setCookie(name, value) {
document.cookie = name + "=" + value + "; expires=" + new Date(Date.now() + 1000 * 60 * 60 * 24 * 7).toUTCString(); //week
}
var userId = getCookie("uid");
if (userId) userSel.val(userId);
var langId = getCookie("ulang");
if (langId) langSel.val(langId);
userSel.on("change", function () {
setCookie("uid", userSel.val());
setCookie("uname", userSel.find("option:selected").text())
});
langSel.on("change", function () {
setCookie("ulang", langSel.val());
});
};
jq(document).on("click", "#beginEdit:not(.disable)", function () {
var fileId = encodeURIComponent(jq('#hiddenFileName').val());
var url = UrlEditor + "?fileName=" + fileId;
@ -193,6 +211,33 @@ if (typeof jQuery != "undefined") {
jq.unblockUI();
});
jq(document).on("click", ".try-editor", function (e) {
var url = jq(".try-editor-list")[0].attributes["data-link"].value;
url += "?fileExt=" + e.target.attributes["data-type"].value;
if (jq("#createSample").is(":checked")) {
url += "&sample=true";
}
var w = window.open(url, "_blank");
w.onload = function () {
window.location.reload();
}
});
jq(document).on("click", ".delete-file", function () {
var requestAddress = "webeditor.ashx"
+ "?type=remove"
+ "&filename=" + encodeURIComponent(jq(this).attr("data-filename"));
jq.ajax({
async: true,
contentType: "text/xml",
url: requestAddress,
complete: function (data) {
document.location.reload();
}
});
});
jq.dropdownToggle({
switcherSelector: ".question",
dropdownID: "hint"

View File

@ -1,29 +1,4 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*-->
<%@ Page Title="ONLYOFFICE" Language="C#" Inherits="System.Web.Mvc.ViewPage<OnlineEditorsExampleMVC.Models.FileModel>" %>
<%@ Page Title="ONLYOFFICE" Language="C#" Inherits="System.Web.Mvc.ViewPage<OnlineEditorsExampleMVC.Models.FileModel>" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="OnlineEditorsExampleMVC.Helpers" %>
@ -34,8 +9,29 @@
<head runat="server">
<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" />
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
<title><%= Model.FileName + " - ONLYOFFICE" %></title>
<%: Styles.Render("~/Content/editor") %>
@ -52,15 +48,13 @@
<script type="text/javascript" language="javascript">
var docEditor;
var fileName = "<%= Model.FileName %>";
var fileType = "<%= Path.GetExtension(Model.FileName).Trim('.') %>";
var innerAlert = function (message) {
if (console && console.log)
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -78,89 +72,72 @@
innerAlert(event.data);
};
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor",
{
width: "100%",
height: "100%",
type: '<%= Request["mode"] != "embedded" ? "desktop" : "embedded" %>',
documentType: "<%= Model.DocumentType %>",
document: {
title: fileName,
url: "<%= Model.FileUri %>",
fileType: fileType,
key: "<%= Model.Key %>",
info: {
author: "Me",
created: "<%= DateTime.Now.ToShortDateString() %>",
},
permissions: {
edit: "<%= DocManagerHelper.EditedExts.Contains(Path.GetExtension(Model.FileName)) %>" == "True",
download: true,
}
},
editorConfig: {
mode: '<%= DocManagerHelper.EditedExts.Contains(Path.GetExtension(Model.FileName)) && Request["mode"] != "view" ? "edit" : "view" %>',
lang: "en",
callbackUrl: "<%= Model.CallbackUrl %>",
user: {
id: "<%= DocManagerHelper.CurUserHostAddress() %>",
name: "John Smith",
},
embedded: {
saveUrl: "<%= Model.FileUri %>",
embedUrl: "<%= Model.FileUri %>",
shareUrl: "<%= Model.FileUri %>",
toolbarDocked: "top",
},
customization: {
about: true,
feedback: true,
goback: {
url: "<%= Url.Action("Index", "Home") %>",
},
},
},
events: {
'onReady': onReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
}
});
var onOutdatedVersion = function (event) {
location.reload(true);
};
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", сonnectEditor);
var replaceActionLink = function(href, linkParam) {
var link;
var actionIndex = href.indexOf("&actionLink=");
if (actionIndex != -1) {
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
if (endIndex != -1) {
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
} else {
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
}
} else {
link = href + "&actionLink=" + encodeURIComponent(linkParam);
}
return link;
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (ex) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
var onMakeActionLink = function (event) {
var actionData = event.data;
var linkParam = JSON.stringify(actionData);
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
};
var config = <%= Model.GetDocConfig(Request, Url) %>;
config.width = "100%";
config.height = "100%";
config.events = {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
"onMakeActionLink": onMakeActionLink,
};
<% string hist, histData; %>
<% Model.GetHistory(out hist, out histData); %>
<% if (!string.IsNullOrEmpty(hist) && !string.IsNullOrEmpty(histData))
{ %>
config.events['onRequestHistory'] = function () {
docEditor.refreshHistory(<%= hist %>);
};
config.events['onRequestHistoryData'] = function (event) {
var ver = event.data;
var histData = <%= histData %>;
docEditor.setHistoryData(histData[ver]);
};
config.events['onRequestHistoryClose '] = function () {
document.location.reload();
};
<% } %>
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", сonnectEditor);
}
</script>
</body>

View File

@ -1,32 +1,8 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*-->
<%@ Page Title="ONLYOFFICE" Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Page Title="ONLYOFFICE" Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="OnlineEditorsExampleMVC.Helpers" %>
<%@ Import Namespace="OnlineEditorsExampleMVC.Models" %>
<!DOCTYPE html>
@ -35,6 +11,25 @@
<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" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
<title>ONLYOFFICE</title>
<link href="<%: Url.Content("~/favicon.ico") %>" rel="shortcut icon" type="image/x-icon" />
@ -46,29 +41,184 @@
<body>
<div class="top-panel"></div>
<div class="main-panel">
<span class="portal-name">ONLYOFFICE Online Editors</span>
<span class="portal-name">ONLYOFFICE Document Editors</span>
<br />
<br />
<span class="portal-descr">Get started with a demo-sample of ONLYOFFICE Online Editors, the first html5-based editors. You may upload your own documents for testing using the "Choose file" button and selecting the necessary files on your PC.</span>
<span class="portal-descr">Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors. You may upload your own documents for testing using the "Upload file" button and selecting the necessary files on your PC.</span>
<div class="file-upload button gray">
<span>Choose file</span>
<input type="file" id="fileupload" name="files[]" data-url="<%= Url.Content("~/webeditor.ashx?type=upload") %>" />
<table class="user-block-table" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="30%" valign="middle">
<span class="select-user">Username:</span>
<select class="select-user" id="user">
<option value="uid-1">John Smith</option>
<option value="uid-2">Mark Pottato</option>
<option value="uid-3">Hamish Mitchell</option>
</select>
</td>
<td width="70%" valign="middle">Select user name before opening the document; you can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</td>
</tr>
<tr>
<td width="30%" valign="middle">
<select class="select-user" id="language">
<option value="en">English</option>
<option value="bg">Bulgarian</option>
<option value="zh">Chinese</option>
<option value="cs">Czech</option>
<option value="nl">Dutch</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="hu">Hungarian</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="lv">Latvian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="ru">Russian</option>
<option value="sk">Slovak</option>
<option value="sl">Slovenian</option>
<option value="es">Spanish</option>
<option value="tr">Turkish</option>
<option value="uk">Ukrainian</option>
<option value="vi">Vietnamese</option>
</select>
</td>
<td width="70%" valign="middle">Choose the language for ONLYOFFICE™ editors interface.</td>
</tr>
</tbody>
</table>
<br />
<br />
<div class="help-block">
<span class="try-descr">Upload your file or create new file</span>
<br />
<br />
<div class="clearFix">
<div class="upload-panel clearFix">
<a class="file-upload">
Upload
<br />
File
<input type="file" id="fileupload" name="files[]" data-url="<%= Url.Content("~/webeditor.ashx?type=upload") %>" />
</a>
</div>
<div class="create-panel">
<ul class="try-editor-list clearFix" data-link="<%= Url.Action("sample", "Home") %>">
<li><a class="try-editor document" data-type="docx">Create<br />Document</a></li>
<li><a class="try-editor spreadsheet" data-type="xlsx">Create<br />Spreadsheet</a></li>
<li><a class="try-editor presentation" data-type="pptx">Create<br />Presentation</a></li>
</ul>
<label class="create-sample">
<input id="createSample" class="checkbox" type="checkbox" />
Create a file filled with sample content
</label>
</div>
</div>
</div>
<label class="save-original">
<input type="checkbox" id="checkOriginalFormat" class="checkbox" />Save document in original format
</label>
<span class="question"></span>
<br />
<br />
<br />
<span class="try-descr">You are also enabled to view and edit documents pre-uploaded to the portal.</span>
<ul class="try-editor-list">
<li><a class="try-editor document" href="<%= Url.Action("sample", "Home", new { fileExt = "docx" }) %>" target="_blank">Create<br />Sample Document</a></li>
<li><a class="try-editor spreadsheet" href="<%= Url.Action("sample", "Home", new { fileExt = "xlsx" }) %>" target="_blank">Create<br />Sample Spreadsheet</a></li>
<li><a class="try-editor presentation" href="<%= Url.Action("sample", "Home", new { fileExt = "pptx" }) %>" target="_blank">Create<br />Sample Presentation</a></li>
</ul>
<% var storedFiles = DocManagerHelper.GetStoredFiles();
if (storedFiles.Any())
{ %>
<div class="help-block">
<span>Your documents</span>
<br />
<br />
<div class="stored-list">
<table width="100%" cellspacing="0" cellpadding="0">
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
<tbody>
<% foreach (var storedFile in storedFiles)
{ %>
<%
var editUrl = "doceditor.aspx?fileID=" + HttpUtility.UrlEncode(storedFile);
var docType = FileUtility.GetFileType(storedFile).ToString().ToLower();
%>
<tr class="tableRow" title="<%= storedFile %>">
<td class="contentCells">
<a class="stored-edit <%= docType %>" href="<%= Url.Action("Editor", "Home", new { fileName = storedFile }) %>" target="_blank">
<span title="<%= storedFile %>"><%= storedFile %></span>
</a>
<a href="<%= Url.Content(DocManagerHelper.CurUserHostAddress() + "/" + storedFile) %>">
<img class="icon-download" src="content/images/download-24.png" alt="Download" title="Download" />
</a>
<a class="delete-file" data-filename="<%= storedFile %>">
<img class="icon-delete" src="content/images/delete-24.png" alt="Delete" title="Delete" />
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "edit" }) %>" target="_blank">
<img src="content/images/desktop-24.png" alt="Open in editor for full size screens" title="Open in editor for full size screens"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "mobile", editorsMode = "edit" }) %>" target="_blank">
<img src="content/images/mobile-24.png" alt="Open in editor for mobile devices" title="Open in editor for mobile devices"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "review" }) %>" target="_blank">
<img src="content/images/review-24.png" alt="Open in editor for review" title="Open in editor for review"/>
</a>
<% } else if (docType == "spreadsheet") { %>
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "filter" }) %>" target="_blank">
<img src="content/images/filter-24.png" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" />
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "comment" }) %>" target="_blank">
<img src="content/images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "fillForms" }) %>" target="_blank">
<img src="content/images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "blockcontent" }) %>" target="_blank">
<img src="content/images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "view" }) %>" target="_blank">
<img src="content/images/desktop-24.png" alt="Open in viewer for full size screens" title="Open in viewer for full size screens"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "mobile", editorsMode = "view" }) %>" target="_blank">
<img src="content/images/mobile-24.png" alt="Open in viewer for mobile devices" title="Open in viewer for mobile devices"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "embedded", editorsMode = "embedded" }) %>" target="_blank">
<img src="content/images/embeded-24.png" alt="Open in embedded mode" title="Open in embedded mode"/>
</a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
<% } %>
<br />
<br />

View File

@ -3,6 +3,25 @@
<html>
<head>
<meta name="viewport" content="width=device-width" />
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
<title>Error</title>
</head>
<body>

View File

@ -31,11 +31,11 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="1.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="1.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
<bindingRedirect oldVersion="1.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@ -1,33 +1,28 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Configuration;
using System.Web.Script.Serialization;
using System.Web.Services;
using OnlineEditorsExampleMVC.Helpers;
@ -52,6 +47,9 @@ namespace OnlineEditorsExampleMVC
case "track":
Track(context);
break;
case "remove":
Remove(context);
break;
}
}
@ -89,6 +87,7 @@ namespace OnlineEditorsExampleMVC
var savedFileName = DocManagerHelper.StoragePath(fileName);
httpPostedFile.SaveAs(savedFileName);
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies.GetOrDefault("uid", ""), context.Request.Cookies.GetOrDefault("uname", ""));
context.Response.Write("{ \"filename\": \"" + fileName + "\"}");
}
@ -142,8 +141,9 @@ namespace OnlineEditorsExampleMVC
}
}
File.Delete(DocManagerHelper.StoragePath(fileName));
Remove(fileName);
fileName = correctName;
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies.GetOrDefault("uid", ""), context.Request.Cookies.GetOrDefault("uname", ""));
}
context.Response.Write("{ \"filename\" : \"" + fileName + "\"}");
@ -168,8 +168,6 @@ namespace OnlineEditorsExampleMVC
var userAddress = context.Request["userAddress"];
var fileName = context.Request["fileName"];
var storagePath = DocManagerHelper.StoragePath(fileName, userAddress);
string body;
try
{
@ -187,6 +185,24 @@ namespace OnlineEditorsExampleMVC
var jss = new JavaScriptSerializer();
if (string.IsNullOrEmpty(body)) return;
var fileData = jss.Deserialize<Dictionary<string, object>>(body);
if (JwtManager.Enabled)
{
if (fileData.ContainsKey("token"))
{
fileData = jss.Deserialize<Dictionary<string, object>>(JwtManager.Decode(fileData["token"].ToString()));
}
else if (context.Request.Headers.AllKeys.Contains("Authorization", StringComparer.InvariantCultureIgnoreCase))
{
var headerToken = context.Request.Headers.Get("Authorization").Substring("Bearer ".Length);
fileData = (Dictionary<string, object>)jss.Deserialize<Dictionary<string, object>>(JwtManager.Decode(headerToken))["payload"];
}
else
{
throw new Exception("Expected JWT");
}
}
var status = (TrackerStatus) (int) fileData["status"];
switch (status)
@ -195,26 +211,32 @@ namespace OnlineEditorsExampleMVC
case TrackerStatus.Corrupted:
var downloadUri = (string) fileData["url"];
var req = (HttpWebRequest) WebRequest.Create(downloadUri);
var saved = 1;
try
{
using (var stream = req.GetResponse().GetResponseStream())
{
if (stream == null) throw new Exception("stream is null");
const int bufferSize = 4096;
var storagePath = DocManagerHelper.StoragePath(fileName, userAddress);
var histDir = DocManagerHelper.HistoryDir(storagePath);
var versionDir = DocManagerHelper.VersionDir(histDir, DocManagerHelper.GetFileVersion(histDir) + 1);
using (var fs = File.Open(storagePath, FileMode.Create))
{
var buffer = new byte[bufferSize];
int readed;
while ((readed = stream.Read(buffer, 0, bufferSize)) != 0)
{
fs.Write(buffer, 0, readed);
}
}
if (!Directory.Exists(versionDir)) Directory.CreateDirectory(versionDir);
File.Copy(storagePath, Path.Combine(versionDir, "prev" + Path.GetExtension(fileName)));
DownloadToFile(downloadUri, DocManagerHelper.StoragePath(fileName, userAddress));
DownloadToFile((string)fileData["changesurl"], Path.Combine(versionDir, "diff.zip"));
var hist = fileData.ContainsKey("changeshistory") ? (string)fileData["changeshistory"] : null;
if (string.IsNullOrEmpty(hist) && fileData.ContainsKey("history"))
{
hist = jss.Serialize(fileData["history"]);
}
if (!string.IsNullOrEmpty(hist))
{
File.WriteAllText(Path.Combine(versionDir, "changes.json"), hist);
}
File.WriteAllText(Path.Combine(versionDir, "key.txt"), (string)fileData["key"]);
}
catch (Exception)
{
@ -226,6 +248,54 @@ namespace OnlineEditorsExampleMVC
context.Response.Write("{\"error\":0}");
}
private static void Remove(HttpContext context)
{
context.Response.ContentType = "text/plain";
try
{
var fileName = context.Request["fileName"];
Remove(fileName);
context.Response.Write("{ \"success\": true }");
}
catch (Exception e)
{
context.Response.Write("{ \"error\": \"" + e.Message + "\"}");
}
}
private static void Remove(string fileName)
{
var path = DocManagerHelper.StoragePath(fileName, null);
var histDir = DocManagerHelper.HistoryDir(path);
if (File.Exists(path)) File.Delete(path);
if (Directory.Exists(histDir)) Directory.Delete(histDir, true);
}
private static void DownloadToFile(string url, string path)
{
if (string.IsNullOrEmpty(url)) throw new ArgumentException("url");
if (string.IsNullOrEmpty(path)) throw new ArgumentException("path");
var req = (HttpWebRequest)WebRequest.Create(url);
using (var stream = req.GetResponse().GetResponseStream())
{
if (stream == null) throw new Exception("stream is null");
const int bufferSize = 4096;
using (var fs = File.Open(path, FileMode.Create))
{
var buffer = new byte[bufferSize];
int readed;
while ((readed = stream.Read(buffer, 0, bufferSize)) != 0)
{
fs.Write(buffer, 0, readed);
}
}
}
}
public bool IsReusable
{
get { return false; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -0,0 +1,37 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
Entity Framework - Entity Framework is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. (https://docs.microsoft.com/en-us/ef/ef6/resources/licenses/ef5/enu)
License: MICROSOFT SOFTWARE SUPPLEMENTAL TERMS, MICROSOFT SOFTWARE LICENSE TERMS
License File: EntityFramework.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Microsoft.Web.Infrastructure - This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time. (https://www.microsoft.com/web/webpi/eula/aspnetmvc3update-eula.htm)
License: MS-EULA License
License File: Microsoft.Web.Infrastructure.license
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://licenses.nuget.org/MIT)
License: MIT
License File: Newtonsoft.Json.license
WebGrease - Web Grease is a suite of tools for optimizing javascript, css files and images. (https://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm)
License: MICROSOFT .NET LIBRARY LICENSE
License File: WebGrease.license

View File

@ -0,0 +1,9 @@
Copyright <20> 2007-2013 M. Alsup.
The BlockUI plugin is dual licensed under the MIT and GPL licenses.
You may use either license. The MIT license is recommended for most projects because it is simple and easy to understand and it places almost no restrictions on what you can do with the plugin.
If the GPL suits your project better you are also free to use the plugin under that license.
You do not have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. You are free to use the BlockUI plugin in commercial projects as long as the copyright header is left intact.

View File

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

View File

@ -0,0 +1,43 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery-ui
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code contained within the demos directory.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.

View File

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

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Providers.Core" version="1.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>

View File

@ -9,13 +9,13 @@
<add key="filesize-max" value="5242880"/>
<add key="files.docservice.viewed-docs" value=".ppt|.pps|.odp|.pdf|.djvu|.epub|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.doc|.odt|.xlsx|.xls|.ods|.csv|.pptx|.ppsx|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".doc|.odt|.xls|.ods|.ppt|.pps|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.txt"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.secret" value="" />
<add key="files.docservice.url.storage" value="https://doc.onlyoffice.com/FileUploader.ashx"/>
<add key="files.docservice.url.converter" value="https://doc.onlyoffice.com/ConvertService.ashx"/>
<add key="files.docservice.url.api" value="https://doc.onlyoffice.com/web-apps/apps/api/documents/api.js"/>
<add key="files.docservice.url.preloader" value="https://doc.onlyoffice.com/web-apps/apps/api/documents/cache-scripts.html"/>
<add key="files.docservice.url.converter" value="https://documentserver/ConvertService.ashx"/>
<add key="files.docservice.url.api" value="https://documentserver/web-apps/apps/api/documents/api.js"/>
<add key="files.docservice.url.preloader" value="https://documentserver/web-apps/apps/api/documents/cache-scripts.html"/>
</appSettings>

View File

@ -0,0 +1,21 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

View File

@ -1,29 +1,22 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
html {
html {
height: 100%;
width: 100%;
}
@ -111,14 +104,17 @@ label .checkbox {
.try-editor-list {
list-style: none;
margin: 0;
margin: 0 0 16px;
padding: 0;
}
.try-editor-list li {
float: left;
margin: 25px;
width: 150px;
}
.try-editor-list li {
float: left;
margin: 0 15px;
width: 100px;
cursor: pointer;
}
.try-editor {
background-color: transparent;
background-position: center 0;
@ -141,6 +137,11 @@ label .checkbox {
background-image: url("images/file_pptx.png");
}
.create-sample {
display: inline-block;
margin-left: 75px;
}
.button, .button:visited, .button:hover, .button:active {
display: inline-block;
font-weight: normal;
@ -183,25 +184,43 @@ label .checkbox {
border: 1px solid #E9EAEA;
}
.upload-panel {
border-right: 1px solid #D1D1D1;
float: left;
margin-right: 25px;
}
.file-upload {
background: url("images/file_upload.png") no-repeat center 0 transparent;
cursor: pointer;
margin-bottom: 8px;
padding: 0 !important;
display: inline-block;
font-size: 14px;
font-weight: bold;
height: 45px;
margin: 0 40px 16px;
overflow: hidden;
padding-top: 100px;
position: relative;
text-align: center;
width: 100px;
}
.file-upload span {
line-height: 21px;
margin: 2px 12px;
.file-upload input {
cursor: pointer;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transform: translate(555px, 60px) scale(8);
}
.create-panel {
float: left;
}
.file-upload input {
cursor: pointer;
font-size: 23px;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transform: translate(-300px, 0) scale(4);
.upload-panel,
.create-panel {
padding: 10px 0;
}
#mainProgress {
@ -319,16 +338,6 @@ label .checkbox {
.stored-edit:hover span {
text-decoration: underline;
}
.stored-download {
color: #787878;
float: right;
text-decoration: none;
}
.stored-download:hover {
color: #787878;
text-decoration: underline;
}
.blockTitle {
@ -368,3 +377,112 @@ label .checkbox {
clear: both;
visibility: hidden;
}
/*Icon table*/
#tableRow {
vertical-align: top;
}
.tableRow {
background: transparent;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tableRow:hover {
background-color: #ebebeb;
}
.tableHeader {
background: transparent;
color: #333;
cursor: default;
font-family: 'Open Sans', sans-serif;
font-size: 13px;
height: 40px;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.tableHeaderCell {
padding: 2px 1px 2px 5px;
text-align: center;
}
.tableHeaderCellFileName {
text-align: left;
}
.contentCells {
padding: 4px 1px 4px 5px;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
border-bottom: 1px solid #e5e5e5;
white-space: nowrap;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.contentCells a {
text-decoration: none;
}
.contentCells-shift {
padding-right: 30px;
}
.contentCells-icon {
width: 6%;
}
.contentCellsSmall {
padding: 5px 1px 5px 6px;
font-family: 'Open Sans', sans-serif;
font-size: 13px;
border-bottom: 1px solid #e5e5e5;
white-space: nowrap;
text-align: center;
}
.primaryRow {
background-color: #e9e9e9;
}
.secondaryRow {
background-color: #F9F9F9;
}
.select-user {
margin-left: 15px;
}
.user-block-table {
height: 100%;
width: 100%;
}
.user-block-table td {
background-color: #F4F4F4;
border-bottom: 1px solid white;
padding: 12px 0;
}
#user, #language {
width: 130px;
}
.icon-download {
margin-bottom: -5px;
}
.icon-delete {
cursor: pointer;
margin-bottom: -6px;
}

View File

@ -11,6 +11,24 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ONLYOFFICE</title>
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:900,800,700,600,500,400,300&subset=latin,cyrillic-ext,cyrillic,latin-ext" />
@ -43,28 +61,84 @@
<div class="top-panel"></div>
<div class="main-panel">
<span class="portal-name">ONLYOFFICE Online Editors</span>
<span class="portal-name">ONLYOFFICE Document Editors</span>
<br />
<br />
<span class="portal-descr">Get started with a demo-sample of ONLYOFFICE Online Editors, the first html5-based editors. You may upload your own documents for testing using the "Choose file" button and selecting the necessary files on your PC.</span>
<span class="portal-descr">Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors. You may upload your own documents for testing using the "Upload file" button and selecting the necessary files on your PC.</span>
<div class="file-upload button gray">
<span>Choose file</span>
<input type="file" id="fileupload" name="files[]" data-url="webeditor.ashx?type=upload" />
<table class="user-block-table" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="30%" valign="middle">
<span class="select-user">Username:</span>
<select class="select-user" id="user">
<option value="uid-1">John Smith</option>
<option value="uid-2">Mark Pottato</option>
<option value="uid-3">Hamish Mitchell</option>
</select>
</td>
<td width="70%" valign="middle">Select user name before opening the document; you can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</td>
</tr>
<tr>
<td width="30%" valign="middle">
<select class="select-user" id="language">
<option value="en">English</option>
<option value="bg">Bulgarian</option>
<option value="zh">Chinese</option>
<option value="cs">Czech</option>
<option value="nl">Dutch</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="hu">Hungarian</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="lv">Latvian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="ru">Russian</option>
<option value="sk">Slovak</option>
<option value="sl">Slovenian</option>
<option value="es">Spanish</option>
<option value="tr">Turkish</option>
<option value="uk">Ukrainian</option>
<option value="vi">Vietnamese</option>
</select>
</td>
<td width="70%" valign="middle">Choose the language for ONLYOFFICE™ editors interface.</td>
</tr>
</tbody>
</table>
<br />
<br />
<div class="help-block">
<span class="try-descr">Upload your file or create new file</span>
<br />
<br />
<div class="clearFix">
<div class="upload-panel clearFix">
<a class="file-upload">
Upload
<br />
File
<input type="file" id="fileupload" name="files[]" data-url="webeditor.ashx?type=upload" />
</a>
</div>
<div class="create-panel">
<ul class="try-editor-list clearFix">
<li><a class="try-editor document" data-type="document">Create<br />Document</a></li>
<li><a class="try-editor spreadsheet" data-type="spreadsheet">Create<br />Spreadsheet</a></li>
<li><a class="try-editor presentation" data-type="presentation">Create<br />Presentation</a></li>
</ul>
<label class="create-sample">
<input id="createSample" class="checkbox" type="checkbox" />
Create a file filled with sample content
</label>
</div>
</div>
</div>
<label class="save-original">
<input type="checkbox" id="checkOriginalFormat" class="checkbox" />Save document in original format
</label>
<span class="question"></span>
<br />
<br />
<br />
<span class="try-descr">You are also enabled to view and edit documents pre-uploaded to the portal.</span>
<ul class="try-editor-list">
<li><a class="try-editor document" href="doceditor.aspx?type=document" target="_blank">Create<br />Sample Document</a></li>
<li><a class="try-editor spreadsheet" href="doceditor.aspx?type=spreadsheet" target="_blank">Create<br />Sample Spreadsheet</a></li>
<li><a class="try-editor presentation" href="doceditor.aspx?type=presentation" target="_blank">Create<br />Sample Presentation</a></li>
</ul>
<% var storedFiles = GetStoredFiles();
if (storedFiles.Any())
@ -73,17 +147,96 @@
<span>Your documents</span>
<br />
<br />
<ul class="stored-list">
<% foreach (var storedFile in storedFiles)
{ %>
<li class="clearFix">
<a class="stored-edit <%= DocumentType(storedFile) %>" href="doceditor.aspx?fileID=<%= HttpUtility.UrlEncode(storedFile) %>" target="_blank">
<span title="<%= storedFile %>"><%= storedFile %></span>
</a>
<a class="stored-download" href="<%= VirtualPath + WebConfigurationManager.AppSettings["storage-path"] + storedFile %>">Download</a>
</li>
<% } %>
</ul>
<div class="stored-list">
<table width="100%" cellspacing="0" cellpadding="0">
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
<tbody>
<% foreach (var storedFile in storedFiles)
{ %>
<%
var editUrl = "doceditor.aspx?fileID=" + HttpUtility.UrlEncode(storedFile);
var docType = DocumentType(storedFile);
%>
<tr class="tableRow" title="<%= storedFile %>">
<td class="contentCells">
<a class="stored-edit <%= docType %>" href="<%= editUrl %>" target="_blank">
<span title="<%= storedFile %>"><%= storedFile %></span>
</a>
<a href="<%= VirtualPath + WebConfigurationManager.AppSettings["storage-path"] + storedFile %>">
<img class="icon-download" src="app_themes/images/download-24.png" alt="Download" title="Download" />
</a>
<a class="delete-file" data-filename="<%= storedFile %>">
<img class="icon-delete" src="app_themes/images/delete-24.png" alt="Delete" title="Delete" />
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=edit" %>" target="_blank">
<img src="app_themes/images/desktop-24.png" alt="Open in editor for full size screens" title="Open in editor for full size screens"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=mobile&editorsMode=edit" %>" target="_blank">
<img src="app_themes/images/mobile-24.png" alt="Open in editor for mobile devices" title="Open in editor for mobile devices"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=review" %>" target="_blank">
<img src="app_themes/images/review-24.png" alt="Open in editor for review" title="Open in editor for review"/>
</a>
<% } else if (docType == "spreadsheet") { %>
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=filter" %>" target="_blank">
<img src="app_themes/images/filter-24.png" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" />
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=comment" %>" target="_blank">
<img src="app_themes/images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=fillForms" %>" target="_blank">
<img src="app_themes/images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<% if (docType == "text") { %>
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=blockcontent" %>" target="_blank">
<img src="app_themes/images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=view" %>" target="_blank">
<img src="app_themes/images/desktop-24.png" alt="Open in viewer for full size screens" title="Open in viewer for full size screens"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=mobile&editorsMode=view" %>" target="_blank">
<img src="app_themes/images/mobile-24.png" alt="Open in viewer for mobile devices" title="Open in viewer for mobile devices"/>
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=embedded&editorsMode=embedded" %>" target="_blank">
<img src="app_themes/images/embeded-24.png" alt="Open in embedded mode" title="Open in embedded mode"/>
</a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
<% } %>
@ -99,7 +252,7 @@
if (examples.Any())
{ %>
<br />
Download the code for the sample of ONLYOFFICE Online Editors to find out the details.
Download the code for the sample of ONLYOFFICE Document Editors to find out the details.
<br />
<br />
<% foreach (var example in examples)
@ -156,10 +309,7 @@
<br />
<div id="beginEmbedded" class="button disable">Embedded view</div>
<div id="beginView" class="button disable">View</div>
<% if (EditMode)
{ %>
<div id="beginEdit" class="button disable">Edit</div>
<% } %>
<div id="cancelEdit" class="button gray">Cancel</div>
</div>

View File

@ -1,27 +1,20 @@
/*
/**
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2020
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* 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
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* http://www.apache.org/licenses/LICENSE-2.0
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
* 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.
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
*/
using System;
using System.Collections.Generic;
@ -30,8 +23,8 @@ using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Caching;
using System.Web.Configuration;
using System.Web.Script.Serialization;
using System.Web.UI;
using ASC.Api.DocumentConverter;
@ -41,22 +34,26 @@ namespace OnlineEditorsExample
{
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx",
".ods", ".csv"
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};
public static readonly List<string> ExtsPresentation = new List<string>
{
".pps", ".ppsx",
".ppt", ".pptx",
".odp"
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp", ".otp"
};
public static readonly List<string> ExtsDocument = new List<string>
{
".docx", ".doc", ".odt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
public static string GetInternalExtension(string extension)
@ -97,12 +94,10 @@ namespace OnlineEditorsExample
}
private static bool? _ismono;
public static bool IsMono
{
get
{
return _ismono.HasValue ? _ismono.Value : (_ismono = (bool?)(Type.GetType("Mono.Runtime") != null)).Value;
}
get { return _ismono.HasValue ? _ismono.Value : (_ismono = (bool?)(Type.GetType("Mono.Runtime") != null)).Value; }
}
private static long MaxFileSize
@ -135,11 +130,6 @@ namespace OnlineEditorsExample
get { return (WebConfigurationManager.AppSettings["files.docservice.convert-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
}
public static bool EditMode
{
get { return (WebConfigurationManager.AppSettings["mode"] ?? "") != "view"; }
}
private static string _fileName;
public static string CurUserHostAddress(string userAddress)
@ -157,6 +147,32 @@ namespace OnlineEditorsExample
return directory + fileName;
}
public static string HistoryDir(string storagePath)
{
return storagePath += "-hist";
}
public static string VersionDir(string histPath, int version)
{
return Path.Combine(histPath, version.ToString());
}
public static string VersionDir(string fileName, string userAddress, int version)
{
return VersionDir(HistoryDir(StoragePath(fileName, userAddress)), version);
}
public static int GetFileVersion(string historyPath)
{
if (!Directory.Exists(historyPath)) return 0;
return Directory.EnumerateDirectories(historyPath).Count();
}
public static int GetFileVersion(string fileName, string userAddress)
{
return GetFileVersion(HistoryDir(StoragePath(fileName, userAddress)));
}
public static string FileUri(string fileName)
{
var uri = Host;
@ -213,10 +229,18 @@ namespace OnlineEditorsExample
var savedFileName = StoragePath(_fileName, null);
httpPostedFile.SaveAs(savedFileName);
var histDir = HistoryDir(savedFileName);
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", context.Request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", context.Request.Cookies.GetOrDefault("uname", "John Smith") }
}));
return _fileName;
}
public static string DoUpload(string fileUri)
public static string DoUpload(string fileUri, HttpRequest request)
{
_fileName = GetCorrectName(Path.GetFileName(fileUri));
@ -251,6 +275,14 @@ namespace OnlineEditorsExample
}
}
}
var histDir = HistoryDir(StoragePath(_fileName, null));
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
}));
}
catch (Exception)
{
@ -304,8 +336,19 @@ namespace OnlineEditorsExample
}
}
File.Delete(StoragePath(_fileName, null));
var storagePath = StoragePath(_fileName, null);
var histDir = HistoryDir(storagePath);
File.Delete(storagePath);
if (Directory.Exists(histDir)) Directory.Delete(histDir, true);
_fileName = fileName;
histDir = HistoryDir(StoragePath(_fileName, null));
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", context.Request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", context.Request.Cookies.GetOrDefault("uname", "John Smith") }
}));
}
return "{ \"filename\" : \"" + _fileName + "\"}";

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