mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-11 18:35:17 +08:00
Compare commits
730 Commits
feature/ja
...
v99.99.99.
| Author | SHA1 | Date | |
|---|---|---|---|
| 6315ccbf45 | |||
| 969a8c6cfe | |||
| f4dd6d665f | |||
| 427d13af24 | |||
| 6bdadd6053 | |||
| 95579f2376 | |||
| 8c518fd109 | |||
| aa245e2aae | |||
| 6511507093 | |||
| 8f14876b81 | |||
| 09f24a3b87 | |||
| 14b014cb7f | |||
| 2d83d3ec87 | |||
| 05904fd68a | |||
| a56b411c93 | |||
| bc5393e28c | |||
| a3fa30b192 | |||
| 24b9a35651 | |||
| 52a722cf89 | |||
| 4fa9d4c9fd | |||
| 35613ddccb | |||
| 2fa83dcc94 | |||
| c1af2ba5b4 | |||
| fa84f451c2 | |||
| 87e9da1212 | |||
| 22dbacaa63 | |||
| d192d1e0e8 | |||
| 5b115f7dbc | |||
| 41a22934a0 | |||
| 94f4e83d79 | |||
| 8ed0c4771d | |||
| 0445184cbc | |||
| e4750e7a61 | |||
| a78450453d | |||
| ca139938e9 | |||
| 8ae9dc6fff | |||
| 9c0121e69f | |||
| e11861b30f | |||
| 21842b772d | |||
| 17a1485d52 | |||
| 07c752ed81 | |||
| 8c704687a7 | |||
| b691eb5717 | |||
| dc35b240d1 | |||
| 527e5053e6 | |||
| 1839a5c26b | |||
| ccb81a60e1 | |||
| b73a70e6d0 | |||
| 89e64fe71e | |||
| 2ffc44f339 | |||
| 4e515a66ef | |||
| a758f9a6d8 | |||
| 0131724cab | |||
| a178dbc612 | |||
| 4064f73c89 | |||
| 561af8444c | |||
| 091bf10374 | |||
| 63461b3eb6 | |||
| bd20af2096 | |||
| 2611fae25c | |||
| c740e21e83 | |||
| 8193d5b9f2 | |||
| 1f109c2b88 | |||
| a676da0a61 | |||
| 5f0fcfebd2 | |||
| 292640aa95 | |||
| 9aedba8be3 | |||
| c98e8d03d2 | |||
| 5951870870 | |||
| 9bc6964274 | |||
| 2051f3028e | |||
| 869f8e7ba7 | |||
| 815b5fb428 | |||
| 13a1a6ba2c | |||
| a3b93fee99 | |||
| 36cca57dd8 | |||
| 53f315c5ee | |||
| 7c0d8cd59d | |||
| 3405af796c | |||
| b4905eb94e | |||
| 5a3330beb2 | |||
| 5d16a50f0f | |||
| d8b6b0bbb5 | |||
| 7b6c9b5683 | |||
| d4bed077e0 | |||
| 8aba537cea | |||
| 9cc6612bb2 | |||
| 4bae7d8bf5 | |||
| 59c9061306 | |||
| 2fb011185a | |||
| 49a58e687d | |||
| 42e1b0635a | |||
| e9d8b60c13 | |||
| 33119ca2ad | |||
| 913c1350c2 | |||
| fa34f5a44e | |||
| 5784171806 | |||
| 8829f969d3 | |||
| ab48645ba8 | |||
| 5d0f1b62d0 | |||
| 78747c1cae | |||
| 2955dc004f | |||
| 85981abd00 | |||
| 7542c6ca6e | |||
| ab0553d988 | |||
| 57e498ebba | |||
| ce1052139e | |||
| 350ea4e678 | |||
| 979391e413 | |||
| 2b454e23d5 | |||
| 9ed5f19d6b | |||
| 851b2e48c7 | |||
| be40222d1a | |||
| d701f1565b | |||
| 2f39fb3bc6 | |||
| 626f051aab | |||
| acd4bf87e7 | |||
| 9a9e122eec | |||
| 340eaa31f4 | |||
| 6433f502ad | |||
| cbfbf77f0f | |||
| 173641a7af | |||
| ce37d1de20 | |||
| ce80e89028 | |||
| 63365e176e | |||
| 32a60c09aa | |||
| 5a03024cd3 | |||
| cb6416c481 | |||
| 55e4247687 | |||
| a0620905b2 | |||
| 3fcef4096a | |||
| 4e5349c1c4 | |||
| 538eec1ff3 | |||
| 10e67c787c | |||
| 565a27d981 | |||
| 7304c1e67a | |||
| f9ba90d3ac | |||
| d2f40c5395 | |||
| ca0b7adcee | |||
| df7cfda2fb | |||
| 9ebef04f3d | |||
| a6ed970bca | |||
| 7f659bc95e | |||
| 3c4a1c1c31 | |||
| 2bae0567ad | |||
| 419fbf90f9 | |||
| 2d637b88df | |||
| 13e2d5b33c | |||
| f208fe1939 | |||
| b3cc35cb5e | |||
| 8b316b0786 | |||
| c57fcbfd90 | |||
| 1939b85c8c | |||
| ee0ac33820 | |||
| c93579d98f | |||
| 61a9e122cd | |||
| e88a9f5bed | |||
| f1ce0fb415 | |||
| 3b142d92fc | |||
| 1898da660e | |||
| 0629cf0797 | |||
| 7737670a6d | |||
| 5bdcac42e3 | |||
| 4b8ffa26cc | |||
| a4b6fcb512 | |||
| 523b10c979 | |||
| 1d4bc95c29 | |||
| e94a4863aa | |||
| edda981ab7 | |||
| 65ebf9a5b1 | |||
| a081cd1f06 | |||
| 04c5ee8cd7 | |||
| 3ebf3fabee | |||
| 403efc1325 | |||
| 7deedcaa5e | |||
| 161e26dd8a | |||
| 09804349fa | |||
| 83a83f4f5d | |||
| 79ee987003 | |||
| 434484cac3 | |||
| a0bafb0e4b | |||
| 184aded727 | |||
| 7db708e559 | |||
| 3b3116f56e | |||
| 15c70f43d7 | |||
| 39af4be045 | |||
| c9dc4862ed | |||
| 122d41e307 | |||
| 2880db7383 | |||
| c0f23a4fc2 | |||
| 1a49d8dd03 | |||
| 180f287c07 | |||
| 37c33965c8 | |||
| 0861732dbe | |||
| d3220c7a91 | |||
| 450cafdae3 | |||
| 62abe3e569 | |||
| 8b2fbff3b7 | |||
| acf243ee3e | |||
| 66c38ded4a | |||
| 58a73190d4 | |||
| ae7a208831 | |||
| 2d83f3f39c | |||
| 2aed1e3a83 | |||
| 001a99b502 | |||
| a7a9f997d5 | |||
| 4c3dc96e30 | |||
| 7fe1ae27b4 | |||
| dce840c627 | |||
| 4f832ac2f7 | |||
| e7623e29d7 | |||
| 16dd8a55e5 | |||
| dca68bf0d1 | |||
| f028f1ba2f | |||
| 5c8867dd20 | |||
| 27eea60fc3 | |||
| c285b49d3b | |||
| 70c86f3054 | |||
| 00e5466a0c | |||
| 12a366a28a | |||
| b4918cf493 | |||
| b2b21980d1 | |||
| 09a97c0f66 | |||
| 5db65ef062 | |||
| 5164380336 | |||
| 26c5cd0a83 | |||
| bff8c83283 | |||
| 827bd3981f | |||
| e8599c7c56 | |||
| 0a3b951eb6 | |||
| 988da27e3f | |||
| a697219dcf | |||
| 7649e7f51e | |||
| 108b5ea317 | |||
| 4ea0760803 | |||
| c558098deb | |||
| 4a61093343 | |||
| 2af1f56aa7 | |||
| 6780feafa6 | |||
| 23b4ffc104 | |||
| 7304166d8f | |||
| 46a9fffb0e | |||
| 0ccc98e83f | |||
| 7f59c15112 | |||
| 455f2ee823 | |||
| 3076a9bc0e | |||
| c605607b5e | |||
| e05afc931a | |||
| 53aeb19e2f | |||
| 14a557be69 | |||
| 666b6f8a03 | |||
| ebddc8114a | |||
| fa76819b2d | |||
| 69aa25880a | |||
| 7cd79280ff | |||
| 4535bfe661 | |||
| 01cabdf1e5 | |||
| 8b15a0e417 | |||
| 451b3b7a38 | |||
| 952b495c4d | |||
| 1cd3642de8 | |||
| a4f49cb86b | |||
| 9ca722329f | |||
| 496a150620 | |||
| 983a92d9e0 | |||
| ad94016a85 | |||
| fcb807471f | |||
| 50a4ddbd11 | |||
| 01d1dc4274 | |||
| 1447b304eb | |||
| 8e79c6448f | |||
| badf3c7d49 | |||
| 342b31f7d7 | |||
| 0ae8f5d396 | |||
| 7a238c2b73 | |||
| 0b4c67e552 | |||
| f5391051b1 | |||
| 01c8a940d4 | |||
| 579992e40b | |||
| 3a2218a466 | |||
| 0ea28f525f | |||
| 33363f6144 | |||
| da8bdca022 | |||
| c4eccc5ee8 | |||
| ab13745cf6 | |||
| 97f07e4275 | |||
| 7c3e250797 | |||
| 32ab794f11 | |||
| 800ef84f84 | |||
| a7e4036667 | |||
| 4f589a7394 | |||
| a3abb58d72 | |||
| 17536df8e5 | |||
| 2e8a483a0c | |||
| a0aa7b4fd0 | |||
| 8b720beffa | |||
| a1c286cbaa | |||
| fc377b967d | |||
| b2de5eff4c | |||
| 02439f3699 | |||
| 2429f21a84 | |||
| aa0a4b5400 | |||
| a28300848b | |||
| fec0e87218 | |||
| efbace1e8b | |||
| 35e479355a | |||
| 32c91b9016 | |||
| 183d165c00 | |||
| a996f2c3c3 | |||
| 782243eb86 | |||
| f058d68126 | |||
| a8f07fce4d | |||
| 025bd1068d | |||
| 75b22614cf | |||
| 6cb15697ab | |||
| 1da93ce071 | |||
| 837e34de37 | |||
| 20c4ec1b78 | |||
| 39bab74422 | |||
| 665ab6a77d | |||
| 5663227c55 | |||
| 42ac89e5e5 | |||
| c95499536d | |||
| 5659756c07 | |||
| 038b3b3049 | |||
| 6b555c4d0d | |||
| 44d49bed62 | |||
| 517b130db6 | |||
| 0ff435b9bd | |||
| 56bc372140 | |||
| 0068b6d87d | |||
| 4679804774 | |||
| d03f74087c | |||
| e3a088ccaf | |||
| 5865fedbe7 | |||
| 68390aa26c | |||
| 744e5203cb | |||
| 7df7af3f47 | |||
| bf40cd1249 | |||
| f3cb5adb22 | |||
| c8d44199c2 | |||
| 12bcc0009b | |||
| be1ea81f82 | |||
| 668df46ec3 | |||
| 43905695e0 | |||
| 4a49becea1 | |||
| c91d3a24b9 | |||
| d6a4984b84 | |||
| f1dae06746 | |||
| 3cf3bcf2c8 | |||
| aa6e19ebaa | |||
| 24a26fd530 | |||
| a5f91bc14f | |||
| d7034c72c9 | |||
| c0437b152f | |||
| b72b2c6619 | |||
| c516631360 | |||
| 5cc8d7c094 | |||
| 5f4764060c | |||
| 44832008a8 | |||
| d86e737493 | |||
| 07a1e3101b | |||
| 1ebfe49916 | |||
| b1d6f8d652 | |||
| 8f0edf90e6 | |||
| 7c77389550 | |||
| 637731a4d7 | |||
| 6fc98a025b | |||
| f123cbcce3 | |||
| 11f166525e | |||
| 68db498dfd | |||
| f914afcc53 | |||
| 8dcf75f3fb | |||
| 3d9e091882 | |||
| a9ca4b3272 | |||
| a722b04226 | |||
| 9a1110a56e | |||
| 707122013f | |||
| f9ed5edf89 | |||
| dbf6766897 | |||
| a60c594505 | |||
| 2d0e6c0d3f | |||
| 63e7461995 | |||
| d2491ae6b7 | |||
| 35798a7916 | |||
| f7000b51a7 | |||
| 7e36939392 | |||
| afec51b296 | |||
| 66faaab294 | |||
| 7be2a5a507 | |||
| 8cf26de5e2 | |||
| 016611ba52 | |||
| 73d1011e8a | |||
| f2a11a5894 | |||
| c6043d4428 | |||
| c37ba28ad3 | |||
| 53f810fc54 | |||
| a55875ae1e | |||
| 707a634823 | |||
| b511fa872a | |||
| 4a2e7d9a9e | |||
| e4d5de2c0e | |||
| 50dca2e2c0 | |||
| 893303c27f | |||
| b543392c62 | |||
| adf52c756e | |||
| 693cc5a951 | |||
| ff9ba7fbf1 | |||
| c2b87959a2 | |||
| 18ee7776ef | |||
| c99efda67a | |||
| d65f970255 | |||
| f5442a8a89 | |||
| e347ea36ce | |||
| f0651dabf0 | |||
| ccf85c1c0f | |||
| 6ea35bf55c | |||
| f6afde346a | |||
| ce4074bcce | |||
| 5697b58aa2 | |||
| d5e6301211 | |||
| 9048082cb7 | |||
| 63526226be | |||
| fb07785b0e | |||
| 91638382d3 | |||
| 56e46466b2 | |||
| fa9731ab57 | |||
| c2ba46ce85 | |||
| 4c5780f1d6 | |||
| 0419611a62 | |||
| bcc1011ddd | |||
| 91a4fe1e52 | |||
| 21fed8a81e | |||
| f2fc63c24f | |||
| 521608fa15 | |||
| e16ad4e53d | |||
| 7205e383c8 | |||
| 9bf317b3e0 | |||
| ac668a41c5 | |||
| 606f4255dc | |||
| 22a64dd932 | |||
| dd3255779f | |||
| 89c7e63ab8 | |||
| 447c604fe9 | |||
| dff9602852 | |||
| f4d7915dd6 | |||
| 01204d544e | |||
| a06aa8c8b3 | |||
| 7977427038 | |||
| 0b8d0ed10a | |||
| efec141039 | |||
| 6736555ff3 | |||
| d94fe30a3e | |||
| 3079320534 | |||
| 4f3af51e54 | |||
| d19c81c944 | |||
| bc3cbbbb82 | |||
| 8ee3ddc925 | |||
| 173c05dbf3 | |||
| b13c548c4d | |||
| ef8237adfd | |||
| c80379da31 | |||
| a54c43c0c2 | |||
| 5e524aa148 | |||
| e84ee9e01b | |||
| 27ceb1e6c6 | |||
| 508b0d913c | |||
| 5999b070dc | |||
| 3ed13f3975 | |||
| 1789f7c9fd | |||
| a05ea11dd7 | |||
| c6dd46a004 | |||
| bf04979c31 | |||
| e9274b7303 | |||
| 03022c5b45 | |||
| ce4ccdd5b0 | |||
| 07eba65458 | |||
| 072b082240 | |||
| c664bc4ee9 | |||
| f113d7eeb1 | |||
| 9409bf0785 | |||
| d51e724130 | |||
| 9489b4dcde | |||
| d9c139a42b | |||
| 534f1d8284 | |||
| f177af8791 | |||
| 0b1a100be7 | |||
| 3932aeabed | |||
| be1dd93627 | |||
| fd75d3ce17 | |||
| eac69c683d | |||
| 4351de8ec7 | |||
| 4c4092634a | |||
| efac4d4a66 | |||
| 1afb1db3d5 | |||
| 6b63d8298c | |||
| 2a6e5e44bf | |||
| c76d93966f | |||
| a74fef732e | |||
| 06a692326e | |||
| cc73e6b42b | |||
| 7b926f1e11 | |||
| bbb81f9bf1 | |||
| 2b19d96646 | |||
| bfae48f32f | |||
| a2a9fb3d25 | |||
| 5b9d4a7eb2 | |||
| 0f9144bb12 | |||
| 76dde2fac8 | |||
| 75f44a79d3 | |||
| d874ba0096 | |||
| 7495ae9c15 | |||
| ee5c892e2d | |||
| c464e658fc | |||
| 575b68a8cf | |||
| 16e39b5535 | |||
| 5c3d64df54 | |||
| dcf0b500ec | |||
| a1fd64af8f | |||
| e76f06fbd7 | |||
| dcac8cbbde | |||
| 497a7dc98f | |||
| a3db74a449 | |||
| 7d74726b07 | |||
| 36169cbaa8 | |||
| 1dcc0cb3b9 | |||
| 69cc5de02a | |||
| a2cacd983e | |||
| be1616d6b6 | |||
| d9a79e20d7 | |||
| 6aa80c4a8c | |||
| 8bf38e39ac | |||
| 35017c341d | |||
| 2f91bdd1b8 | |||
| f5c6fe76d3 | |||
| e1d6bac33a | |||
| 2724f007db | |||
| 8744e79b62 | |||
| a0abfb39a7 | |||
| ccd5584b0c | |||
| a871b29d7c | |||
| 4f5c38be87 | |||
| cc1b3cdbe8 | |||
| 0387b80843 | |||
| 2c1a160215 | |||
| 5c773cb5e6 | |||
| 5b666247cc | |||
| 7c0b67215e | |||
| 18650f7da2 | |||
| b62214a416 | |||
| d4ed01196e | |||
| 9ec9cd4912 | |||
| 547da16760 | |||
| 51be4d06d8 | |||
| 456b27e4c3 | |||
| 3f9f0d01f6 | |||
| 60222f3068 | |||
| 49084614cd | |||
| e5b8628760 | |||
| f0dbf0f9a0 | |||
| 072ba012ab | |||
| 01f7f18cd4 | |||
| e6511a5b69 | |||
| 43b9f31aa6 | |||
| eb5b4f42c7 | |||
| 12f5528d90 | |||
| ae58966ef0 | |||
| a0e22c1304 | |||
| 3fc916e8da | |||
| 084e9cfca2 | |||
| d943bf26cc | |||
| 1983f170d3 | |||
| 22a3608238 | |||
| 40c4a37e4a | |||
| 03d0068038 | |||
| d8771a877b | |||
| 1e2ac3e23c | |||
| 1683a08660 | |||
| 459c7cd233 | |||
| c0241a84be | |||
| 0df40f97ea | |||
| b7aa93e628 | |||
| d47ec1820a | |||
| 3952663302 | |||
| 9e39adddcc | |||
| f79fb213f1 | |||
| c236f2902e | |||
| 96368f871c | |||
| 5831c7f651 | |||
| 52706402a2 | |||
| 90be38c240 | |||
| 19f75a0646 | |||
| 4fd38856fd | |||
| 593ad9559f | |||
| 8d06c0afcb | |||
| 4b3b44d828 | |||
| bb9d73610e | |||
| 8468c87170 | |||
| 3427554bf0 | |||
| ec2845af5e | |||
| 976dfc9276 | |||
| da7cc3e65d | |||
| 3283e14c01 | |||
| 17f336a156 | |||
| 3d7ea8715a | |||
| 487467cbed | |||
| cb71e3fb35 | |||
| 5749ad8db2 | |||
| f3d03c6011 | |||
| 16b1a90cb1 | |||
| a29d98eb10 | |||
| 82cb492bb7 | |||
| 6fde4de187 | |||
| ad073bb2f8 | |||
| 827b315bff | |||
| 33c093f7a6 | |||
| 855dfb4736 | |||
| 50eeaf0db4 | |||
| 8d3afb7ad0 | |||
| 830fa87e27 | |||
| 4d8a893326 | |||
| 7f371699b1 | |||
| 76a2bfd9f9 | |||
| 9c88f86e80 | |||
| 4d4951f184 | |||
| 251f48ee1e | |||
| bdca343550 | |||
| dcc7bdfcae | |||
| 469a8c087b | |||
| 61a8490d4f | |||
| 4fa2049adc | |||
| 060f28e404 | |||
| 82bc0e6496 | |||
| beaab91223 | |||
| 49953199d4 | |||
| 9c7b39bd5a | |||
| c2f653bbde | |||
| d3d3121d51 | |||
| ebd252f42c | |||
| 586d7767b4 | |||
| ea8b0c0fa3 | |||
| 055f548056 | |||
| 78752275fd | |||
| c26a17f29e | |||
| 61d64e909b | |||
| 21d1fd962f | |||
| 4eff2e7d89 | |||
| 2b6b48720e | |||
| 4f26ff64c6 | |||
| d23e139272 | |||
| e6ec9acc96 | |||
| 9d54ec748a | |||
| 8d2cbca12f | |||
| 20c51ea577 | |||
| 23f2837c66 | |||
| 9faf540f8c | |||
| 5bb8719e00 | |||
| 2bb01fbfff | |||
| de9f27465f | |||
| 66ab02199b | |||
| d77be1fcbd | |||
| e729afdd05 | |||
| e88c2e9c68 | |||
| 63b7641c47 | |||
| 54f501c82b | |||
| c291b1059c | |||
| ee0a167708 | |||
| f76c611033 | |||
| 7d1c3a994d | |||
| 42b7c8353e | |||
| 584dd720de | |||
| aa5d6fce47 | |||
| 32c64daa4d | |||
| 1b1d07ebc5 | |||
| 55734a1458 | |||
| 43875b06bf | |||
| 97ba0da3c2 | |||
| 8147608d3b | |||
| 9213143e14 | |||
| f1a9a84777 | |||
| 75046b80c6 | |||
| 69caf53646 | |||
| 6f69350183 | |||
| 2e75037b4e | |||
| bba6473b95 | |||
| 2aaa32449a | |||
| 1a44d6d415 | |||
| 7a3025c548 | |||
| cdd816ef35 | |||
| f69097b209 | |||
| 9896be023e | |||
| 1d99c8f58e | |||
| 835e10ed4b | |||
| e4439bfc3e | |||
| 5ad77a855b | |||
| 37f49af588 | |||
| f86c09b19d | |||
| 3112be387e | |||
| 383d7c27c0 | |||
| 7190725726 | |||
| 065da92d65 | |||
| 5c877cf902 | |||
| 726808813a | |||
| 7af4c16b35 | |||
| e7fc9bb8c2 | |||
| baf429a0d0 | |||
| 00b2d948dc | |||
| 81258cc717 | |||
| 9db426ffe5 | |||
| a6ee7d28d0 | |||
| 7a50b8fda2 | |||
| 5f7f8d66d5 | |||
| d514acf32e | |||
| d3df1499d2 | |||
| f7682b12ae | |||
| 8c2d62d917 | |||
| f0d9c54038 | |||
| fbe5b1de37 | |||
| dccfbb2edf | |||
| 0f2b5305e3 | |||
| c69a7c92a5 | |||
| 6fa3aab99c | |||
| 02f4777058 | |||
| 66cbb64039 | |||
| 879ee1f750 | |||
| 90449fff3a | |||
| 893c6306f2 | |||
| aa3806f1dd | |||
| 4000117811 | |||
| 3319e6428a |
33
.github/workflows/artifact-csharp-mvc.yml
vendored
Normal file
33
.github/workflows/artifact-csharp-mvc.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Csharp MVC
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/csharp-mvc/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/csharp-mvc/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp-mvc
|
||||
mkdir -p ./deploy/'DotNet (Csharp MVN) Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp MVC) Example'
|
||||
cd ./deploy/'DotNet (Csharp MVC) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: DotNet.Csharp.MVC.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/csharp-mvc/deploy
|
||||
33
.github/workflows/artifact-csharp.yml
vendored
Normal file
33
.github/workflows/artifact-csharp.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Csharp
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/csharp/**']
|
||||
pull_request:
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/csharp/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp
|
||||
mkdir -p ./deploy/'DotNet (Csharp) Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp) Example'
|
||||
cd ./deploy/'DotNet (Csharp) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: DotNet.Csharp.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/csharp/deploy
|
||||
33
.github/workflows/artifact-java.yml
vendored
Normal file
33
.github/workflows/artifact-java.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Java
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/java/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/java/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java
|
||||
mkdir -p ./deploy/'Java Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Java Example'
|
||||
cd ./deploy/'Java Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Java.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/java/deploy
|
||||
33
.github/workflows/artifact-node.yml
vendored
Normal file
33
.github/workflows/artifact-node.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Nodejs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/nodejs/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/nodejs/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/nodejs
|
||||
mkdir -p ./deploy/'Node.js Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Node.js Example'
|
||||
cd ./deploy/'Node.js Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Node.js.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/nodejs/deploy
|
||||
33
.github/workflows/artifact-php.yml
vendored
Normal file
33
.github/workflows/artifact-php.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact PHP
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/php/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/php/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/php
|
||||
mkdir -p ./deploy/'PHP Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'PHP Example'
|
||||
cd ./deploy/'PHP Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: PHP.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/php/deploy
|
||||
33
.github/workflows/artifact-python.yml
vendored
Normal file
33
.github/workflows/artifact-python.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Python
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/python/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/python/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/python
|
||||
mkdir -p ./deploy/'Python Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Python Example'
|
||||
cd ./deploy/'Python Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Python.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/python/deploy
|
||||
33
.github/workflows/artifact-ruby.yml
vendored
Normal file
33
.github/workflows/artifact-ruby.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Ruby
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/ruby/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/ruby/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/ruby
|
||||
mkdir -p ./deploy/'Ruby Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Ruby Example'
|
||||
cd ./deploy/'Ruby Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Ruby.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/ruby/deploy
|
||||
33
.github/workflows/artifact-spring.yml
vendored
Normal file
33
.github/workflows/artifact-spring.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Artifact Java Spring
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/java-spring/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/java-spring/**']
|
||||
|
||||
jobs:
|
||||
artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java-spring
|
||||
mkdir -p ./deploy/'Java Spring Example'
|
||||
rsync -av --exclude='deploy' ./ ./deploy/'Java Spring Example'
|
||||
cd ./deploy/'Java Spring Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Java.Spring.Example
|
||||
path: ${{ github.workspace }}/web/documentserver-example/java-spring/deploy
|
||||
2
.github/workflows/lint-java.yml
vendored
2
.github/workflows/lint-java.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/java/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/java/**']
|
||||
|
||||
jobs:
|
||||
|
||||
2
.github/workflows/lint-nodejs.yml
vendored
2
.github/workflows/lint-nodejs.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/nodejs/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/nodejs/**']
|
||||
|
||||
env:
|
||||
|
||||
8
.github/workflows/lint-php.yml
vendored
8
.github/workflows/lint-php.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/php/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/php/**']
|
||||
|
||||
jobs:
|
||||
@ -25,7 +25,5 @@ jobs:
|
||||
php-version: '8.2'
|
||||
tools: cs2pr, phpcs
|
||||
|
||||
- name: Run phpcs
|
||||
run: |
|
||||
phpcs --version
|
||||
phpcs -q --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor,css,js,lib --standard=./ruleset.xml ./
|
||||
- name: Lint
|
||||
run: phpcs src index.php
|
||||
|
||||
2
.github/workflows/lint-python.yml
vendored
2
.github/workflows/lint-python.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/python/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/python/**']
|
||||
|
||||
jobs:
|
||||
|
||||
2
.github/workflows/lint-ruby.yml
vendored
2
.github/workflows/lint-ruby.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/ruby/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/ruby/**']
|
||||
|
||||
jobs:
|
||||
|
||||
2
.github/workflows/lint-spring.yml
vendored
2
.github/workflows/lint-spring.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
branches: [master, main]
|
||||
paths: ['web/documentserver-example/java-spring/**']
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
branches: [master, main, develop]
|
||||
paths: ['web/documentserver-example/java-spring/**']
|
||||
|
||||
jobs:
|
||||
|
||||
146
.github/workflows/release.yml
vendored
Normal file
146
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master,main]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Zip
|
||||
run: sudo apt-get install zip
|
||||
- name: Get Info
|
||||
run: |
|
||||
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
|
||||
id: info
|
||||
- name: Generate Changelog
|
||||
run: |
|
||||
awk '/## [0-9]/{p++} p; /## [0-9]/{if (p > 1) exit}' CHANGELOG.md | awk 'NR>2 {print last} {last=$0}' > RELEASE.md
|
||||
- name: Build Csharp MVC Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp-mvc
|
||||
mkdir -p ./'DotNet (Csharp MVC) Example'
|
||||
rsync -av --exclude='DotNet (Csharp MVC) Example' ./ ./'DotNet (Csharp MVC) Example'
|
||||
cd ./'DotNet (Csharp MVC) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build Csharp Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/csharp
|
||||
mkdir -p ./'DotNet (Csharp) Example'
|
||||
rsync -av --exclude='DotNet (Csharp) Example' ./ ./'DotNet (Csharp) Example'
|
||||
cd ./'DotNet (Csharp) Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build Java Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java
|
||||
mkdir -p ./'Java Example'
|
||||
rsync -av --exclude='Java Example' ./ ./'Java Example'
|
||||
cd ./'Java Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build Nodejs Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/nodejs
|
||||
mkdir -p ./'Node.js Example'
|
||||
rsync -av --exclude='Node.js Example' ./ ./'Node.js Example'
|
||||
cd ./'Node.js Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build PHP Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/php
|
||||
mkdir -p ./'PHP Example'
|
||||
rsync -av --exclude='PHP Example' ./ ./'PHP Example'
|
||||
cd ./'PHP Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build Python Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/python
|
||||
mkdir -p ./'Python Example'
|
||||
rsync -av --exclude='Python Example' ./ ./'Python Example'
|
||||
cd ./'Python Example'/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build Ruby Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/ruby
|
||||
mkdir -p ./'Ruby Example'
|
||||
rsync -av --exclude='Ruby Example' ./ ./'Ruby Example'
|
||||
cd ./'Ruby Example'/public/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Build Spring Artifact
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cwd=$(pwd)
|
||||
git submodule update --init --recursive
|
||||
cd ./web/documentserver-example/java-spring
|
||||
mkdir -p ./'Java Spring Example'
|
||||
rsync -av --exclude='Java Spring Example' ./ ./'Java Spring Example'
|
||||
cd ./'Java Spring Example'/src/main/resources/assets
|
||||
rm -rf ./.git/
|
||||
rm .git
|
||||
- name: Pack Artifacts
|
||||
run: |
|
||||
cd ${{ github.workspace }}/web/documentserver-example/csharp-mvc
|
||||
zip -r DotNet.Csharp.MVC.Example.zip ./'DotNet (Csharp MVC) Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/csharp
|
||||
zip -r DotNet.Csharp.Example.zip ./'DotNet (Csharp) Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/java
|
||||
zip -r Java.Example.zip ./'Java Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/nodejs
|
||||
zip -r Node.js.Example.zip ./'Node.js Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/php
|
||||
zip -r PHP.Example.zip ./'PHP Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/python
|
||||
zip -r Python.Example.zip ./'Python Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/ruby
|
||||
zip -r Ruby.Example.zip ./'Ruby Example'
|
||||
cd ${{ github.workspace }}/web/documentserver-example/java-spring
|
||||
zip -r Java.Spring.Example.zip ./'Java Spring Example'
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1
|
||||
id: create_release
|
||||
with:
|
||||
bodyFile: RELEASE.md
|
||||
artifacts: "
|
||||
${{ github.workspace }}/web/documentserver-example/csharp-mvc/DotNet.Csharp.MVC.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/csharp/DotNet.Csharp.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/java/Java.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/nodejs/Node.js.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/php/PHP.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/python/Python.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/ruby/Ruby.Example.zip,
|
||||
${{ github.workspace }}/web/documentserver-example/java-spring/Java.Spring.Example.zip
|
||||
"
|
||||
tag: v${{ steps.info.outputs.version }}
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@ -11,6 +11,14 @@
|
||||
**/.vscode/
|
||||
**/.vs/
|
||||
**/.idea
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
*.iml
|
||||
*.iws
|
||||
.DS_Store
|
||||
/web/documentserver-example/java/target/
|
||||
/web/documentserver-example/java-spring/target/
|
||||
/web/documentserver-example/csharp/packages
|
||||
/web/documentserver-example/csharp-mvc/packages
|
||||
/web/documentserver-example/java-spring/documents/
|
||||
|
||||
56
.gitmodules
vendored
56
.gitmodules
vendored
@ -1,19 +1,3 @@
|
||||
[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
|
||||
@ -22,11 +6,43 @@
|
||||
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
|
||||
[submodule "web/documentserver-example/nodejs/public/assets/document-templates"]
|
||||
path = web/documentserver-example/nodejs/public/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/java-spring/src/main/resources/assets"]
|
||||
path = web/documentserver-example/java-spring/src/main/resources/assets
|
||||
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
|
||||
path = web/documentserver-example/nodejs/public/assets/document-formats
|
||||
url = https://github.com/ONLYOFFICE/document-formats
|
||||
branch = master
|
||||
[submodule "web/documentserver-example/php/assets/document-templates"]
|
||||
path = web/documentserver-example/php/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/php/assets/document-formats"]
|
||||
path = web/documentserver-example/php/assets/document-formats
|
||||
url = https://github.com/ONLYOFFICE/document-formats
|
||||
branch = master
|
||||
[submodule "web/documentserver-example/python/assets/document-templates"]
|
||||
path = web/documentserver-example/python/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/java/src/main/resources/assets/document-templates"]
|
||||
path = web/documentserver-example/java/src/main/resources/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/ruby/assets/document-templates"]
|
||||
path = web/documentserver-example/ruby/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/java-spring/src/main/resources/assets/document-templates"]
|
||||
path = web/documentserver-example/java-spring/src/main/resources/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/python/assets/document-formats"]
|
||||
path = web/documentserver-example/python/assets/document-formats
|
||||
url = https://github.com/ONLYOFFICE/document-formats
|
||||
branch = master
|
||||
[submodule "web/documentserver-example/ruby/assets/document-formats"]
|
||||
path = web/documentserver-example/ruby/assets/document-formats
|
||||
url = https://github.com/ONLYOFFICE/document-formats
|
||||
branch = master
|
||||
|
||||
@ -3,10 +3,6 @@ Document Server integration example uses code from the following 3rd party proje
|
||||
|
||||
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
|
||||
@ -19,10 +15,26 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
JWT - JWT (JSON Web Token) Implementation for .NET (Public Domain) (https://github.com/jwt-dotnet/jwt/)
|
||||
License: MIT
|
||||
License File: JWT.license
|
||||
|
||||
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://github.com/JamesNK/Newtonsoft.Json)
|
||||
License: MIT
|
||||
License File: Newtonsoft.Json.license
|
||||
|
||||
|
||||
web/documentserver-example/csharp-mvc
|
||||
|
||||
@ -30,10 +42,6 @@ Entity Framework - Entity Framework is an object-relational mapper that enables
|
||||
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
|
||||
@ -46,15 +54,27 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
JWT - JWT (JSON Web Token) Implementation for .NET (Public Domain) (https://github.com/jwt-dotnet/jwt/)
|
||||
License: MIT
|
||||
License File: JWT.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)
|
||||
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://github.com/JamesNK/Newtonsoft.Json)
|
||||
License: MIT
|
||||
License File: Newtonsoft.Json.license
|
||||
|
||||
@ -65,10 +85,6 @@ 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
|
||||
@ -81,6 +97,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
@ -92,9 +116,17 @@ License File: prime-jwt.license
|
||||
|
||||
web/documentserver-example/java-spring
|
||||
|
||||
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
|
||||
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: gson.license
|
||||
|
||||
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
|
||||
License: MPL 2.0 or EPL 1.0
|
||||
License File: h2database.license
|
||||
|
||||
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: jackson-databind.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
|
||||
@ -108,10 +140,30 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: JSON.simple.license
|
||||
|
||||
Project Lombok - Project Lombok is a java library that automatically plugs into your editor and build tools. (https://mvnrepository.com/artifact/org.projectlombok/lombok).
|
||||
License: MIT
|
||||
License File lombok.license
|
||||
|
||||
ModelMapper - ModelMapper is an intelligent object mapping library that automatically maps objects to each other. (https://github.com/modelmapper/modelmapper)
|
||||
License: Apache 2.0
|
||||
License File modelmapper.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
|
||||
@ -132,22 +184,6 @@ Spring Data JPA - Persist data in SQL stores with Java Persistence API using Spr
|
||||
License: Apache 2.0
|
||||
License File: spring-data-jpa.license
|
||||
|
||||
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
|
||||
License: MPL 2.0 or EPL 1.0
|
||||
License File: h2database.license
|
||||
|
||||
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: JSON.simple.license
|
||||
|
||||
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: gson.license
|
||||
|
||||
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: jackson-databind.license
|
||||
|
||||
|
||||
web/documentserver-example/nodejs
|
||||
|
||||
@ -183,10 +219,6 @@ he - a robust HTML entity encoder/decoder written in JavaScript. (htt
|
||||
License: MIT
|
||||
License File: he.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
|
||||
@ -199,6 +231,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
@ -228,11 +268,8 @@ 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
|
||||
web/documentserver-example/php
|
||||
|
||||
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
|
||||
@ -246,6 +283,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
@ -258,24 +303,32 @@ PHP_CodeSniffer - PHP_CodeSniffer is a set of two PHP scripts; the main phpcs sc
|
||||
License: BSD-3-Clause
|
||||
License File: PHP_CodeSniffer.license
|
||||
|
||||
PHPUnit - The PHP Unit Testing framework. (https://github.com/sebastianbergmann/phpunit/blob/main/LICENSE)
|
||||
License: BSD 3-Clause
|
||||
License File: phpunit.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)
|
||||
property-access - Provides functions to read and write from/to an object or array using a simple string notation. (https://github.com/symfony/property-access/blob/6.3/LICENSE)
|
||||
License: MIT
|
||||
License File: coffee-rails.license
|
||||
License File: property-access.license
|
||||
|
||||
jbuilder - Create JSON structures via a Builder-style DSL (https://github.com/rails/jbuilder/blob/master/MIT-LICENSE)
|
||||
serializer - Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON. (https://github.com/symfony/serializer/blob/6.3/LICENSE)
|
||||
License: MIT
|
||||
License File: jbuilder.license
|
||||
License File: serializer.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/)
|
||||
|
||||
web/documentserver-example/python
|
||||
|
||||
django-stubs - PEP-484 stubs for Django. (https://github.com/typeddjango/django-stubs/blob/master/LICENSE.md)
|
||||
License: MIT
|
||||
License File: jQuery.license
|
||||
License File: django-stubs.license
|
||||
|
||||
Django - Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Thanks for checking it out. (https://github.com/django/django/blob/main/LICENSE)
|
||||
License: BSD-3-Clause
|
||||
License File: Django.license
|
||||
|
||||
flake8 - flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code. (https://github.com/PyCQA/flake8/blob/main/LICENSE)
|
||||
License: MIT
|
||||
License File: flake8.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
|
||||
@ -289,6 +342,81 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
msgspec - A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML. (https://github.com/jcrist/msgspec/blob/0.18.1/LICENSE)
|
||||
License: BSD 3-Clause
|
||||
License File: msgspec.license
|
||||
|
||||
mypy - Optional static typing for Python. (https://github.com/python/mypy/blob/master/LICENSE)
|
||||
License: MIT
|
||||
License File: mypy.license
|
||||
|
||||
PyJWT - A Python implementation of RFC 7519. (https://github.com/jpadilla/pyjwt/blob/master/LICENSE)
|
||||
License: MIT
|
||||
License File: PyJWT.license
|
||||
|
||||
python-magic - python-magic is a Python interface to the libmagic file type identification library. (https://github.com/ahupp/python-magic/blob/master/LICENSE)
|
||||
License: MIT
|
||||
License File: python-magic.license
|
||||
|
||||
requests - Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your PUT & POST data — but nowadays, just use the json method! (https://github.com/psf/requests/blob/main/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: requests.license
|
||||
|
||||
typeshed - Collection of library stubs for Python, with static types. (https://github.com/python/typeshed/blob/main/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: typeshed.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
|
||||
|
||||
dalli - High performance memcached client for Ruby. (https://github.com/petergoldstein/dalli/blob/v3.2.0/LICENSE)
|
||||
License: MIT
|
||||
License File: dalli.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.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 - 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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
@ -297,10 +425,18 @@ jquery-rails - This gem provides jQuery and the jQuery-ujs driver for your Rail
|
||||
License: MIT
|
||||
License File: jquery-rails.license
|
||||
|
||||
mimemagic - А library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
|
||||
License: MIT
|
||||
License File: mimemagic.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
|
||||
|
||||
rubocop - A Ruby static code analyzer and formatter, based on the community Ruby style guide. (https://github.com/rubocop/rubocop/blob/v1.52.0/LICENSE.txt)
|
||||
License: MIT
|
||||
License File: rubocop.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
|
||||
@ -309,9 +445,13 @@ sdoc - rdoc generator html with javascript search index. (https://githu
|
||||
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
|
||||
sorbet - A fast, powerful type checker designed for Ruby. (https://github.com/sorbet/sorbet/blob/0.5.10871.20230607144259-d9000e2ba/LICENSE)
|
||||
License: Apache License 2.0
|
||||
License File: sorbet.license
|
||||
|
||||
tapioca - The swiss army knife of RBI generation. (https://github.com/Shopify/tapioca/blob/v0.11.6/LICENSE.txt)
|
||||
License: MIT
|
||||
License File: tapioca.license
|
||||
|
||||
turbolinks - Rails engine for Turbolinks 5 support (https://github.com/turbolinks/turbolinks-rails/blob/master/LICENSE)
|
||||
License: MIT
|
||||
|
||||
31
CHANGELOG.md
31
CHANGELOG.md
@ -1,6 +1,37 @@
|
||||
# Change Log
|
||||
|
||||
- nodejs: link in referenceData
|
||||
- nodejs: onRequestSelectDocument method
|
||||
- nodejs: onRequestSelectSpreadsheet method
|
||||
- nodejs: onRequestOpen
|
||||
- nodejs: submitForm
|
||||
- nodejs: key in referenceData
|
||||
- nodejs: change reference source
|
||||
- php: using a repo with a list of formats
|
||||
- nodejs: using a repo with a list of formats
|
||||
- nodejs: delete file without reloading the page
|
||||
- nodejs: getting history by a separate request
|
||||
- csharp-mvc: getting history by a separate request
|
||||
- csharp: getting history by a separate request
|
||||
- java: getting history by a separate request
|
||||
- java-spring: getting history by a separate request
|
||||
- restore from history
|
||||
|
||||
## 1.6.0
|
||||
- nodejs: setUsers for region protection
|
||||
- si skin languages
|
||||
- fix "no" skin languages
|
||||
- anonymous can't change viewer to edit
|
||||
- referenceData
|
||||
- anonymous can't protect file
|
||||
- separate setting for checking the token in requests
|
||||
- php: linter refactoring
|
||||
- horizontal scroll fix for Internet Explorer
|
||||
- save file with extension from response after conversation
|
||||
- conversation to ooxml
|
||||
|
||||
## 1.5.1
|
||||
- update jquery
|
||||
|
||||
## 1.5.0
|
||||
- nodejs: added wopi putRelativeFile action
|
||||
|
||||
@ -4,10 +4,6 @@ Entity Framework - Entity Framework is an object-relational mapper that enables
|
||||
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
|
||||
@ -20,6 +16,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
@ -28,6 +28,7 @@ namespace OnlineEditorsExampleMVC
|
||||
// create a jquery script bundle
|
||||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
|
||||
"~/Scripts/jquery-{version}.js",
|
||||
"~/Scripts/jquery-migrate-{version}.js",
|
||||
"~/Scripts/jquery-ui.js",
|
||||
"~/Scripts/jquery.blockUI.js",
|
||||
"~/Scripts/jquery.iframe-transport.js",
|
||||
|
||||
@ -682,3 +682,8 @@
|
||||
max-width:15%;
|
||||
}
|
||||
}
|
||||
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
||||
.tableRow td:first-child{
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,6 +220,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
var fileName = GetCorrectName(demoName); // get a file name with an index if the file with such a name already exists
|
||||
|
||||
File.Copy(HttpRuntime.AppDomainAppPath + demoPath + demoName, StoragePath(fileName)); // copy file to the storage directory
|
||||
File.SetLastWriteTime(StoragePath(fileName), DateTime.Now);
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
@ -68,24 +68,24 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
/// <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>
|
||||
/// <param name="convertedDocumentUri">Uri to the converted document</param>
|
||||
/// <param name="convertedDocumentData">Uri and file type of the converted document</param>
|
||||
/// <returns>The percentage of conversion completion</returns>
|
||||
/// <example>
|
||||
/// string convertedDocumentUri;
|
||||
/// GetConvertedUri("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentUri);
|
||||
/// Dictionary<string, string> convertedDocumentData;
|
||||
/// GetConvertedData("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentData);
|
||||
/// </example>
|
||||
/// <exception>
|
||||
/// </exception>
|
||||
public static int GetConvertedUri(string documentUri,
|
||||
public static int GetConvertedData(string documentUri,
|
||||
string fromExtension,
|
||||
string toExtension,
|
||||
string documentRevisionId,
|
||||
bool isAsync,
|
||||
out string convertedDocumentUri,
|
||||
out Dictionary<string, string> convertedDocumentData,
|
||||
string filePass = null,
|
||||
string lang = null)
|
||||
{
|
||||
convertedDocumentUri = string.Empty;
|
||||
convertedDocumentData = new Dictionary<string, string>();
|
||||
|
||||
// check if the fromExtension parameter is defined; if not, get it from the document url
|
||||
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri).ToLower() : fromExtension;
|
||||
@ -119,7 +119,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
{ "region", lang }
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
// create payload object
|
||||
var payload = new Dictionary<string, object>
|
||||
@ -157,7 +157,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
}
|
||||
}
|
||||
|
||||
return GetResponseUri(dataResponse, out convertedDocumentUri);
|
||||
return GetResponseData(dataResponse, out convertedDocumentData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -181,9 +181,9 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
/// Processing document received from the editing service
|
||||
/// </summary>
|
||||
/// <param name="jsonDocumentResponse">The resulting json from editing service</param>
|
||||
/// <param name="responseUri">Uri to the converted document</param>
|
||||
/// <param name="responseData">Uri and file type of the converted document</param>
|
||||
/// <returns>The percentage of conversion completion</returns>
|
||||
private static int GetResponseUri(string jsonDocumentResponse, out string responseUri)
|
||||
private static int GetResponseData(string jsonDocumentResponse, out Dictionary<string, string> responseData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(jsonDocumentResponse)) throw new ArgumentException("Invalid param", "jsonDocumentResponse");
|
||||
|
||||
@ -197,14 +197,20 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
var isEndConvert = responseFromService.endConvert;
|
||||
|
||||
int resultPercent;
|
||||
responseUri = string.Empty;
|
||||
responseData = new Dictionary<string, string>();
|
||||
var responseUri = string.Empty;
|
||||
var responseFileType = string.Empty;
|
||||
if (isEndConvert) // if the conversion is completed
|
||||
{
|
||||
responseUri = responseFromService.fileUrl; // get the file url
|
||||
responseFileType = responseFromService.fileType; // get the file type
|
||||
responseData.Add("fileUrl", responseUri);
|
||||
responseData.Add("fileType", responseFileType);
|
||||
resultPercent = 100;
|
||||
}
|
||||
else // if the conversion isn't completed
|
||||
{
|
||||
responseData.Add("fileUrl", "");
|
||||
resultPercent = responseFromService.percent; // get the percentage value
|
||||
if (resultPercent >= 100) resultPercent = 99;
|
||||
}
|
||||
|
||||
@ -29,11 +29,13 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
{
|
||||
private static readonly string Secret;
|
||||
public static readonly bool Enabled;
|
||||
public static readonly bool SignatureUseForRequest;
|
||||
|
||||
static JwtManager()
|
||||
{
|
||||
Secret = WebConfigurationManager.AppSettings["files.docservice.secret"] ?? ""; // get token secret from the config parameters
|
||||
Enabled = !string.IsNullOrEmpty(Secret); // check if the token is enabled
|
||||
SignatureUseForRequest = bool.Parse(WebConfigurationManager.AppSettings["files.docservice.token.useforrequest"]);
|
||||
}
|
||||
|
||||
// encode a payload object into a token using a secret key
|
||||
|
||||
@ -53,7 +53,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
var fileData = jss.Deserialize<Dictionary<string, object>>(body);
|
||||
|
||||
// check if the document token is enabled
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
@ -108,8 +108,9 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
try
|
||||
{
|
||||
// convert file and give url to a new file
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
|
||||
Dictionary<string, string> newFileData;
|
||||
var result = ServiceConverter.GetConvertedData(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileData);
|
||||
var newFileUri = newFileData["fileUrl"];
|
||||
if (string.IsNullOrEmpty(newFileUri))
|
||||
{
|
||||
// get the correct file name if it already exists
|
||||
@ -195,8 +196,9 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
try
|
||||
{
|
||||
// convert file and give url to a new file
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
|
||||
Dictionary<string, string> newFileData;
|
||||
var result = ServiceConverter.GetConvertedData(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileData);
|
||||
var newFileUri = newFileData["fileUrl"];
|
||||
if (string.IsNullOrEmpty(newFileUri))
|
||||
{
|
||||
newFileName = true;
|
||||
@ -285,7 +287,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
}
|
||||
|
||||
// check if a secret key to generate token exists or not
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
var payload = new Dictionary<string, object>
|
||||
{
|
||||
|
||||
@ -69,6 +69,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
"Can’t see anyone’s information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration",
|
||||
};
|
||||
|
||||
@ -131,7 +132,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
new Dictionary<string,object>(),
|
||||
new List<string>(),
|
||||
null,
|
||||
new List<string>(),
|
||||
new List<string>() { "protect" },
|
||||
descr_user_0,
|
||||
false
|
||||
)
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
@ -138,6 +137,17 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{ "favorite", favorite}
|
||||
}
|
||||
},
|
||||
{
|
||||
"referenceData", new Dictionary<string, string>()
|
||||
{
|
||||
{ "fileKey", !user.id.Equals("uid-0") ?
|
||||
jss.Serialize(new Dictionary<string, object>{
|
||||
{"fileName", FileName},
|
||||
{"userAddress", HttpUtility.UrlEncode(DocManagerHelper.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress))}
|
||||
}) : null },
|
||||
{"instanceId", DocManagerHelper.GetServerUrl(false) }
|
||||
}
|
||||
},
|
||||
{
|
||||
// the permission for the document to be edited and downloaded or not
|
||||
"permissions", new Dictionary<string, object>
|
||||
@ -154,7 +164,8 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{ "chat", !user.id.Equals("uid-0") },
|
||||
{ "reviewGroups", user.reviewGroups },
|
||||
{ "commentGroups", user.commentGroups },
|
||||
{ "userInfoGroups", user.userInfoGroups }
|
||||
{ "userInfoGroups", user.userInfoGroups },
|
||||
{ "protect", !user.deniedPermissions.Contains("protect") }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -224,123 +235,6 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
return jss.Serialize(config);
|
||||
}
|
||||
|
||||
// get the document history
|
||||
public void GetHistory(out string history, out string historyData)
|
||||
{
|
||||
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
|
||||
var jss = new JavaScriptSerializer();
|
||||
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(FileName, null));
|
||||
|
||||
history = null;
|
||||
historyData = null;
|
||||
|
||||
if (DocManagerHelper.GetFileVersion(histDir) > 0) // if the file was modified (the file version is greater than 0)
|
||||
{
|
||||
var currentVersion = DocManagerHelper.GetFileVersion(histDir);
|
||||
var hist = new List<Dictionary<string, object>>();
|
||||
var histData = new Dictionary<string, object>();
|
||||
|
||||
for (var i = 1; i <= currentVersion; i++) // run through all the file versions
|
||||
{
|
||||
var obj = new Dictionary<string, object>();
|
||||
var dataObj = new Dictionary<string, object>();
|
||||
var verDir = DocManagerHelper.VersionDir(histDir, i); // get the path to the given file version
|
||||
|
||||
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
|
||||
|
||||
obj.Add("key", key);
|
||||
obj.Add("version", i);
|
||||
|
||||
if (i == 1) // check if the version number is equal to 1
|
||||
{
|
||||
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
|
||||
|
||||
if (File.Exists(infoPath))
|
||||
{
|
||||
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
|
||||
obj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
|
||||
obj.Add("user", new Dictionary<string, object>() {
|
||||
{ "id", info["id"] },
|
||||
{ "name", info["name"] },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(FileName).ToLower();
|
||||
dataObj.Add("fileType", ext.Replace(".", ""));
|
||||
dataObj.Add("key", key);
|
||||
// write file url to the data object
|
||||
string prevFileUrl;
|
||||
string directPrevFileUrl;
|
||||
if (Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath))
|
||||
{
|
||||
prevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext)
|
||||
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
|
||||
directPrevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext, false)
|
||||
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
|
||||
}
|
||||
else {
|
||||
prevFileUrl = i == currentVersion ? FileUri
|
||||
: DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext);
|
||||
directPrevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext, false)
|
||||
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
|
||||
}
|
||||
|
||||
dataObj.Add("url", prevFileUrl);
|
||||
if (IsEnabledDirectUrl)
|
||||
{
|
||||
dataObj.Add("directUrl", directPrevFileUrl);
|
||||
}
|
||||
dataObj.Add("version", i);
|
||||
if (i > 1) // check if the version number is greater than 1 (the file was modified)
|
||||
{
|
||||
// get the path to the changes.json file
|
||||
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(DocManagerHelper.VersionDir(histDir, i - 1), "changes.json")));
|
||||
var changesArray = (ArrayList)changes["changes"];
|
||||
var change = changesArray.Count > 0
|
||||
? (Dictionary<string, object>)changesArray[0]
|
||||
: new Dictionary<string, object>();
|
||||
|
||||
// write information about changes to the object
|
||||
obj.Add("changes", change.Count > 0 ? changes["changes"] : null);
|
||||
obj.Add("serverVersion", changes["serverVersion"]);
|
||||
obj.Add("created", change.Count > 0 ? change["created"] : null);
|
||||
obj.Add("user", change.Count > 0 ? change["user"] : null);
|
||||
|
||||
var prev = (Dictionary<string, object>)histData[(i - 2).ToString()]; // get the history data from the previous file version
|
||||
dataObj.Add("previous", IsEnabledDirectUrl ? new Dictionary<string, object>() { // write information about previous file version to the data object with direct url
|
||||
{ "fileType", prev["fileType"] },
|
||||
{ "key", prev["key"] }, // write key and url information about previous file version
|
||||
{ "url", prev["url"] },
|
||||
{ "directUrl", prev["directUrl"] },
|
||||
} : new Dictionary<string, object>() { // write information about previous file version to the data object without direct url
|
||||
{ "fileType", prev["fileType"] },
|
||||
{ "key", prev["key"] }, // write key and url information about previous file version
|
||||
{ "url", prev["url"] },
|
||||
});
|
||||
// write the path to the diff.zip archive with differences in this file version
|
||||
var changesUrl = DocManagerHelper.GetHistoryDownloadUrl(FileName, (i - 1).ToString(), "diff.zip");
|
||||
dataObj.Add("changesUrl", changesUrl);
|
||||
}
|
||||
if(JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(dataObj);
|
||||
dataObj.Add("token", token);
|
||||
}
|
||||
hist.Add(obj); // add object dictionary to the hist list
|
||||
histData.Add((i - 1).ToString(), dataObj); // write data object information to the history data
|
||||
}
|
||||
|
||||
// write history information about the current file version to the history object
|
||||
history = jss.Serialize(new Dictionary<string, object>()
|
||||
{
|
||||
{ "currentVersion", currentVersion },
|
||||
{ "history", hist }
|
||||
});
|
||||
historyData = jss.Serialize(histData);
|
||||
}
|
||||
}
|
||||
|
||||
// get a document which will be compared with the current document
|
||||
public void GetCompareFileData(out string compareConfig)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
web/documentserver-example/csharp-mvc/Scripts/jquery-3.6.4.js
vendored
Normal file
2
web/documentserver-example/csharp-mvc/Scripts/jquery-3.6.4.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -236,6 +236,7 @@ if (typeof jQuery != "undefined") {
|
||||
window.open(url, "_blank");
|
||||
jq('#hiddenFileName').val("");
|
||||
jq.unblockUI();
|
||||
document.location.reload();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginView:not(.disable)", function () {
|
||||
@ -244,6 +245,7 @@ if (typeof jQuery != "undefined") {
|
||||
window.open(url, "_blank");
|
||||
jq('#hiddenFileName').val("");
|
||||
jq.unblockUI();
|
||||
document.location.reload();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEmbedded:not(.disable)", function () {
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
-->
|
||||
<link rel="icon" href="<%= "content/images/" + Model.DocumentType + ".ico" %>" type="image/x-icon" />
|
||||
<title><%= Model.FileName + " - ONLYOFFICE" %></title>
|
||||
|
||||
|
||||
<%: Styles.Render("~/Content/editor") %>
|
||||
|
||||
</head>
|
||||
@ -40,7 +40,7 @@
|
||||
<div id="iframeEditor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%: Scripts.Render(new []{ WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.api"] }) %>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
@ -141,7 +141,7 @@
|
||||
<% Model.GetMailMergeConfig(out dataMailMergeRecipients); %>
|
||||
docEditor.setMailMergeRecipients(<%= dataMailMergeRecipients%>); // insert recipient data for mail merge into the file
|
||||
};
|
||||
|
||||
|
||||
var onRequestSaveAs = function (event) { // the user is trying to save file by clicking Save Copy as... button
|
||||
var title = event.data.title;
|
||||
var url = event.data.url;
|
||||
@ -178,6 +178,59 @@
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestReferenceData = function (event) { // user refresh external data source
|
||||
event.data.directUrl = !!config.document.directUrl;
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "webeditor.ashx?type=reference");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send(JSON.stringify(event.data));
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.responseText);
|
||||
docEditor.setReferenceData(JSON.parse(xhr.responseText));
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestHistory = function () {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "webeditor.ashx?type=gethistory&filename=<%= Model.FileName %>");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send();
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.responseText);
|
||||
docEditor.refreshHistory(JSON.parse(xhr.responseText));
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestHistoryData = function (event) {
|
||||
var ver = event.data;
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "webeditor.ashx?type=getversiondata&filename=<%= Model.FileName %>&version=" + ver + "&directUrl=" + !!config.document.directUrl);
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send();
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.responseText);
|
||||
docEditor.setHistoryData(JSON.parse(xhr.responseText)); // send the link to the document for viewing the version history
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestRestore = function (event) {
|
||||
var fileName = "<%= Model.FileName %>";
|
||||
var version = event.data.version;
|
||||
var data = {
|
||||
fileName: fileName,
|
||||
version: version
|
||||
};
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "webeditor.ashx?type=restore&directUrl=" + !!config.document.directUrl);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.send(JSON.stringify(data));
|
||||
xhr.onload = function () {
|
||||
docEditor.refreshHistory(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
|
||||
config = <%= Model.GetDocConfig(Request, Url) %>;
|
||||
|
||||
config.width = "100%";
|
||||
@ -186,7 +239,6 @@
|
||||
config.events = {
|
||||
'onAppReady': onAppReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
'onOutdatedVersion': onOutdatedVersion,
|
||||
"onMakeActionLink": onMakeActionLink,
|
||||
@ -196,30 +248,19 @@
|
||||
"onRequestMailMergeRecipients": onRequestMailMergeRecipients,
|
||||
};
|
||||
|
||||
<% string hist, histData; %>
|
||||
<% Model.GetHistory(out hist, out histData); %>
|
||||
|
||||
<% string usersForMentions; %>
|
||||
<% Model.GetUsersMentions(Request, out usersForMentions); %>
|
||||
|
||||
if (config.editorConfig.user.id) {
|
||||
<% if (!string.IsNullOrEmpty(hist) && !string.IsNullOrEmpty(histData))
|
||||
{ %>
|
||||
// the user is trying to show the document version history
|
||||
config.events['onRequestHistory'] = function () {
|
||||
docEditor.refreshHistory(<%= hist %>); // show the document version history
|
||||
};
|
||||
// the user is trying to click the specific document version in the document version history
|
||||
config.events['onRequestHistoryData'] = function (event) {
|
||||
var ver = event.data;
|
||||
var histData = <%= histData %>;
|
||||
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
|
||||
};
|
||||
// the user is trying to go back to the document from viewing the document version history
|
||||
config.events['onRequestHistoryClose '] = function () {
|
||||
document.location.reload();
|
||||
};
|
||||
<% } %>
|
||||
// the user is trying to show the document version history
|
||||
config.events['onRequestHistory'] = onRequestHistory;
|
||||
// the user is trying to click the specific document version in the document version history
|
||||
config.events['onRequestHistoryData'] = onRequestHistoryData;
|
||||
// the user is trying to go back to the document from viewing the document version history
|
||||
config.events['onRequestHistoryClose'] = function () {
|
||||
document.location.reload();
|
||||
};
|
||||
config.events['onRequestRestore'] = onRequestRestore;
|
||||
|
||||
// add mentions for not anonymous users
|
||||
<% if (!string.IsNullOrEmpty(usersForMentions))
|
||||
@ -239,6 +280,9 @@
|
||||
};
|
||||
// prevent file renaming for anonymous users
|
||||
config.events['onRequestRename'] = onRequestRename;
|
||||
config.events['onRequestReferenceData'] = onRequestReferenceData;
|
||||
// prevent switch the document from the viewing into the editing mode for anonymous users
|
||||
config.events['onRequestEditRights'] = onRequestEditRights;
|
||||
}
|
||||
|
||||
if (config.editorConfig.createUrl) {
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@ -50,6 +51,15 @@ namespace OnlineEditorsExampleMVC
|
||||
case "downloadhistory":
|
||||
DownloadHistory(context);
|
||||
break;
|
||||
case "gethistory":
|
||||
GetHistory(context);
|
||||
break;
|
||||
case "getversiondata":
|
||||
GetVersionData(context);
|
||||
break;
|
||||
case "restore":
|
||||
Restore(context);
|
||||
break;
|
||||
case "convert":
|
||||
Convert(context);
|
||||
break;
|
||||
@ -74,6 +84,9 @@ namespace OnlineEditorsExampleMVC
|
||||
case "rename":
|
||||
Rename(context);
|
||||
break;
|
||||
case "reference":
|
||||
Reference(context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,11 +240,10 @@ namespace OnlineEditorsExampleMVC
|
||||
var fileUri = DocManagerHelper.GetDownloadUrl(fileName);
|
||||
|
||||
var extension = (Path.GetExtension(fileName).ToLower() ?? "").Trim('.');
|
||||
var internalExtension = DocManagerHelper.GetInternalExtension(FileUtility.GetFileType(fileName)).Trim('.');
|
||||
var internalExtension = "ooxml";
|
||||
|
||||
// check if the file with such an extension can be converted
|
||||
if (DocManagerHelper.ConvertExts.Contains("." + extension)
|
||||
&& !string.IsNullOrEmpty(internalExtension))
|
||||
if (DocManagerHelper.ConvertExts.Contains("." + extension))
|
||||
{
|
||||
// generate document key
|
||||
var key = ServiceConverter.GenerateRevisionId(fileUri);
|
||||
@ -244,17 +256,19 @@ namespace OnlineEditorsExampleMVC
|
||||
Query = "type=download&fileName=" + HttpUtility.UrlEncode(fileName)
|
||||
};
|
||||
|
||||
// get the url to the converted file
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(downloadUri.ToString(), extension, internalExtension, key, true, out newFileUri, filePass, lang);
|
||||
// get the url and file type of the converted file
|
||||
Dictionary<string, string> newFileData;
|
||||
var result = ServiceConverter.GetConvertedData(downloadUri.ToString(), extension, internalExtension, key, true, out newFileData, filePass, lang);
|
||||
if (result != 100)
|
||||
{
|
||||
context.Response.Write("{ \"step\" : \"" + result + "\", \"filename\" : \"" + fileName + "\"}");
|
||||
return;
|
||||
}
|
||||
|
||||
var newFileUri = newFileData["fileUrl"];
|
||||
var newFileType = "." + newFileData["fileType"];
|
||||
// get a file name of an internal file extension with an index if the file with such a name already exists
|
||||
var correctName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "." + internalExtension);
|
||||
var correctName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + newFileType);
|
||||
|
||||
var req = (HttpWebRequest)WebRequest.Create(newFileUri);
|
||||
|
||||
@ -461,7 +475,7 @@ namespace OnlineEditorsExampleMVC
|
||||
var userAddress = context.Request["userAddress"];
|
||||
var isEmbedded = context.Request["dmode"];
|
||||
|
||||
if (JwtManager.Enabled && isEmbedded == null && userAddress != null)
|
||||
if (JwtManager.Enabled && isEmbedded == null && userAddress != null && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
@ -509,6 +523,173 @@ namespace OnlineEditorsExampleMVC
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
private static void GetHistory(HttpContext context)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
var fileName = context.Request["filename"];
|
||||
|
||||
var history = GetHistory(fileName);
|
||||
|
||||
context.Response.Write(jss.Serialize(history));
|
||||
}
|
||||
|
||||
private static void GetVersionData(HttpContext context)
|
||||
{
|
||||
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var fileName = context.Request["filename"];
|
||||
int version;
|
||||
|
||||
if (!int.TryParse(context.Request["version"], out version))
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"Version number invalid!\"}");
|
||||
return;
|
||||
}
|
||||
|
||||
var versionData = new Dictionary<string, object>();
|
||||
|
||||
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(fileName, null));
|
||||
var lastVersion = DocManagerHelper.GetFileVersion(histDir);
|
||||
|
||||
var verDir = DocManagerHelper.VersionDir(histDir, version);
|
||||
|
||||
var key = version == lastVersion
|
||||
? ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress()
|
||||
+ "/" + fileName + "/"
|
||||
+ File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode())
|
||||
: File.ReadAllText(Path.Combine(verDir, "key.txt"));
|
||||
|
||||
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
versionData.Add("fileType", ext.Replace(".", ""));
|
||||
versionData.Add("key", key);
|
||||
|
||||
// write file url to the data object
|
||||
string prevFileUrl;
|
||||
string directPrevFileUrl;
|
||||
if (Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath))
|
||||
{
|
||||
prevFileUrl = version == lastVersion ? DocManagerHelper.GetDownloadUrl(fileName)
|
||||
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
|
||||
directPrevFileUrl = version == lastVersion ? DocManagerHelper.GetDownloadUrl(fileName, false)
|
||||
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
prevFileUrl = version == lastVersion ? DocManagerHelper.GetFileUri(fileName, true)
|
||||
: DocManagerHelper.GetHistoryDownloadUrl(fileName, version.ToString(), "prev" + ext);
|
||||
directPrevFileUrl = version == lastVersion ? DocManagerHelper.GetFileUri(fileName, false)
|
||||
: DocManagerHelper.GetHistoryDownloadUrl(fileName, version.ToString(), "prev" + ext, false);
|
||||
}
|
||||
|
||||
versionData.Add("url", prevFileUrl);
|
||||
|
||||
var isEnableDirectUrl = string.Equals(DocManagerHelper.GetDirectUrl(), "true");
|
||||
if (isEnableDirectUrl)
|
||||
{
|
||||
versionData.Add("directUrl", directPrevFileUrl); // write direct url to the data object
|
||||
}
|
||||
|
||||
versionData.Add("version", version);
|
||||
if (version > 1)
|
||||
{
|
||||
var prevVerDir = DocManagerHelper.VersionDir(histDir, version - 1);
|
||||
|
||||
var prevUrl = Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath)
|
||||
? DocManagerHelper.GetDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""))
|
||||
: DocManagerHelper.GetHistoryDownloadUrl(fileName, (version - 1).ToString(), "prev" + ext);
|
||||
|
||||
var prevKey = File.ReadAllText(Path.Combine(prevVerDir, "key.txt"));
|
||||
|
||||
Dictionary<string, object> dataPrev = new Dictionary<string, object>() { // write information about previous file version to the data object
|
||||
{ "fileType", ext.Replace(".", "") },
|
||||
{ "key", prevKey }, // write key and url information about previous file version
|
||||
{ "url", prevUrl }
|
||||
};
|
||||
|
||||
string directPrevUrl;
|
||||
if (isEnableDirectUrl)
|
||||
{
|
||||
directPrevUrl = Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath)
|
||||
? DocManagerHelper.GetDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""), false)
|
||||
: DocManagerHelper.GetHistoryDownloadUrl(fileName, version.ToString(), "prev" + ext, false);
|
||||
|
||||
dataPrev.Add("directUrl", directPrevUrl);
|
||||
}
|
||||
|
||||
versionData.Add("previous", dataPrev);
|
||||
|
||||
if (File.Exists(Path.Combine(prevVerDir, "diff.zip")))
|
||||
{
|
||||
var changesUrl = DocManagerHelper.GetHistoryDownloadUrl(fileName, (version - 1).ToString(), "diff.zip");
|
||||
versionData.Add("changesUrl", changesUrl);
|
||||
}
|
||||
}
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(versionData);
|
||||
versionData.Add("token", token);
|
||||
}
|
||||
|
||||
context.Response.Write(jss.Serialize(versionData));
|
||||
}
|
||||
|
||||
private static void Restore(HttpContext context)
|
||||
{
|
||||
string fileData;
|
||||
try
|
||||
{
|
||||
using (var receiveStream = context.Request.InputStream)
|
||||
using (var readStream = new StreamReader(receiveStream))
|
||||
{
|
||||
fileData = readStream.ReadToEnd();
|
||||
if (string.IsNullOrEmpty(fileData)) return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
var body = jss.Deserialize<Dictionary<string, object>>(fileData);
|
||||
|
||||
var fileName = (string)body["fileName"];
|
||||
var version = (int)body["version"];
|
||||
|
||||
var key = ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress()
|
||||
+ "/" + fileName + "/"
|
||||
+ File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode());
|
||||
|
||||
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(fileName, null));
|
||||
var currentVersionDir = DocManagerHelper.VersionDir(histDir, DocManagerHelper.GetFileVersion(histDir));
|
||||
var verDir = DocManagerHelper.VersionDir(histDir, version);
|
||||
|
||||
if (!Directory.Exists(currentVersionDir)) Directory.CreateDirectory(currentVersionDir);
|
||||
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
File.Copy(DocManagerHelper.StoragePath(fileName, null), Path.Combine(currentVersionDir, "prev" + ext));
|
||||
|
||||
File.WriteAllText(Path.Combine(currentVersionDir, "key.txt"), key);
|
||||
|
||||
var changesPath = Path.Combine(DocManagerHelper.VersionDir(histDir, version - 1), "changes.json");
|
||||
if (File.Exists(changesPath))
|
||||
{
|
||||
File.Copy(changesPath, Path.Combine(currentVersionDir, "changes.json"));
|
||||
}
|
||||
|
||||
File.Copy(Path.Combine(verDir, "prev" + ext), DocManagerHelper.StoragePath(fileName, null), true);
|
||||
|
||||
var fileInfo = new FileInfo(DocManagerHelper.StoragePath(fileName, null));
|
||||
fileInfo.LastWriteTimeUtc = DateTime.UtcNow;
|
||||
|
||||
var history = GetHistory(fileName);
|
||||
|
||||
context.Response.Write(jss.Serialize(history));
|
||||
}
|
||||
|
||||
// download a history file
|
||||
private static void DownloadHistory(HttpContext context)
|
||||
{
|
||||
@ -519,7 +700,7 @@ namespace OnlineEditorsExampleMVC
|
||||
var version = System.Convert.ToInt32(context.Request["ver"]);
|
||||
var file = Path.GetFileName(context.Request["file"]);
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
@ -591,5 +772,162 @@ namespace OnlineEditorsExampleMVC
|
||||
TrackManager.commandRequest("meta", docKey, meta);
|
||||
context.Response.Write("{ \"result\": \"OK\"}");
|
||||
}
|
||||
|
||||
private static void Reference(HttpContext context)
|
||||
{
|
||||
string fileData;
|
||||
try
|
||||
{
|
||||
using (var receiveStream = context.Request.InputStream)
|
||||
using (var readStream = new StreamReader(receiveStream))
|
||||
{
|
||||
fileData = readStream.ReadToEnd();
|
||||
if (string.IsNullOrEmpty(fileData)) return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
var body = jss.Deserialize<Dictionary<string, object>>(fileData);
|
||||
Dictionary<string, object> referenceData = null;
|
||||
var fileName = "";
|
||||
var userAddress = "";
|
||||
|
||||
if (body.ContainsKey("referenceData"))
|
||||
{
|
||||
referenceData = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(body["referenceData"]));
|
||||
var instanceId = (string)referenceData["instanceId"];
|
||||
var fileKey = (string)referenceData["fileKey"];
|
||||
if (instanceId == DocManagerHelper.GetServerUrl(false))
|
||||
{
|
||||
var fileKeyObj = jss.Deserialize<Dictionary<string, object>>(fileKey);
|
||||
userAddress = (string)fileKeyObj["userAddress"];
|
||||
if (userAddress == HttpUtility.UrlEncode(DocManagerHelper.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)))
|
||||
{
|
||||
fileName = (string)fileKeyObj["fileName"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName == "")
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = (string)body["path"];
|
||||
path = Path.GetFileName(path);
|
||||
if (File.Exists(DocManagerHelper.StoragePath(path, null)))
|
||||
{
|
||||
fileName = path;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"Path not found!\"}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName == "")
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"File not found!\"}");
|
||||
return;
|
||||
}
|
||||
|
||||
var directUrl = (bool)body["directUrl"];
|
||||
|
||||
var data = new Dictionary<string, object>() {
|
||||
{ "fileType", (Path.GetExtension(fileName) ?? "").ToLower().Trim('.') },
|
||||
{ "url", DocManagerHelper.GetDownloadUrl(fileName)},
|
||||
{ "directUrl", directUrl ? DocManagerHelper.GetDownloadUrl(fileName, false) : null },
|
||||
{ "referenceData", new Dictionary<string, string>()
|
||||
{
|
||||
{ "fileKey", jss.Serialize(new Dictionary<string, object>{
|
||||
{"fileName", fileName},
|
||||
{"userAddress", HttpUtility.UrlEncode(DocManagerHelper.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress))}
|
||||
})
|
||||
},
|
||||
{ "instanceId", DocManagerHelper.GetServerUrl(false) }
|
||||
}
|
||||
},
|
||||
{ "path", fileName }
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(data);
|
||||
data.Add("token", token);
|
||||
}
|
||||
|
||||
context.Response.Write(jss.Serialize(data));
|
||||
}
|
||||
|
||||
// get the document history
|
||||
private static Dictionary<string, object> GetHistory(string fileName)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(fileName, null));
|
||||
|
||||
var history = new Dictionary<string, object>();
|
||||
|
||||
var currentVersion = DocManagerHelper.GetFileVersion(histDir);
|
||||
var currentKey = ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress()
|
||||
+ "/" + fileName + "/"
|
||||
+ File.GetLastWriteTime(DocManagerHelper.StoragePath(fileName, null)).GetHashCode());
|
||||
|
||||
var versionList = new List<Dictionary<string, object>>();
|
||||
for (var versionNum = 1; versionNum <= currentVersion; versionNum++)
|
||||
{
|
||||
var versionObj = new Dictionary<string, object>();
|
||||
var verDir = DocManagerHelper.VersionDir(histDir, versionNum); // get the path to the given file version
|
||||
|
||||
var key = versionNum == currentVersion ? currentKey : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
|
||||
|
||||
versionObj.Add("key", key);
|
||||
versionObj.Add("version", versionNum);
|
||||
|
||||
var changesPath = Path.Combine(DocManagerHelper.VersionDir(histDir, versionNum - 1), "changes.json");
|
||||
if (versionNum == 1 || !File.Exists(changesPath)) // check if the version number is equal to 1
|
||||
{
|
||||
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
|
||||
if (File.Exists(infoPath))
|
||||
{
|
||||
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
|
||||
versionObj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
|
||||
versionObj.Add("user", new Dictionary<string, object>()
|
||||
{
|
||||
{ "id", info["id"] },
|
||||
{ "name", info["name"] },
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (versionNum > 1) // check if the version number is greater than 1 (the file was modified)
|
||||
{
|
||||
// get the path to the changes.json file
|
||||
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(changesPath));
|
||||
var changesArray = (ArrayList)changes["changes"];
|
||||
var change = changesArray.Count > 0
|
||||
? (Dictionary<string, object>)changesArray[0]
|
||||
: new Dictionary<string, object>();
|
||||
|
||||
// write information about changes to the object
|
||||
versionObj.Add("changes", change.Count > 0 ? changes["changes"] : null);
|
||||
versionObj.Add("serverVersion", changes["serverVersion"]);
|
||||
versionObj.Add("created", change.Count > 0 ? change["created"] : null);
|
||||
versionObj.Add("user", change.Count > 0 ? change["user"] : null);
|
||||
}
|
||||
|
||||
versionList.Add(versionObj);
|
||||
}
|
||||
|
||||
history.Add("currentVersion", currentVersion);
|
||||
history.Add("history", versionList);
|
||||
|
||||
return history;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,10 +4,6 @@ Entity Framework - Entity Framework is an object-relational mapper that enables
|
||||
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
|
||||
@ -20,6 +16,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.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-migrate
|
||||
|
||||
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.
|
||||
|
||||
====
|
||||
|
||||
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.
|
||||
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009 John Resig, http://jquery.com/
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@ -1,22 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.5.0"/>
|
||||
<add key="version" value="1.6.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
|
||||
<add key="files.docservice.fillform-docs" value=".oform|.docx"/>
|
||||
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps|.oxps"/>
|
||||
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.txt|.docxf"/>
|
||||
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.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.fillform-docs" value=".docx|.oform"/>
|
||||
<add key="files.docservice.viewed-docs" value=".djvu|.oxps|.pdf|.xps"/>
|
||||
<add key="files.docservice.edited-docs" value=".csv|.docm|.docx|.docxf|.dotm|.dotx|.epub|.fb2|.html|.odp|.ods|.odt|.otp|.ots|.ott|.potm|.potx|.ppsm|.ppsx|.pptm|.pptx|.rtf|.txt|.xlsm|.xlsx|.xltm|.xltx"/>
|
||||
<add key="files.docservice.convert-docs" value=".doc|.dot|.dps|.dpt|.epub|.et|.ett|.fb2|.fodp|.fods|.fodt|.htm|.html|.mht|.mhtml|.odp|.ods|.odt|.otp|.ots|.ott|.pot|.pps|.ppt|.rtf|.stw|.sxc|.sxi|.sxw|.wps|.wpt|.xls|.xlsb|.xlt|.xml"/>
|
||||
<add key="files.docservice.timeout" value="120000" />
|
||||
<add key="files.docservice.secret" value="" />
|
||||
<add key="files.docservice.header" value="Authorization" />
|
||||
|
||||
<add key="files.docservice.token.useforrequest" value="true" />
|
||||
|
||||
<add key="files.docservice.verify-peer-off" value="true"/>
|
||||
|
||||
<add key="files.docservice.languages" value="en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (People's Republic of China)|zh-TW:Chinese (Traditional, Taiwan)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lv:Latvian|lo:Lao|ms:Malay (Malaysia)|nb:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
|
||||
<add key="files.docservice.languages" value="en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
|
||||
|
||||
<add key="files.docservice.url.site" value="http://documentserver/"/>
|
||||
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
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
|
||||
@ -16,6 +12,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
@ -682,3 +682,8 @@
|
||||
max-width:15%;
|
||||
}
|
||||
}
|
||||
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
||||
.tableRow td:first-child{
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,7 +356,8 @@
|
||||
</footer>
|
||||
</form>
|
||||
|
||||
<script language="javascript" type="text/javascript" src="script/jquery-1.9.0.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="script/jquery-3.6.4.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="script/jquery-migrate-3.4.1.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="script/jquery-ui.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="script/jquery.blockUI.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="script/jquery.iframe-transport.js"></script>
|
||||
|
||||
@ -471,11 +471,10 @@ namespace OnlineEditorsExample
|
||||
var lang = context.Request.Cookies.GetOrDefault("ulang", null);
|
||||
|
||||
var extension = (Path.GetExtension(_fileName).ToLower() ?? "").Trim('.');
|
||||
var internalExtension = FileType.GetInternalExtension(_fileName).Trim('.');
|
||||
var internalExtension = "ooxml";
|
||||
|
||||
// check if the file with such an extension can be converted
|
||||
if (ConvertExts.Contains("." + extension)
|
||||
&& !string.IsNullOrEmpty(internalExtension))
|
||||
if (ConvertExts.Contains("." + extension))
|
||||
{
|
||||
// generate document key
|
||||
var key = ServiceConverter.GenerateRevisionId(FileUri(_fileName, true));
|
||||
@ -487,16 +486,18 @@ namespace OnlineEditorsExample
|
||||
fileUrl.Query = "type=download&fileName=" + HttpUtility.UrlEncode(_fileName)
|
||||
+ "&userAddress=" + HttpUtility.UrlEncode(CurUserHostAddress(HttpContext.Current.Request.UserHostAddress));
|
||||
|
||||
// get the url to the converted file
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(fileUrl.ToString() , extension, internalExtension, key, true, out newFileUri, filePass, lang);
|
||||
// get the url and file type of the converted file
|
||||
Dictionary<string, string> newFileData;
|
||||
var result = ServiceConverter.GetConvertedData(fileUrl.ToString() , extension, internalExtension, key, true, out newFileData, filePass, lang);
|
||||
if (result != 100)
|
||||
{
|
||||
return "{ \"step\" : \"" + result + "\", \"filename\" : \"" + _fileName + "\"}";
|
||||
}
|
||||
|
||||
var newFileUri = newFileData["fileUrl"];
|
||||
var newFileType = "." + newFileData["fileType"];
|
||||
// get a file name of an internal file extension with an index if the file with such a name already exists
|
||||
var fileName = GetCorrectName(Path.GetFileNameWithoutExtension(_fileName) + "." + internalExtension);
|
||||
var fileName = GetCorrectName(Path.GetFileNameWithoutExtension(_fileName) + newFileType);
|
||||
|
||||
var req = (HttpWebRequest)WebRequest.Create(newFileUri);
|
||||
|
||||
@ -632,5 +633,12 @@ namespace OnlineEditorsExample
|
||||
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
|
||||
return "&directUrl=" + (isEnabledDirectUrl != null ? isEnabledDirectUrl : "false");
|
||||
}
|
||||
|
||||
// get direct url flag
|
||||
public static bool IsEnabledDirectUrl()
|
||||
{
|
||||
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
|
||||
return isEnabledDirectUrl != null ? Convert.ToBoolean(isEnabledDirectUrl) : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -153,7 +153,7 @@
|
||||
var onRequestMailMergeRecipients = function (event) {
|
||||
docEditor.setMailMergeRecipients(<%= DataMailMergeRecipients %>); // insert recipient data for mail merge into the file
|
||||
};
|
||||
|
||||
|
||||
var onRequestSaveAs = function (event) { // the user is trying to save file by clicking Save Copy as... button
|
||||
var title = event.data.title;
|
||||
var url = event.data.url;
|
||||
@ -190,6 +190,19 @@
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestReferenceData = function (event) { // user refresh external data source
|
||||
|
||||
event.data.directUrl = !!config.document.directUrl;
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "webeditor.ashx?type=reference");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send(JSON.stringify(event.data));
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.responseText);
|
||||
docEditor.setReferenceData(JSON.parse(xhr.responseText));
|
||||
}
|
||||
};
|
||||
|
||||
config = <%= DocConfig %>;
|
||||
|
||||
config.width = "100%";
|
||||
@ -198,7 +211,6 @@
|
||||
config.events = {
|
||||
'onAppReady': onAppReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
'onOutdatedVersion': onOutdatedVersion,
|
||||
'onMakeActionLink': onMakeActionLink,
|
||||
@ -209,20 +221,49 @@
|
||||
};
|
||||
|
||||
if (config.editorConfig.user.id) {
|
||||
<% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData))
|
||||
{ %>
|
||||
config.events['onRequestHistory'] = function () { // the user is trying to show the document version history
|
||||
docEditor.refreshHistory(<%= History %>); // show the document version history
|
||||
|
||||
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "webeditor.ashx?type=gethistory&filename=<%= FileName %>");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send();
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.responseText);
|
||||
docEditor.refreshHistory(JSON.parse(xhr.responseText));
|
||||
}
|
||||
};
|
||||
config.events['onRequestHistoryData'] = function (event) { // the user is trying to click the specific document version in the document version history
|
||||
var ver = event.data;
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "webeditor.ashx?type=getversiondata&filename=<%= FileName %>&version=" + ver + "&directUrl=" + !!config.document.directUrl);
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send();
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.responseText);
|
||||
docEditor.setHistoryData(JSON.parse(xhr.responseText)); // send the link to the document for viewing the version history
|
||||
}
|
||||
};
|
||||
config.events['onRequestHistoryClose'] = function () { // the user is trying to go back to the document from viewing the document version history
|
||||
document.location.reload();
|
||||
};
|
||||
config.events['onRequestRestore'] = function (event) {
|
||||
var fileName = "<%= FileName %>";
|
||||
var version = event.data.version;
|
||||
var data = {
|
||||
fileName: fileName,
|
||||
version: version
|
||||
};
|
||||
config.events['onRequestHistoryData'] = function (event) { // the user is trying to click the specific document version in the document version history
|
||||
var ver = event.data;
|
||||
var histData = <%= HistoryData %>;
|
||||
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
|
||||
};
|
||||
config.events['onRequestHistoryClose '] = function () { // the user is trying to go back to the document from viewing the document version history
|
||||
document.location.reload();
|
||||
};
|
||||
<% } %>
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "webeditor.ashx?type=restore&directUrl=" + !!config.document.directUrl);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.send(JSON.stringify(data));
|
||||
xhr.onload = function () {
|
||||
docEditor.refreshHistory(JSON.parse(xhr.responseText));
|
||||
}
|
||||
};
|
||||
|
||||
// add mentions for not anonymous users
|
||||
<% if (!string.IsNullOrEmpty(UsersForMentions))
|
||||
@ -242,6 +283,9 @@
|
||||
};
|
||||
// prevent file renaming for anonymous users
|
||||
config.events['onRequestRename'] = onRequestRename;
|
||||
config.events['onRequestReferenceData'] = onRequestReferenceData;
|
||||
// prevent switch the document from the viewing into the editing mode for anonymous users
|
||||
config.events['onRequestEditRights'] = onRequestEditRights;
|
||||
}
|
||||
|
||||
if (config.editorConfig.createUrl) {
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
@ -61,8 +60,6 @@ namespace OnlineEditorsExample
|
||||
}
|
||||
|
||||
protected string DocConfig { get; private set; }
|
||||
protected string History { get; private set; }
|
||||
protected string HistoryData { get; private set; }
|
||||
protected string InsertImageConfig { get; private set; }
|
||||
protected string CompareFileData { get; private set; }
|
||||
protected string DataMailMergeRecipients { get; private set; }
|
||||
@ -195,7 +192,7 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
{ "title", FileName },
|
||||
{ "url", getDownloadUrl(FileName) },
|
||||
{ "directUrl", IsEnabledDirectUrl() ? directUrl : "" },
|
||||
{ "directUrl", _Default.IsEnabledDirectUrl() ? directUrl : "" },
|
||||
{ "fileType", ext.Trim('.') },
|
||||
{ "key", Key },
|
||||
{
|
||||
@ -206,6 +203,17 @@ namespace OnlineEditorsExample
|
||||
{ "favorite", favorite }
|
||||
}
|
||||
},
|
||||
{
|
||||
"referenceData", new Dictionary<string, string>()
|
||||
{
|
||||
{ "fileKey", !user.id.Equals("uid-0") ?
|
||||
jss.Serialize(new Dictionary<string, object>{
|
||||
{"fileName", FileName},
|
||||
{"userAddress", HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress))}
|
||||
}) : null },
|
||||
{"instanceId", _Default.GetServerUrl(false) }
|
||||
}
|
||||
},
|
||||
{
|
||||
// the permission for the document to be edited and downloaded or not
|
||||
"permissions", new Dictionary<string, object>
|
||||
@ -222,7 +230,8 @@ namespace OnlineEditorsExample
|
||||
{ "chat", !user.id.Equals("uid-0") },
|
||||
{ "reviewGroups", user.reviewGroups },
|
||||
{ "commentGroups", user.commentGroups },
|
||||
{ "userInfoGroups", user.userInfoGroups }
|
||||
{ "userInfoGroups", user.userInfoGroups },
|
||||
{ "protect", !user.deniedPermissions.Contains("protect") }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -308,134 +317,10 @@ namespace OnlineEditorsExample
|
||||
// get users for mentions
|
||||
List<Dictionary<string, object>> usersData = Users.getUsersForMentions(user.id);
|
||||
UsersForMentions = !user.id.Equals("uid-0") ? jss.Serialize(usersData) : null;
|
||||
|
||||
Dictionary<string, object> hist;
|
||||
Dictionary<string, object> histData;
|
||||
|
||||
// get the document history
|
||||
GetHistory(out hist, out histData);
|
||||
if (hist != null && histData != null)
|
||||
{
|
||||
History = jss.Serialize(hist);
|
||||
HistoryData = jss.Serialize(histData);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// get the document history
|
||||
private void GetHistory(out Dictionary<string, object> history, out Dictionary<string, object> historyData)
|
||||
{
|
||||
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
|
||||
var jss = new JavaScriptSerializer();
|
||||
var histDir = _Default.HistoryDir(_Default.StoragePath(FileName, null));
|
||||
|
||||
history = null;
|
||||
historyData = null;
|
||||
|
||||
if (_Default.GetFileVersion(histDir) > 0) // if the file was modified (the file version is greater than 0)
|
||||
{
|
||||
var currentVersion = _Default.GetFileVersion(histDir);
|
||||
var hist = new List<Dictionary<string, object>>();
|
||||
var histData = new Dictionary<string, object>();
|
||||
|
||||
for (var i = 1; i <= currentVersion; i++) // run through all the file versions
|
||||
{
|
||||
var obj = new Dictionary<string, object>();
|
||||
var dataObj = new Dictionary<string, object>();
|
||||
var verDir = _Default.VersionDir(histDir, i); // get the path to the given file version
|
||||
|
||||
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
|
||||
|
||||
obj.Add("key", key);
|
||||
obj.Add("version", i);
|
||||
|
||||
if (i == 1) // check if the version number is equal to 1
|
||||
{
|
||||
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
|
||||
|
||||
if (File.Exists(infoPath)) {
|
||||
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
|
||||
obj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
|
||||
obj.Add("user", new Dictionary<string, object>() {
|
||||
{ "id", info["id"] },
|
||||
{ "name", info["name"] },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(FileName).ToLower();
|
||||
dataObj.Add("fileType", ext.Replace(".", ""));
|
||||
dataObj.Add("key", key);
|
||||
// write file url to the data object
|
||||
var directPrevFileUrl = i == currentVersion ? _Default.FileUri(FileName, false) : MakePublicHistoryUrl(FileName, i.ToString(), "prev" + ext, false);
|
||||
var prevFileUrl = i == currentVersion ? FileUri : MakePublicHistoryUrl(FileName, i.ToString(), "prev" + ext);
|
||||
if (Path.IsPathRooted(storagePath))
|
||||
{
|
||||
prevFileUrl = i == currentVersion ? getDownloadUrl(FileName) : getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
|
||||
directPrevFileUrl = i == currentVersion ? getDownloadUrl(FileName, false) : getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
|
||||
}
|
||||
|
||||
dataObj.Add("url", prevFileUrl); // write file url to the data object
|
||||
|
||||
if (IsEnabledDirectUrl())
|
||||
{
|
||||
dataObj.Add("directUrl", directPrevFileUrl); // write direct url to the data object
|
||||
}
|
||||
|
||||
dataObj.Add("version", i);
|
||||
if (i > 1) // check if the version number is greater than 1 (the file was modified)
|
||||
{
|
||||
// get the path to the changes.json file
|
||||
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(_Default.VersionDir(histDir, i - 1), "changes.json")));
|
||||
var changesArray = (ArrayList)changes["changes"];
|
||||
var change = changesArray.Count > 0
|
||||
? (Dictionary<string, object>)changesArray[0]
|
||||
: new Dictionary<string, object>();
|
||||
|
||||
// write information about changes to the object
|
||||
obj.Add("changes", change.Count > 0 ? changes["changes"] : null);
|
||||
obj.Add("serverVersion", changes["serverVersion"]);
|
||||
obj.Add("created", change.Count > 0 ? change["created"] : null);
|
||||
obj.Add("user", change.Count > 0 ? change["user"] : null);
|
||||
|
||||
var prev = (Dictionary<string, object>)histData[(i - 2).ToString()]; // get the history data from the previous file version
|
||||
|
||||
Dictionary<string, object> dataPrev = new Dictionary<string, object>() { // write information about previous file version to the data object
|
||||
{ "fileType", prev["fileType"] },
|
||||
{ "key", prev["key"] }, // write key and url information about previous file version
|
||||
{ "url", prev["url"] }
|
||||
};
|
||||
|
||||
if (IsEnabledDirectUrl())
|
||||
{
|
||||
dataPrev.Add("directUrl", prev["directUrl"]);
|
||||
}
|
||||
|
||||
dataObj.Add("previous", dataPrev);
|
||||
// write the path to the diff.zip archive with differences in this file version
|
||||
var changesUrl = MakePublicHistoryUrl(FileName, (i - 1).ToString(), "diff.zip");
|
||||
dataObj.Add("changesUrl", changesUrl);
|
||||
}
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(dataObj);
|
||||
dataObj.Add("token", token);
|
||||
}
|
||||
hist.Add(obj); // add object dictionary to the hist list
|
||||
histData.Add((i - 1).ToString(), dataObj); // write data object information to the history data
|
||||
}
|
||||
|
||||
// write history information about the current file version to the history object
|
||||
history = new Dictionary<string, object>()
|
||||
{
|
||||
{ "currentVersion", currentVersion },
|
||||
{ "history", hist }
|
||||
};
|
||||
historyData = histData;
|
||||
}
|
||||
}
|
||||
|
||||
// get a logo config
|
||||
private Dictionary<string, object> GetLogoConfig()
|
||||
{
|
||||
@ -457,7 +342,7 @@ namespace OnlineEditorsExample
|
||||
{ "url", InsertImageUrl.ToString()}
|
||||
};
|
||||
|
||||
if (IsEnabledDirectUrl())
|
||||
if (_Default.IsEnabledDirectUrl())
|
||||
{
|
||||
logoConfig.Add("directUrl", DirectImageUrl.ToString());
|
||||
}
|
||||
@ -494,7 +379,7 @@ namespace OnlineEditorsExample
|
||||
{ "url", compareFileUrl.ToString() }
|
||||
};
|
||||
|
||||
if (IsEnabledDirectUrl())
|
||||
if (_Default.IsEnabledDirectUrl())
|
||||
{
|
||||
dataCompareFile.Add("directUrl", DirectFileUrl.ToString());
|
||||
}
|
||||
@ -533,7 +418,7 @@ namespace OnlineEditorsExample
|
||||
{ "url", mailmergeUrl.ToString() }
|
||||
};
|
||||
|
||||
if (IsEnabledDirectUrl())
|
||||
if (_Default.IsEnabledDirectUrl())
|
||||
{
|
||||
mailMergeConfig.Add("directUrl", DirectMailMergeUrl.ToString());
|
||||
}
|
||||
@ -577,21 +462,6 @@ namespace OnlineEditorsExample
|
||||
return _Default.GetServerUrl(true) + fullPath.Substring(root.Length).Replace(Path.DirectorySeparatorChar, '/');
|
||||
}
|
||||
|
||||
|
||||
// create the public history url
|
||||
private string MakePublicHistoryUrl(string filename, string version, string file, Boolean isServer = true)
|
||||
{
|
||||
var userAddress = isServer ? "&userAddress=" + HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)) : "";
|
||||
var fileUrl = new UriBuilder(_Default.GetServerUrl(isServer));
|
||||
fileUrl.Path = HttpRuntime.AppDomainAppVirtualPath
|
||||
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
|
||||
+ "webeditor.ashx";
|
||||
fileUrl.Query = "type=downloadhistory&fileName=" + HttpUtility.UrlEncode(filename)
|
||||
+ "&ver=" + version + "&file=" + file
|
||||
+ userAddress;
|
||||
return fileUrl.ToString();
|
||||
}
|
||||
|
||||
// create demo document
|
||||
private static void Try(string type, string sample, HttpRequest request)
|
||||
{
|
||||
@ -620,6 +490,7 @@ namespace OnlineEditorsExample
|
||||
|
||||
var filePath = _Default.StoragePath(FileName, null);
|
||||
File.Copy(HttpRuntime.AppDomainAppPath + demoPath + demoName, filePath); // copy this file to the storage directory
|
||||
File.SetLastWriteTime(filePath, DateTime.Now);
|
||||
|
||||
// create a json file with file meta data
|
||||
var id = request.Cookies.GetOrDefault("uid", null);
|
||||
@ -639,12 +510,5 @@ namespace OnlineEditorsExample
|
||||
{ "name", uname }
|
||||
}));
|
||||
}
|
||||
|
||||
// get direct url flag
|
||||
private static bool IsEnabledDirectUrl()
|
||||
{
|
||||
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
|
||||
return isEnabledDirectUrl != null ? Convert.ToBoolean(isEnabledDirectUrl) : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,24 +70,24 @@ namespace ASC.Api.DocumentConverter
|
||||
/// <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>
|
||||
/// <param name="convertedDocumentUri">Uri to the converted document</param>
|
||||
/// <param name="convertedDocumentData">Uri and file type of the converted document</param>
|
||||
/// <returns>The percentage of conversion completion</returns>
|
||||
/// <example>
|
||||
/// string convertedDocumentUri;
|
||||
/// GetConvertedUri("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentUri);
|
||||
/// Dictionary<string, string> convertedDocumentData;
|
||||
/// GetConvertedData("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentData);
|
||||
/// </example>
|
||||
/// <exception>
|
||||
/// </exception>
|
||||
public static int GetConvertedUri(string documentUri,
|
||||
public static int GetConvertedData(string documentUri,
|
||||
string fromExtension,
|
||||
string toExtension,
|
||||
string documentRevisionId,
|
||||
bool isAsync,
|
||||
out string convertedDocumentUri,
|
||||
out Dictionary<string, string> convertedDocumentData,
|
||||
string filePass = null,
|
||||
string lang = null)
|
||||
{
|
||||
convertedDocumentUri = string.Empty;
|
||||
convertedDocumentData = new Dictionary<string, string>();
|
||||
|
||||
// check if the fromExtension parameter is defined; if not, get it from the document url
|
||||
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri).ToLower() : fromExtension;
|
||||
@ -121,7 +121,7 @@ namespace ASC.Api.DocumentConverter
|
||||
{ "region", lang }
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
// create payload object
|
||||
var payload = new Dictionary<string, object>
|
||||
@ -159,7 +159,7 @@ namespace ASC.Api.DocumentConverter
|
||||
}
|
||||
}
|
||||
|
||||
return GetResponseUri(dataResponse, out convertedDocumentUri);
|
||||
return GetResponseData(dataResponse, out convertedDocumentData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -183,9 +183,9 @@ namespace ASC.Api.DocumentConverter
|
||||
/// Processing document received from the editing service
|
||||
/// </summary>
|
||||
/// <param name="jsonDocumentResponse">The resulting json from editing service</param>
|
||||
/// <param name="responseUri">Uri to the converted document</param>
|
||||
/// <param name="responseData">Uri and file type of the converted document</param>
|
||||
/// <returns>The percentage of conversion completion</returns>
|
||||
private static int GetResponseUri(string jsonDocumentResponse, out string responseUri)
|
||||
private static int GetResponseData(string jsonDocumentResponse, out Dictionary<string, string> responseData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(jsonDocumentResponse)) throw new ArgumentException("Invalid param", "jsonDocumentResponse");
|
||||
|
||||
@ -199,14 +199,20 @@ namespace ASC.Api.DocumentConverter
|
||||
var isEndConvert = responseFromService.endConvert;
|
||||
|
||||
int resultPercent;
|
||||
responseUri = string.Empty;
|
||||
responseData = new Dictionary<string, string>();
|
||||
var responseUri = string.Empty;
|
||||
var responseFileType = string.Empty;
|
||||
if (isEndConvert) // if the conversion is completed
|
||||
{
|
||||
responseUri = responseFromService.fileUrl; // get the file url
|
||||
responseFileType = responseFromService.fileType; // get the file type
|
||||
responseData.Add("fileUrl", responseUri);
|
||||
responseData.Add("fileType", responseFileType);
|
||||
resultPercent = 100;
|
||||
}
|
||||
else // if the conversion isn't completed
|
||||
{
|
||||
responseData.Add("fileUrl", "");
|
||||
resultPercent = responseFromService.percent; // get the percentage value
|
||||
if (resultPercent >= 100) resultPercent = 99;
|
||||
}
|
||||
|
||||
@ -29,11 +29,13 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
private static readonly string Secret;
|
||||
public static readonly bool Enabled;
|
||||
public static readonly bool SignatureUseForRequest;
|
||||
|
||||
static JwtManager()
|
||||
{
|
||||
Secret = WebConfigurationManager.AppSettings["files.docservice.secret"] ?? ""; // get token secret from the config parameters
|
||||
Enabled = !string.IsNullOrEmpty(Secret); // check if the token is enabled
|
||||
SignatureUseForRequest = bool.Parse(WebConfigurationManager.AppSettings["files.docservice.token.useforrequest"]);
|
||||
}
|
||||
|
||||
// encode a payload object into a token using a secret key
|
||||
|
||||
@ -55,7 +55,7 @@ namespace OnlineEditorsExample
|
||||
var fileData = jss.Deserialize<Dictionary<string, object>>(body);
|
||||
|
||||
// check if the document token is enabled
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
@ -110,8 +110,9 @@ namespace OnlineEditorsExample
|
||||
try
|
||||
{
|
||||
// convert file and give url to a new file
|
||||
string newFileUri;
|
||||
ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
|
||||
Dictionary<string, string> newFileData;
|
||||
ServiceConverter.GetConvertedData(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileData);
|
||||
var newFileUri = newFileData["fileUrl"];
|
||||
if (string.IsNullOrEmpty(newFileUri))
|
||||
{
|
||||
// get the correct file name if it already exists
|
||||
@ -197,8 +198,9 @@ namespace OnlineEditorsExample
|
||||
try
|
||||
{
|
||||
// convert file and give url to a new file
|
||||
string newFileUri;
|
||||
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
|
||||
Dictionary<string, string> newFileData;
|
||||
var result = ServiceConverter.GetConvertedData(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileData);
|
||||
var newFileUri = newFileData["fileUrl"];
|
||||
if (string.IsNullOrEmpty(newFileUri))
|
||||
{
|
||||
newFileName = true;
|
||||
@ -288,7 +290,7 @@ namespace OnlineEditorsExample
|
||||
}
|
||||
|
||||
// check if a secret key to generate token exists or not
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
var payload = new Dictionary<string, object>
|
||||
{
|
||||
|
||||
@ -68,6 +68,7 @@ namespace OnlineEditorsExample
|
||||
"Can’t see anyone’s information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration",
|
||||
};
|
||||
|
||||
@ -130,7 +131,7 @@ namespace OnlineEditorsExample
|
||||
new Dictionary<string, object>(),
|
||||
new List<string>(),
|
||||
null,
|
||||
new List<string>(),
|
||||
new List<string>() { "protect" },
|
||||
descr_user_0,
|
||||
false
|
||||
)
|
||||
|
||||
@ -26,6 +26,9 @@ using System.Diagnostics;
|
||||
using System.Web.Configuration;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Collections;
|
||||
using System.Net.Sockets;
|
||||
using ASC.Api.DocumentConverter;
|
||||
|
||||
namespace OnlineEditorsExample
|
||||
{
|
||||
@ -47,6 +50,15 @@ namespace OnlineEditorsExample
|
||||
case "downloadhistory":
|
||||
DownloadHistory(context);
|
||||
break;
|
||||
case "gethistory":
|
||||
GetHistory(context);
|
||||
break;
|
||||
case "getversiondata":
|
||||
GetVersionData(context);
|
||||
break;
|
||||
case "restore":
|
||||
Restore(context);
|
||||
break;
|
||||
case "convert":
|
||||
Convert(context);
|
||||
break;
|
||||
@ -71,6 +83,9 @@ namespace OnlineEditorsExample
|
||||
case "rename":
|
||||
Rename(context);
|
||||
break;
|
||||
case "reference":
|
||||
Reference(context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,7 +296,7 @@ namespace OnlineEditorsExample
|
||||
var userAddress = Path.GetFileName(context.Request["userAddress"]);
|
||||
var isEmbedded = context.Request["dmode"];
|
||||
|
||||
if (JwtManager.Enabled && isEmbedded == null && userAddress != null)
|
||||
if (JwtManager.Enabled && isEmbedded == null && userAddress != null && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
@ -329,6 +344,164 @@ namespace OnlineEditorsExample
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
private static void GetHistory(HttpContext context)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
var fileName = context.Request["filename"];
|
||||
|
||||
var history = GetHistory(fileName);
|
||||
|
||||
context.Response.Write(jss.Serialize(history));
|
||||
}
|
||||
|
||||
private static void GetVersionData(HttpContext context)
|
||||
{
|
||||
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var fileName = context.Request["filename"];
|
||||
int version;
|
||||
|
||||
if (!int.TryParse(context.Request["version"], out version))
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"Version number invalid!\"}");
|
||||
return;
|
||||
}
|
||||
|
||||
var versionData = new Dictionary<string, object>();
|
||||
|
||||
var histDir = _Default.HistoryDir(_Default.StoragePath(fileName, null));
|
||||
var lastVersion = _Default.GetFileVersion(histDir);
|
||||
|
||||
var verDir = _Default.VersionDir(histDir, version);
|
||||
|
||||
var lastVersionUri = _Default.FileUri(fileName, true);
|
||||
var key = version == lastVersion
|
||||
? ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
|
||||
+ "/" + Path.GetFileName(lastVersionUri)
|
||||
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode())
|
||||
: File.ReadAllText(Path.Combine(verDir, "key.txt"));
|
||||
|
||||
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
versionData.Add("fileType", ext.Replace(".", ""));
|
||||
versionData.Add("key", key);
|
||||
|
||||
var directPrevFileUrl = version == lastVersion ? _Default.FileUri(fileName, false) : MakePublicHistoryUrl(fileName, version.ToString(), "prev" + ext, false);
|
||||
var prevFileUrl = version == lastVersion ? lastVersionUri : MakePublicHistoryUrl(fileName, version.ToString(), "prev" + ext);
|
||||
if (Path.IsPathRooted(storagePath))
|
||||
{
|
||||
prevFileUrl = version == lastVersion ? DocEditor.getDownloadUrl(fileName) : DocEditor.getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
|
||||
directPrevFileUrl = version == lastVersion ? DocEditor.getDownloadUrl(fileName, false) : DocEditor.getDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
|
||||
}
|
||||
|
||||
versionData.Add("url", prevFileUrl);
|
||||
|
||||
if (_Default.IsEnabledDirectUrl())
|
||||
{
|
||||
versionData.Add("directUrl", directPrevFileUrl); // write direct url to the data object
|
||||
}
|
||||
|
||||
versionData.Add("version", version);
|
||||
if (version > 1)
|
||||
{
|
||||
var prevVerDir = _Default.VersionDir(histDir, version - 1);
|
||||
|
||||
var prevUrl = MakePublicHistoryUrl(fileName, (version - 1).ToString(), "prev" + ext);
|
||||
if (Path.IsPathRooted(storagePath))
|
||||
prevUrl = DocEditor.getDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""));
|
||||
|
||||
var prevKey = File.ReadAllText(Path.Combine(prevVerDir, "key.txt"));
|
||||
|
||||
Dictionary<string, object> dataPrev = new Dictionary<string, object>() { // write information about previous file version to the data object
|
||||
{ "fileType", ext.Replace(".", "") },
|
||||
{ "key", prevKey }, // write key and url information about previous file version
|
||||
{ "url", prevUrl }
|
||||
};
|
||||
|
||||
string directPrevUrl;
|
||||
if (_Default.IsEnabledDirectUrl())
|
||||
{
|
||||
directPrevUrl = Path.IsPathRooted(storagePath)
|
||||
? DocEditor.getDownloadUrl(Directory.GetFiles(prevVerDir, "prev.*")[0].Replace(storagePath + "\\", ""), false)
|
||||
: MakePublicHistoryUrl(fileName, (version - 1).ToString(), "prev" + ext, false);
|
||||
|
||||
dataPrev.Add("directUrl", directPrevUrl); // write direct url to the data object
|
||||
}
|
||||
|
||||
versionData.Add("previous", dataPrev);
|
||||
|
||||
if (File.Exists(Path.Combine(prevVerDir, "diff.zip")))
|
||||
{
|
||||
var changesUrl = MakePublicHistoryUrl(fileName, (version - 1).ToString(), "diff.zip");
|
||||
versionData.Add("changesUrl", changesUrl);
|
||||
}
|
||||
}
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(versionData);
|
||||
versionData.Add("token", token);
|
||||
}
|
||||
|
||||
context.Response.Write(jss.Serialize(versionData));
|
||||
}
|
||||
|
||||
private void Restore(HttpContext context)
|
||||
{
|
||||
string fileData;
|
||||
try
|
||||
{
|
||||
using (var receiveStream = context.Request.InputStream)
|
||||
using (var readStream = new StreamReader(receiveStream))
|
||||
{
|
||||
fileData = readStream.ReadToEnd();
|
||||
if (string.IsNullOrEmpty(fileData)) return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
var body = jss.Deserialize<Dictionary<string, object>>(fileData);
|
||||
|
||||
var fileName = (string)body["fileName"];
|
||||
var version = (int)body["version"];
|
||||
|
||||
var lastVersionUri = _Default.FileUri(fileName, true);
|
||||
var key = ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
|
||||
+ "/" + Path.GetFileName(lastVersionUri)
|
||||
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode());
|
||||
|
||||
var histDir = _Default.HistoryDir(_Default.StoragePath(fileName, null));
|
||||
var currentVersionDir = _Default.VersionDir(histDir, _Default.GetFileVersion(histDir));
|
||||
var verDir = _Default.VersionDir(histDir, version);
|
||||
|
||||
if (!Directory.Exists(currentVersionDir)) Directory.CreateDirectory(currentVersionDir);
|
||||
|
||||
var ext = Path.GetExtension(fileName).ToLower();
|
||||
File.Copy(_Default.StoragePath(fileName, null), Path.Combine(currentVersionDir, "prev" + ext));
|
||||
|
||||
File.WriteAllText(Path.Combine(currentVersionDir, "key.txt"), key);
|
||||
|
||||
var changesPath = Path.Combine(_Default.VersionDir(histDir, version - 1), "changes.json");
|
||||
if (File.Exists(changesPath))
|
||||
{
|
||||
File.Copy(changesPath, Path.Combine(currentVersionDir, "changes.json"));
|
||||
}
|
||||
|
||||
File.Copy(Path.Combine(verDir, "prev" + ext), _Default.StoragePath(fileName, null), true);
|
||||
|
||||
var fileInfo = new FileInfo(_Default.StoragePath(fileName, null));
|
||||
fileInfo.LastWriteTimeUtc = DateTime.UtcNow;
|
||||
|
||||
var history = GetHistory(fileName);
|
||||
|
||||
context.Response.Write(jss.Serialize(history));
|
||||
}
|
||||
|
||||
private static void DownloadHistory(HttpContext context)
|
||||
{
|
||||
try
|
||||
@ -338,7 +511,7 @@ namespace OnlineEditorsExample
|
||||
var version = Path.GetFileName(context.Request["ver"]);
|
||||
var file = Path.GetFileName(context.Request["file"]);
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
|
||||
{
|
||||
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
|
||||
|
||||
@ -409,5 +582,175 @@ namespace OnlineEditorsExample
|
||||
TrackManager.commandRequest("meta", docKey, meta);
|
||||
context.Response.Write("{ \"result\": \"OK\"}");
|
||||
}
|
||||
|
||||
private static void Reference(HttpContext context)
|
||||
{
|
||||
string fileData;
|
||||
try
|
||||
{
|
||||
using (var receiveStream = context.Request.InputStream)
|
||||
using (var readStream = new StreamReader(receiveStream))
|
||||
{
|
||||
fileData = readStream.ReadToEnd();
|
||||
if (string.IsNullOrEmpty(fileData)) return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
var body = jss.Deserialize<Dictionary<string, object>>(fileData);
|
||||
Dictionary<string, object> referenceData = null;
|
||||
var fileName = "";
|
||||
var userAddress = "";
|
||||
|
||||
if (body.ContainsKey("referenceData"))
|
||||
{
|
||||
referenceData = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(body["referenceData"]));
|
||||
var instanceId = (string)referenceData["instanceId"];
|
||||
var fileKey = (string)referenceData["fileKey"];
|
||||
if (instanceId == _Default.GetServerUrl(false))
|
||||
{
|
||||
var fileKeyObj = jss.Deserialize<Dictionary<string, object>>(fileKey);
|
||||
userAddress = (string)fileKeyObj["userAddress"];
|
||||
if (userAddress == HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)))
|
||||
{
|
||||
fileName = (string)fileKeyObj["fileName"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName == "")
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = (string)body["path"];
|
||||
path = Path.GetFileName(path);
|
||||
if (File.Exists(_Default.StoragePath(path, null)))
|
||||
{
|
||||
fileName = path;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"Path not found!\"}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName == "")
|
||||
{
|
||||
context.Response.Write("{ \"error\": \"File not found!\"}");
|
||||
return;
|
||||
}
|
||||
|
||||
var directUrl = (bool) body["directUrl"];
|
||||
|
||||
var data = new Dictionary<string, object>() {
|
||||
{ "fileType", (Path.GetExtension(fileName) ?? "").ToLower().Trim('.') },
|
||||
{ "url", DocEditor.getDownloadUrl(fileName)},
|
||||
{ "directUrl", directUrl ? DocEditor.getDownloadUrl(fileName, false) : null},
|
||||
{ "referenceData", new Dictionary<string, string>()
|
||||
{
|
||||
{ "fileKey", jss.Serialize(new Dictionary<string, object>{
|
||||
{"fileName", fileName},
|
||||
{"userAddress", HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress))}
|
||||
})
|
||||
},
|
||||
{"instanceId", _Default.GetServerUrl(false) }
|
||||
}
|
||||
},
|
||||
{ "path", fileName }
|
||||
};
|
||||
|
||||
if (JwtManager.Enabled)
|
||||
{
|
||||
var token = JwtManager.Encode(data);
|
||||
data.Add("token", token);
|
||||
}
|
||||
|
||||
context.Response.Write(jss.Serialize(data));
|
||||
}
|
||||
|
||||
// get the document history
|
||||
private static Dictionary<string, object> GetHistory(string fileName)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
var histDir = _Default.HistoryDir(_Default.StoragePath(fileName, null));
|
||||
|
||||
var history = new Dictionary<string, object>();
|
||||
|
||||
var currentVersion = _Default.GetFileVersion(histDir);
|
||||
var currentFileUri = _Default.FileUri(fileName, true);
|
||||
var currentKey = ServiceConverter.GenerateRevisionId(_Default.CurUserHostAddress(null)
|
||||
+ "/" + Path.GetFileName(currentFileUri)
|
||||
+ "/" + File.GetLastWriteTime(_Default.StoragePath(fileName, null)).GetHashCode());
|
||||
|
||||
var versionList = new List<Dictionary<string, object>>();
|
||||
for (var versionNum = 1; versionNum <= currentVersion; versionNum++)
|
||||
{
|
||||
var versionObj = new Dictionary<string, object>();
|
||||
var verDir = _Default.VersionDir(histDir, versionNum); // get the path to the given file version
|
||||
|
||||
var key = versionNum == currentVersion ? currentKey : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
|
||||
|
||||
versionObj.Add("key", key);
|
||||
versionObj.Add("version", versionNum);
|
||||
|
||||
var changesPath = Path.Combine(_Default.VersionDir(histDir, versionNum - 1), "changes.json");
|
||||
if (versionNum == 1 || !File.Exists(changesPath)) // check if the version number is equal to 1
|
||||
{
|
||||
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
|
||||
if (File.Exists(infoPath))
|
||||
{
|
||||
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
|
||||
versionObj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
|
||||
versionObj.Add("user", new Dictionary<string, object>()
|
||||
{
|
||||
{ "id", info["id"] },
|
||||
{ "name", info["name"] },
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (versionNum > 1) // check if the version number is greater than 1 (the file was modified)
|
||||
{
|
||||
// get the path to the changes.json file
|
||||
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(changesPath));
|
||||
var changesArray = (ArrayList)changes["changes"];
|
||||
var change = changesArray.Count > 0
|
||||
? (Dictionary<string, object>)changesArray[0]
|
||||
: new Dictionary<string, object>();
|
||||
|
||||
// write information about changes to the object
|
||||
versionObj.Add("changes", change.Count > 0 ? changes["changes"] : null);
|
||||
versionObj.Add("serverVersion", changes["serverVersion"]);
|
||||
versionObj.Add("created", change.Count > 0 ? change["created"] : null);
|
||||
versionObj.Add("user", change.Count > 0 ? change["user"] : null);
|
||||
}
|
||||
|
||||
versionList.Add(versionObj);
|
||||
}
|
||||
|
||||
history.Add("currentVersion", currentVersion);
|
||||
history.Add("history", versionList);
|
||||
|
||||
return history;
|
||||
}
|
||||
|
||||
// create the public history url
|
||||
private static string MakePublicHistoryUrl(string filename, string version, string file, Boolean isServer = true)
|
||||
{
|
||||
var userAddress = isServer ? "&userAddress=" + HttpUtility.UrlEncode(_Default.CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)) : "";
|
||||
var fileUrl = new UriBuilder(_Default.GetServerUrl(isServer));
|
||||
fileUrl.Path = HttpRuntime.AppDomainAppVirtualPath
|
||||
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
|
||||
+ "webeditor.ashx";
|
||||
fileUrl.Query = "type=downloadhistory&fileName=" + HttpUtility.UrlEncode(filename)
|
||||
+ "&ver=" + version + "&file=" + file
|
||||
+ userAddress;
|
||||
return fileUrl.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,5 @@
|
||||
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
|
||||
@ -16,6 +12,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.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-migrate
|
||||
|
||||
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.
|
||||
|
||||
====
|
||||
|
||||
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.
|
||||
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009 John Resig, http://jquery.com/
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
web/documentserver-example/csharp/script/jquery-3.6.4.min.js
vendored
Normal file
2
web/documentserver-example/csharp/script/jquery-3.6.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
web/documentserver-example/csharp/script/jquery-migrate-3.4.1.min.js
vendored
Normal file
2
web/documentserver-example/csharp/script/jquery-migrate-3.4.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -236,6 +236,7 @@ if (typeof jQuery != "undefined") {
|
||||
window.open(url, "_blank");
|
||||
jq('#hiddenFileName').val("");
|
||||
jq.unblockUI();
|
||||
document.location.reload();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginView:not(.disable)", function () {
|
||||
@ -244,6 +245,7 @@ if (typeof jQuery != "undefined") {
|
||||
window.open(url, "_blank");
|
||||
jq('#hiddenFileName').val("");
|
||||
jq.unblockUI();
|
||||
document.location.reload();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEmbedded:not(.disable)", function () {
|
||||
|
||||
@ -1,21 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.5.0"/>
|
||||
<add key="version" value="1.6.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
|
||||
<add key="files.docservice.fillform-docs" value=".oform|.docx"/>
|
||||
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps|.oxps"/>
|
||||
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.txt|.docxf"/>
|
||||
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.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.fillform-docs" value=".docx|.oform"/>
|
||||
<add key="files.docservice.viewed-docs" value=".djvu|.oxps|.pdf|.xps"/>
|
||||
<add key="files.docservice.edited-docs" value=".csv|.docm|.docx|.docxf|.dotm|.dotx|.epub|.fb2|.html|.odp|.ods|.odt|.otp|.ots|.ott|.potm|.potx|.ppsm|.ppsx|.pptm|.pptx|.rtf|.txt|.xlsm|.xlsx|.xltm|.xltx"/>
|
||||
<add key="files.docservice.convert-docs" value=".doc|.dot|.dps|.dpt|.epub|.et|.ett|.fb2|.fodp|.fods|.fodt|.htm|.html|.mht|.mhtml|.odp|.ods|.odt|.otp|.ots|.ott|.pot|.pps|.ppt|.rtf|.stw|.sxc|.sxi|.sxw|.wps|.wpt|.xls|.xlsb|.xlt|.xml"/>
|
||||
<add key="files.docservice.timeout" value="120000" />
|
||||
<add key="files.docservice.secret" value="" />
|
||||
<add key="files.docservice.header" value="Authorization" />
|
||||
<add key="files.docservice.verify-peer-off" value="true"/>
|
||||
|
||||
<add key="files.docservice.languages" value="en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (People's Republic of China)|zh-TW:Chinese (Traditional, Taiwan)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lv:Latvian|lo:Lao|ms:Malay (Malaysia)|nb:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
|
||||
<add key="files.docservice.token.useforrequest" value="true" />
|
||||
|
||||
<add key="files.docservice.languages" value="en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA: Test Language"/>
|
||||
|
||||
<add key="files.docservice.url.site" value="http://documentserver/"/>
|
||||
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
# Eclipse
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
|
||||
# Intellij
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
||||
|
||||
# Maven
|
||||
log/
|
||||
target/
|
||||
|
||||
#project
|
||||
documents
|
||||
@ -1,8 +1,17 @@
|
||||
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
|
||||
|
||||
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: gson.license
|
||||
|
||||
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
|
||||
License: MPL 2.0 or EPL 1.0
|
||||
License File: h2database.license
|
||||
|
||||
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: jackson-databind.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
|
||||
@ -16,10 +25,30 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: JSON.simple.license
|
||||
|
||||
Project Lombok - Project Lombok is a java library that automatically plugs into your editor and build tools. (https://mvnrepository.com/artifact/org.projectlombok/lombok).
|
||||
License: MIT
|
||||
License File lombok.license
|
||||
|
||||
ModelMapper - ModelMapper is an intelligent object mapping library that automatically maps objects to each other. (https://github.com/modelmapper/modelmapper)
|
||||
License: Apache 2.0
|
||||
License File modelmapper.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
|
||||
@ -39,27 +68,3 @@ License File: spring-boot.license
|
||||
Spring Data JPA - Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate. (https://github.com/spring-projects/spring-data-jpa/blob/main/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: spring-data-jpa.license
|
||||
|
||||
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
|
||||
License: MPL 2.0 or EPL 1.0
|
||||
License File: h2database.license
|
||||
|
||||
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: JSON.simple.license
|
||||
|
||||
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: gson.license
|
||||
|
||||
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: jackson-databind.license
|
||||
|
||||
ModelMapper - ModelMapper is an intelligent object mapping library that automatically maps objects to each other. (https://github.com/modelmapper/modelmapper)
|
||||
License: Apache 2.0
|
||||
License File modelmapper.license
|
||||
|
||||
Project Lombok - Project Lombok is a java library that automatically plugs into your editor and build tools. (https://mvnrepository.com/artifact/org.projectlombok/lombok).
|
||||
License: MIT
|
||||
License File lombok.license
|
||||
|
||||
@ -128,11 +128,7 @@ See the detailed guide to learn how to install Document Server [for Linux](https
|
||||
|
||||
### Step 2. Install the prerequisites and run the website with the editors
|
||||
|
||||
1. Install **Java**:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java11-installer
|
||||
```
|
||||
1. Install **Java** following the instructions [here](https://docs.oracle.com/en/java/javase/20/install/installation-jdk-linux-platforms.html#GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8).
|
||||
|
||||
2. Download the archive with the Java-Spring example and unpack the archive or clone git repository:
|
||||
|
||||
@ -210,13 +206,51 @@ Make sure that the Document Server has access to the server with the example ins
|
||||
|
||||
## For Docker
|
||||
|
||||
1. Edit the *application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed ([installation instructions](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx)).
|
||||
### Step 1. Install ONLYOFFICE Docs
|
||||
|
||||
Download and install ONLYOFFICE Docs (packaged as Document Server).
|
||||
|
||||
See the detailed guide to learn how to install Document Server [for Docker](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx).
|
||||
|
||||
### Step 2. Install the prerequisites and run the website with the editors
|
||||
|
||||
1. Install **Java** following the instructions [here](https://docs.oracle.com/en/java/javase/20/install/installation-jdk-linux-platforms.html#GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8).
|
||||
|
||||
2. Download the archive with the Java-Spring example and unpack the archive or clone git repository:
|
||||
|
||||
a) archive with Java-Spring:
|
||||
|
||||
```
|
||||
wget https://api.onlyoffice.com/app_data/editor/Java%20Spring%20Example.zip
|
||||
```
|
||||
|
||||
```
|
||||
unzip Java\ Spring\ Example.zip
|
||||
```
|
||||
b) git repository:
|
||||
```
|
||||
git clone https://github.com/ONLYOFFICE/document-server-integration.git
|
||||
```
|
||||
|
||||
|
||||
3. Change the current directory for the project directory:
|
||||
|
||||
a) from archive
|
||||
|
||||
```
|
||||
cd Java\ Spring\ Example/
|
||||
```
|
||||
b) from git repository
|
||||
```
|
||||
cd document-server-integration/web/documentserver-example/java-spring
|
||||
```
|
||||
4. Edit the *application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed:
|
||||
|
||||
```
|
||||
nano src/main/resources/application.properties
|
||||
```
|
||||
|
||||
2. Edit the following lines:
|
||||
5. Edit the following lines:
|
||||
|
||||
```
|
||||
files.storage=
|
||||
@ -226,17 +260,23 @@ Make sure that the Document Server has access to the server with the example ins
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Docs installed, **port** is any available port and **files.storage** is the path where files will be created and stored (in the project folder by default). You can set an absolute path.
|
||||
|
||||
3. Run the next command in the java example directory:
|
||||
6. Run the next command in the java example directory:
|
||||
|
||||
```
|
||||
docker-compose up
|
||||
```
|
||||
4. Open your browser using **server.address** and **server.port**:
|
||||
7. Open your browser using **server.address** and **server.port**:
|
||||
|
||||
```
|
||||
http://server.address:server.port/
|
||||
```
|
||||
|
||||
### Step 3. Check accessibility
|
||||
|
||||
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files.
|
||||
|
||||
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
|
||||
|
||||
## Important security info
|
||||
|
||||
Please keep in mind the following security aspects when you are using test examples:
|
||||
|
||||
@ -1,8 +1,17 @@
|
||||
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
|
||||
|
||||
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: gson.license
|
||||
|
||||
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
|
||||
License: MPL 2.0 or EPL 1.0
|
||||
License File: h2database.license
|
||||
|
||||
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: jackson-databind.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
|
||||
@ -16,10 +25,30 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: JSON.simple.license
|
||||
|
||||
Project Lombok - Project Lombok is a java library that automatically plugs into your editor and build tools. (https://mvnrepository.com/artifact/org.projectlombok/lombok).
|
||||
License: MIT
|
||||
License File lombok.license
|
||||
|
||||
ModelMapper - ModelMapper is an intelligent object mapping library that automatically maps objects to each other. (https://github.com/modelmapper/modelmapper)
|
||||
License: Apache 2.0
|
||||
License File modelmapper.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
|
||||
@ -39,19 +68,3 @@ License File: spring-boot.license
|
||||
Spring Data JPA - Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate. (https://github.com/spring-projects/spring-data-jpa/blob/main/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: spring-data-jpa.license
|
||||
|
||||
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
|
||||
License: MPL 2.0 or EPL 1.0
|
||||
License File: h2database.license
|
||||
|
||||
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
|
||||
License: Apache 2.0
|
||||
License File: JSON.simple.license
|
||||
|
||||
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: gson.license
|
||||
|
||||
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
|
||||
License: Apache 2.0
|
||||
License File: jackson-databind.license
|
||||
@ -0,0 +1,36 @@
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.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-migrate
|
||||
|
||||
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.
|
||||
|
||||
====
|
||||
|
||||
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.
|
||||
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009 John Resig, http://jquery.com/
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@ -45,6 +45,7 @@ public class ExampleData {
|
||||
"Can’t see anyone’s information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration"
|
||||
);
|
||||
|
||||
@ -92,22 +93,23 @@ public class ExampleData {
|
||||
userService.createUser("John Smith", "smith@example.com", descriptionUserFirst,
|
||||
"", List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()), null, true);
|
||||
List.of(FilterState.NULL.toString()), null, true, true);
|
||||
|
||||
// create user 2 with the specified parameters
|
||||
userService.createUser("Mark Pottato", "pottato@example.com", descriptionUserSecond,
|
||||
"group-2", List.of("", "group-2"), List.of(FilterState.NULL.toString()),
|
||||
List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true, true);
|
||||
List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true, true,
|
||||
true);
|
||||
|
||||
// create user 3 with the specified parameters
|
||||
userService.createUser("Hamish Mitchell", "mitchell@example.com", descriptionUserThird,
|
||||
"group-3", List.of("group-2"), List.of("group-2", "group-3"), List.of("group-2"),
|
||||
new ArrayList<>(), List.of("group-2"), false, true);
|
||||
new ArrayList<>(), List.of("group-2"), false, true, true);
|
||||
|
||||
// create user 0 with the specified parameters
|
||||
userService.createUser("Anonymous", null, descriptionUserZero, "",
|
||||
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
new ArrayList<>(), null, false);
|
||||
new ArrayList<>(), null, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ package com.onlyoffice.integration.controllers;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
|
||||
import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
|
||||
import com.onlyoffice.integration.documentserver.models.enums.Action;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
@ -73,9 +72,6 @@ public class EditorController {
|
||||
@Autowired
|
||||
private UserServices userService;
|
||||
|
||||
@Autowired
|
||||
private HistoryManager historyManager;
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@ -140,9 +136,6 @@ public class EditorController {
|
||||
// add file model with the default parameters to the original model
|
||||
model.addAttribute("model", fileModel);
|
||||
|
||||
// get file history and add it to the model
|
||||
model.addAttribute("fileHistory", historyManager.getHistory(fileModel.getDocument()));
|
||||
|
||||
// create the document service api URL and add it to the model
|
||||
model.addAttribute("docserviceApiUrl", docserviceSite + docserviceApiUrl);
|
||||
|
||||
|
||||
@ -19,11 +19,20 @@
|
||||
package com.onlyoffice.integration.controllers;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.onlyoffice.integration.documentserver.callbacks.CallbackHandler;
|
||||
import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
|
||||
import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
import com.onlyoffice.integration.dto.Converter;
|
||||
import com.onlyoffice.integration.dto.ConvertedData;
|
||||
import com.onlyoffice.integration.dto.Reference;
|
||||
import com.onlyoffice.integration.dto.ReferenceData;
|
||||
import com.onlyoffice.integration.dto.Rename;
|
||||
import com.onlyoffice.integration.dto.Restore;
|
||||
import com.onlyoffice.integration.dto.SaveAs;
|
||||
import com.onlyoffice.integration.dto.Track;
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import com.onlyoffice.integration.documentserver.models.enums.DocumentType;
|
||||
@ -32,7 +41,10 @@ import com.onlyoffice.integration.documentserver.util.file.FileUtility;
|
||||
import com.onlyoffice.integration.documentserver.util.service.ServiceConverter;
|
||||
import com.onlyoffice.integration.documentserver.managers.document.DocumentManager;
|
||||
import com.onlyoffice.integration.documentserver.managers.callback.CallbackManager;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
@ -45,19 +57,28 @@ import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@ -98,6 +119,8 @@ public class FileController {
|
||||
private ServiceConverter serviceConverter;
|
||||
@Autowired
|
||||
private CallbackManager callbackManager;
|
||||
@Autowired
|
||||
private HistoryManager historyManager;
|
||||
|
||||
// create user metadata
|
||||
private String createUserMetadata(final String uid, final String fullFileName) {
|
||||
@ -198,15 +221,18 @@ public class FileController {
|
||||
// get document type (word, cell or slide)
|
||||
DocumentType type = fileUtility.getDocumentType(fileName);
|
||||
|
||||
// get an editor internal extension (".docx", ".xlsx" or ".pptx")
|
||||
String internalFileExt = fileUtility.getInternalExtension(type);
|
||||
// convert to .ooxml
|
||||
String internalFileExt = "ooxml";
|
||||
|
||||
try {
|
||||
// check if the file with such an extension can be converted
|
||||
if (fileUtility.getConvertExts().contains(fileExt)) {
|
||||
String key = serviceConverter.generateRevisionId(fileUri); // generate document key
|
||||
String newFileUri = serviceConverter // get the URL to the converted file
|
||||
.getConvertedUri(fileUri, fileExt, internalFileExt, key, filePass, true, lang);
|
||||
ConvertedData response = serviceConverter // get the URL to the converted file
|
||||
.getConvertedData(fileUri, fileExt, internalFileExt, key, filePass, true, lang);
|
||||
|
||||
String newFileUri = response.getUri();
|
||||
String newFileType = "." + response.getFileType();
|
||||
|
||||
if (newFileUri.isEmpty()) {
|
||||
return "{ \"step\" : \"0\", \"filename\" : \"" + fileName + "\"}";
|
||||
@ -214,7 +240,7 @@ public class FileController {
|
||||
|
||||
/* get a file name of an internal file extension with an index if the file
|
||||
with such a name already exists */
|
||||
String nameWithInternalExt = fileUtility.getFileNameWithoutExtension(fileName) + internalFileExt;
|
||||
String nameWithInternalExt = fileUtility.getFileNameWithoutExtension(fileName) + newFileType;
|
||||
String correctedName = documentManager.getCorrectName(nameWithInternalExt);
|
||||
|
||||
URL url = new URL(newFileUri);
|
||||
@ -226,6 +252,9 @@ public class FileController {
|
||||
throw new RuntimeException("Input stream is null");
|
||||
}
|
||||
|
||||
// remove source file
|
||||
storageMutator.deleteFile(fileName);
|
||||
|
||||
// create the converted file with input stream
|
||||
storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(correctedName)), stream);
|
||||
fileName = correctedName;
|
||||
@ -266,7 +295,7 @@ public class FileController {
|
||||
@RequestParam("file") final String file) { // history file
|
||||
try {
|
||||
// check if a token is enabled or not
|
||||
if (jwtManager.tokenEnabled()) {
|
||||
if (jwtManager.tokenEnabled() && jwtManager.tokenUseForRequest()) {
|
||||
String header = request.getHeader(documentJwtHeader == null // get the document JWT header
|
||||
|| documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
|
||||
if (header != null && !header.isEmpty()) {
|
||||
@ -286,10 +315,11 @@ public class FileController {
|
||||
@GetMapping(path = "${url.download}")
|
||||
public ResponseEntity<Resource> download(final HttpServletRequest request, // download a file
|
||||
@RequestParam("fileName") final String fileName,
|
||||
@RequestParam(value = "userAddress", required = false) final String userAddress){
|
||||
@RequestParam(value = "userAddress", required = false)
|
||||
final String userAddress) {
|
||||
try {
|
||||
// check if a token is enabled or not
|
||||
if (jwtManager.tokenEnabled() && userAddress != null) {
|
||||
if (jwtManager.tokenEnabled() && userAddress != null && jwtManager.tokenUseForRequest()) {
|
||||
String header = request.getHeader(documentJwtHeader == null // get the document JWT header
|
||||
|| documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
|
||||
if (header != null && !header.isEmpty()) {
|
||||
@ -341,13 +371,13 @@ public class FileController {
|
||||
@GetMapping("/assets")
|
||||
public ResponseEntity<Resource> assets(@RequestParam("name")
|
||||
final String name) { // get sample files from the assests
|
||||
String fileName = Path.of("assets", "sample", fileUtility.getFileName(name)).toString();
|
||||
String fileName = Path.of("assets", "document-templates", "sample", fileUtility.getFileName(name)).toString();
|
||||
return downloadFile(fileName);
|
||||
}
|
||||
|
||||
@GetMapping("/csv")
|
||||
public ResponseEntity<Resource> csv() { // download a csv file
|
||||
String fileName = Path.of("assets", "sample", "csv.csv").toString();
|
||||
String fileName = Path.of("assets", "document-templates", "sample", "csv.csv").toString();
|
||||
return downloadFile(fileName);
|
||||
}
|
||||
|
||||
@ -389,19 +419,16 @@ public class FileController {
|
||||
|
||||
@PostMapping("/saveas")
|
||||
@ResponseBody
|
||||
public String saveAs(@RequestBody final JSONObject body, @CookieValue("uid") final String uid) {
|
||||
String title = (String) body.get("title");
|
||||
String saveAsFileUrl = (String) body.get("url");
|
||||
|
||||
public String saveAs(@RequestBody final SaveAs body, @CookieValue("uid") final String uid) {
|
||||
try {
|
||||
String fileName = documentManager.getCorrectName(title);
|
||||
String fileName = documentManager.getCorrectName(body.getTitle());
|
||||
String curExt = fileUtility.getFileExtension(fileName);
|
||||
|
||||
if (!fileUtility.getFileExts().contains(curExt)) {
|
||||
return "{\"error\":\"File type is not supported\"}";
|
||||
}
|
||||
|
||||
URL url = new URL(saveAsFileUrl);
|
||||
URL url = new URL(body.getUrl());
|
||||
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
|
||||
InputStream stream = connection.getInputStream();
|
||||
|
||||
@ -420,29 +447,181 @@ public class FileController {
|
||||
|
||||
@PostMapping("/rename")
|
||||
@ResponseBody
|
||||
public String rename(@RequestBody final JSONObject body) {
|
||||
String newfilename = (String) body.get("newfilename");
|
||||
String dockey = (String) body.get("dockey");
|
||||
String origExt = "." + (String) body.get("ext");
|
||||
String curExt = newfilename;
|
||||
|
||||
if (newfilename.indexOf(".") != -1) {
|
||||
curExt = (String) fileUtility.getFileExtension(newfilename);
|
||||
}
|
||||
|
||||
if (origExt.compareTo(curExt) != 0) {
|
||||
newfilename += origExt;
|
||||
}
|
||||
public String rename(@RequestBody final Rename body) {
|
||||
String fileName = body.getFileName();
|
||||
|
||||
HashMap<String, String> meta = new HashMap<>();
|
||||
meta.put("title", newfilename);
|
||||
meta.put("title", fileName + "." + body.getFileType());
|
||||
|
||||
try {
|
||||
callbackManager.commandRequest("meta", dockey, meta);
|
||||
callbackManager.commandRequest("meta", body.getFileKey(), meta);
|
||||
return "result ok";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/reference")
|
||||
@ResponseBody
|
||||
public String reference(@RequestBody final Reference body) {
|
||||
try {
|
||||
JSONParser parser = new JSONParser();
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
|
||||
|
||||
String userAddress = "";
|
||||
String fileName = "";
|
||||
|
||||
if (body.getReferenceData() != null) {
|
||||
ReferenceData referenceData = body.getReferenceData();
|
||||
|
||||
if (referenceData.getInstanceId().equals(storagePathBuilder.getServerUrl(false))) {
|
||||
JSONObject fileKey = (JSONObject) parser.parse(referenceData.getFileKey());
|
||||
userAddress = (String) fileKey.get("userAddress");
|
||||
if (userAddress.equals(InetAddress.getLocalHost().getHostAddress())) {
|
||||
fileName = (String) fileKey.get("fileName");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fileName.equals("")) {
|
||||
try {
|
||||
String path = (String) body.getPath();
|
||||
path = fileUtility.getFileName(path);
|
||||
File f = new File(storagePathBuilder.getFileLocation(path));
|
||||
if (f.exists()) {
|
||||
fileName = path;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName.equals("")) {
|
||||
return "{ \"error\": \"File not found\"}";
|
||||
}
|
||||
|
||||
HashMap<String, Object> fileKey = new HashMap<>();
|
||||
fileKey.put("fileName", fileName);
|
||||
fileKey.put("userAddress", InetAddress.getLocalHost().getHostAddress());
|
||||
|
||||
HashMap<String, Object> referenceData = new HashMap<>();
|
||||
referenceData.put("instanceId", storagePathBuilder.getServerUrl(true));
|
||||
referenceData.put("fileKey", gson.toJson(fileKey));
|
||||
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("fileType", fileUtility.getFileExtension(fileName).replace(".", ""));
|
||||
data.put("url", documentManager.getDownloadUrl(fileName, true));
|
||||
data.put("directUrl", body.getDirectUrl() ? documentManager.getDownloadUrl(fileName, false) : null);
|
||||
data.put("referenceData", referenceData);
|
||||
data.put("path", fileName);
|
||||
|
||||
if (jwtManager.tokenEnabled()) {
|
||||
String token = jwtManager.createToken(data);
|
||||
data.put("token", token);
|
||||
}
|
||||
return gson.toJson(data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/history")
|
||||
@ResponseBody
|
||||
public String history(@RequestParam("fileName") final String fileName) {
|
||||
return historyManager.getHistory(fileName);
|
||||
}
|
||||
|
||||
@GetMapping("/historydata")
|
||||
@ResponseBody
|
||||
public String history(@RequestParam("fileName") final String fileName,
|
||||
@RequestParam("version") final String version,
|
||||
@RequestParam(value = "directUrl", defaultValue = "false") final Boolean directUrl) {
|
||||
return historyManager.getHistoryData(fileName, version, directUrl);
|
||||
}
|
||||
|
||||
@PutMapping("/restore")
|
||||
@ResponseBody
|
||||
public String restore(@RequestBody final Restore body, @CookieValue("uid") final Integer uid) {
|
||||
try {
|
||||
String sourceStringFile = storagePathBuilder.getFileLocation(body.getFileName());
|
||||
File sourceFile = new File(sourceStringFile);
|
||||
Path sourcePathFile = sourceFile.toPath();
|
||||
String historyDirectory = storagePathBuilder.getHistoryDir(sourcePathFile.toString());
|
||||
|
||||
Integer bumpedVersion = storagePathBuilder.getFileVersion(historyDirectory, false);
|
||||
String bumpedVersionStringDirectory = documentManager.versionDir(historyDirectory, bumpedVersion, true);
|
||||
File bumpedVersionDirectory = new File(bumpedVersionStringDirectory);
|
||||
if (!bumpedVersionDirectory.exists()) {
|
||||
bumpedVersionDirectory.mkdir();
|
||||
}
|
||||
|
||||
Path bumpedKeyPathFile = Paths.get(bumpedVersionStringDirectory, "key.txt");
|
||||
String bumpedKeyStringFile = bumpedKeyPathFile.toString();
|
||||
File bumpedKeyFile = new File(bumpedKeyStringFile);
|
||||
String bumpedKey = serviceConverter.generateRevisionId(
|
||||
storagePathBuilder.getStorageLocation()
|
||||
+ "/"
|
||||
+ body.getFileName()
|
||||
+ "/"
|
||||
+ Long.toString(sourceFile.lastModified())
|
||||
);
|
||||
FileWriter bumpedKeyFileWriter = new FileWriter(bumpedKeyFile);
|
||||
bumpedKeyFileWriter.write(bumpedKey);
|
||||
bumpedKeyFileWriter.close();
|
||||
|
||||
User user = userService.findUserById(uid).get();
|
||||
|
||||
Path bumpedChangesPathFile = Paths.get(bumpedVersionStringDirectory, "changes.json");
|
||||
String bumpedChangesStringFile = bumpedChangesPathFile.toString();
|
||||
File bumpedChangesFile = new File(bumpedChangesStringFile);
|
||||
JSONObject bumpedChangesUser = new JSONObject();
|
||||
// Don't add the `uid-` prefix.
|
||||
// https://github.com/ONLYOFFICE/document-server-integration/issues/437#issuecomment-1663526562
|
||||
bumpedChangesUser.put("id", user.getId());
|
||||
bumpedChangesUser.put("name", user.getName());
|
||||
JSONObject bumpedChangesChangesItem = new JSONObject();
|
||||
bumpedChangesChangesItem.put("created", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||
bumpedChangesChangesItem.put("user", bumpedChangesUser);
|
||||
JSONArray bumpedChangesChanges = new JSONArray();
|
||||
bumpedChangesChanges.add(bumpedChangesChangesItem);
|
||||
JSONObject bumpedChanges = new JSONObject();
|
||||
bumpedChanges.put("serverVersion", null);
|
||||
bumpedChanges.put("changes", bumpedChangesChanges);
|
||||
String bumpedChangesContent = bumpedChanges.toJSONString();
|
||||
FileWriter bumpedChangesFileWriter = new FileWriter(bumpedChangesFile);
|
||||
bumpedChangesFileWriter.write(bumpedChangesContent);
|
||||
bumpedChangesFileWriter.close();
|
||||
|
||||
String sourceExtension = fileUtility.getFileExtension(body.getFileName());
|
||||
String previousBasename = "prev" + sourceExtension;
|
||||
|
||||
Path bumpedFile = Paths.get(bumpedVersionStringDirectory, previousBasename);
|
||||
Files.move(sourcePathFile, bumpedFile);
|
||||
|
||||
String recoveryVersionStringDirectory = documentManager.versionDir(
|
||||
historyDirectory,
|
||||
body.getVersion(),
|
||||
true
|
||||
);
|
||||
Path recoveryPathFile = Paths.get(recoveryVersionStringDirectory, previousBasename);
|
||||
String recoveryStringFile = recoveryPathFile.toString();
|
||||
FileInputStream recoveryStream = new FileInputStream(recoveryStringFile);
|
||||
storageMutator.createFile(sourcePathFile, recoveryStream);
|
||||
recoveryStream.close();
|
||||
|
||||
JSONObject responseBody = new JSONObject();
|
||||
responseBody.put("error", null);
|
||||
responseBody.put("success", true);
|
||||
return responseBody.toJSONString();
|
||||
} catch (Exception error) {
|
||||
error.printStackTrace();
|
||||
JSONObject responseBody = new JSONObject();
|
||||
responseBody.put("error", error.getMessage());
|
||||
responseBody.put("success", false);
|
||||
return responseBody.toJSONString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,9 +127,9 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
if (!curExt.equals(downloadExt)) {
|
||||
try {
|
||||
String newFileUri = serviceConverter
|
||||
.getConvertedUri(downloadUri, downloadExt, curExt,
|
||||
.getConvertedData(downloadUri, downloadExt, curExt,
|
||||
serviceConverter.generateRevisionId(downloadUri), null, false,
|
||||
null); // convert a file and get URL to a new file
|
||||
null).getUri(); // convert a file and get URL to a new file
|
||||
if (newFileUri.isEmpty()) {
|
||||
newFileName = documentManager
|
||||
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName)
|
||||
@ -163,6 +163,8 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
|
||||
storageMutator.createDirectory(ver); // create the file version directory
|
||||
|
||||
lastVersion.toFile().renameTo(new File(versionDir + File.separator + "prev" + curExt));
|
||||
|
||||
saveFile(byteArrayFile, toSave); // save document file
|
||||
|
||||
byte[] byteArrayChanges = getDownloadFile(changesUri); // download file changes
|
||||
@ -211,7 +213,8 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
}
|
||||
|
||||
String headerToken;
|
||||
if (jwtManager.tokenEnabled()) { // check if a secret key to generate token exists or not
|
||||
// check if a secret key to generate token exists or not
|
||||
if (jwtManager.tokenEnabled() && jwtManager.tokenUseForRequest()) {
|
||||
Map<String, Object> payloadMap = new HashMap<>();
|
||||
payloadMap.put("payload", params);
|
||||
headerToken = jwtManager.createToken(payloadMap); // encode a payload object into a header token
|
||||
@ -276,8 +279,8 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
try {
|
||||
// convert file and get URL to a new file
|
||||
String newFileUri = serviceConverter
|
||||
.getConvertedUri(downloadUri, downloadExt, curExt, serviceConverter
|
||||
.generateRevisionId(downloadUri), null, false, null);
|
||||
.getConvertedData(downloadUri, downloadExt, curExt, serviceConverter
|
||||
.generateRevisionId(downloadUri), null, false, null).getUri();
|
||||
if (newFileUri.isEmpty()) {
|
||||
newFileName = true;
|
||||
} else {
|
||||
|
||||
@ -217,8 +217,14 @@ public class DefaultDocumentManager implements DocumentManager {
|
||||
public String createDemo(final String fileExt, final Boolean sample, final String uid, final String uname) {
|
||||
String demoName = (sample ? "sample." : "new.")
|
||||
+ fileExt; // create sample or new template file with the necessary extension
|
||||
String demoPath = "assets" + File.separator + (sample ? "sample" : "new")
|
||||
+ File.separator + demoName; // get the path to the sample document
|
||||
String demoPath =
|
||||
"assets"
|
||||
+ File.separator
|
||||
+ "document-templates"
|
||||
+ File.separator
|
||||
+ (sample ? "sample" : "new")
|
||||
+ File.separator
|
||||
+ demoName;
|
||||
|
||||
// get a file name with an index if the file with such a name already exists
|
||||
String fileName = getCorrectName(demoName);
|
||||
|
||||
@ -25,6 +25,7 @@ import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
|
||||
import com.onlyoffice.integration.documentserver.models.filemodel.Document;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
import com.onlyoffice.integration.documentserver.util.file.FileUtility;
|
||||
import com.onlyoffice.integration.documentserver.util.service.ServiceConverter;
|
||||
import lombok.SneakyThrows;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
@ -62,6 +63,9 @@ public class DefaultHistoryManager implements HistoryManager {
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Autowired
|
||||
private ServiceConverter serviceConverter;
|
||||
|
||||
// todo: Refactoring
|
||||
@SneakyThrows
|
||||
public String[] getHistory(final Document document) { // get document history
|
||||
@ -164,6 +168,153 @@ public class DefaultHistoryManager implements HistoryManager {
|
||||
return new String[]{"", ""};
|
||||
}
|
||||
|
||||
// todo: Refactoring
|
||||
@SneakyThrows
|
||||
public String getHistory(final String fileName) { // get document history
|
||||
|
||||
// get history directory
|
||||
String histDir = storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(fileName));
|
||||
Integer curVer = storagePathBuilder.getFileVersion(histDir, false); // get current file version
|
||||
|
||||
if (curVer > 0) { // check if the current file version is greater than 0
|
||||
List<Object> hist = new ArrayList<>();
|
||||
|
||||
for (Integer i = 1; i <= curVer; i++) { // run through all the file versions
|
||||
Map<String, Object> obj = new HashMap<String, Object>();
|
||||
String verDir = documentManager
|
||||
.versionDir(histDir, i, true); // get the path to the given file version
|
||||
|
||||
String key;
|
||||
if (i == curVer) {
|
||||
key = serviceConverter
|
||||
.generateRevisionId(storagePathBuilder.getStorageLocation()
|
||||
+ "/" + fileName + "/"
|
||||
+ new File(storagePathBuilder.getFileLocation(fileName)).lastModified());
|
||||
} else {
|
||||
key = readFileToEnd(new File(verDir + File.separator + "key.txt"));
|
||||
}
|
||||
|
||||
obj.put("key", key);
|
||||
obj.put("version", i);
|
||||
|
||||
if (i == 1) { // check if the version number is equal to 1
|
||||
String createdInfo = readFileToEnd(new File(histDir
|
||||
+ File.separator + "createdInfo.json")); // get file with meta data
|
||||
JSONObject json = (JSONObject) parser.parse(createdInfo); // and turn it into json object
|
||||
|
||||
// write meta information to the object (user information and creation date)
|
||||
obj.put("created", json.get("created"));
|
||||
Map<String, Object> user = new HashMap<String, Object>();
|
||||
user.put("id", json.get("id"));
|
||||
user.put("name", json.get("name"));
|
||||
obj.put("user", user);
|
||||
}
|
||||
|
||||
if (i > 1) { //check if the version number is greater than 1
|
||||
// if so, get the path to the changes.json file
|
||||
JSONObject changes = (JSONObject) parser.parse(readFileToEnd(new File(documentManager
|
||||
.versionDir(histDir, i - 1, true) + File.separator + "changes.json")));
|
||||
JSONObject change = (JSONObject) ((JSONArray) changes.get("changes")).get(0);
|
||||
|
||||
// write information about changes to the object
|
||||
obj.put("changes", changes.get("changes"));
|
||||
obj.put("serverVersion", changes.get("serverVersion"));
|
||||
obj.put("created", change.get("created"));
|
||||
obj.put("user", change.get("user"));
|
||||
}
|
||||
|
||||
hist.add(obj);
|
||||
}
|
||||
|
||||
// write history information about the current file version to the history object
|
||||
Map<String, Object> histObj = new HashMap<String, Object>();
|
||||
histObj.put("currentVersion", curVer);
|
||||
histObj.put("history", hist);
|
||||
|
||||
try {
|
||||
return objectMapper.writeValueAsString(histObj);
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// todo: Refactoring
|
||||
@SneakyThrows
|
||||
public String getHistoryData(final String fileName, final String version, final Boolean directUrl) {
|
||||
// get history directory
|
||||
String histDir = storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(fileName));
|
||||
Integer curVer = storagePathBuilder.getFileVersion(histDir, false); // get current file version
|
||||
|
||||
if (curVer > 0) { // check if the current file version is greater than 0
|
||||
Map<String, Object> histData = new HashMap<>();
|
||||
|
||||
for (Integer i = 1; i <= curVer; i++) { // run through all the file versions
|
||||
Map<String, Object> dataObj = new HashMap<String, Object>();
|
||||
String verDir = documentManager
|
||||
.versionDir(histDir, i, true); // get the path to the given file version
|
||||
|
||||
String key;
|
||||
if (i == curVer) {
|
||||
key = serviceConverter
|
||||
.generateRevisionId(storagePathBuilder.getStorageLocation()
|
||||
+ "/" + fileName + "/"
|
||||
+ new File(storagePathBuilder.getFileLocation(fileName)).lastModified());
|
||||
} else {
|
||||
key = readFileToEnd(new File(verDir + File.separator + "key.txt"));
|
||||
}
|
||||
|
||||
dataObj.put("fileType", fileUtility
|
||||
.getFileExtension(fileName).replace(".", ""));
|
||||
dataObj.put("key", key);
|
||||
dataObj.put("url", i == curVer ? documentManager.getDownloadUrl(fileName, true)
|
||||
: documentManager.getHistoryFileUrl(fileName, i, "prev" + fileUtility
|
||||
.getFileExtension(fileName), true));
|
||||
if (directUrl) {
|
||||
dataObj.put("directUrl", i == curVer
|
||||
? documentManager.getDownloadUrl(fileName, false)
|
||||
: documentManager.getHistoryFileUrl(fileName, i, "prev" + fileUtility
|
||||
.getFileExtension(fileName), false));
|
||||
}
|
||||
dataObj.put("version", i);
|
||||
|
||||
if (i > 1) { //check if the version number is greater than 1
|
||||
// get the history data from the previous file version
|
||||
Map<String, Object> prev = (Map<String, Object>) histData.get(Integer.toString(i - 1));
|
||||
Map<String, Object> prevInfo = new HashMap<String, Object>();
|
||||
prevInfo.put("fileType", prev.get("fileType"));
|
||||
prevInfo.put("key", prev.get("key")); // write key and URL information about previous file version
|
||||
prevInfo.put("url", prev.get("url"));
|
||||
if (directUrl) {
|
||||
prevInfo.put("directUrl", prev.get("directUrl"));
|
||||
}
|
||||
|
||||
// write information about previous file version to the data object
|
||||
dataObj.put("previous", prevInfo);
|
||||
// write the path to the diff.zip archive with differences in this file version
|
||||
Integer verdiff = i - 1;
|
||||
dataObj.put("changesUrl", documentManager
|
||||
.getHistoryFileUrl(fileName, verdiff, "diff.zip", true));
|
||||
}
|
||||
|
||||
if (jwtManager.tokenEnabled()) {
|
||||
dataObj.put("token", jwtManager.createToken(dataObj));
|
||||
}
|
||||
|
||||
histData.put(Integer.toString(i), dataObj);
|
||||
}
|
||||
|
||||
try {
|
||||
return objectMapper.writeValueAsString(histData.get(version));
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
// read a file
|
||||
private String readFileToEnd(final File file) {
|
||||
String output = "";
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
|
||||
package com.onlyoffice.integration.documentserver.managers.history;
|
||||
|
||||
import com.onlyoffice.integration.documentserver.models.filemodel.Document;
|
||||
|
||||
// specify the history manager functions
|
||||
public interface HistoryManager {
|
||||
String[] getHistory(Document document); // get document history
|
||||
String getHistory(String fileName); // get document history
|
||||
|
||||
String getHistoryData(String fileName, String version, Boolean directUrl); // get document history data
|
||||
}
|
||||
|
||||
@ -37,6 +37,8 @@ import java.util.Map;
|
||||
public class DefaultJwtManager implements JwtManager {
|
||||
@Value("${files.docservice.secret}")
|
||||
private String tokenSecret;
|
||||
@Value("${files.docservice.token-use-for-request}")
|
||||
private String tokenUseForRequest;
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
@Autowired
|
||||
@ -62,6 +64,10 @@ public class DefaultJwtManager implements JwtManager {
|
||||
return tokenSecret != null && !tokenSecret.isEmpty();
|
||||
}
|
||||
|
||||
public boolean tokenUseForRequest() {
|
||||
return Boolean.parseBoolean(tokenUseForRequest) && !tokenUseForRequest.isEmpty();
|
||||
}
|
||||
|
||||
// read document token
|
||||
public JWT readToken(final String token) {
|
||||
try {
|
||||
@ -84,7 +90,7 @@ public class DefaultJwtManager implements JwtManager {
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException("{\"error\":1,\"message\":\"JSON Parsing error\"}");
|
||||
}
|
||||
if (tokenEnabled()) { // check if the token is enabled
|
||||
if (tokenEnabled() && tokenUseForRequest()) { // check if the token is enabled
|
||||
String token = (String) body.get("token"); // get token from the body
|
||||
if (token == null) { // if token is empty
|
||||
if (header != null && !header.isBlank()) { // and the header is defined
|
||||
|
||||
@ -26,6 +26,7 @@ import java.util.Map;
|
||||
// specify the jwt manager functions
|
||||
public interface JwtManager {
|
||||
boolean tokenEnabled(); // check if the token is enabled
|
||||
boolean tokenUseForRequest(); // check if the token is enabled
|
||||
String createToken(Map<String, Object> payloadClaims); // create document token
|
||||
JWT readToken(String token); // read document token
|
||||
JSONObject parseBody(String payload, String header); // parse the body
|
||||
|
||||
@ -27,5 +27,6 @@ public enum Action {
|
||||
comment,
|
||||
chat,
|
||||
fillForms,
|
||||
blockcontent
|
||||
blockcontent,
|
||||
protect
|
||||
}
|
||||
|
||||
@ -25,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@Getter
|
||||
@ -43,4 +45,5 @@ public class Document { // the parameters pertaining to the document (title, ur
|
||||
as file name when the document is downloaded */
|
||||
private String url; // the absolute URL where the source viewed or edited document is stored
|
||||
private String directUrl;
|
||||
private HashMap<String, Object> referenceData;
|
||||
}
|
||||
|
||||
@ -51,4 +51,5 @@ public class Permission extends AbstractModel { // the permission for the docum
|
||||
private CommentGroup commentGroups; // the groups whose comments the user can edit, remove and/or view
|
||||
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
|
||||
private List<String> userInfoGroups;
|
||||
private Boolean protect = true;
|
||||
}
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.documentserver.models.filemodel;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class ReferenceData {
|
||||
@Autowired
|
||||
private FileStoragePathBuilder storagePathBuilder;
|
||||
private final String instanceId;
|
||||
private final Map<String, String> fileKey;
|
||||
public ReferenceData(final String fileName, final String curUserHostAddress, final User user) {
|
||||
instanceId = storagePathBuilder.getServerUrl(true);
|
||||
Map<String, String> fileKeyList = new HashMap<>();
|
||||
if (!user.getId().equals("uid-0")) {
|
||||
fileKeyList.put("fileName", fileName);
|
||||
fileKeyList.put("userAddress", curUserHostAddress);
|
||||
} else {
|
||||
fileKeyList = null;
|
||||
}
|
||||
fileKey = fileKeyList;
|
||||
}
|
||||
}
|
||||
@ -23,6 +23,7 @@ import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
|
||||
import com.onlyoffice.integration.documentserver.models.enums.ConvertErrorType;
|
||||
import com.onlyoffice.integration.documentserver.util.file.FileUtility;
|
||||
import com.onlyoffice.integration.dto.Convert;
|
||||
import com.onlyoffice.integration.dto.ConvertedData;
|
||||
import lombok.SneakyThrows;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
@ -105,17 +106,17 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
|
||||
connection.connect();
|
||||
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
os.write(bodyByte); // write bytes to the output stream
|
||||
os.flush(); // force write data to the output stream that can be cached in the current thread
|
||||
}
|
||||
|
||||
int statusCode = connection.getResponseCode();
|
||||
if (statusCode != HttpStatus.OK.value()) { // checking status code
|
||||
connection.disconnect();
|
||||
throw new RuntimeException("Convertation service returned status: " + statusCode);
|
||||
}
|
||||
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
os.write(bodyByte); // write bytes to the output stream
|
||||
os.flush(); // force write data to the output stream that can be cached in the current thread
|
||||
}
|
||||
|
||||
response = connection.getInputStream(); // get the input stream
|
||||
jsonString = convertStreamToString(response); // convert the response stream into a string
|
||||
} finally {
|
||||
@ -125,9 +126,9 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
}
|
||||
|
||||
// get the URL to the converted file
|
||||
public String getConvertedUri(final String documentUri, final String fromExtension,
|
||||
final String toExtension, final String documentRevisionId,
|
||||
final String filePass, final Boolean isAsync, final String lang) {
|
||||
public ConvertedData getConvertedData(final String documentUri, final String fromExtension,
|
||||
final String toExtension, final String documentRevisionId,
|
||||
final String filePass, final Boolean isAsync, final String lang) {
|
||||
// check if the fromExtension parameter is defined; if not, get it from the document url
|
||||
String fromExt = fromExtension == null || fromExtension.isEmpty()
|
||||
? fileUtility.getFileExtension(documentUri) : fromExtension;
|
||||
@ -155,7 +156,7 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
}
|
||||
|
||||
String headerToken = "";
|
||||
if (jwtManager.tokenEnabled()) {
|
||||
if (jwtManager.tokenEnabled() && jwtManager.tokenUseForRequest()) {
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("region", lang);
|
||||
map.put("url", body.getUrl());
|
||||
@ -179,7 +180,7 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
|
||||
String jsonString = postToServer(body, headerToken);
|
||||
|
||||
return getResponseUri(jsonString);
|
||||
return getResponseData(jsonString);
|
||||
}
|
||||
|
||||
// generate document key
|
||||
@ -203,7 +204,7 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
|
||||
// get the response URL
|
||||
@SneakyThrows
|
||||
private String getResponseUri(final String jsonString) {
|
||||
private ConvertedData getResponseData(final String jsonString) {
|
||||
JSONObject jsonObj = convertStringToJSON(jsonString);
|
||||
|
||||
Object error = jsonObj.get("error");
|
||||
@ -216,10 +217,15 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
|
||||
Long resultPercent = 0L;
|
||||
String responseUri = null;
|
||||
String responseFileType = null;
|
||||
ConvertedData convertedData = new ConvertedData("", "");
|
||||
|
||||
if (isEndConvert) { // if the conversion is completed
|
||||
resultPercent = FULL_LOADING_IN_PERCENT;
|
||||
responseUri = (String) jsonObj.get("fileUrl"); // get the file URL
|
||||
responseFileType = (String) jsonObj.get("fileType"); // get the file type
|
||||
convertedData.setUri(responseUri);
|
||||
convertedData.setFileType(responseFileType);
|
||||
} else { // if the conversion isn't completed
|
||||
resultPercent = (Long) jsonObj.get("percent");
|
||||
|
||||
@ -227,7 +233,7 @@ public class DefaultServiceConverter implements ServiceConverter {
|
||||
resultPercent = resultPercent >= FULL_LOADING_IN_PERCENT ? FULL_LOADING_IN_PERCENT - 1 : resultPercent;
|
||||
}
|
||||
|
||||
return resultPercent >= FULL_LOADING_IN_PERCENT ? responseUri : "";
|
||||
return convertedData;
|
||||
}
|
||||
|
||||
// convert stream to string
|
||||
|
||||
@ -18,15 +18,16 @@
|
||||
|
||||
package com.onlyoffice.integration.documentserver.util.service;
|
||||
|
||||
import com.onlyoffice.integration.dto.ConvertedData;
|
||||
import org.json.simple.JSONObject;
|
||||
import java.io.InputStream;
|
||||
|
||||
|
||||
// specify the converter service functions
|
||||
public interface ServiceConverter {
|
||||
String getConvertedUri(String documentUri, String fromExtension, // get the URL to the converted file
|
||||
String toExtension, String documentRevisionId,
|
||||
String filePass, Boolean isAsync, String lang);
|
||||
ConvertedData getConvertedData(String documentUri, String fromExtension, // get the URL to the converted file
|
||||
String toExtension, String documentRevisionId,
|
||||
String filePass, Boolean isAsync, String lang);
|
||||
String generateRevisionId(String expectedKey); // generate document key
|
||||
String convertStreamToString(InputStream stream); // convert stream to string
|
||||
JSONObject convertStringToJSON(String jsonString); // convert string to json
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ConvertedData {
|
||||
private String uri;
|
||||
private String fileType;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Reference {
|
||||
private Boolean directUrl;
|
||||
private ReferenceData referenceData;
|
||||
private String path;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReferenceData {
|
||||
private String fileKey;
|
||||
private String instanceId;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Rename {
|
||||
private String fileName;
|
||||
private String fileKey;
|
||||
private String fileType;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Restore {
|
||||
private String fileName;
|
||||
private Integer version;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
/**
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.onlyoffice.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SaveAs {
|
||||
private String title;
|
||||
private String url;
|
||||
}
|
||||
@ -52,4 +52,5 @@ public class Permission extends AbstractEntity {
|
||||
private List<Group> commentsRemoveGroups;
|
||||
@ManyToMany
|
||||
private List<Group> userInfoGroups;
|
||||
private Boolean protect = true;
|
||||
}
|
||||
|
||||
@ -38,7 +38,8 @@ public class PermissionServices {
|
||||
final List<Group> commentEditGroups,
|
||||
final List<Group> commentRemoveGroups,
|
||||
final List<Group> userInfoGroups,
|
||||
final Boolean chat) {
|
||||
final Boolean chat,
|
||||
final Boolean protect) {
|
||||
|
||||
Permission permission = new Permission();
|
||||
permission.setReviewGroups(reviewGroups); // define the groups whose changes the user can accept/reject
|
||||
@ -48,6 +49,7 @@ public class PermissionServices {
|
||||
whose comments the user can remove */
|
||||
permission.setUserInfoGroups(userInfoGroups);
|
||||
permission.setChat(chat);
|
||||
permission.setProtect(protect);
|
||||
|
||||
permissionRepository.save(permission); // save new permissions
|
||||
|
||||
|
||||
@ -57,7 +57,8 @@ public class UserServices {
|
||||
final List<String> editGroups,
|
||||
final List<String> removeGroups,
|
||||
final List<String> userInfoGroups, final Boolean favoriteDoc,
|
||||
final Boolean chat) {
|
||||
final Boolean chat,
|
||||
final Boolean protect) {
|
||||
User newUser = new User();
|
||||
newUser.setName(name); // set the user name
|
||||
newUser.setEmail(email); // set the user email
|
||||
@ -81,7 +82,8 @@ public class UserServices {
|
||||
commentGroupsEdit,
|
||||
commentGroupsRemove,
|
||||
usInfoGroups,
|
||||
chat); // specify permissions for the current user
|
||||
chat,
|
||||
protect); // specify permissions for the current user
|
||||
newUser.setPermissions(permission);
|
||||
|
||||
userRepository.save(newUser); // save a new user
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
package com.onlyoffice.integration.services.configurers.implementations;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.onlyoffice.integration.documentserver.models.filemodel.Document;
|
||||
import com.onlyoffice.integration.documentserver.models.filemodel.Permission;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
@ -31,6 +32,8 @@ import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
@Primary
|
||||
@ -71,7 +74,20 @@ public class DefaultDocumentConfigurer implements DocumentConfigurer<DefaultDocu
|
||||
+ "/" + fileName + "/"
|
||||
+ new File(storagePathBuilder.getFileLocation(fileName)).lastModified());
|
||||
|
||||
Gson gson = new Gson();
|
||||
HashMap<String, String> fileKey = new HashMap<>();
|
||||
fileKey.put("fileName", fileName);
|
||||
try {
|
||||
fileKey.put("userAddress", InetAddress.getLocalHost().getHostAddress());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
HashMap<String, Object> referenceData = new HashMap<>();
|
||||
referenceData.put("instanceId", storagePathBuilder.getServerUrl(true));
|
||||
referenceData.put("fileKey", gson.toJson(fileKey));
|
||||
|
||||
document.setKey(key); // set the key to the document config
|
||||
document.setPermissions(permission); // set the permission parameters to the document config
|
||||
document.setReferenceData(referenceData);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
package com.onlyoffice.integration.services.configurers.wrappers;
|
||||
|
||||
import com.onlyoffice.integration.documentserver.models.filemodel.Permission;
|
||||
import com.onlyoffice.integration.documentserver.models.filemodel.ReferenceData;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@ -29,4 +30,5 @@ public class DefaultDocumentWrapper {
|
||||
private String fileName;
|
||||
private Boolean favorite;
|
||||
private Boolean isEnableDirectUrl;
|
||||
private ReferenceData referenceData;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
server.version=1.5.0
|
||||
server.version=1.6.0
|
||||
|
||||
server.address=
|
||||
server.port=4000
|
||||
@ -8,10 +8,10 @@ filesize-max=5242880
|
||||
files.storage=
|
||||
files.storage.folder=documents
|
||||
|
||||
files.docservice.fillforms-docs=.oform|.docx
|
||||
files.docservice.viewed-docs=.pdf|.djvu|.xps|.oxps
|
||||
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt|.docxf
|
||||
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.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
|
||||
files.docservice.fillforms-docs=.docx|.oform
|
||||
files.docservice.viewed-docs=.djvu|.oxps|.pdf|.xps
|
||||
files.docservice.edited-docs=.csv|.docm|.docx|.docxf|.dotm|.dotx|.epub|.fb2|.html|.odp|.ods|.odt|.otp|.ots|.ott|.potm|.potx|.ppsm|.ppsx|.pptm|.pptx|.rtf|.txt|.xlsm|.xlsx|.xltm|.xltx
|
||||
files.docservice.convert-docs=.doc|.dot|.dps|.dpt|.epub|.et|.ett|.fb2|.fodp|.fods|.fodt|.htm|.html|.mht|.mhtml|.odp|.ods|.odt|.otp|.ots|.ott|.pot|.pps|.ppt|.rtf|.stw|.sxc|.sxi|.sxw|.wps|.wpt|.xls|.xlsb|.xlt|.xml
|
||||
files.docservice.timeout=120000
|
||||
files.docservice.history.postfix=-hist
|
||||
|
||||
@ -24,10 +24,11 @@ files.docservice.url.example=
|
||||
|
||||
files.docservice.secret=
|
||||
files.docservice.header=Authorization
|
||||
files.docservice.token-use-for-request=true
|
||||
|
||||
files.docservice.verify-peer-off=true
|
||||
|
||||
files.docservice.languages=en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (People's Republic of China)|zh-TW:Chinese (Traditional, Taiwan)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lv:Latvian|lo:Lao|ms:Malay (Malaysia)|nb:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language
|
||||
files.docservice.languages=en:English|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language
|
||||
|
||||
spring.datasource.url=jdbc:h2:mem:usersdb
|
||||
spring.datasource.driverClassName=org.h2.Driver
|
||||
@ -37,6 +38,8 @@ spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||
hibernate.ddl-auto
|
||||
spring.h2.console.enabled=true
|
||||
spring.h2.console.path=/h2
|
||||
spring.servlet.multipart.max-file-size=5MB
|
||||
spring.servlet.multipart.max-request-size=5MB
|
||||
|
||||
url.index=/
|
||||
url.converter=/converter
|
||||
|
||||
@ -668,4 +668,9 @@
|
||||
.main-panel > span{
|
||||
max-width:15%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
||||
.tableRow td:first-child{
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
web/documentserver-example/java-spring/src/main/resources/static/scripts/jquery-3.6.4.min.js
vendored
Normal file
2
web/documentserver-example/java-spring/src/main/resources/static/scripts/jquery-3.6.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -211,14 +211,10 @@ if (typeof jQuery !== "undefined") {
|
||||
setCookie("ulang", langSel.val());
|
||||
});
|
||||
if(!userId){
|
||||
jq(document).on("ready",function(){
|
||||
setCookie("uid",1)
|
||||
})
|
||||
setCookie("uid",1);
|
||||
}
|
||||
if(!langId){
|
||||
jq(document).on("ready",function () {
|
||||
setCookie("ulang","en")
|
||||
})
|
||||
setCookie("ulang","en");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
// the user is trying to switch the document from the viewing into the editing mode
|
||||
var onRequestEditRights = function () {
|
||||
location.href = location.href.replace(RegExp("\&?action=view\&?", "i"), "");
|
||||
location.href = location.href.replace(RegExp("\&?action=view", "i"), "");
|
||||
};
|
||||
|
||||
// an error or some other specific event occurs
|
||||
@ -147,9 +147,9 @@
|
||||
|
||||
var newfilename = event.data;
|
||||
var data = {
|
||||
newfilename: newfilename,
|
||||
dockey: config.document.key,
|
||||
ext: config.document.fileType
|
||||
fileName: newfilename,
|
||||
fileKey: config.document.key,
|
||||
fileType: config.document.fileType
|
||||
};
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "rename");
|
||||
@ -160,12 +160,81 @@
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestReferenceData = function(event) { // user refresh external data source
|
||||
event.data.directUrl = !!config.document.directUrl;
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "reference");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send(JSON.stringify(event.data));
|
||||
xhr.onload = function () {
|
||||
innerAlert(xhr.responseText);
|
||||
docEditor.setReferenceData(JSON.parse(xhr.responseText));
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestHistory = function () {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "history?fileName=" + config.document.title, false);
|
||||
xhr.send();
|
||||
|
||||
if (xhr.status == 200) {
|
||||
var historyInfo = JSON.parse(xhr.responseText);
|
||||
docEditor.refreshHistory(historyInfo);
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestHistoryData = function (event) {
|
||||
var version = event.data;
|
||||
var historyDataUri = "historydata?fileName=" + config.document.title
|
||||
+ "&version=" + version
|
||||
+ "&directUrl=" + !!config.document.directUrl;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", historyDataUri, false);
|
||||
xhr.send();
|
||||
|
||||
if (xhr.status == 200) {
|
||||
var historyData = JSON.parse(xhr.responseText);
|
||||
docEditor.setHistoryData(historyData);
|
||||
}
|
||||
};
|
||||
|
||||
var onRequestHistoryClose = function() {
|
||||
document.location.reload();
|
||||
};
|
||||
|
||||
function onRequestRestore(event) {
|
||||
const query = new URLSearchParams(window.location.search)
|
||||
const payload = {
|
||||
fileName: query.get('fileName'),
|
||||
version: event.data.version
|
||||
}
|
||||
const request = new XMLHttpRequest()
|
||||
request.open('PUT', 'restore')
|
||||
request.setRequestHeader('Content-Type', 'application/json')
|
||||
request.send(JSON.stringify(payload))
|
||||
request.onload = function () {
|
||||
const response = JSON.parse(request.responseText);
|
||||
if (response.success && !response.error) {
|
||||
var historyInfoUri = "history?fileName=" + config.document.title;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", historyInfoUri, false);
|
||||
xhr.send();
|
||||
|
||||
if (xhr.status == 200) {
|
||||
var historyInfo = JSON.parse(xhr.responseText);
|
||||
docEditor.refreshHistory(historyInfo);
|
||||
}
|
||||
} else {
|
||||
innerAlert(response.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config.width = "100%";
|
||||
config.height = "100%";
|
||||
config.events = {
|
||||
"onAppReady": onAppReady,
|
||||
"onDocumentStateChange": onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
"onError": onError,
|
||||
"onOutdatedVersion": onOutdatedVersion,
|
||||
"onMakeActionLink": onMakeActionLink,
|
||||
@ -173,30 +242,15 @@
|
||||
"onRequestInsertImage": onRequestInsertImage,
|
||||
"onRequestCompareFile": onRequestCompareFile,
|
||||
"onRequestMailMergeRecipients": onRequestMailMergeRecipients,
|
||||
"onRequestRestore": onRequestRestore,
|
||||
"onRequestHistory": onRequestHistory,
|
||||
"onRequestHistoryData": onRequestHistoryData,
|
||||
"onRequestHistoryClose": onRequestHistoryClose
|
||||
};
|
||||
|
||||
var histArray = [[${fileHistory}]];
|
||||
var hist = histArray[0];
|
||||
var historyData = histArray[1];
|
||||
var usersForMentions = [[${usersForMentions}]];
|
||||
|
||||
if (config.editorConfig.user.id != 4) {
|
||||
if (hist && historyData) {
|
||||
// the user is trying to show the document version history
|
||||
config.events['onRequestHistory'] = function () {
|
||||
docEditor.refreshHistory(JSON.parse(hist)); // show the document version history
|
||||
};
|
||||
// the user is trying to click the specific document version in the document version history
|
||||
config.events['onRequestHistoryData'] = function (event) {
|
||||
var ver = event.data;
|
||||
var histData = historyData;
|
||||
docEditor.setHistoryData(JSON.parse(histData)[ver - 1]); // send the link to the document for viewing the version history
|
||||
};
|
||||
// the user is trying to go back to the document from viewing the document version history
|
||||
config.events['onRequestHistoryClose'] = function () {
|
||||
document.location.reload();
|
||||
};
|
||||
}
|
||||
// add mentions for not anonymous users
|
||||
config.events['onRequestUsers'] = function () {
|
||||
docEditor.setUsers({ // set a list of users to mention in the comments
|
||||
@ -211,6 +265,9 @@
|
||||
};
|
||||
// prevent file renaming for anonymous users
|
||||
config.events['onRequestRename'] = onRequestRename;
|
||||
config.events['onRequestReferenceData'] = onRequestReferenceData;
|
||||
// prevent switch the document from the viewing into the editing mode for anonymous users
|
||||
config.events['onRequestEditRights'] = onRequestEditRights;
|
||||
}
|
||||
|
||||
if (config.editorConfig.createUrl) {
|
||||
|
||||
@ -333,7 +333,8 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script type="text/javascript" src="scripts/jquery-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery-3.6.4.min.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery-migrate-3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery-ui.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery.blockUI.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery.iframe-transport.js"></script>
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
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
|
||||
@ -16,6 +12,14 @@ jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https:
|
||||
License: MIT
|
||||
License File: jQuery.iframe-transport.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.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
|
||||
License: OpenJS
|
||||
License File: jQuery.Migrate.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
|
||||
|
||||
@ -140,11 +140,7 @@ See the detailed guide to learn how to [install Document Server for Linux](https
|
||||
|
||||
### Step 2. Install the prerequisites and run the website with the editors
|
||||
|
||||
1. Install **Java**:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
|
||||
```
|
||||
1. Install **Java** following the instructions [here](https://docs.oracle.com/en/java/javase/20/install/installation-jdk-linux-platforms.html#GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8).
|
||||
|
||||
2. Download the archive with the Java example and unpack the archive:
|
||||
|
||||
@ -241,13 +237,39 @@ Make sure that the Document Server has access to the server with the example ins
|
||||
|
||||
## For Docker
|
||||
|
||||
1. Edit the *settings.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed ([installation instructions](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx)).
|
||||
### Step 1. Install ONLYOFFICE Docs
|
||||
|
||||
Download and install ONLYOFFICE Docs (packaged as Document Server).
|
||||
|
||||
See the detailed guide to learn how to install Document Server [for Docker](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx).
|
||||
|
||||
### Step 2. Install the prerequisites and run the website with the editors
|
||||
|
||||
1. Install **Java** following the instructions [here](https://docs.oracle.com/en/java/javase/20/install/installation-jdk-linux-platforms.html#GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8).
|
||||
|
||||
2. Download the archive with the Java example and unpack the archive:
|
||||
|
||||
```
|
||||
wget https://api.onlyoffice.com/app_data/editor/Java%20Example.zip
|
||||
```
|
||||
|
||||
```
|
||||
unzip Java\ Example.zip
|
||||
```
|
||||
|
||||
3. Change the current directory for the project directory:
|
||||
|
||||
```
|
||||
cd Java\ Example/
|
||||
```
|
||||
|
||||
4. Edit the *settings.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed:
|
||||
|
||||
```
|
||||
nano src/main/resources/settings.properties
|
||||
```
|
||||
|
||||
2. Edit the following lines:
|
||||
5. Edit the following lines:
|
||||
|
||||
```
|
||||
storage-folder = app_data
|
||||
@ -256,13 +278,19 @@ Make sure that the Document Server has access to the server with the example ins
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storage-folder** is the path where files will be created and stored.
|
||||
|
||||
3. Run the next command in the Java example directory:
|
||||
6. Run the next command in the Java example directory:
|
||||
|
||||
```
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
4. After it, all the *bin* files will be passed to the *./target* folder.
|
||||
7. After it, all the *bin* files will be passed to the *./target* folder.
|
||||
|
||||
### Step 3. Check accessibility
|
||||
|
||||
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files.
|
||||
|
||||
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
|
||||
|
||||
## Important security info
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user