Compare commits
601 Commits
v4.5.dev.4
...
v6.3.0.70
| Author | SHA1 | Date | |
|---|---|---|---|
| 988e336f43 | |||
| 9ab94ee9c3 | |||
| fe02c4914c | |||
| 82981d3ce2 | |||
| 6870923b94 | |||
| 7d5c90e9cf | |||
| b541936473 | |||
| a2e59cf705 | |||
| dc074d4baf | |||
| 1cf5b1eea5 | |||
| 2635306e2e | |||
| f0cc80fd53 | |||
| c9f58e3ca6 | |||
| 821e481734 | |||
| f0309615d6 | |||
| 47588d135e | |||
| 8e6ae3b915 | |||
| 8fc9d6125c | |||
| b427594248 | |||
| 5c43308e14 | |||
| c5b67b4b00 | |||
| 8442def83c | |||
| 2cb91eb8d5 | |||
| cf82b0ffc9 | |||
| ffcf787f94 | |||
| ce2714c684 | |||
| 4ccd78053f | |||
| 7602183cf9 | |||
| 1a6744a814 | |||
| 6a89a073fa | |||
| 353119145c | |||
| 0aaaedc4d6 | |||
| 246ddc9f9c | |||
| 3e8b6aaffa | |||
| c95439c0db | |||
| 62873e4ce4 | |||
| e04155e7ad | |||
| 733f798968 | |||
| f7f0a07239 | |||
| ee79e02c54 | |||
| d8afda9b56 | |||
| 0569dc7271 | |||
| fef62baa2b | |||
| be82ae7078 | |||
| 0a4fcc0cdc | |||
| 823374e2fe | |||
| 3b89aae808 | |||
| cc488187b4 | |||
| 0e191eed91 | |||
| 6d27c1866b | |||
| 845b111a85 | |||
| 79d12ecd02 | |||
| 61c388a7af | |||
| c6deb13712 | |||
| 13250e18b3 | |||
| 7d373fa1a9 | |||
| 8af2607e62 | |||
| c2db28fbcf | |||
| 212fd26807 | |||
| c9ef51a361 | |||
| f25e4ea614 | |||
| e4eb8366bd | |||
| bcfa08b43c | |||
| 193238fbdb | |||
| 37e36f7fef | |||
| ec90b2ff98 | |||
| 758f0c08e5 | |||
| b76c532569 | |||
| 856613d644 | |||
| 75c11f4ee8 | |||
| 1e023e58b2 | |||
| f9f757bd0d | |||
| a213b635f2 | |||
| 96d6c521ef | |||
| 7d2469cfe9 | |||
| 2f7352c296 | |||
| 6ec262e221 | |||
| 5fdbd2954b | |||
| 758291fd71 | |||
| 2a856c6919 | |||
| d075855065 | |||
| f026d0ef60 | |||
| 2ec0a3798d | |||
| 506b55a201 | |||
| 90dd2c837f | |||
| 75d828a6ae | |||
| fe3b5558df | |||
| 3d49eabaf0 | |||
| 51f712b900 | |||
| a565da4035 | |||
| 7db6983167 | |||
| b7262ff874 | |||
| 50921b278b | |||
| 9d16bee672 | |||
| 1a63a7f65f | |||
| 4ba7b3f02e | |||
| f8f15d2191 | |||
| 2b217de9b4 | |||
| 6f64d40e5d | |||
| 620a097faa | |||
| 9759839cd0 | |||
| e6ee57e09b | |||
| 50daec31b4 | |||
| bcd114d089 | |||
| 49592f66bf | |||
| e854b78884 | |||
| 4dd5f9d9f6 | |||
| abee34981b | |||
| 768f45f4fb | |||
| c3bb70aa9a | |||
| e53dac1e2b | |||
| 71ab72299a | |||
| eb4e6b4bc0 | |||
| 4f02a4957f | |||
| 469c2b6ced | |||
| 8b9a2d2481 | |||
| e921c936b8 | |||
| a5929897ad | |||
| 00a1c64353 | |||
| 6c18acdf97 | |||
| c0f459132e | |||
| d780a61e52 | |||
| 361b8bd0f4 | |||
| 48694f0f31 | |||
| 9ed7b0e96e | |||
| a2a094a22c | |||
| 9d9afce3ce | |||
| bb19ea1a6f | |||
| d667a62a24 | |||
| a92907135d | |||
| 71fde6f7b9 | |||
| 9ac78b77dc | |||
| dae246e8a2 | |||
| 7f95d59394 | |||
| 7bfa4229de | |||
| 1c6c45606b | |||
| 1c0a742f54 | |||
| 4eb4753c01 | |||
| 979f001fd0 | |||
| d0edb368ac | |||
| ac36df16d1 | |||
| e845cc498b | |||
| 606ce23228 | |||
| dcd4adf5ad | |||
| 6e81fa8996 | |||
| 15580ee144 | |||
| 422bb36b53 | |||
| e74811a755 | |||
| 4c987fbfce | |||
| e90ba356fe | |||
| 54c6025bc5 | |||
| b867d75bac | |||
| 2748dbf5b3 | |||
| 8b5aab3c63 | |||
| ee23e7948e | |||
| badcd6e110 | |||
| 53e1fbe9ef | |||
| c28e12e31e | |||
| b94704adf8 | |||
| 255ec7afe9 | |||
| 7996ea4825 | |||
| 1fc1fb2b76 | |||
| 267fe7d260 | |||
| b8f5485201 | |||
| d19eaf0ef4 | |||
| 9ee379e8df | |||
| a4b75554bd | |||
| 854f5e7045 | |||
| 8cf4eb2fc2 | |||
| eba3f15587 | |||
| 3f52fd5563 | |||
| b439a5f729 | |||
| 848229f79c | |||
| 491f600dc0 | |||
| 38055f0b85 | |||
| 0e3c759806 | |||
| 6427db4ea6 | |||
| d624cdf0f6 | |||
| 930338f5fc | |||
| 0875ca8d89 | |||
| 193bbe2cb7 | |||
| 533ee1af91 | |||
| db0339d4e4 | |||
| 1a46b8a215 | |||
| 022f1bb16d | |||
| c01afdec17 | |||
| b2ee170ecb | |||
| a104aa6c61 | |||
| 3f13590f55 | |||
| aa7132e467 | |||
| 60ddcb433c | |||
| 14840847bf | |||
| 06cf08822b | |||
| c4e2921040 | |||
| ea455421f7 | |||
| 90abe267bf | |||
| 4e2a5fb175 | |||
| c54b760526 | |||
| a92963aed1 | |||
| feee808453 | |||
| d19ee9d4c1 | |||
| 1a7fbe656b | |||
| 500be4f8e4 | |||
| c96659ed9c | |||
| 1b2cec44ac | |||
| ecfe99f7ed | |||
| 81450a883f | |||
| fec328ad9d | |||
| b197f4c258 | |||
| 0b03093c53 | |||
| 3bf8952b1a | |||
| 23b42ed070 | |||
| 25906383e2 | |||
| 1de2571c1b | |||
| c597e914a9 | |||
| a2c0527882 | |||
| a7f7b3ebf7 | |||
| 95dfc9796d | |||
| 125d9a2ab4 | |||
| 4dd4453599 | |||
| 7e2d83f04e | |||
| b7d2775733 | |||
| aa5f1e3df4 | |||
| 4193089de4 | |||
| 18a4dc20eb | |||
| 7ced0591bd | |||
| a010088395 | |||
| d5a6c1e605 | |||
| ab68d95f5d | |||
| 301775aafd | |||
| b7bda80f48 | |||
| 51c180726c | |||
| aee637b980 | |||
| 63af540fe8 | |||
| 2819cbc5e3 | |||
| 02db6fa76a | |||
| 1feb56e397 | |||
| 502f001cfa | |||
| 7c10a0fe82 | |||
| aa16df8de7 | |||
| bbff0206c1 | |||
| e08e6f5f27 | |||
| 38cc631e2e | |||
| 6250902a55 | |||
| 7b017c15f8 | |||
| b21d179f4b | |||
| c75f9166c5 | |||
| 0f2695fba0 | |||
| aca8e94f2a | |||
| 9876e745e5 | |||
| eb8cf75bc0 | |||
| 62060d2538 | |||
| 0ad9907eb6 | |||
| 2090bad807 | |||
| 2368354c6d | |||
| 31337cc9c9 | |||
| 17cad4a0dc | |||
| 48fa83b850 | |||
| 2017c45c19 | |||
| 74505f5c44 | |||
| 6f6e80cf68 | |||
| d5a8cdc760 | |||
| ca5ba06506 | |||
| 720c61c7b7 | |||
| 6e03e71b59 | |||
| ea22efdac8 | |||
| 5521cd44dd | |||
| 773aa62478 | |||
| 280d9e3dba | |||
| ee5fe30010 | |||
| c0b520e440 | |||
| fd95aca32b | |||
| 791f2b53a9 | |||
| 02ee872d4c | |||
| a76ec17e70 | |||
| 9591995b9c | |||
| 9f806aa48a | |||
| 85dd8f8b77 | |||
| e91beb5518 | |||
| 39fbf43019 | |||
| 74af4cf734 | |||
| e8eb607325 | |||
| cefcba3b04 | |||
| fb4bc9c38e | |||
| cb245efbb2 | |||
| 0a2056b1b1 | |||
| 974840bbac | |||
| be5f6e3a6e | |||
| 19debed4d1 | |||
| 4903c017f4 | |||
| 6c3f31c32a | |||
| 73d79c1f61 | |||
| 65b4e453a4 | |||
| 157e6d3121 | |||
| d62a760439 | |||
| 4ef5f7d290 | |||
| 9b7d54fdfb | |||
| 4e17421c7e | |||
| 2b4513d68b | |||
| 47c0b04de1 | |||
| ee077978b9 | |||
| 1dc5e67da6 | |||
| cf4dd454f6 | |||
| 858b437e80 | |||
| 0512243be0 | |||
| ba3b3b4ce6 | |||
| e79cb3c3f3 | |||
| ddb31bd4e8 | |||
| 57e813d0ce | |||
| 1d24a4a309 | |||
| fe7e7640b5 | |||
| 7a7503be6a | |||
| 651e161680 | |||
| 67b93909ac | |||
| 2e3fd4725a | |||
| 17f651c47a | |||
| 928cc7480a | |||
| bf8e59ddee | |||
| 986c51483d | |||
| 1ea1a3f904 | |||
| 715ab7d690 | |||
| 4c62e12822 | |||
| 951f5f9887 | |||
| 1184402f94 | |||
| 5c0d8b8dd9 | |||
| cadeb19ece | |||
| 001b9a2cf6 | |||
| 5e852e024d | |||
| 875dfaaec4 | |||
| c9def721d2 | |||
| 8050ec572a | |||
| 6918016dda | |||
| fb039100e1 | |||
| 4a6b549eaa | |||
| 3d09910cf3 | |||
| fa0aad779d | |||
| 5cefe5c3b2 | |||
| 0cf0171721 | |||
| f8a1587109 | |||
| 44142da370 | |||
| ecbae22fcc | |||
| b3a79deef8 | |||
| c4f278d58a | |||
| b0ea8ed388 | |||
| 220516c930 | |||
| 3be28877ab | |||
| b3a96f15ab | |||
| 14a68befd2 | |||
| b1af12a78d | |||
| 83bab147d0 | |||
| 80670a0d64 | |||
| 75f137470b | |||
| 870a3ee799 | |||
| c3c1689170 | |||
| a271b847d5 | |||
| 45ea1a8c1d | |||
| 1b90f16eb5 | |||
| 422429e742 | |||
| 29072e3d5c | |||
| b82c2c68d5 | |||
| 67d6eaa18b | |||
| cb91ba1620 | |||
| 0e91256847 | |||
| ce16625091 | |||
| 4d538fc35d | |||
| 36c9583a2c | |||
| 1bde1f66d3 | |||
| fddc08c24b | |||
| 06305ee262 | |||
| e55e27cee8 | |||
| 8fa77cb9ba | |||
| f038327928 | |||
| 0adaf8a84b | |||
| 85cb88b0fc | |||
| 4c8ac0457f | |||
| 3ba6072b3e | |||
| ad966cfc28 | |||
| 1f9b2b8230 | |||
| 61826dc813 | |||
| 3dc4a6d6a3 | |||
| 4de89aa858 | |||
| 8b9f07e46e | |||
| af7101844a | |||
| b58bf412fa | |||
| a1c524df00 | |||
| 710d4f4059 | |||
| be25001479 | |||
| 7466aba10f | |||
| c4fc8c85e2 | |||
| 007efef742 | |||
| a4bf9d76f6 | |||
| 7c5faa7c8a | |||
| 3497eeea9f | |||
| 7717cb35f8 | |||
| 1c59409ce2 | |||
| bd4c3543d7 | |||
| 8770526316 | |||
| 51ecf3afeb | |||
| 8887edefb3 | |||
| 7ab292bc13 | |||
| 6ab006e409 | |||
| 582ed3f61b | |||
| d06cffabfb | |||
| 5545568e04 | |||
| 6ba9b33606 | |||
| 178477f9fb | |||
| 8d657a0101 | |||
| c1454eff13 | |||
| f7867e4bc3 | |||
| f94e057492 | |||
| a5371faa27 | |||
| 34527f0b3e | |||
| b9dd792672 | |||
| 13c3164ca1 | |||
| ceed4ac712 | |||
| 6a16a9392a | |||
| 48043e5d70 | |||
| d7809b848e | |||
| d5466f1070 | |||
| f639971861 | |||
| 95ee0bf128 | |||
| 03efbf468e | |||
| 60cb77136a | |||
| d1d7d1e416 | |||
| a60e7b9b6b | |||
| 79d5682a02 | |||
| 96994fd0dc | |||
| 668a0e323a | |||
| 057d38d063 | |||
| 1ecf16085e | |||
| 945c09f5d4 | |||
| b642053bc3 | |||
| fef0179c7e | |||
| c0366c0134 | |||
| 584fb155b7 | |||
| 95a15661d0 | |||
| ca17dd1128 | |||
| e375404e25 | |||
| a58c1483b3 | |||
| 9b6e90718a | |||
| 14f8419f00 | |||
| 0899644f32 | |||
| 036c0fb19a | |||
| 5382c43ec5 | |||
| 8af7c45e7d | |||
| aa289a6d85 | |||
| b93aeebe3c | |||
| fe38ca4a08 | |||
| df74cdeb66 | |||
| 1f022f12a1 | |||
| 1217de89b3 | |||
| cd94eb0401 | |||
| 118a4d74b0 | |||
| 31c23fbf49 | |||
| 95b4556884 | |||
| 96bfe3c58a | |||
| 0f549db065 | |||
| c064b8fa57 | |||
| 490a6cd8b6 | |||
| 097a99b947 | |||
| 88fa94c090 | |||
| 507bf0098a | |||
| 9bbcdf599d | |||
| d4f07aee2a | |||
| d12897930c | |||
| 314dfb7811 | |||
| f5b4a1f78d | |||
| 9459d4a7c1 | |||
| 120a0712da | |||
| a536fdf6ab | |||
| 71103b802e | |||
| 0b33ce14f7 | |||
| a945870c6a | |||
| cafaa27e92 | |||
| d22d2ace22 | |||
| 430a16b543 | |||
| d2a89f4a5f | |||
| efda987b55 | |||
| 20827e4d76 | |||
| 16473b4e06 | |||
| 30d26df97d | |||
| 9fb0289af4 | |||
| fa8e2cf975 | |||
| 68f6be2e43 | |||
| 87381123e3 | |||
| 7d79efe1f1 | |||
| 04c3ff5895 | |||
| e3eb837f45 | |||
| c96205b4da | |||
| 2c5ee77c08 | |||
| 4dc137cf96 | |||
| f8003e75ec | |||
| cb2414140a | |||
| d1f63976cb | |||
| 4276caf87d | |||
| d5571a3f2e | |||
| 3582109cf7 | |||
| 10ecddbe61 | |||
| 5a4dea7bfc | |||
| 911da29ecb | |||
| 37fe8eb4d5 | |||
| 633fd6efc9 | |||
| a758d3f294 | |||
| 0245c992a3 | |||
| 04cad3f10f | |||
| cb60398051 | |||
| f46b6a7c8c | |||
| 4872a74d13 | |||
| b00ed15051 | |||
| 0cbc290fbe | |||
| cb065bc4db | |||
| 4712057faa | |||
| 2e9842d559 | |||
| 0078c05a74 | |||
| aa8a143338 | |||
| a999b20588 | |||
| cab5f62201 | |||
| 95d33f3ee7 | |||
| 83c03c97db | |||
| 7b1c56ea2c | |||
| 178133a292 | |||
| f9232788b2 | |||
| c0f8caaf0b | |||
| fbb23a5872 | |||
| ec764e0f0e | |||
| d08d887392 | |||
| b039b16fd9 | |||
| 1df7cc54c1 | |||
| cf6d11bf4e | |||
| 8793235481 | |||
| 232fc0d156 | |||
| b1352bd897 | |||
| d8e1d4d6b7 | |||
| fc2db9b47f | |||
| c0b8e2e578 | |||
| fa4c3e3258 | |||
| 6d1bda75b9 | |||
| db9287263c | |||
| 6e1cef27cc | |||
| ceb4db9de6 | |||
| 68c2ae0444 | |||
| 30bdc7497a | |||
| 67a53ea5c8 | |||
| 043ab4251c | |||
| 20412f0c80 | |||
| 3792599e41 | |||
| 48a5f7ce72 | |||
| f3ee251088 | |||
| 2497acb9f5 | |||
| 6038381f72 | |||
| 7cd8333186 | |||
| 39301f65b6 | |||
| 5209ea55c0 | |||
| fb1715eebc | |||
| 59e78960ea | |||
| 102f34c49e | |||
| d0bbc736af | |||
| 5115995fb9 | |||
| 682ed58528 | |||
| 2114b23900 | |||
| 207f896e25 | |||
| 983c8829fa | |||
| 02afb13601 | |||
| 494bc6b6a4 | |||
| 72db6178ac | |||
| 5c1d925d42 | |||
| fd4dfea7d7 | |||
| ebd309dabc | |||
| f376c50fd9 | |||
| 6088e7d685 | |||
| d143e3c80d | |||
| 56d6388603 | |||
| 54993942bf | |||
| f2301ecbbf | |||
| f09f62103c | |||
| 75c1cc0c83 | |||
| e1e3357748 | |||
| 449020a9a4 | |||
| 22f2f0f922 | |||
| 1aa7e73d79 | |||
| 6eaa290557 | |||
| ed8df66513 | |||
| 16d942a487 | |||
| 5c6d9ec008 | |||
| 8e7f7c20e4 | |||
| b3f7e9861f | |||
| 797696ceea | |||
| af30096d71 | |||
| 8a7193a645 | |||
| 84f5be3556 | |||
| cff90de454 | |||
| 18b7bdb401 | |||
| 75155b4c54 | |||
| 4c3bc0e7ef | |||
| 908affc61c | |||
| c5b227d278 | |||
| 364d24dda2 | |||
| 74537582d7 | |||
| 8057ef7cbc | |||
| 8bab3ecbc6 | |||
| 7e2a12c836 |
8
.gitignore
vendored
@ -5,8 +5,12 @@
|
||||
/build/deploy
|
||||
/build/*.log
|
||||
/web/documentserver-example/nodejs/node_modules
|
||||
/web/documentserver-example/nodejs/public/files
|
||||
/web/documentserver-example/nodejs/files
|
||||
/web/documentserver-example/nodejs/config/local.json
|
||||
/web/documentserver-example/nodejs/example
|
||||
**/.vscode/
|
||||
**/.vs/
|
||||
**/.idea
|
||||
/web/documentserver-example/java/target/
|
||||
/web/documentserver-example/java/target/
|
||||
/web/documentserver-example/csharp/packages
|
||||
/web/documentserver-example/csharp-mvc/packages
|
||||
|
||||
28
.gitmodules
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
[submodule "web/documentserver-example/nodejs/public/assets"]
|
||||
path = web/documentserver-example/nodejs/public/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/java/src/main/resources/assets"]
|
||||
path = web/documentserver-example/java/src/main/resources/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/php/assets"]
|
||||
path = web/documentserver-example/php/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/python/assets"]
|
||||
path = web/documentserver-example/python/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/csharp-mvc/assets"]
|
||||
path = web/documentserver-example/csharp-mvc/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/csharp/assets"]
|
||||
path = web/documentserver-example/csharp/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/ruby/public/assets"]
|
||||
path = web/documentserver-example/ruby/public/assets
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
263
3rd-Party.license
Normal 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
|
||||
@ -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
@ -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.
|
||||
67
Readme.md
@ -1,19 +1,74 @@
|
||||
|
||||
[](https://opensource.org/licenses/MIT) 
|
||||
|
||||
## 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 /> |
|
||||
|
||||
|
||||
### GET `/files`
|
||||
|
||||
| | |
|
||||
| ------------------ | ------------------------------------------------------------ |
|
||||
| **Summary** | Get information about all files |
|
||||
| **URL** | /files |
|
||||
| **Method** | GET |
|
||||
| **Response** | **Code:** 200 OK <br /> **Success:**<br /> `[{ "version": <file_version>, "id": <file_id>, "contentLength": <file_size_in_kilobytes>, "pureContentLength": <file_size_in_bytes>, "title": <file_name>, "updated": <last_change_date>}, ..., {...}]` |
|
||||
| **Sample** | `curl -X GET http://localhost/files/` |
|
||||
|
||||
|
||||
### GET `/files/file/{fileId}`
|
||||
|
||||
| | |
|
||||
| ------------------ | ------------------------------------------------------------ |
|
||||
| **Summary** | Get information about a file by file id |
|
||||
| **URL** | /files/file/{fileId} |
|
||||
| **Method** | GET |
|
||||
| **Response** | **Code:** 200 OK <br />**Content on success:**<br /> `[{ "version": <file_version>, "id": <file_id>, "contentLength": <file_size_in_kilobytes>, "pureContentLength": <file_size_in_bytes>, "title": <file_name>, "updated": <last_change_date>}]`<br />**Content on error:**<br /> `"File not found"` |
|
||||
| **Sample** | `curl -X GET http://localhost/files/{fileId}` |
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
<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>
|
||||
|
||||
@ -11,8 +9,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectToBuild Include="$(DirCSharp)OnlineEditorsExample.csproj"/>
|
||||
<ProjectToBuild Include="$(DirMvc)OnlineEditorsExampleMVC.csproj"/>
|
||||
<ProjectToBuild Include="$(DirCSharp)OnlineEditorsExample.sln"/>
|
||||
<ProjectToBuild Include="$(DirMvc)OnlineEditorsExampleMVC.sln"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Build">
|
||||
|
||||
@ -4,44 +4,66 @@
|
||||
<PropertyGroup>
|
||||
<To Condition=" '$(To)' == '' ">..\deploy\</To>
|
||||
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
|
||||
<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">
|
||||
<RemoveDir Directories="$(To)" ContinueOnError="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp)obj\**" />
|
||||
</ItemGroup>
|
||||
<Zip Files="@(ZipFilesCSharp)" WorkingDirectory="$(DirCSharp)" ZipFileName="$(To).Net (C#) 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>
|
||||
<Zip Files="@(ZipFilesMVC)" WorkingDirectory="$(DirMvc)" ZipFileName="$(To).Net (C# MVC) Example.zip" />
|
||||
<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\**" />
|
||||
</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>
|
||||
@ -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
|
||||
@ -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.
|
||||
|
||||
|
||||
37
web/documentserver-example/csharp-mvc/3rd-Party.license
Normal 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
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.Web.Optimization;
|
||||
|
||||
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.Web.Mvc;
|
||||
|
||||
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.Web.Http;
|
||||
|
||||
|
||||
@ -1,30 +1,22 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
html {
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 452 B |
BIN
web/documentserver-example/csharp-mvc/Content/images/cell.ico
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 127 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 152 B |
|
After Width: | Height: | Size: 118 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,15 @@
|
||||
<svg width="248" height="53" viewBox="0 0 248 53" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.9111 46.0096L7.13565 37.771C5.62145 37.0517 5.62145 35.9401 7.13565 35.2863L13.3241 32.4093L24.8453 37.771C26.3595 38.4902 28.7954 38.4902 30.2437 37.771L41.7648 32.4093L47.9533 35.2863C49.4675 36.0055 49.4675 37.1171 47.9533 37.771L30.1779 46.0096C28.7954 46.6635 26.3595 46.6635 24.9111 46.0096Z" fill="#FF6F3D"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.9111 35.8748L7.13565 27.6361C5.62145 26.9169 5.62145 25.8053 7.13565 25.1514L13.1925 22.3398L24.9111 27.7669C26.4253 28.4861 28.8612 28.4861 30.3096 27.7669L42.0282 22.3398L48.085 25.1514C49.5992 25.8707 49.5992 26.9823 48.085 27.6361L30.3096 35.8748C28.7953 36.594 26.3595 36.594 24.9111 35.8748Z" fill="#95C038"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.9111 26.0014L7.13565 17.7628C5.62145 17.0435 5.62145 15.9319 7.13565 15.2781L24.9111 7.03944C26.4253 6.32019 28.8612 6.32019 30.3096 7.03944L48.085 15.2781C49.5992 15.9973 49.5992 17.1089 48.085 17.7628L30.3096 26.0014C28.7953 26.6553 26.3595 26.6553 24.9111 26.0014Z" fill="#5DC0E8"/>
|
||||
<path d="M60.085 26.4189C60.085 23.0116 61.0651 20.44 63.0906 18.7685C65.0509 17.0327 67.4031 16.197 70.0821 16.197C72.7611 16.197 75.048 17.0327 77.0083 18.7685C78.9685 20.5043 79.9486 23.0116 79.9486 26.4832C79.9486 29.8906 78.9685 32.4621 77.0083 34.1336C75.048 35.8695 72.6958 36.7052 70.0821 36.7052C67.4031 36.7052 65.1162 35.8695 63.0906 34.1336C61.0651 32.3978 60.085 29.8263 60.085 26.4189ZM64.3975 26.4189C64.3975 28.7976 64.8548 30.4692 65.7043 31.5621C66.619 32.655 67.5992 33.3622 68.6446 33.6193C68.906 33.6836 69.102 33.7479 69.3634 33.7479C69.5594 33.7479 69.8208 33.8122 70.0168 33.8122C70.2781 33.8122 70.4742 33.8122 70.7355 33.7479C70.9969 33.7479 71.1929 33.6836 71.4543 33.6193C72.4997 33.3622 73.4798 32.655 74.3293 31.5621C75.1787 30.4692 75.6361 28.7334 75.6361 26.4832C75.6361 24.1688 75.1787 22.4973 74.3293 21.4044C73.4798 20.3115 72.4997 19.6043 71.4543 19.3471C71.1929 19.2828 70.9315 19.2186 70.7355 19.2186C70.4742 19.2186 70.2781 19.1543 70.0168 19.1543C69.7554 19.1543 69.5594 19.1543 69.3634 19.2186C69.1673 19.2186 68.906 19.2828 68.6446 19.3471C67.5992 19.6043 66.619 20.3115 65.7043 21.4044C64.8548 22.3687 64.3975 24.1045 64.3975 26.4189Z" fill="white"/>
|
||||
<path d="M82.105 16.3898H87.4629L94.5198 28.9905L95.5652 31.755H95.6306L95.5652 28.1548V16.3898H99.6817V36.4481H94.3237L87.2669 23.3331L86.2215 21.0829H86.1561L86.2215 24.6188V36.4481H82.105V16.3898Z" fill="white"/>
|
||||
<path d="M103.929 16.3898H108.045V33.0407H116.147V36.4481H103.929V16.3898Z" fill="white"/>
|
||||
<path d="M113.599 16.3898H118.369L122.551 23.3974L123.204 24.8117H123.335L123.988 23.3974L128.235 16.3898H132.613L125.23 28.2833V36.4481H121.113V28.219L113.599 16.3898Z" fill="white"/>
|
||||
<path d="M132.091 26.4189C132.091 23.0116 133.071 20.44 135.096 18.7685C137.057 17.0327 139.409 16.197 142.088 16.197C144.767 16.197 147.054 17.0327 149.014 18.7685C150.974 20.5043 151.954 23.0116 151.954 26.4832C151.954 29.8906 150.974 32.4621 149.014 34.1336C147.054 35.8695 144.702 36.7052 142.088 36.7052C139.409 36.7052 137.122 35.8695 135.096 34.1336C133.136 32.3978 132.091 29.8263 132.091 26.4189ZM136.403 26.4189C136.403 28.7976 136.861 30.4692 137.71 31.5621C138.625 32.655 139.54 33.3622 140.65 33.6193C140.912 33.6836 141.108 33.7479 141.369 33.7479C141.565 33.7479 141.827 33.8122 142.023 33.8122C142.284 33.8122 142.48 33.8122 142.741 33.7479C143.003 33.7479 143.199 33.6836 143.46 33.6193C144.506 33.3622 145.486 32.655 146.335 31.5621C147.185 30.4692 147.642 28.7334 147.642 26.4832C147.642 24.1688 147.185 22.4973 146.335 21.4044C145.486 20.3115 144.506 19.6043 143.46 19.3471C143.199 19.2828 142.937 19.2186 142.741 19.2186C142.48 19.2186 142.284 19.1543 142.023 19.1543C141.761 19.1543 141.565 19.1543 141.369 19.2186C141.173 19.2186 140.912 19.2828 140.65 19.3471C139.605 19.6043 138.625 20.3115 137.71 21.4044C136.861 22.3687 136.403 24.1045 136.403 26.4189Z" fill="white"/>
|
||||
<path d="M154.829 16.3898H166.198V19.7329H158.946V24.6188H165.872V28.0262H158.946V36.4481H154.829V16.3898Z" fill="white"/>
|
||||
<path d="M169.27 16.3898H180.639V19.7329H173.386V24.6188H180.312V28.0262H173.386V36.4481H169.27V16.3898Z" fill="white"/>
|
||||
<path d="M183.057 36.4481V16.3898H187.173V36.4481H183.057Z" fill="white"/>
|
||||
<path d="M205.311 16.8397V20.3113C204.592 20.0542 203.873 19.8613 203.089 19.7327C202.305 19.6041 201.39 19.5398 200.476 19.5398C198.319 19.5398 196.686 20.1827 195.51 21.5328C194.334 22.8186 193.746 24.4901 193.746 26.4831C193.746 28.4117 194.268 30.019 195.379 31.3048C196.49 32.5905 198.058 33.2977 200.084 33.2977C200.802 33.2977 201.521 33.2334 202.371 33.1692C203.22 33.0406 204.069 32.8477 204.984 32.462L205.246 35.8693C205.115 35.9336 204.919 35.9979 204.723 36.0622C204.462 36.1265 204.2 36.1907 203.873 36.255C203.351 36.3836 202.697 36.4479 201.913 36.5765C201.129 36.6408 200.345 36.7051 199.496 36.7051C199.365 36.7051 199.234 36.7051 199.169 36.7051C199.038 36.7051 198.908 36.7051 198.842 36.7051C196.49 36.5765 194.334 35.6764 192.373 34.1335C190.413 32.5263 189.433 30.019 189.433 26.6759C189.433 23.3972 190.413 20.8256 192.308 19.0255C194.203 17.2254 196.817 16.3254 200.018 16.3254C200.868 16.3254 201.652 16.3254 202.305 16.3897C203.024 16.454 203.677 16.5825 204.396 16.7111C204.527 16.7754 204.723 16.7754 204.854 16.8397C204.984 16.7754 205.115 16.8397 205.311 16.8397Z" fill="white"/>
|
||||
<path d="M208.578 16.3899H220.797V19.5401H212.76V24.5546H220.013V27.6405H212.76V33.298H220.797V36.4481H208.578V16.3899Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 145 B |
BIN
web/documentserver-example/csharp-mvc/Content/images/slide.ico
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
web/documentserver-example/csharp-mvc/Content/images/word.ico
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
@ -1,31 +1,22 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
html {
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
@ -53,10 +44,13 @@ a, a:hover, a:visited {
|
||||
|
||||
|
||||
.top-panel {
|
||||
background: url("images/logo.png") no-repeat 30px center #3D4A6B;
|
||||
background: #3D4A6B;
|
||||
height: 80px;
|
||||
width: 100%;
|
||||
}
|
||||
.top-panel img {
|
||||
margin: 12px 0 0 16px;
|
||||
}
|
||||
.main-panel {
|
||||
margin: 80px auto;
|
||||
width: 600px;
|
||||
@ -113,13 +107,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;
|
||||
@ -133,16 +128,21 @@ label .checkbox {
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
.try-editor.document {
|
||||
.try-editor.word {
|
||||
background-image: url("images/file_docx.png");
|
||||
}
|
||||
.try-editor.spreadsheet {
|
||||
.try-editor.cell {
|
||||
background-image: url("images/file_xlsx.png");
|
||||
}
|
||||
.try-editor.presentation {
|
||||
.try-editor.slide {
|
||||
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;
|
||||
@ -185,25 +185,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 {
|
||||
@ -281,7 +299,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.word {
|
||||
background-image: url("images/icon_docx.png");
|
||||
}
|
||||
|
||||
.stored-edit.cell {
|
||||
background-image: url("images/icon_xlsx.png");
|
||||
}
|
||||
|
||||
.stored-edit.slide {
|
||||
background-image: url("images/icon_pptx.png");
|
||||
}
|
||||
|
||||
.stored-edit span {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
}
|
||||
|
||||
.stored-edit:hover span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
.blockTitle {
|
||||
@ -312,4 +377,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;
|
||||
}
|
||||
@ -1,29 +1,22 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using OnlineEditorsExampleMVC.Helpers;
|
||||
using OnlineEditorsExampleMVC.Models;
|
||||
@ -37,22 +30,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",
|
||||
FileName = fileName
|
||||
Mode = editorsMode,
|
||||
Type = editorsType,
|
||||
FileName = Path.GetFileName(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;
|
||||
}
|
||||
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
@ -1,38 +1,29 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
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
|
||||
@ -81,36 +72,119 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
return directory + fileName;
|
||||
return directory + Path.GetFileName(fileName);
|
||||
}
|
||||
|
||||
public static string GetCorrectName(string fileName)
|
||||
public static string ForcesavePath(string fileName, string userAddress, Boolean create)
|
||||
{
|
||||
var directory = HttpRuntime.AppDomainAppPath + CurUserHostAddress(userAddress) + "\\";
|
||||
if (!Directory.Exists(directory))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
directory = directory + Path.GetFileName(fileName) + "-hist" + "\\";
|
||||
if (!Directory.Exists(directory))
|
||||
{
|
||||
if (create)
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
directory = directory + Path.GetFileName(fileName);
|
||||
if (!File.Exists(directory))
|
||||
{
|
||||
if (!create)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return directory;
|
||||
}
|
||||
|
||||
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() + 1;
|
||||
}
|
||||
|
||||
public static int GetFileVersion(string fileName, string userAddress)
|
||||
{
|
||||
return GetFileVersion(HistoryDir(StoragePath(fileName, userAddress)));
|
||||
}
|
||||
|
||||
public static string GetCorrectName(string fileName, string userAddress = null)
|
||||
{
|
||||
var baseName = Path.GetFileNameWithoutExtension(fileName);
|
||||
var ext = Path.GetExtension(fileName);
|
||||
var name = baseName + ext;
|
||||
|
||||
for (var i = 1; File.Exists(StoragePath(name)); i++)
|
||||
for (var i = 1; File.Exists(StoragePath(name, userAddress)); i++)
|
||||
{
|
||||
name = baseName + " (" + i + ")" + ext;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public static string CreateDemo(string fileExt)
|
||||
public static List<FileInfo> GetStoredFiles()
|
||||
{
|
||||
var demoName = "sample." + fileExt;
|
||||
var directory = HttpRuntime.AppDomainAppPath + WebConfigurationManager.AppSettings["storage-path"] + CurUserHostAddress(null) + "\\";
|
||||
if (!Directory.Exists(directory)) return new List<FileInfo>();
|
||||
|
||||
var directoryInfo = new DirectoryInfo(directory);
|
||||
|
||||
List<FileInfo> storedFiles = directoryInfo.GetFiles("*.*", SearchOption.TopDirectoryOnly).ToList();
|
||||
|
||||
return storedFiles;
|
||||
}
|
||||
|
||||
public static string CreateDemo(string fileExt, bool withContent)
|
||||
{
|
||||
var demoName = (withContent ? "sample." : "new.") + fileExt;
|
||||
var demoPath = "assets\\" + (withContent ? "sample\\" : "new\\");
|
||||
|
||||
var fileName = GetCorrectName(demoName);
|
||||
|
||||
File.Copy(HttpRuntime.AppDomainAppPath + "app_data\\" + demoName, StoragePath(fileName));
|
||||
File.Copy(HttpRuntime.AppDomainAppPath + demoPath + demoName, StoragePath(fileName));
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public static string GetFileUri(string fileName)
|
||||
public static void CreateMeta(string fileName, string uid, string uname, string userAddress = null)
|
||||
{
|
||||
var uri = new UriBuilder(HttpContext.Current.Request.Url)
|
||||
var histDir = HistoryDir(StoragePath(fileName, userAddress));
|
||||
Directory.CreateDirectory(histDir);
|
||||
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
|
||||
{ "created", DateTime.Now.ToString("yyyy'-'MM'-'dd HH':'mm':'ss") },
|
||||
{ "id", string.IsNullOrEmpty(uid) ? "uid-1" : uid },
|
||||
{ "name", string.IsNullOrEmpty(uname) ? "John Smith" : uname }
|
||||
}));
|
||||
}
|
||||
|
||||
public static string GetFileUri(string fileName, Boolean forDocumentServer)
|
||||
{
|
||||
var uri = new UriBuilder(GetServerUrl(forDocumentServer))
|
||||
{
|
||||
Path = HttpRuntime.AppDomainAppVirtualPath + "/"
|
||||
+ CurUserHostAddress() + "/"
|
||||
@ -121,9 +195,38 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
return uri.ToString();
|
||||
}
|
||||
|
||||
public static string GetPathUri(string path)
|
||||
{
|
||||
var uri = new UriBuilder(GetServerUrl(true))
|
||||
{
|
||||
Path = HttpRuntime.AppDomainAppVirtualPath + "/"
|
||||
+ path,
|
||||
Query = ""
|
||||
};
|
||||
|
||||
return uri.ToString();
|
||||
}
|
||||
|
||||
public static string GetServerUrl(Boolean forDocumentServer)
|
||||
{
|
||||
if (forDocumentServer && !WebConfigurationManager.AppSettings["files.docservice.url.example"].Equals(""))
|
||||
{
|
||||
return WebConfigurationManager.AppSettings["files.docservice.url.example"];
|
||||
}
|
||||
else
|
||||
{
|
||||
var uri = new UriBuilder(HttpContext.Current.Request.Url) { Query = "" };
|
||||
var requestHost = HttpContext.Current.Request.Headers["Host"];
|
||||
if (!string.IsNullOrEmpty(requestHost))
|
||||
uri = new UriBuilder(uri.Scheme + "://" + requestHost);
|
||||
|
||||
return uri.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCallback(string fileName)
|
||||
{
|
||||
var callbackUrl = new UriBuilder(HttpContext.Current.Request.Url)
|
||||
var callbackUrl = new UriBuilder(GetServerUrl(true))
|
||||
{
|
||||
Path =
|
||||
HttpRuntime.AppDomainAppVirtualPath
|
||||
@ -140,15 +243,46 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
{
|
||||
switch (fileType)
|
||||
{
|
||||
case FileUtility.FileType.Text:
|
||||
case FileUtility.FileType.Word:
|
||||
return ".docx";
|
||||
case FileUtility.FileType.Spreadsheet:
|
||||
case FileUtility.FileType.Cell:
|
||||
return ".xlsx";
|
||||
case FileUtility.FileType.Presentation:
|
||||
case FileUtility.FileType.Slide:
|
||||
return ".pptx";
|
||||
default:
|
||||
return ".docx";
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Dictionary<string, object>> GetFilesInfo(string fileId = null)
|
||||
{
|
||||
var files = new List<Dictionary<string, object>>();
|
||||
|
||||
foreach (var file in GetStoredFiles())
|
||||
{
|
||||
var dictionary = new Dictionary<string, object>();
|
||||
dictionary.Add("version", GetFileVersion(file.Name, null));
|
||||
dictionary.Add("id", ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + file.Name + "/" + File.GetLastWriteTime(DocManagerHelper.StoragePath(file.Name, null)).GetHashCode()));
|
||||
dictionary.Add("contentLength", Math.Round(file.Length / 1024.0, 2) + " KB");
|
||||
dictionary.Add("pureContentLength", file.Length);
|
||||
dictionary.Add("title", file.Name);
|
||||
dictionary.Add("updated", file.LastWriteTime.ToString());
|
||||
|
||||
if (fileId != null)
|
||||
{
|
||||
if (fileId.Equals(dictionary["id"]))
|
||||
{
|
||||
files.Add(dictionary);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
files.Add(dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,38 +1,30 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
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,8 +38,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
/// </summary>
|
||||
static ServiceConverter()
|
||||
{
|
||||
DocumentConverterUrl = WebConfigurationManager.AppSettings["files.docservice.url.converter"] ?? "";
|
||||
DocumentStorageUrl = WebConfigurationManager.AppSettings["files.docservice.url.storage"] ?? "";
|
||||
DocumentConverterUrl = (WebConfigurationManager.AppSettings["files.docservice.url.site"] ?? "") + (WebConfigurationManager.AppSettings["files.docservice.url.converter"] ?? "");
|
||||
|
||||
Int32.TryParse(WebConfigurationManager.AppSettings["files.docservice.timeout"], out ConvertTimeout);
|
||||
ConvertTimeout = ConvertTimeout > 0 ? ConvertTimeout : 120000;
|
||||
@ -65,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
|
||||
@ -108,74 +84,67 @@ 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);
|
||||
string JWTheader = WebConfigurationManager.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
request.Headers.Add(JWTheader, "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>
|
||||
@ -195,77 +164,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}";
|
||||
@ -315,45 +251,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
|
||||
}
|
||||
}
|
||||
105
web/documentserver-example/csharp-mvc/Helpers/JwtManager.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
290
web/documentserver-example/csharp-mvc/Helpers/TrackManager.cs
Normal file
@ -0,0 +1,290 @@
|
||||
/**
|
||||
*
|
||||
* (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.IO;
|
||||
using System.Net;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Web.Configuration;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
|
||||
namespace OnlineEditorsExampleMVC.Helpers
|
||||
{
|
||||
public class TrackManager
|
||||
{
|
||||
public static Dictionary<string, object> readBody(HttpContext context)
|
||||
{
|
||||
string body;
|
||||
try
|
||||
{
|
||||
using (var receiveStream = context.Request.InputStream)
|
||||
using (var readStream = new StreamReader(receiveStream))
|
||||
{
|
||||
body = readStream.ReadToEnd();
|
||||
if (string.IsNullOrEmpty(body)) context.Response.Write("{\"error\":1,\"message\":\"Request stream is empty\"}");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
var fileData = jss.Deserialize<Dictionary<string, object>>(body);
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
string JWTheader = WebConfigurationManager.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
string token = null;
|
||||
|
||||
if (fileData.ContainsKey("token"))
|
||||
{
|
||||
token = JwtManager.Decode(fileData["token"].ToString());
|
||||
}
|
||||
else if (context.Request.Headers.AllKeys.Contains(JWTheader, StringComparer.InvariantCultureIgnoreCase))
|
||||
{
|
||||
var headerToken = context.Request.Headers.Get(JWTheader).Substring("Bearer ".Length);
|
||||
token = JwtManager.Decode(headerToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Response.Write("{\"error\":1,\"message\":\"JWT expected\"}");
|
||||
}
|
||||
|
||||
if (token != null && !token.Equals(""))
|
||||
{
|
||||
fileData = (Dictionary<string, object>)jss.Deserialize<Dictionary<string, object>>(token)["payload"];
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Response.Write("{\"error\":1,\"message\":\"JWT validation failed\"}");
|
||||
}
|
||||
}
|
||||
|
||||
return fileData;
|
||||
}
|
||||
|
||||
public static int processSave(Dictionary<string, object> fileData, string fileName, string userAddress)
|
||||
{
|
||||
var downloadUri = (string)fileData["url"];
|
||||
string curExt = Path.GetExtension(fileName);
|
||||
string downloadExt = Path.GetExtension(downloadUri) ?? "";
|
||||
var newFileName = fileName;
|
||||
|
||||
if (!curExt.Equals(downloadExt, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
|
||||
if (string.IsNullOrEmpty(newFileUri))
|
||||
{
|
||||
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
else
|
||||
{
|
||||
downloadUri = newFileUri;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
}
|
||||
|
||||
var storagePath = DocManagerHelper.StoragePath(newFileName, userAddress);
|
||||
var histDir = DocManagerHelper.HistoryDir(storagePath);
|
||||
if (!Directory.Exists(histDir)) Directory.CreateDirectory(histDir);
|
||||
|
||||
var versionDir = DocManagerHelper.VersionDir(histDir, DocManagerHelper.GetFileVersion(histDir));
|
||||
if (!Directory.Exists(versionDir)) Directory.CreateDirectory(versionDir);
|
||||
|
||||
File.Move(DocManagerHelper.StoragePath(fileName, userAddress), Path.Combine(versionDir, "prev" + curExt));
|
||||
|
||||
DownloadToFile(downloadUri, storagePath);
|
||||
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"))
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
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"]);
|
||||
|
||||
string forcesavePath = DocManagerHelper.ForcesavePath(newFileName, userAddress, false);
|
||||
if (!forcesavePath.Equals(""))
|
||||
{
|
||||
File.Delete(forcesavePath);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int processForceSave(Dictionary<string, object> fileData, string fileName, string userAddress)
|
||||
{
|
||||
var downloadUri = (string)fileData["url"];
|
||||
|
||||
string curExt = Path.GetExtension(fileName);
|
||||
string downloadExt = Path.GetExtension(downloadUri);
|
||||
var newFileName = fileName;
|
||||
|
||||
if (!curExt.Equals(downloadExt))
|
||||
{
|
||||
try
|
||||
{
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
|
||||
if (string.IsNullOrEmpty(newFileUri))
|
||||
{
|
||||
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
else
|
||||
{
|
||||
downloadUri = newFileUri;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
}
|
||||
|
||||
string forcesavePath = "";
|
||||
Boolean isSubmitForm = fileData["forcesavetype"].ToString().Equals("3");
|
||||
|
||||
if (isSubmitForm)
|
||||
{
|
||||
if (newFileName.Equals(fileName))
|
||||
{
|
||||
newFileName = DocManagerHelper.GetCorrectName(fileName, userAddress);
|
||||
}
|
||||
forcesavePath = DocManagerHelper.StoragePath(newFileName, userAddress);
|
||||
}
|
||||
else
|
||||
{
|
||||
forcesavePath = DocManagerHelper.ForcesavePath(newFileName, userAddress, false);
|
||||
if (forcesavePath.Equals(""))
|
||||
{
|
||||
forcesavePath = DocManagerHelper.ForcesavePath(newFileName, userAddress, true);
|
||||
}
|
||||
}
|
||||
|
||||
DownloadToFile(downloadUri, forcesavePath);
|
||||
|
||||
if (isSubmitForm)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
var actions = jss.Deserialize<List<object>>(jss.Serialize(fileData["actions"]));
|
||||
var action = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(actions[0]));
|
||||
var user = action["userid"].ToString();
|
||||
DocManagerHelper.CreateMeta(newFileName, user, "Filling Form", userAddress);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void commandRequest(string method, string key)
|
||||
{
|
||||
string documentCommandUrl = WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.command"];
|
||||
|
||||
var request = (HttpWebRequest)WebRequest.Create(documentCommandUrl);
|
||||
request.Method = "POST";
|
||||
request.ContentType = "application/json";
|
||||
|
||||
var body = new Dictionary<string, object>() {
|
||||
{ "c", method },
|
||||
{ "key", key }
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var payload = new Dictionary<string, object>
|
||||
{
|
||||
{ "payload", body }
|
||||
};
|
||||
|
||||
var payloadToken = JwtManager.Encode(payload);
|
||||
var bodyToken = JwtManager.Encode(body);
|
||||
string JWTheader = WebConfigurationManager.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
request.Headers.Add(JWTheader, "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 Exception("Response is null");
|
||||
|
||||
using (var reader = new StreamReader(stream))
|
||||
{
|
||||
dataResponse = reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
var responseObj = jss.Deserialize<Dictionary<string, object>>(dataResponse);
|
||||
if (!responseObj["error"].ToString().Equals("0"))
|
||||
{
|
||||
throw new Exception(dataResponse);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
web/documentserver-example/csharp-mvc/Helpers/Utils.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
201
web/documentserver-example/csharp-mvc/LICENSE
Normal 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.
|
||||
@ -1,40 +1,45 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
get { return DocManagerHelper.GetFileUri(FileName); }
|
||||
get { return DocManagerHelper.GetFileUri(FileName, true); }
|
||||
}
|
||||
|
||||
public string FileUriUser
|
||||
{
|
||||
get { return DocManagerHelper.GetFileUri(FileName, false); }
|
||||
}
|
||||
|
||||
public string FileName { get; set; }
|
||||
@ -46,15 +51,292 @@ 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 submitForm = canEdit && (editorsMode.Equals("edit") || editorsMode.Equals("fillForms"));
|
||||
|
||||
var userId = request.Cookies.GetOrDefault("uid", "uid-1");
|
||||
var uname = userId.Equals("uid-0") ? null : request.Cookies.GetOrDefault("uname", "John Smith");
|
||||
string userGroup = null;
|
||||
List<string> reviewGroups = null;
|
||||
if (userId.Equals("uid-2"))
|
||||
{
|
||||
return DocManagerHelper.GetCallback(FileName);
|
||||
userGroup = "group-2";
|
||||
reviewGroups = new List<string>() { "group-2", "" };
|
||||
}
|
||||
if (userId.Equals("uid-3"))
|
||||
{
|
||||
userGroup = "group-3";
|
||||
reviewGroups = new List<string>() { "group-2" };
|
||||
}
|
||||
|
||||
object favorite = null;
|
||||
if (!string.IsNullOrEmpty(request.Cookies.GetOrDefault("uid", null)))
|
||||
{
|
||||
favorite = request.Cookies.GetOrDefault("uid", null).Equals("uid-2");
|
||||
}
|
||||
|
||||
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>
|
||||
{
|
||||
{ "owner", "Me" },
|
||||
{ "uploaded", DateTime.Now.ToShortDateString() },
|
||||
{ "favorite", favorite}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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" },
|
||||
{ "reviewGroups", reviewGroups }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"editorConfig", new Dictionary<string, object>
|
||||
{
|
||||
{ "actionLink", actionData },
|
||||
{ "mode", mode },
|
||||
{ "lang", request.Cookies.GetOrDefault("ulang", "en") },
|
||||
{ "callbackUrl", CallbackUrl },
|
||||
{
|
||||
"user", new Dictionary<string, object>
|
||||
{
|
||||
{ "id", userId },
|
||||
{ "name", uname },
|
||||
{ "group", userGroup }
|
||||
}
|
||||
},
|
||||
{
|
||||
"embedded", new Dictionary<string, object>
|
||||
{
|
||||
{ "saveUrl", FileUriUser },
|
||||
{ "embedUrl", FileUriUser },
|
||||
{ "shareUrl", FileUriUser },
|
||||
{ "toolbarDocked", "top" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"customization", new Dictionary<string, object>
|
||||
{
|
||||
{ "about", true },
|
||||
{ "feedback", true },
|
||||
{ "forcesave", false },
|
||||
{ "submitForm", submitForm },
|
||||
{
|
||||
"goback", new Dictionary<string, object>
|
||||
{
|
||||
{ "url", url.Action("Index", "Home") }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
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 = 1; i <= currentVersion; i++)
|
||||
{
|
||||
var obj = new Dictionary<string, object>();
|
||||
var dataObj = new Dictionary<string, object>();
|
||||
var verDir = DocManagerHelper.VersionDir(histDir, i);
|
||||
|
||||
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt"));
|
||||
|
||||
obj.Add("key", key);
|
||||
obj.Add("version", i);
|
||||
|
||||
if (i == 1)
|
||||
{
|
||||
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 > 1)
|
||||
{
|
||||
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(DocManagerHelper.VersionDir(histDir, i - 1), "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 - 2).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 - 1), "diff.zip").Substring(HttpRuntime.AppDomainAppPath.Length)));
|
||||
}
|
||||
if(JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(dataObj);
|
||||
dataObj.Add("token", token);
|
||||
}
|
||||
hist.Add(obj);
|
||||
histData.Add((i - 1).ToString(), dataObj);
|
||||
}
|
||||
|
||||
history = jss.Serialize(new Dictionary<string, object>()
|
||||
{
|
||||
{ "currentVersion", currentVersion },
|
||||
{ "history", hist }
|
||||
});
|
||||
historyData = jss.Serialize(histData);
|
||||
}
|
||||
}
|
||||
|
||||
public void GetCompareFileData(out string compareConfig)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var compareFileUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
|
||||
{
|
||||
Path = HttpRuntime.AppDomainAppVirtualPath
|
||||
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
|
||||
+ "webeditor.ashx",
|
||||
Query = "type=assets&fileName=" + HttpUtility.UrlEncode("sample.docx")
|
||||
};
|
||||
|
||||
var dataCompareFile = new Dictionary<string, object>
|
||||
{
|
||||
{ "fileType", "docx" },
|
||||
{ "url", compareFileUrl.ToString() }
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var compareFileToken = JwtManager.Encode(dataCompareFile);
|
||||
dataCompareFile.Add("token", compareFileToken);
|
||||
}
|
||||
|
||||
compareConfig = jss.Serialize(dataCompareFile);
|
||||
}
|
||||
|
||||
public void GetLogoConfig(out string logoUrl)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var mailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
|
||||
{
|
||||
Path = HttpRuntime.AppDomainAppVirtualPath
|
||||
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
|
||||
+ "Content\\images\\logo.png"
|
||||
};
|
||||
|
||||
var logoConfig = new Dictionary<string, object>
|
||||
{
|
||||
{ "fileType", "png"},
|
||||
{ "url", mailMergeUrl.ToString()}
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(logoConfig);
|
||||
logoConfig.Add("token", token);
|
||||
}
|
||||
|
||||
logoUrl = jss.Serialize(logoConfig).Replace("{", "").Replace("}", "");
|
||||
}
|
||||
|
||||
public void GetMailMergeConfig(out string dataMailMergeRecipients)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var mailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
|
||||
{
|
||||
Path =
|
||||
HttpRuntime.AppDomainAppVirtualPath
|
||||
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
|
||||
+ "webeditor.ashx",
|
||||
Query = "type=csv"
|
||||
};
|
||||
|
||||
var mailMergeConfig = new Dictionary<string, object>
|
||||
{
|
||||
{ "fileType", "csv" },
|
||||
{ "url", mailMergeUrl.ToString()}
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var mailmergeToken = JwtManager.Encode(mailMergeConfig);
|
||||
mailMergeConfig.Add("token", mailmergeToken);
|
||||
}
|
||||
|
||||
dataMailMergeRecipients = jss.Serialize(mailMergeConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -33,40 +25,44 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{
|
||||
public enum FileType
|
||||
{
|
||||
Text,
|
||||
Spreadsheet,
|
||||
Presentation
|
||||
Word,
|
||||
Cell,
|
||||
Slide
|
||||
}
|
||||
|
||||
public static FileType GetFileType(string fileName)
|
||||
{
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
|
||||
if (ExtsDocument.Contains(ext)) return FileType.Text;
|
||||
if (ExtsSpreadsheet.Contains(ext)) return FileType.Spreadsheet;
|
||||
if (ExtsPresentation.Contains(ext)) return FileType.Presentation;
|
||||
if (ExtsDocument.Contains(ext)) return FileType.Word;
|
||||
if (ExtsSpreadsheet.Contains(ext)) return FileType.Cell;
|
||||
if (ExtsPresentation.Contains(ext)) return FileType.Slide;
|
||||
|
||||
return FileType.Text;
|
||||
return FileType.Word;
|
||||
}
|
||||
|
||||
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", ".xml",
|
||||
".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"
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -20,6 +20,10 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<Use64BitIISExpress />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -41,90 +45,55 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.Entity" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<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="Antlr3.Runtime">
|
||||
<HintPath>packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\EntityFramework.dll</HintPath>
|
||||
<HintPath>packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
|
||||
<HintPath>packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http">
|
||||
<HintPath>packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Formatting">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Http.WebHost.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Optimization">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Optimization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Providers">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Providers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Razor.dll</HintPath>
|
||||
<HintPath>packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Helpers">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.Helpers.dll</HintPath>
|
||||
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http">
|
||||
<HintPath>packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost">
|
||||
<HintPath>packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc">
|
||||
<HintPath>packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\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>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor">
|
||||
<HintPath>packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.WebPages.dll</HintPath>
|
||||
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\System.Web.WebPages.Razor.dll</HintPath>
|
||||
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebGrease">
|
||||
<Private>True</Private>
|
||||
<HintPath>bin\WebGrease.dll</HintPath>
|
||||
<HintPath>packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -136,8 +105,11 @@
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\TrackManager.cs" />
|
||||
<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" />
|
||||
@ -148,20 +120,34 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Content\editor.css" />
|
||||
<Content Include="Content\images\alert.png" />
|
||||
<Content Include="Content\images\block-content-24.png" />
|
||||
<Content Include="Content\images\cell.ico" />
|
||||
<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\images\slide.ico" />
|
||||
<Content Include="Content\images\word.ico" />
|
||||
<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" />
|
||||
@ -180,20 +166,29 @@
|
||||
<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" />
|
||||
<Content Include="web.appsettings.config" />
|
||||
<Content Include="WebEditor.ashx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Content Include="assets\AUTHORS.md" />
|
||||
<Content Include="assets\LICENSE" />
|
||||
<Content Include="assets\new\new.docx" />
|
||||
<Content Include="assets\new\new.pptx" />
|
||||
<Content Include="assets\new\new.xlsx" />
|
||||
<Content Include="assets\sample\csv.csv" />
|
||||
<Content Include="assets\sample\sample.docx" />
|
||||
<Content Include="assets\sample\sample.pptx" />
|
||||
<Content Include="assets\sample\sample.xlsx" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
|
||||
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
|
||||
</Target>
|
||||
@ -215,10 +210,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- 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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target> -->
|
||||
</Project>
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30523.141
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineEditorsExampleMVC", "OnlineEditorsExampleMVC.csproj", "{D2C16047-E658-444A-A45D-23CEE79CB8F3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {808AEE5A-E969-411D-8326-9C1F7734DC70}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("OnlineEditorsExampleMVC")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2017")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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 = {};
|
||||
|
||||
@ -1,28 +1,20 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
if (typeof jQuery != "undefined") {
|
||||
jq = jQuery.noConflict();
|
||||
@ -70,6 +62,8 @@ if (typeof jQuery != "undefined") {
|
||||
checkConvert();
|
||||
}
|
||||
});
|
||||
|
||||
initSelectors();
|
||||
});
|
||||
|
||||
var timer = null;
|
||||
@ -91,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());
|
||||
@ -162,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;
|
||||
@ -194,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"
|
||||
|
||||
@ -1,30 +1,4 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*-->
|
||||
|
||||
<%@ 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" %>
|
||||
@ -35,8 +9,27 @@
|
||||
<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="<%= "content/images/" + Model.DocumentType + ".ico" %>" type="image/x-icon" />
|
||||
<title><%= Model.FileName + " - ONLYOFFICE" %></title>
|
||||
|
||||
<%: Styles.Render("~/Content/editor") %>
|
||||
@ -48,20 +41,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%: Scripts.Render(new []{ WebConfigurationManager.AppSettings["files.docservice.url.api"] }) %>
|
||||
<%: Scripts.Render(new []{ WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.api"] }) %>
|
||||
|
||||
<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");
|
||||
};
|
||||
|
||||
@ -83,90 +74,100 @@
|
||||
location.reload(true);
|
||||
};
|
||||
|
||||
var сonnectEditor = function () {
|
||||
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;
|
||||
}
|
||||
|
||||
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,
|
||||
'onOutdatedVersion': onOutdatedVersion,
|
||||
}
|
||||
});
|
||||
var onMakeActionLink = function (event) {
|
||||
var actionData = event.data;
|
||||
var linkParam = JSON.stringify(actionData);
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
|
||||
};
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("load", сonnectEditor);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("load", сonnectEditor);
|
||||
}
|
||||
var onMetaChange = function (event) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
document.title = (favorite ? "☆" : "") + title;
|
||||
docEditor.setFavorite(favorite);
|
||||
};
|
||||
|
||||
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 onRequestInsertImage = function (event) {
|
||||
<% string logoUrl;%>
|
||||
<% Model.GetLogoConfig(out logoUrl); %>
|
||||
docEditor.insertImage({
|
||||
"c": event.data.c,
|
||||
<%= logoUrl%>
|
||||
})
|
||||
};
|
||||
|
||||
var onRequestCompareFile = function () {
|
||||
<% string compareFileData; %>
|
||||
<% Model.GetCompareFileData(out compareFileData); %>
|
||||
docEditor.setRevisedFile(<%=compareFileData%>);
|
||||
};
|
||||
|
||||
var onRequestMailMergeRecipients = function (event) {
|
||||
<% string dataMailMergeRecipients; %>
|
||||
<% Model.GetMailMergeConfig(out dataMailMergeRecipients); %>
|
||||
docEditor.setMailMergeRecipients(<%= dataMailMergeRecipients%>);
|
||||
};
|
||||
|
||||
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,
|
||||
"onMetaChange": onMetaChange,
|
||||
"onRequestInsertImage": onRequestInsertImage,
|
||||
"onRequestCompareFile": onRequestCompareFile,
|
||||
"onRequestMailMergeRecipients": onRequestMailMergeRecipients,
|
||||
};
|
||||
|
||||
<% 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 - 1]);
|
||||
};
|
||||
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>
|
||||
|
||||
@ -1,33 +1,8 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*-->
|
||||
|
||||
<%@ 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>
|
||||
|
||||
@ -36,6 +11,23 @@
|
||||
<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" />
|
||||
@ -45,31 +37,201 @@
|
||||
<%: Styles.Render("~/Content/css") %>
|
||||
</head>
|
||||
<body>
|
||||
<div class="top-panel"></div>
|
||||
<div class="top-panel">
|
||||
<a href="">
|
||||
<img src ="content/images/logo.svg" alt="ONLYOFFICE" />
|
||||
</a>
|
||||
</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>
|
||||
<option value="uid-0">anonymous</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="be">Belarusian</option>
|
||||
<option value="bg">Bulgarian</option>
|
||||
<option value="ca">Catalan</option>
|
||||
<option value="zh">Chinese</option>
|
||||
<option value="cs">Czech</option>
|
||||
<option value="da">Danish</option>
|
||||
<option value="nl">Dutch</option>
|
||||
<option value="fi">Finnish</option>
|
||||
<option value="fr">French</option>
|
||||
<option value="de">German</option>
|
||||
<option value="el">Greek</option>
|
||||
<option value="hu">Hungarian</option>
|
||||
<option value="id">Indonesian</option>
|
||||
<option value="it">Italian</option>
|
||||
<option value="ja">Japanese</option>
|
||||
<option value="ko">Korean</option>
|
||||
<option value="lv">Latvian</option>
|
||||
<option value="lo">Lao</option>
|
||||
<option value="nb">Norwegian</option>
|
||||
<option value="pl">Polish</option>
|
||||
<option value="pt">Portuguese</option>
|
||||
<option value="ro">Romanian</option>
|
||||
<option value="ru">Russian</option>
|
||||
<option value="sk">Slovak</option>
|
||||
<option value="sl">Slovenian</option>
|
||||
<option value="sv">Swedish</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 word" data-type="docx">Create<br />Document</a></li>
|
||||
<li><a class="try-editor cell" data-type="xlsx">Create<br />Spreadsheet</a></li>
|
||||
<li><a class="try-editor slide" 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.Name);
|
||||
var docType = FileUtility.GetFileType(storedFile.Name).ToString().ToLower();
|
||||
%>
|
||||
<tr class="tableRow" title="<%= storedFile.Name %>">
|
||||
<td class="contentCells">
|
||||
<a class="stored-edit <%= docType %>" href="<%= Url.Action("Editor", "Home", new { fileName = storedFile.Name }) %>" target="_blank">
|
||||
<span title="<%= storedFile.Name %>"><%= storedFile.Name %></span>
|
||||
</a>
|
||||
<a href="webeditor.ashx?type=download&filename=<%= HttpUtility.UrlEncode(storedFile.Name) %>">
|
||||
<img class="icon-download" src="content/images/download-24.png" alt="Download" title="Download" />
|
||||
</a>
|
||||
<a class="delete-file" data-filename="<%= storedFile.Name %>">
|
||||
<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.Name, 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.Name, 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 == "word") { %>
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile.Name, 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 == "cell") { %>
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile.Name, 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.Name, 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 == "word") { %>
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile.Name, 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 == "word") { %>
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile.Name, 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.Name, 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.Name, 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.Name, 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 />
|
||||
@ -124,7 +286,7 @@
|
||||
<div id="cancelEdit" class="button gray">Cancel</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" data-docs="<%= WebConfigurationManager.AppSettings["files.docservice.url.preloader"] %>"></span>
|
||||
<span id="loadScripts" data-docs="<%= WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.preloader"] %>"></span>
|
||||
|
||||
<div class="bottom-panel">© Ascensio System SIA <%= DateTime.Now.Year.ToString() %>. All rights reserved.</div>
|
||||
|
||||
|
||||
@ -3,6 +3,23 @@
|
||||
<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>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<appSettings configSource="web.appsettings.config" />
|
||||
<system.web>
|
||||
@ -26,16 +26,35 @@
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<add name="Access-Control-Allow-Origin" value="*" />
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
@ -1,38 +1,33 @@
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2017
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
* 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
|
||||
*
|
||||
* 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:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
* 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 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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Web;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Web.Services;
|
||||
using System.Web.Configuration;
|
||||
using OnlineEditorsExampleMVC.Helpers;
|
||||
using OnlineEditorsExampleMVC.Models;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace OnlineEditorsExampleMVC
|
||||
{
|
||||
@ -47,12 +42,27 @@ namespace OnlineEditorsExampleMVC
|
||||
case "upload":
|
||||
Upload(context);
|
||||
break;
|
||||
case "download":
|
||||
Download(context);
|
||||
break;
|
||||
case "convert":
|
||||
Convert(context);
|
||||
break;
|
||||
case "track":
|
||||
Track(context);
|
||||
break;
|
||||
case "remove":
|
||||
Remove(context);
|
||||
break;
|
||||
case "assets":
|
||||
Assets(context);
|
||||
break;
|
||||
case "csv":
|
||||
GetCsv(context);
|
||||
break;
|
||||
case "files":
|
||||
Files(context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +100,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 + "\"}");
|
||||
}
|
||||
@ -104,8 +115,8 @@ namespace OnlineEditorsExampleMVC
|
||||
context.Response.ContentType = "text/plain";
|
||||
try
|
||||
{
|
||||
var fileName = context.Request["filename"];
|
||||
var fileUri = DocManagerHelper.GetFileUri(fileName);
|
||||
var fileName = Path.GetFileName(context.Request["filename"]);
|
||||
var fileUri = DocManagerHelper.GetFileUri(fileName, true);
|
||||
|
||||
var extension = (Path.GetExtension(fileUri) ?? "").Trim('.');
|
||||
var internalExtension = DocManagerHelper.GetInternalExtension(FileUtility.GetFileType(fileName)).Trim('.');
|
||||
@ -143,8 +154,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 + "\"}");
|
||||
@ -162,69 +174,174 @@ namespace OnlineEditorsExampleMVC
|
||||
MustSave = 2,
|
||||
Corrupted = 3,
|
||||
Closed = 4,
|
||||
MustForceSave = 6,
|
||||
CorruptedForceSave = 7
|
||||
}
|
||||
|
||||
private static void Track(HttpContext context)
|
||||
{
|
||||
var fileData = TrackManager.readBody(context);
|
||||
|
||||
var userAddress = context.Request["userAddress"];
|
||||
var fileName = context.Request["fileName"];
|
||||
var fileName = Path.GetFileName(context.Request["fileName"]);
|
||||
var status = (TrackerStatus) (int) fileData["status"];
|
||||
var saved = 1;
|
||||
switch (status)
|
||||
{
|
||||
case TrackerStatus.Editing:
|
||||
try
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
var actions = jss.Deserialize <List<object>> (jss.Serialize(fileData["actions"]));
|
||||
var action = jss.Deserialize <Dictionary<string, object>> (jss.Serialize(actions[0]));
|
||||
if (action != null && action["type"].ToString().Equals("0"))
|
||||
{
|
||||
var user = action["userid"].ToString();
|
||||
var users = jss.Deserialize<List<object>>(jss.Serialize(fileData["users"]));
|
||||
if (!users.Contains(user))
|
||||
{
|
||||
TrackManager.commandRequest("forcesave", fileData["key"].ToString());
|
||||
}
|
||||
|
||||
var storagePath = DocManagerHelper.StoragePath(fileName, userAddress);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
break;
|
||||
|
||||
string body;
|
||||
case TrackerStatus.MustSave:
|
||||
case TrackerStatus.Corrupted:
|
||||
try
|
||||
{
|
||||
saved = TrackManager.processSave(fileData, fileName, userAddress);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
saved = 1;
|
||||
}
|
||||
context.Response.Write("{\"error\":" + saved + "}");
|
||||
return;
|
||||
|
||||
case TrackerStatus.MustForceSave:
|
||||
case TrackerStatus.CorruptedForceSave:
|
||||
try
|
||||
{
|
||||
saved = TrackManager.processForceSave(fileData, fileName, userAddress);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
saved = 1;
|
||||
}
|
||||
context.Response.Write("{\"error\":" + saved + "}");
|
||||
return;
|
||||
}
|
||||
|
||||
context.Response.Write("{\"error\":0}");
|
||||
}
|
||||
|
||||
private static void Remove(HttpContext context)
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
try
|
||||
{
|
||||
using (var receiveStream = context.Request.InputStream)
|
||||
using (var readStream = new StreamReader(receiveStream))
|
||||
var fileName = Path.GetFileName(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 Files(HttpContext context)
|
||||
{
|
||||
List<Dictionary<string, object>> files = null;
|
||||
|
||||
try
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
context.Response.ContentType = "application/json";
|
||||
|
||||
if (context.Request["fileId"] == null)
|
||||
{
|
||||
body = readStream.ReadToEnd();
|
||||
files = DocManagerHelper.GetFilesInfo();
|
||||
context.Response.Write(jss.Serialize(files));
|
||||
}
|
||||
else
|
||||
{
|
||||
var fileId = context.Request["fileId"];
|
||||
files = DocManagerHelper.GetFilesInfo(fileId);
|
||||
if (files.Count == 0)
|
||||
{
|
||||
context.Response.Write("\"File not found\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Response.Write(jss.Serialize(files));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new HttpException((int) HttpStatusCode.BadRequest, e.Message);
|
||||
context.Response.Write("{ \"error\": \"" + e.Message + "\"}");
|
||||
}
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
if (string.IsNullOrEmpty(body)) return;
|
||||
var fileData = jss.Deserialize<Dictionary<string, object>>(body);
|
||||
var status = (TrackerStatus) (int) fileData["status"];
|
||||
private static void Assets(HttpContext context)
|
||||
{
|
||||
var fileName = Path.GetFileName(context.Request["filename"]);
|
||||
var filePath = HttpRuntime.AppDomainAppPath + "assets/sample/" + fileName;
|
||||
download(filePath, context);
|
||||
}
|
||||
|
||||
switch (status)
|
||||
private static void GetCsv(HttpContext context)
|
||||
{
|
||||
var fileName = "csv.csv";
|
||||
var filePath = HttpRuntime.AppDomainAppPath + "assets/sample/" + fileName;
|
||||
download(filePath, context);
|
||||
}
|
||||
|
||||
private static void Download(HttpContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
case TrackerStatus.MustSave:
|
||||
case TrackerStatus.Corrupted:
|
||||
var downloadUri = (string) fileData["url"];
|
||||
var fileName = Path.GetFileName(context.Request["filename"]);
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
saved = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
var filePath = DocManagerHelper.ForcesavePath(fileName, null, false);
|
||||
if (filePath.Equals(""))
|
||||
{
|
||||
filePath = DocManagerHelper.StoragePath(fileName, null);
|
||||
}
|
||||
download(filePath, context);
|
||||
}
|
||||
context.Response.Write("{\"error\":0}");
|
||||
catch (Exception)
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"File not found!\"}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void download(string filePath, HttpContext context)
|
||||
{
|
||||
var fileinf = new FileInfo(filePath);
|
||||
context.Response.AddHeader("Content-Length", fileinf.Length.ToString());
|
||||
context.Response.AddHeader("Content-Type", MimeMapping.GetMimeMapping(filePath));
|
||||
var tmp = HttpUtility.UrlEncode(Path.GetFileName(filePath));
|
||||
tmp = tmp.Replace("+", "%20");
|
||||
context.Response.AddHeader("Content-Disposition", "attachment; filename*=UTF-8\'\'" + tmp);
|
||||
context.Response.TransmitFile(filePath);
|
||||
}
|
||||
|
||||
public bool IsReusable
|
||||
|
||||
1
web/documentserver-example/csharp-mvc/assets
Submodule
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 144 KiB |
@ -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
|
||||
@ -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.
|
||||
@ -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.
|
||||
@ -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.
|
||||
@ -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.
|
||||
16
web/documentserver-example/csharp-mvc/packages.config
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net45" />
|
||||
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
|
||||
<package id="WebGrease" version="1.6.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@ -9,13 +9,20 @@
|
||||
|
||||
<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|.xml|.epub|.fb2"/>
|
||||
<add key="files.docservice.timeout" value="120000" />
|
||||
<add key="files.docservice.secret" value="" />
|
||||
<add key="files.docservice.header" value="Authorization" />
|
||||
|
||||
<add key="files.docservice.url.site" value="https://documentserver/"/>
|
||||
|
||||
<add key="files.docservice.url.converter" value="ConvertService.ashx"/>
|
||||
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
|
||||
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
|
||||
<add key="files.docservice.url.command" value="coauthoring/CommandService.ashx"/>
|
||||
|
||||
<add key="files.docservice.url.example" 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"/>
|
||||
</appSettings>
|
||||
|
||||
21
web/documentserver-example/csharp/3rd-Party.license
Normal 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
|
||||
|
After Width: | Height: | Size: 452 B |
BIN
web/documentserver-example/csharp/App_Themes/images/cell.ico
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 127 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 152 B |
|
After Width: | Height: | Size: 118 B |