Compare commits

...

82 Commits

Author SHA1 Message Date
a536fdf6ab nodejs: max key length - 120 2019-02-22 15:54:07 +03:00
71103b802e java: send jwt token in body 2019-02-21 14:27:59 +03:00
0b33ce14f7 node: fix Bug 36489 - Files with non ascii symbols were unable to download 2019-02-21 11:47:51 +03:00
a945870c6a java: jwt in headers 2019-02-20 14:55:35 +03:00
cafaa27e92 java: json passed to docserver contained escaped parameters 2019-02-20 14:50:38 +03:00
d22d2ace22 Merge pull request #57 from flaminestone/feature/delete_dockerfile
Delete dockerfile, and move building to docker-compose
2019-02-13 16:27:48 +03:00
430a16b543 Delete dockerfile, and move building to docker-compose 2019-02-13 16:17:41 +03:00
d2a89f4a5f Merge pull request #56 from flaminestone/feature/add_docker_compose_for_java
Add docker-compose file for easy building
2019-02-13 13:43:35 +03:00
efda987b55 Add docker-compose file for easy building 2019-02-13 13:34:20 +03:00
20827e4d76 v5.2.8 2019-02-05 16:23:22 +03:00
16473b4e06 2019 2019-01-22 18:17:07 +03:00
30d26df97d Merge remote-tracking branch 'remotes/origin/hotfix/v5.2.8' into develop 2019-01-22 09:28:29 +03:00
9fb0289af4 onAppReady (Fixed #54) 2019-01-22 09:23:29 +03:00
fa8e2cf975 [[copyright] Update Copyright
2018 -> 2019. Limited -> SIA
2019-01-17 17:32:01 +03:00
68f6be2e43 nodejs: check file existence 2018-12-03 18:38:33 +03:00
87381123e3 v5.2.3 2018-10-30 13:01:36 +03:00
7d79efe1f1 release/v5.2.0 2018-09-27 19:07:46 +03:00
04c3ff5895 Fix Bug 38447 long loading page 2018-08-30 15:57:09 +03:00
e3eb837f45 fix link in header 2018-08-30 15:54:27 +03:00
c96205b4da fix link in header 2018-08-30 14:30:17 +03:00
2c5ee77c08 php: pure php config 2018-08-30 14:27:10 +03:00
4dc137cf96 ppsx is not editable 2018-08-17 10:44:27 +03:00
f8003e75ec java: 3rd party license 2018-08-06 17:16:32 +03:00
cb2414140a java: jwt in conversion 2018-08-06 16:37:32 +03:00
d1f63976cb java: conversion params to body 2018-08-06 16:13:13 +03:00
4276caf87d java: fix process error 2018-08-06 16:12:10 +03:00
d5571a3f2e java: jwt in config 2018-08-06 15:03:58 +03:00
3582109cf7 java: jwt in track 2018-08-06 15:02:46 +03:00
10ecddbe61 java: building configuration on server 2018-08-03 15:25:19 +03:00
5a4dea7bfc java: deleted extra parameters 2018-08-03 12:18:42 +03:00
911da29ecb java: fix switch view mode to edit 2018-08-03 12:13:24 +03:00
37fe8eb4d5 java: fix string compare 2018-08-02 16:42:12 +03:00
633fd6efc9 java: format 2018-08-02 13:59:19 +03:00
a758d3f294 nodejs: version count to hint 2018-07-20 13:07:24 +03:00
0245c992a3 nodejs: fillForms only mode 2018-07-20 12:29:50 +03:00
04cad3f10f nodejs: fix unique key 2018-05-24 16:05:44 +03:00
cb60398051 nodejs: correct result 2018-05-24 16:05:44 +03:00
f46b6a7c8c nodejs: fix content type in conversion request 2018-05-24 16:05:14 +03:00
4872a74d13 nodejs: disable cache in ajax 2018-05-24 16:05:06 +03:00
b00ed15051 Java: formating 2018-05-24 16:03:43 +03:00
0cbc290fbe java: using GetServerUrl 2018-05-24 16:03:42 +03:00
cb065bc4db v5.1.4 2018-05-24 15:34:47 +03:00
4712057faa Merge pull request #48 from flaminestone/develop
Thx
2018-05-24 14:21:21 +03:00
2e9842d559 nodejs: jwt in request body 2018-05-11 15:44:27 +03:00
0078c05a74 Add folder for bin files after build and add README.md file 2018-05-03 18:13:56 +03:00
aa8a143338 java: change version 2018-04-27 15:21:00 +03:00
a999b20588 java: fix path separator 2018-04-27 15:20:05 +03:00
cab5f62201 v5.1.3 2018-04-26 18:26:25 +03:00
95d33f3ee7 v5.1.3 2018-04-26 18:23:53 +03:00
83c03c97db php: fix filename in url (178133a292) 2018-04-24 17:42:27 +03:00
7b1c56ea2c php: replace download url 2018-04-24 17:32:31 +03:00
178133a292 php: fix filename in url 2018-04-24 16:55:16 +03:00
f9232788b2 php: using current scheme 2018-04-24 16:54:38 +03:00
c0f8caaf0b nodejs: comment only for spreadsheet editor 2018-04-19 19:06:40 +03:00
fbb23a5872 recognize type of otf 2018-04-16 15:58:00 +03:00
ec764e0f0e OpenDocument template 2018-04-16 15:58:00 +03:00
d08d887392 v5.1.2 2018-04-11 14:28:01 +03:00
b039b16fd9 v5.1.2 2018-04-11 14:26:31 +03:00
1df7cc54c1 Merge branch 'develop' of github.com:ONLYOFFICE/document-server-integration into develop 2018-04-06 15:00:12 +03:00
cf6d11bf4e nodejs: comment only for presentation editor 2018-04-06 14:57:07 +03:00
8793235481 v5.1.1 2018-04-05 15:56:59 +03:00
232fc0d156 Java: fix encoding space 2018-04-05 11:12:24 +03:00
b1352bd897 remove unusing code 2018-03-29 11:52:01 +03:00
d8e1d4d6b7 Merge pull request #44 from ONLYOFFICE/feature/otf
Feature/otf
2018-03-28 16:36:50 +03:00
fc2db9b47f v5.1.0 2018-03-28 12:09:01 +03:00
c0b8e2e578 v5.1.0 2018-03-28 12:06:45 +03:00
fa4c3e3258 nodejs: upload big file 2018-03-27 17:34:17 +03:00
6d1bda75b9 recognize type of otf 2018-03-27 10:41:35 +03:00
db9287263c OpenDocument template 2018-03-19 12:31:58 +03:00
6e1cef27cc nodejs: Add var body; 2018-03-16 14:40:26 +03:00
ceb4db9de6 https://documentserver/ 2018-03-15 14:13:47 +03:00
68c2ae0444 use strict (9c4fc0347f) 2018-03-15 13:31:31 +03:00
30bdc7497a zip with subfolder 2018-03-15 13:30:35 +03:00
67a53ea5c8 Fix Bug 37017 - single file uploads 2018-03-06 16:28:28 +03:00
043ab4251c Merge pull request #42 from ONLYOFFICE/feature/update-year-2018
Update copyright and footer info to 2018 year
2018-03-01 14:08:20 +03:00
20412f0c80 Update copyright and footer info to 2018 year 2018-03-01 12:41:44 +03:00
3792599e41 php: argument default value (php 7.1) 2018-02-19 12:38:01 +03:00
48a5f7ce72 php: argument default value (php 7.1) 2018-02-13 17:35:44 +03:00
f3ee251088 php: create folder with logs 2018-02-13 17:21:22 +03:00
2497acb9f5 php: remove undefined variable 2018-02-13 17:16:54 +03:00
6038381f72 switching favicon in editor 2018-01-24 17:35:02 +03:00
7cd8333186 removed authorization key 2018-01-24 17:35:01 +03:00
100 changed files with 2450 additions and 604 deletions

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -4,44 +4,58 @@
<PropertyGroup>
<To Condition=" '$(To)' == '' ">..\deploy\</To>
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
<NameCSharp>$(To).Net (C#) Example</NameCSharp>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<NameMvc>$(To).Net (C# MVC) Example</NameMvc>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<NameJava>$(To)Java Example</NameJava>
<DirJava>$(RootDir)web\documentserver-example\java\</DirJava>
<NameNodeJS>$(To)Node.js Example</NameNodeJS>
<DirNodeJS>$(RootDir)web\documentserver-example\nodejs\</DirNodeJS>
<NamePHP>$(To)PHP Example</NamePHP>
<DirPHP>$(RootDir)web\documentserver-example\php\</DirPHP>
<NameRuby>$(To)Ruby Example</NameRuby>
<DirRuby>$(RootDir)web\documentserver-example\ruby\</DirRuby>
</PropertyGroup>
<Target Name="Build">
<RemoveDir Directories="$(To)" ContinueOnError="true" />
<ItemGroup>
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp)obj\**" />
</ItemGroup>
<Zip Files="@(ZipFilesCSharp)" WorkingDirectory="$(DirCSharp)" ZipFileName="$(To).Net (C#) Example.zip" />
<Copy SourceFiles="@(ZipFilesCSharp)" DestinationFiles="@(ZipFilesCSharp->'$(NameCSharp)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameCSharp)" WorkingDirectory="$(To)" ZipFileName="$(NameCSharp).zip" />
<ItemGroup>
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc)obj\**" />
</ItemGroup>
<Zip Files="@(ZipFilesMVC)" WorkingDirectory="$(DirMvc)" ZipFileName="$(To).Net (C# MVC) Example.zip" />
<Copy SourceFiles="@(ZipFilesMVC)" DestinationFiles="@(ZipFilesMVC->'$(NameMvc)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameMvc)" WorkingDirectory="$(To)" ZipFileName="$(NameMvc).zip" />
<ItemGroup>
<ZipFilesJava Include="$(DirJava)**" />
</ItemGroup>
<Zip Files="@(ZipFilesJava)" WorkingDirectory="$(DirJava)" ZipFileName="$(To)Java Example.zip" />
<Copy SourceFiles="@(ZipFilesJava)" DestinationFiles="@(ZipFilesJava->'$(NameJava)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameJava)" WorkingDirectory="$(To)" ZipFileName="$(NameJava).zip" />
<ItemGroup>
<ZipFilesNodeJS Include="$(DirNodeJS)**" Exclude="$(DirNodeJS)node_modules\**" />
</ItemGroup>
<Zip Files="@(ZipFilesNodeJS)" WorkingDirectory="$(DirNodeJS)" ZipFileName="$(To)Node.js Example.zip" />
<Copy SourceFiles="@(ZipFilesNodeJS)" DestinationFiles="@(ZipFilesNodeJS->'$(NameNodeJS)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameNodeJS)" WorkingDirectory="$(To)" ZipFileName="$(NameNodeJS).zip" />
<ItemGroup>
<ZipFilesPHP Include="$(DirPHP)**" />
</ItemGroup>
<Zip Files="@(ZipFilesPHP)" WorkingDirectory="$(DirPHP)" ZipFileName="$(To)PHP Example.zip" />
<Copy SourceFiles="@(ZipFilesPHP)" DestinationFiles="@(ZipFilesPHP->'$(NamePHP)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NamePHP)" WorkingDirectory="$(To)" ZipFileName="$(NamePHP).zip" />
<ItemGroup>
<ZipFilesRuby Include="$(DirRuby)**" />
</ItemGroup>
<Zip Files="@(ZipFilesRuby)" WorkingDirectory="$(DirRuby)" ZipFileName="$(To)Ruby Example.zip" />
<Copy SourceFiles="@(ZipFilesRuby)" DestinationFiles="@(ZipFilesRuby->'$(NameRuby)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameRuby)" WorkingDirectory="$(To)" ZipFileName="$(NameRuby).zip" />
</Target>
</Project>

View File

@ -19,4 +19,9 @@ License: MIT, GPL
4. jQuery UI - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice. (http://jqueryui.com/)
License: MIT
License: MIT
5. Prime JWT - Prime JWT is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson.
License: Apache-2.0

201
licences/prime-jwt.license Normal file
View File

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

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -53,7 +53,7 @@ namespace OnlineEditorsExampleMVC.Models
{
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".rtf", ".txt",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
@ -62,7 +62,7 @@ namespace OnlineEditorsExampleMVC.Models
{
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".csv"
".ods", ".fods", ".ots", ".csv"
};
public static readonly List<string> ExtsPresentation = new List<string>
@ -70,7 +70,7 @@ namespace OnlineEditorsExampleMVC.Models
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp"
".odp", ".fodp", ".otp"
};
}
}

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -61,7 +61,7 @@
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -136,7 +136,7 @@
},
},
events: {
'onReady': onReady,
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
@ -145,28 +145,11 @@
});
};
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", сonnectEditor);
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (ex) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", сonnectEditor);
}
</script>
</body>

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

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

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -44,7 +44,7 @@ namespace OnlineEditorsExample
{
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".csv"
".ods", ".fods", ".ots", ".csv"
};
public static readonly List<string> ExtsPresentation = new List<string>
@ -52,14 +52,14 @@ namespace OnlineEditorsExample
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp"
".odp", ".fodp", ".otp"
};
public static readonly List<string> ExtsDocument = new List<string>
{
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".rtf", ".txt",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};

View File

@ -53,7 +53,7 @@
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -128,7 +128,7 @@
},
},
events: {
'onReady': onReady,
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
@ -143,35 +143,6 @@
window.attachEvent("load", сonnectEditor);
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (ex) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function SaveFileRequest(fileName, fileType, fileUri) {
var req = getXmlHttp();
var requestAddress = "webeditor.ashx"
+ "?type=save"
+ "&filename=" + encodeURIComponent(fileName)
+ "&filetype=" + encodeURIComponent(fileType)
+ "&fileuri=" + encodeURIComponent(fileUri);
req.open('get', requestAddress, true);
req.send(fileUri);
}
</script>
</head>
<body>

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

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

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OnlineEditorsExampleJava</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<name>OnlineEditorsExampleJava</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

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

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -0,0 +1,60 @@
## Build instruction
At first, You need to install `oracle-java8-installer`
```
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
```
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
```
Edit the following lines:
```
files.docservice.url.converter=https://documentserver/ConvertService.ashx
files.docservice.url.tempstorage=https://documentserver/ResourceService.ashx
files.docservice.url.api=https://documentserver/web-apps/apps/api/documents/api.js
files.docservice.url.preloader=https://documentserver/web-apps/apps/api/documents/cache-scripts.html
```
Install Maven:
```
apt-get install maven
```
And build:
```
mvn package
```
After it, all bin files will be passed to `./target` folder
## Build from docker
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
```
Edit the following lines. You need to change `documentserver` to your documentserver:
```
files.docservice.url.converter=https://documentserver/ConvertService.ashx
files.docservice.url.tempstorage=https://documentserver/ResourceService.ashx
files.docservice.url.api=https://documentserver/web-apps/apps/api/documents/api.js
files.docservice.url.preloader=https://documentserver/web-apps/apps/api/documents/cache-scripts.html
```
Run next command in java example directory:
```
docker-compose up
```
After it, all bin files will be passed to `./target` folder

View File

@ -0,0 +1,7 @@
version: '3'
services:
build:
image: maven:3.6
volumes:
- .:/java
command: mvn -f /java package

View File

@ -4,7 +4,7 @@
<groupId>onlyoffice.com</groupId>
<artifactId>OnlineEditorsExampleJava</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0</version>
<packaging>war</packaging>
<name>OnlineEditorsExampleJava</name>
@ -13,7 +13,7 @@
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
@ -26,6 +26,16 @@
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.inversoft</groupId>
<artifactId>prime-jwt</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
<build>

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -43,23 +43,15 @@ public class EditorServlet extends HttpServlet
{
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String fileName = "";
if (request.getParameterMap().containsKey("fileName"))
{
fileName = request.getParameter("fileName");
}
DocumentManager.Init(request, response);
String fileExt = null;
if (request.getParameterMap().containsKey("fileExt"))
{
fileExt = request.getParameter("fileExt");
}
String fileName = request.getParameter("fileName");
String fileExt = request.getParameter("fileExt");
if (fileExt != null)
{
try
{
DocumentManager.Init(request, response);
fileName = DocumentManager.CreateDemo(fileExt);
}
catch (Exception ex)
@ -68,20 +60,18 @@ public class EditorServlet extends HttpServlet
}
}
String mode = "";
if (request.getParameterMap().containsKey("mode"))
FileModel file = new FileModel(fileName);
if ("embedded".equals(request.getParameter("mode")))
file.InitDesktop();
if ("view".equals(request.getParameter("mode")))
file.editorConfig.mode = "view";
if (DocumentManager.TokenEnabled())
{
mode = request.getParameter("mode");
file.BuildToken();
}
Boolean desktopMode = !"embedded".equals(mode);
FileModel file = new FileModel();
file.SetTypeDesktop(desktopMode);
file.SetFileName(fileName);
request.setAttribute("file", file);
request.setAttribute("mode", mode);
request.setAttribute("type", desktopMode ? "desktop" : "embedded");
request.setAttribute("docserviceApiUrl", ConfigManager.GetProperty("files.docservice.url.api"));
request.getRequestDispatcher("editor.jsp").forward(request, response);
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -37,7 +37,7 @@ import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class GlobalServletContextListener implements ServletContextListener
{
@Override
@ -88,7 +88,7 @@ public class GlobalServletContextListener implements ServletContextListener
@Override
public boolean verify(String hostname, SSLSession session)
{
return true;
return true;
}
};

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -27,6 +27,7 @@
package controllers;
import helpers.ConfigManager;
import helpers.DocumentManager;
import helpers.ServiceConverter;
import java.io.File;
@ -35,6 +36,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.Scanner;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
@ -48,15 +50,19 @@ import helpers.FileUtility;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.primeframework.jwt.domain.JWT;
@WebServlet(name = "IndexServlet", urlPatterns = {"/IndexServlet"})
@MultipartConfig
public class IndexServlet extends HttpServlet
{
private static final String DocumentJwtHeader = ConfigManager.GetProperty("files.docservice.header");
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String action = request.getParameter("type");
if(action == null)
if (action == null)
{
request.getRequestDispatcher("index.jsp").forward(request, response);
return;
@ -64,7 +70,7 @@ public class IndexServlet extends HttpServlet
DocumentManager.Init(request, response);
PrintWriter writer = response.getWriter();
switch (action.toLowerCase())
{
case "upload":
@ -156,8 +162,8 @@ public class IndexServlet extends HttpServlet
String key = ServiceConverter.GenerateRevisionId(fileUri);
String newFileUri = ServiceConverter.GetConvertedUri(fileUri, fileExt, internalFileExt, key, true);
if (newFileUri == "")
if (newFileUri.isEmpty())
{
writer.write("{ \"step\" : \"0\", \"filename\" : \"" + fileName + "\"}");
return;
@ -183,7 +189,7 @@ public class IndexServlet extends HttpServlet
{
out.write(bytes, 0, read);
}
out.flush();
}
@ -231,7 +237,7 @@ public class IndexServlet extends HttpServlet
writer.write("empty request.getInputStream");
return;
}
JSONParser parser = new JSONParser();
JSONObject jsonObj;
@ -246,13 +252,50 @@ public class IndexServlet extends HttpServlet
return;
}
long status = (long) jsonObj.get("status");
int status;
String downloadUri;
if (DocumentManager.TokenEnabled())
{
String token = (String) jsonObj.get("token");
if (token == null) {
String header = (String) request.getHeader(DocumentJwtHeader == "" ? "Authorization" : DocumentJwtHeader);
token = header.startsWith("Bearer ") ? header.substring(7) : header;
}
JWT jwt = DocumentManager.ReadToken(token);
if (jwt == null)
{
writer.write("JWT.parse error");
return;
}
if (jwt.getObject("payload") != null) {
try {
@SuppressWarnings("unchecked") LinkedHashMap<String, Object> payload =
(LinkedHashMap<String, Object>)jwt.getObject("payload");
jwt.claims = payload;
}
catch (Exception ex) {
writer.write("Wrong payload");
return;
}
}
status = jwt.getInteger("status");
downloadUri = jwt.getString("url");
}
else
{
status = (int) jsonObj.get("status");
downloadUri = (String) jsonObj.get("url");
}
int saved = 0;
if(status == 2 || status == 3)//MustSave, Corrupted
if (status == 2 || status == 3)//MustSave, Corrupted
{
String downloadUri = (String) jsonObj.get("url");
try
{
URL url = new URL(downloadUri);
@ -273,7 +316,7 @@ public class IndexServlet extends HttpServlet
{
out.write(bytes, 0, read);
}
out.flush();
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -27,62 +27,126 @@
package entities;
import java.util.HashMap;
import java.util.Map;
import helpers.DocumentManager;
import helpers.ServiceConverter;
import helpers.FileUtility;
import com.google.gson.Gson;
public class FileModel
{
private String FileName;
private Boolean TypeDesktop;
public String type = "desktop";
public String documentType;
public Document document;
public EditorConfig editorConfig;
public String token;
public String GetFileName()
public FileModel(String fileName)
{
return FileName;
if (fileName == null) fileName = "";
fileName = fileName.trim();
documentType = FileUtility.GetFileType(fileName).toString().toLowerCase();
document = new Document();
document.title = fileName;
document.url = DocumentManager.GetFileUri(fileName);
document.fileType = FileUtility.GetFileExtension(fileName).replace(".", "");
String userId = DocumentManager.CurUserHostAddress(null);
document.key = ServiceConverter.GenerateRevisionId(userId + "/" + fileName);
editorConfig = new EditorConfig();
if (!DocumentManager.GetEditedExts().contains(FileUtility.GetFileExtension(fileName)))
editorConfig.mode = "view";
editorConfig.callbackUrl = DocumentManager.GetCallback(fileName);
editorConfig.user.id = userId;
editorConfig.customization.goback.url = DocumentManager.GetServerUrl() + "/IndexServlet";
}
public void SetFileName(String fileName)
public void InitDesktop()
{
this.FileName = fileName;
}
public Boolean GetTypeDesktop()
{
return TypeDesktop;
type = "embedded";
editorConfig.InitDesktop(document.url);
}
public void SetTypeDesktop(Boolean typeDesktop)
public void BuildToken()
{
this.TypeDesktop = typeDesktop;
Map<String, Object> map = new HashMap<>();
map.put("type", type);
map.put("documentType", documentType);
map.put("document", document);
map.put("editorConfig", editorConfig);
token = DocumentManager.CreateToken(map);
}
public String GetFileUri() throws Exception
public class Document
{
return DocumentManager.GetFileUri(FileName);
public String title;
public String url;
public String fileType;
public String key;
}
public String CurUserHostAddress()
public class EditorConfig
{
return DocumentManager.CurUserHostAddress(null);
public String mode = "edit";
public String callbackUrl;
public User user;
public Customization customization;
public Embedded embedded;
public EditorConfig()
{
user = new User();
customization = new Customization();
}
public void InitDesktop(String url)
{
embedded = new Embedded();
embedded.saveUrl = url;
embedded.embedUrl = url;
embedded.shareUrl = url;
embedded.toolbarDocked = "top";
}
public class User
{
public String id;
public String name = "John Smith";
}
public class Customization
{
public Goback goback;
public Customization()
{
goback = new Goback();
}
public class Goback
{
public String url;
}
}
public class Embedded
{
public String saveUrl;
public String embedUrl;
public String shareUrl;
public String toolbarDocked;
}
}
public String GetDocumentType()
{
return FileUtility.GetFileType(FileName).toString().toLowerCase();
}
public String GetKey()
public static String Serialize(FileModel model)
{
return ServiceConverter.GenerateRevisionId(DocumentManager.CurUserHostAddress(null) + "/" + FileName);
}
public String GetCallbackUrl()
{
return DocumentManager.GetCallback(FileName);
}
public String GetServerUrl()
{
return DocumentManager.GetServerUrl();
Gson gson = new Gson();
return gson.toJson(model);
}
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -33,12 +33,12 @@ import java.util.Properties;
public class ConfigManager
{
private static Properties properties;
static
{
Init();
}
private static void Init()
{
try
@ -52,14 +52,16 @@ public class ConfigManager
properties = null;
}
}
public static String GetProperty(String name)
{
if(properties == null)
if (properties == null)
{
return "";
}
String property = properties.getProperty(name);
return property == null ? "" : property;
}
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -35,10 +35,16 @@ import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import entities.FileType;
import org.primeframework.jwt.domain.JWT;
import org.primeframework.jwt.hmac.HMACSigner;
import org.primeframework.jwt.hmac.HMACVerifier;
import org.primeframework.jwt.Signer;
import org.primeframework.jwt.Verifier;
public class DocumentManager
{
@ -52,7 +58,7 @@ public class DocumentManager
public static long GetMaxFileSize()
{
long size;
try
{
size = Long.parseLong(ConfigManager.GetProperty("filesize-max"));
@ -68,12 +74,12 @@ public class DocumentManager
public static List<String> GetFileExts()
{
List<String> res = new ArrayList<>();
res.addAll(GetViewedExts());
res.addAll(GetEditedExts());
res.addAll(GetConvertExts());
return res;
return res;
}
public static List<String> GetViewedExts()
@ -116,17 +122,16 @@ public class DocumentManager
String serverPath = request.getSession().getServletContext().getRealPath("");
String storagePath = ConfigManager.GetProperty("storage-folder");
String hostAddress = CurUserHostAddress(userAddress);
String directory = serverPath + "\\" + storagePath + "\\";
String directory = serverPath + File.separator + storagePath + File.separator;
File file = new File(directory);
if (!file.exists())
{
file.mkdir();
}
directory = directory + hostAddress + "\\";
directory = directory + hostAddress + File.separator;
file = new File(directory);
if (!file.exists())
@ -173,60 +178,102 @@ public class DocumentManager
}
out.flush();
}
return fileName;
}
public static String GetFileUri(String fileName) throws Exception
public static String GetFileUri(String fileName)
{
try
{
String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
String serverPath = GetServerUrl();
String storagePath = ConfigManager.GetProperty("storage-folder");
String hostAddress = CurUserHostAddress(null);
String filePath = serverPath + "/" + storagePath + "/" + hostAddress + "/" + URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString());
String filePath = serverPath + "/" + storagePath + "/" + hostAddress + "/" + URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString()).replace("+", "%20");
return filePath;
}
catch (UnsupportedEncodingException e)
{
throw new AssertionError("UTF-8 is unknown");
return "";
}
}
public static String GetServerUrl()
{
return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
}
public static String GetCallback(String fileName)
{
String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
String serverPath = GetServerUrl();
String hostAddress = CurUserHostAddress(null);
try
{
String query = "?type=track&fileName=" + URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString()) + "&userAddress=" + URLEncoder.encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString());
return serverPath + "/IndexServlet" + query;
}
catch (UnsupportedEncodingException e)
{
throw new AssertionError("UTF-8 is unknown");
return "";
}
}
public static String GetInternalExtension(FileType fileType)
{
if(fileType.equals(FileType.Text))
if (fileType.equals(FileType.Text))
return ".docx";
if(fileType.equals(FileType.Spreadsheet))
if (fileType.equals(FileType.Spreadsheet))
return ".xlsx";
if(fileType.equals(FileType.Presentation))
if (fileType.equals(FileType.Presentation))
return ".pptx";
return ".docx";
}
public static String CreateToken(Map<String, Object> payloadClaims)
{
try
{
Signer signer = HMACSigner.newSHA256Signer(GetTokenSecret());
JWT jwt = new JWT();
for (String key : payloadClaims.keySet())
{
jwt.addClaim(key, payloadClaims.get(key));
}
return JWT.getEncoder().encode(jwt, signer);
}
catch (Exception e)
{
return "";
}
}
public static JWT ReadToken(String token)
{
try
{
Verifier verifier = HMACVerifier.newVerifier(GetTokenSecret());
return JWT.getDecoder().decode(token, verifier);
}
catch (Exception exception)
{
return null;
}
}
public static Boolean TokenEnabled()
{
String secret = GetTokenSecret();
return secret != null && !secret.isEmpty();
}
private static String GetTokenSecret()
{
return ConfigManager.GetProperty("files.docservice.secret");
}
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -47,7 +47,7 @@ public class FileUtility
if (ExtsSpreadsheet.contains(ext))
return FileType.Spreadsheet;
if (ExtsPresentation.contains(ext))
return FileType.Presentation;
@ -55,74 +55,74 @@ public class FileUtility
}
public static List<String> ExtsDocument = Arrays.asList
(
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
);
(
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
);
public static List<String> ExtsSpreadsheet = Arrays.asList
(
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".csv"
);
(
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
);
public static List<String> ExtsPresentation = Arrays.asList
(
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp"
);
(
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp", ".otp"
);
public static String GetFileName (String url)
public static String GetFileName(String url)
{
if(url == null) return null;
if (url == null) return null;
//for external file url
String tempstorage = ConfigManager.GetProperty("files.docservice.url.tempstorage");
if(!tempstorage.isEmpty() && url.startsWith(tempstorage))
if (!tempstorage.isEmpty() && url.startsWith(tempstorage))
{
Map<String, String> params = GetUrlParams(url);
return params == null ? null : params.get("filename");
}
String fileName = url.substring(url.lastIndexOf('/')+1, url.length());
String fileName = url.substring(url.lastIndexOf('/') + 1, url.length());
return fileName;
}
public static String GetFileNameWithoutExtension (String url)
public static String GetFileNameWithoutExtension(String url)
{
String fileName = GetFileName(url);
if(fileName == null) return null;
if (fileName == null) return null;
String fileNameWithoutExt = fileName.substring(0, fileName.lastIndexOf('.'));
return fileNameWithoutExt;
}
public static String GetFileExtension (String url)
public static String GetFileExtension(String url)
{
String fileName = GetFileName(url);
if(fileName == null) return null;
if (fileName == null) return null;
String fileExt = fileName.substring(fileName.lastIndexOf("."));
return fileExt.toLowerCase();
}
public static Map<String, String> GetUrlParams (String url)
public static Map<String, String> GetUrlParams(String url)
{
try
{
String query = new URL(url).getQuery();
String[] params = query.split("&");
Map<String, String> map = new HashMap<>();
for (String param : params)
{
String name = param.split("=")[0];
String value = param.split("=")[1];
map.put(name, value);
String[] params = query.split("&");
Map<String, String> map = new HashMap<>();
for (String param : params)
{
String name = param.split("=")[0];
String value = param.split("=")[1];
map.put(name, value);
}
return map;
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -26,17 +26,20 @@
package helpers;
import helpers.DocumentManager;
import com.google.gson.Gson;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeoutException;
import java.nio.charset.StandardCharsets;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
@ -46,14 +49,25 @@ public class ServiceConverter
{
private static int ConvertTimeout = 120000;
private static final String DocumentConverterUrl = ConfigManager.GetProperty("files.docservice.url.converter");
private static final MessageFormat ConvertParams = new MessageFormat("?url={0}&outputtype={1}&filetype={2}&title={3}&key={4}");
private static final String DocumentJwtHeader = ConfigManager.GetProperty("files.docservice.header");
public static class ConvertBody
{
public String url;
public String outputtype;
public String filetype;
public String title;
public String key;
public Boolean async;
public String token;
}
static
{
try
{
int timeout = Integer.parseInt(ConfigManager.GetProperty("files.docservice.timeout"));
if(timeout > 0)
if (timeout > 0)
{
ConvertTimeout = timeout;
}
@ -74,24 +88,59 @@ public class ServiceConverter
documentRevisionId = GenerateRevisionId(documentRevisionId);
Object[] args = {
URLEncoder.encode(documentUri, java.nio.charset.StandardCharsets.UTF_8.toString()),
toExtension.replace(".", ""),
fromExtension.replace(".", ""),
title,
documentRevisionId
};
String urlToConverter = DocumentConverterUrl + ConvertParams.format(args);
ConvertBody body = new ConvertBody();
body.url = documentUri;
body.outputtype = toExtension.replace(".", "");
body.filetype = fromExtension.replace(".", "");
body.title = title;
body.key = documentRevisionId;
if (isAsync)
urlToConverter += "&async=true";
body.async = true;
URL url = new URL(urlToConverter);
String headerToken = "";
if (DocumentManager.TokenEnabled())
{
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("url", body.url);
map.put("outputtype", body.outputtype);
map.put("filetype", body.filetype);
map.put("title", body.title);
map.put("key", body.key);
if (isAsync)
map.put("async", body.async);
String token = DocumentManager.CreateToken(map);
body.token = token;
Map<String, Object> payloadMap = new HashMap<String, Object>();
payloadMap.put("payload", map);
headerToken = DocumentManager.CreateToken(payloadMap);
}
Gson gson = new Gson();
String bodyString = gson.toJson(body);
byte[] bodyByte = bodyString.getBytes(StandardCharsets.UTF_8);
URL url = new URL(DocumentConverterUrl);
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
connection.setFixedLengthStreamingMode(bodyByte.length);
connection.setRequestProperty("Accept", "application/json");
connection.setConnectTimeout(ConvertTimeout);
if (DocumentManager.TokenEnabled())
{
connection.setRequestProperty(DocumentJwtHeader == "" ? "Authorization" : DocumentJwtHeader, "Bearer " + headerToken);
}
connection.connect();
try (OutputStream os = connection.getOutputStream()) {
os.write(bodyByte);
}
InputStream stream = connection.getInputStream();
if (stream == null)
@ -159,9 +208,9 @@ public class ServiceConverter
{
JSONObject jsonObj = ConvertStringToJSON(jsonString);
String error = (String) jsonObj.get("error");
if (error != null && error != "")
ProcessConvertServiceResponceError(Integer.parseInt(error));
Object error = jsonObj.get("error");
if (error != null)
ProcessConvertServiceResponceError(Math.toIntExact((long)error));
Boolean isEndConvert = (Boolean) jsonObj.get("endConvert");
@ -189,7 +238,7 @@ public class ServiceConverter
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String line = bufferedReader.readLine();
while(line != null)
while (line != null)
{
stringBuilder.append(line);
line = bufferedReader.readLine();

View File

@ -2,11 +2,13 @@ filesize-max=5242880
storage-folder=app_data
files.docservice.viewed-docs=.pdf|.djvu|.xps
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.ppsx|.txt
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.rtf|.mht|.html|.htm|.epub
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.epub
files.docservice.timeout=120000
files.docservice.url.converter=http://documentserver/ConvertService.ashx
files.docservice.url.tempstorage=http://documentserver/ResourceService.ashx
files.docservice.url.api=http://documentserver/web-apps/apps/api/documents/api.js
files.docservice.url.preloader=http://documentserver/web-apps/apps/api/documents/cache-scripts.html
files.docservice.url.converter=https://documentserver/ConvertService.ashx
files.docservice.url.tempstorage=https://documentserver/ResourceService.ashx
files.docservice.url.api=https://documentserver/web-apps/apps/api/documents/api.js
files.docservice.url.preloader=https://documentserver/web-apps/apps/api/documents/cache-scripts.html
files.docservice.secret=
files.docservice.header=Authorization

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -24,12 +24,7 @@
*
*-->
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.Arrays"%>
<%@page import="entities.FileModel"%>
<%@page import="helpers.DocumentManager"%>
<%@page import="helpers.FileUtility"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
@ -40,23 +35,20 @@
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/editor.css" />
<% DocumentManager.Init(request, response); %>
<% FileModel Model = (FileModel)request.getAttribute("file"); %>
<% FileModel Model = (FileModel) request.getAttribute("file"); %>
<script type="text/javascript" src="${docserviceApiUrl}"></script>
<script type="text/javascript" language="javascript">
var docEditor;
var fileName = "<%= Model.GetFileName() %>";
var fileType = "<%= FileUtility.GetFileExtension(Model.GetFileName()).replace(".", "") %>";
var innerAlert = function (message) {
if (console && console.log)
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -66,7 +58,7 @@
};
var onRequestEditRights = function () {
location.href = location.href.replace(RegExp("action=view\&?", "i"), "");
location.href = location.href.replace(RegExp("mode=view\&?", "i"), "");
};
var onError = function (event) {
@ -79,65 +71,18 @@
};
var сonnectEditor = function () {
var config = JSON.parse('<%= FileModel.Serialize(Model) %>');
config.width = "100%";
config.height = "100%";
config.events = {
"onAppReady": onAppReady,
"onDocumentStateChange": onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
"onError": onError,
"onOutdatedVersion": onOutdatedVersion,
};
docEditor = new DocsAPI.DocEditor("iframeEditor",
{
width: "100%",
height: "100%",
type: "${type}",
documentType: "<%= Model.GetDocumentType() %>",
document: {
title: fileName,
url: "<%= Model.GetFileUri() %>",
fileType: fileType,
key: "<%= Model.GetKey() %>",
info: {
author: "Me",
created: "<%= new SimpleDateFormat("MM/dd/yyyy").format(new Date()) %>",
},
permissions: {
edit: <%= Boolean.toString(DocumentManager.GetEditedExts().contains(FileUtility.GetFileExtension(Model.GetFileName()))).toLowerCase() %>,
download: true,
}
},
editorConfig: {
mode: "<%= DocumentManager.GetEditedExts().contains(FileUtility.GetFileExtension(Model.GetFileName())) && !"view".equals(request.getAttribute("mode")) ? "edit" : "view" %>",
lang: "en",
callbackUrl: "<%= Model.GetCallbackUrl() %>",
user: {
id: "<%= Model.CurUserHostAddress() %>",
name: "John Smith",
},
embedded: {
saveUrl: "<%= Model.GetFileUri() %>",
embedUrl: "<%= Model.GetFileUri() %>",
shareUrl: "<%= Model.GetFileUri() %>",
toolbarDocked: "top",
},
customization: {
about: true,
feedback: true,
goback: {
url: "<%= Model.GetServerUrl() %>/IndexServlet",
},
},
},
events: {
"onReady": onReady,
"onDocumentStateChange": onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
"onError": onError,
"onOutdatedVersion": onOutdatedVersion,
}
});
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
if (window.addEventListener) {
@ -146,25 +91,8 @@
window.attachEvent("load", сonnectEditor);
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (ex) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest !== "undefined") {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
</script>
</head>
<body>
<div class="form">

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -42,7 +42,7 @@
<body>
<div class="top-panel"></div>
<div class="main-panel">
<span class="portal-name">ONLYOFFICE Document Editors</span>
<br />
@ -52,7 +52,7 @@
<div class="file-upload button gray">
<span>Choose file</span>
<form class="fileupload" action="server/php/" method="POST" enctype="multipart/form-data">
</form>
<input type="file" id="fileupload" name="file" data-url="IndexServlet?type=upload" />
</div>
@ -100,12 +100,12 @@
Please, <a href="mailto:sales@onlyoffice.com">submit your request</a> and we'll help you shortly.
</div>
</div>
<div id="hint">
<div class="corner"></div>
If you check this option the file will be saved both in the original and converted into Office Open XML format for faster viewing and editing. In other case the document will be overwritten by its copy in Office Open XML format.
</div>
<div id="mainProgress">
<div id="uploadSteps">
<span id="step1" class="step">1. Loading the file</span>
@ -135,7 +135,7 @@
<div id="beginEdit" class="button disable">Edit</div>
<div id="cancelEdit" class="button gray">Cancel</div>
</div>
<span id="loadScripts" data-docs="<%= ConfigManager.GetProperty("files.docservice.url.preloader") %>"></span>
<div class="bottom-panel">
@ -149,13 +149,13 @@
<script type="text/javascript" src="scripts/jquery.fileupload.js"></script>
<script type="text/javascript" src="scripts/jquery.dropdownToggle.js"></script>
<script type="text/javascript" src="scripts/jscript.js"></script>
<script language="javascript" type="text/javascript">
var ConverExtList = "<%= String.join(",", DocumentManager.GetConvertExts()) %>";
var EditedExtList = "<%= String.join(",", DocumentManager.GetEditedExts()) %>";
var UrlConverter = "IndexServlet?type=convert";
var UrlEditor = "EditorServlet";
</script>
</body>
</html>

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -33,7 +33,7 @@
<link href="stylesheet.css" type="text/css" rel="stylesheet">
<!--Change the address on installed ONLYOFFICE Document Editors-->
<script id="scriptApi" type="text/javascript" src="http://documentserver/web-apps/apps/api/documents/api.js"></script>
<script id="scriptApi" type="text/javascript" src="https://documentserver/web-apps/apps/api/documents/api.js"></script>
<script type="text/javascript" src="init.js"></script>

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -73,8 +73,8 @@ function key(k) {
};
var getDocumentType = function (ext) {
if (".doc.docx.docm.dot.dotx.dotm.odt.fodt.rtf.txt.html.htm.mht.pdf.djvu.fb2.epub.xps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.xlsm.xlt.xltx.xltm.ods.fods.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppsm.ppt.pptx.pptm.pot.potx.potm.odp.fodp".indexOf(ext) != -1) return "presentation";
if (".doc.docx.docm.dot.dotx.dotm.odt.fodt.ott.rtf.txt.html.htm.mht.pdf.djvu.fb2.epub.xps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.xlsm.xlt.xltx.xltm.ods.fods.ots.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppsm.ppt.pptx.pptm.pot.potx.potm.odp.fodp.otp".indexOf(ext) != -1) return "presentation";
return null;
};

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,7 @@
/*
"use strict";
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -131,7 +132,7 @@ app.get("/download", function(req, res) {
res.setHeader("Content-Length", fileSystem.statSync(path).size);
res.setHeader("Content-Type", mime.lookup(path));
res.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
res.setHeader("Content-Disposition", "attachment; filename*=UTF-8\'\'" + encodeURIComponent(fileName));
var filestream = fileSystem.createReadStream(path);
filestream.pipe(res);
@ -150,6 +151,7 @@ app.post("/upload", function (req, res) {
const form = new formidable.IncomingForm();
form.uploadDir = uploadDirTmp;
form.keepExtensions = true;
form.maxFileSize = configServer.get("maxFileSize");
form.parse(req, function (err, fields, files) {
if (err) {
@ -229,6 +231,7 @@ app.get("/convert", function (req, res) {
if (error != null)
result["error"] = error;
response.setHeader("Content-Type", "application/json");
response.write(JSON.stringify(result));
response.end();
};
@ -268,7 +271,7 @@ app.get("/convert", function (req, res) {
fileSystem.renameSync(path.join(correctHistoryPath, fileName + ".txt"), path.join(correctHistoryPath, correctName + ".txt"));
writeResult(correctName, null, null);
writeResult(correctName, result, null);
} catch (e) {
console.log(e);
writeResult(null, null, "Server error");
@ -277,7 +280,11 @@ app.get("/convert", function (req, res) {
try {
if (configServer.get('convertedDocs').indexOf(fileExt) != -1) {
const key = documentService.generateRevisionId(fileUri);
let storagePath = docManager.storagePath(fileName);
const stat = fileSystem.statSync(storagePath);
let key = fileUri + stat.mtime.getTime();
key = documentService.generateRevisionId(key);
documentService.getConvertedUri(fileUri, fileExt, internalFileExt, key, true, callback);
} else {
writeResult(fileName, null, null);
@ -354,7 +361,7 @@ app.post("/track", function (req, res) {
var count_version = docManager.countVersion(historyPath);
version = count_version + 1;
versionPath = docManager.versionPath(fileName, userAddress, version);
var versionPath = docManager.versionPath(fileName, userAddress, version);
docManager.createDirectory(versionPath);
var downloadZip = body.changesurl;
@ -467,24 +474,32 @@ app.post("/track", function (req, res) {
//checkjwt
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
var checkJwtHeaderRes = documentService.checkJwtHeader(req);
if (checkJwtHeaderRes) {
if (checkJwtHeaderRes.payload) {
body = checkJwtHeaderRes.payload;
}
if (checkJwtHeaderRes.query) {
if (checkJwtHeaderRes.query.useraddress) {
userAddress = checkJwtHeaderRes.query.useraddress;
}
if (checkJwtHeaderRes.query.filename) {
fileName = fileUtility.getFileName(checkJwtHeaderRes.query.filename);
}
}
processTrack(res, body, fileName, userAddress);
var body = null;
if (req.body.hasOwnProperty("token")) {
body = documentService.readToken(req.body.token);
} else {
var checkJwtHeaderRes = documentService.checkJwtHeader(req);
if (checkJwtHeaderRes) {
var body;
if (checkJwtHeaderRes.payload) {
body = checkJwtHeaderRes.payload;
}
if (checkJwtHeaderRes.query) {
if (checkJwtHeaderRes.query.useraddress) {
userAddress = checkJwtHeaderRes.query.useraddress;
}
if (checkJwtHeaderRes.query.filename) {
fileName = fileUtility.getFileName(checkJwtHeaderRes.query.filename);
}
}
}
}
if (body == null) {
res.write("{\"error\":1}");
res.end();
return;
}
processTrack(res, body, fileName, userAddress);
return;
}
@ -517,9 +532,14 @@ app.get("/editor", function (req, res) {
var userAddress = docManager.curUserHostAddress();
var fileName = fileUtility.getFileName(req.query.fileName);
if (!docManager.existsSync(docManager.storagePath(fileName, userAddress))) {
throw {
"message": "File not found: " + fileName
};
}
var key = docManager.getKey(fileName);
var url = docManager.getFileUri(fileName);
var mode = req.query.mode || "edit"; //mode: view/edit/review/comment/embedded
var mode = req.query.mode || "edit"; //mode: view/edit/review/comment/fillForms/embedded
var type = req.query.type || ""; //type: embedded/mobile/desktop
if (type == "") {
type = new RegExp(configServer.get("mobileRegEx"), "i").test(req.get('User-Agent')) ? "mobile" : "desktop";
@ -598,7 +618,8 @@ app.get("/editor", function (req, res) {
callbackUrl: docManager.getCallback(fileName),
isEdit: canEdit && (mode == "edit" || mode == "filter"),
review: mode == "edit" || mode == "review",
comment: mode != "view" && mode != "embedded",
comment: mode != "view" && mode != "fillForms" && mode != "embedded",
fillForms: mode != "view" && mode != "comment" && mode != "embedded",
modifyFilter: mode != "filter",
mode: canEdit && mode != "view" ? "edit" : "view",
canBackToFolder: type != "embedded",

View File

@ -12,7 +12,7 @@
},
"server": {
"port": 3000,
"siteUrl": "http://documentserver/",
"siteUrl": "https://documentserver/",
"commandUrl": "coauthoring/CommandService.ashx",
"converterUrl": "ConvertService.ashx",
"tempStorageUrl": "ResourceService.ashx",
@ -20,8 +20,8 @@
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html",
"exampleUrl": null,
"viewedDocs": [".pdf", ".djvu", ".xps"],
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".txt"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"storageFolder": "files",
"maxFileSize": 1073741824,
"mobileRegEx": "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino",

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,7 @@
"use strict";
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -231,7 +232,8 @@ docManager.changesUser = function (fileName, userAddress, version) {
};
docManager.getStoredFiles = function () {
const directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress());
const userAddress = docManager.curUserHostAddress();
const directory = path.join(docManager.dir, "public", storageFolder, userAddress);
this.createDirectory(directory);
const result = [];
const storedFiles = fileSystem.readdirSync(directory);
@ -239,13 +241,19 @@ docManager.getStoredFiles = function () {
const stats = fileSystem.lstatSync(path.join(directory, storedFiles[i]));
if (!stats.isDirectory()) {
let historyPath = docManager.historyPath(storedFiles[i], userAddress);
let version = 1;
if (historyPath != "") {
version = docManager.countVersion(historyPath);
}
const time = stats.mtime.getTime();
const item = {
time: time,
name: storedFiles[i],
documentType: fileUtility.getFileType(storedFiles[i]),
canEdit: configServer.get("editedDocs").indexOf(fileUtility.getFileExtension(storedFiles[i])) != -1
canEdit: configServer.get("editedDocs").indexOf(fileUtility.getFileExtension(storedFiles[i])) != -1,
version: version
};
if (!result.length) {
@ -303,7 +311,7 @@ docManager.getKey = function (fileName) {
let storagePath = docManager.storagePath(fileName, userAddress);
const stat = fileSystem.statSync(storagePath);
key += stat.mtime.toString();
key += stat.mtime.getTime();
return documentService.generateRevisionId(key);
};

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -46,8 +46,6 @@ var documentService = {};
documentService.userIp = null;
documentService.getConvertedUriSync = function (documentUri, fromExtension, toExtension, documentRevisionId, callback) {
documentRevisionId = documentService.generateRevisionId(documentRevisionId || documentUri);
documentService.getConvertedUri(documentUri, fromExtension, toExtension, documentRevisionId, false, function (err, data) {
if (err) {
callback();
@ -82,6 +80,7 @@ documentService.getConvertedUri = function (documentUri, fromExtension, toExtens
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
headers[cfgSignatureAuthorizationHeader] = cfgSignatureAuthorizationHeaderPrefix + this.fillJwtByUrl(uri, params);
params.token = documentService.getToken(params);
}
urllib.request(uri,
@ -94,13 +93,14 @@ documentService.getConvertedUri = function (documentUri, fromExtension, toExtens
};
documentService.generateRevisionId = function (expectedKey) {
if (expectedKey.length > 20) {
let maxKeyLength = 128;
if (expectedKey.length > maxKeyLength) {
expectedKey = expectedKey.hashCode().toString();
}
var key = expectedKey.replace(new RegExp("[^0-9-.a-zA-Z_=]", "g"), "_");
return key.substring(0, Math.min(key.length, 20));
return key.substring(0, Math.min(key.length, maxKeyLength));
};
documentService.processConvertServiceResponceError = function (errorCode) {
@ -185,6 +185,7 @@ documentService.commandRequest = function (method, documentRevisionId, callback)
};
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
headers[cfgSignatureAuthorizationHeader] = cfgSignatureAuthorizationHeaderPrefix + this.fillJwtByUrl(uri, params);
params.token = documentService.getToken(params);
}
urllib.request(uri,
@ -218,4 +219,18 @@ documentService.fillJwtByUrl = function (uri, opt_dataObject, opt_iss, opt_paylo
return jwt.sign(payload, cfgSignatureSecret, options);
}
documentService.getToken = function (data) {
var options = {algorithm: cfgSignatureSecretAlgorithmRequest, expiresIn: cfgSignatureSecretExpiresIn};
return jwt.sign(data, cfgSignatureSecret, options);
};
documentService.readToken = function (token) {
try {
return jwt.verify(token, cfgSignatureSecret);
} catch (err) {
console.log('checkJwtHeader error: name = ' + err.name + ' message = ' + err.message + ' token = ' + token)
}
return null;
};
module.exports = documentService;

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -77,11 +77,11 @@ fileUtility.fileType = {
presentation: "presentation"
}
fileUtility.documentExts = [".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".fodt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"];
fileUtility.documentExts = [".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".fodt", ".ott", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".csv"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".ots", ".csv"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp", ".fodp"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp", ".fodp", ".otp"];
function getUrlParams(url) {
try {

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -70,6 +70,9 @@ if (typeof jQuery != "undefined") {
jq('#fileupload').fileupload({
dataType: 'json',
add: function (e, data) {
if (jq("#mainProgress").is(":visible")) {
return;
}
jq(".error").removeClass("error");
jq(".done").removeClass("done");
jq(".current").removeClass("current");
@ -133,10 +136,9 @@ if (typeof jQuery != "undefined") {
timer = setTimeout(function () {
var requestAddress = UrlConverter + "?filename=" + encodeURIComponent(jq("#hiddenFileName").val());
jq.ajaxSetup({ cache: false });
jq.ajax({
async: true,
contentType: "text/xml",
type: "get",
url: requestAddress,
complete: function (data) {
@ -225,7 +227,7 @@ if (typeof jQuery != "undefined") {
jq("#mainProgress").addClass("embedded");
jq("#beginEmbedded").addClass("disable");
jq("#embeddedView").attr("src", url);
jq("#uploadSteps").after('<iframe id="embeddedView" src="' + url + '" height="345px" width="600px" frameborder="0" scrolling="no" allowtransparency></iframe>');
});
jq(document).on("click", ".reload-page", function () {
@ -242,7 +244,7 @@ if (typeof jQuery != "undefined") {
jq(document).on("click", "#cancelEdit, .dialog-close", function () {
jq('#hiddenFileName').val("");
jq("#embeddedView").attr("src", "");
jq("#embeddedView").remove();
jq.unblockUI();
if (mustReload) {
document.location.reload();

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -125,7 +125,7 @@ label .checkbox {
font-weight: normal;
text-align: center;
text-decoration: none;
vertical-align: middle;
vertical-align: middle;
cursor:pointer;
border-radius: 6px;
-moz-border-radius: 6px;
@ -143,7 +143,7 @@ label .checkbox {
margin-right: 3px;
padding: 4px 12px;
color: #fff;
color: #fff;
background: #3D96C6;
@ -376,7 +376,7 @@ footer {
vertical-align: top;
}
.tableRow {
background: transparent;
background: transparent;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
@ -385,7 +385,7 @@ footer {
transition: all 0.2s ease-in-out;
}
.tableRow:hover {
background-color: #ebebeb;
background-color: #ebebeb;
}
.tableHeader {

View File

@ -16,6 +16,7 @@
"comment": <%- editor.comment %>,
"download": true,
"edit": <%- editor.isEdit %>,
"fillForms": <%- editor.fillForms %>,
"modifyFilter": <%- editor.modifyFilter %>,
"review": <%- editor.review %>
}

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -33,7 +33,9 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<title>ONLYOFFICE</title>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="icon"
href="images/<%- editor.documentType %>.ico"
type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="stylesheets/editor.css" />
</head>
<body>
@ -51,7 +53,7 @@
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -98,7 +100,7 @@
docEditor = new DocsAPI.DocEditor("iframeEditor", {<% include config %>,
events: {
"onReady": onReady,
"onAppReady": onAppReady,
"onDocumentStateChange": onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
"onError": onError,

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -39,8 +39,8 @@
</head>
<body>
<header>
<a href="/">
<img src ='images/logo.png' alt="ONLYOFFICE" />
<a href="">
<img src ="images/logo.png" alt="ONLYOFFICE" />
</a>
</header>
<div class="main-panel">
@ -130,16 +130,16 @@
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="4" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
<tbody>
<% for (var i = 0; i < storedFiles.length; i++) { %>
<tr class="tableRow" title="<%=storedFiles[i].name%>">
<tr class="tableRow" title="<%= storedFiles[i].name %> [<%= storedFiles[i].version %>]">
<td class="contentCells">
<a class="stored-edit <%= storedFiles[i].documentType %>" href="editor?fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<span title="<%= storedFiles[i].name %>"><%= storedFiles[i].name %></span></a>
<span title="<%= storedFiles[i].name %> [<%= storedFiles[i].version %>]"><%= storedFiles[i].name %></span></a>
<a href="download?fileName=<%= encodeURIComponent(storedFiles[i].name) %>">
<img class="icon-download" src="images/download-24.png" alt="Download" title="Download" /></a>
<a class="delete-file" data="<%= encodeURIComponent(storedFiles[i].name) %>">
@ -163,14 +163,18 @@
<img src="images/filter-24.png" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" /></a>
<% } %>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<% if (storedFiles[i].documentType == "text") { %>
<td class="contentCells contentCells-icon">
<a href="editor?type=desktop&mode=comment&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment" /></a>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<% if (storedFiles[i].documentType == "text") { %>
<a href="editor?type=desktop&mode=fillForms&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms" /></a>
<% } %>
</td>
<% } else { %>
<td class="contentCells contentCells-shift contentCells-icon" colspan="4"></td>
<td class="contentCells contentCells-shift contentCells-icon" colspan="5"></td>
<% } %>
<td class="contentCells contentCells-icon">
<a href="editor?type=desktop&mode=view&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
@ -231,7 +235,6 @@
Please select another file and try again. If you have questions please <a href="mailto:sales@onlyoffice.com">contact us.</a>
</div>
</div>
<iframe id="embeddedView" src="" height="345px" width="600px" frameborder="0" scrolling="no" allowtransparency></iframe>
<br />
<div id="beginEmbedded" class="button disable">Embedded view</div>
<div id="beginView" class="button disable">View</div>
@ -241,7 +244,7 @@
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
<footer>&copy; Ascensio Systems Inc 2017. All rights reserved.</footer>
<footer>&copy; Ascensio Systems SIA 2019. All rights reserved.</footer>
<script type="text/javascript" src="javascripts/jquery-1.8.2.js"></script>
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -32,7 +32,11 @@ require_once( dirname(__FILE__) . '/config.php' );
require_once( dirname(__FILE__) . '/functions.php' );
function sendlog($msg, $logFileName) {
file_put_contents($logFileName, $msg . PHP_EOL, FILE_APPEND);
$logsFolder = "logs/";
if (!file_exists($logsFolder)) {
mkdir($logsFolder);
}
file_put_contents($logsFolder . $logFileName, $msg . PHP_EOL, FILE_APPEND);
}
function guid() {
@ -143,10 +147,10 @@ function getClientIp() {
return $ipaddress;
}
function serverPath($forDocumentServer) {
return $forDocumentServer && isset($GLOBALS['EXAMPLE_URL']) && $GLOBALS['EXAMPLE_URL'] != ""
? $GLOBALS['EXAMPLE_URL']
: ('http://' . $_SERVER['HTTP_HOST']);
function serverPath($forDocumentServer = NULL) {
return $forDocumentServer && isset($GLOBALS['EXAMPLE_URL']) && $GLOBALS['EXAMPLE_URL'] != ""
? $GLOBALS['EXAMPLE_URL']
: (getScheme() . '://' . $_SERVER['HTTP_HOST']);
}
function getCurUserHostAddress($userAddress = NULL) {
@ -201,7 +205,7 @@ function getStoragePath($fileName, $userAddress = NULL) {
if (!file_exists($directory) && !is_dir($directory)) {
mkdir($directory);
}
sendlog("getStoragePath result: " . $directory . $fileName, "logs/common.log");
sendlog("getStoragePath result: " . $directory . $fileName, "common.log");
return $directory . $fileName;
}
@ -212,24 +216,24 @@ function getStoredFiles() {
$result = array();
if ($storagePath != "")
{
$directory = $directory . DIRECTORY_SEPARATOR;
$directory = $directory . DIRECTORY_SEPARATOR;
if (!file_exists($directory) && !is_dir($directory)) {
return $result;
}
}
$directory = $directory . getCurUserHostAddress($userAddress) . DIRECTORY_SEPARATOR;
$directory = $directory . getCurUserHostAddress() . DIRECTORY_SEPARATOR;
if (!file_exists($directory) && !is_dir($directory)) {
return $result;
}
}
$cdir = scandir($directory);
$result = array();
foreach($cdir as $key => $fileName) {
if (!in_array($fileName,array(".", ".."))) {
if (!is_dir($directory . DIRECTORY_SEPARATOR . $fileName)) {
if (!is_dir($directory . DIRECTORY_SEPARATOR . $fileName)) {
$dat = filemtime($directory . DIRECTORY_SEPARATOR . $fileName);
$result[$dat] = (object) array(
"name" => $fileName,
@ -248,12 +252,12 @@ function getVirtualPath($forDocumentServer) {
$virtPath = serverPath($forDocumentServer) . '/' . $storagePath . getCurUserHostAddress() . '/';
sendlog("getVirtualPath virtPath: " . $virtPath, "logs/common.log");
sendlog("getVirtualPath virtPath: " . $virtPath, "common.log");
return $virtPath;
}
function FileUri($file_name, $forDocumentServer) {
$uri = getVirtualPath($forDocumentServer) . $file_name;
function FileUri($file_name, $forDocumentServer = NULL) {
$uri = getVirtualPath($forDocumentServer) . rawurlencode($file_name);
return $uri;
}

View File

@ -7,15 +7,15 @@ $GLOBALS['ALONE'] = FALSE;
$GLOBALS['MODE'] = "";
$GLOBALS['DOC_SERV_VIEWD'] = array(".pdf", ".djvu", ".xps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".rtf", ".mht", ".html", ".htm", ".epub");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".xlsx", ".csv", ".pptx", ".txt");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".epub");
$GLOBALS['DOC_SERV_TIMEOUT'] = "120000";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://documentserver/ConvertService.ashx";
$GLOBALS['DOC_SERV_API_URL'] = "http://documentserver/web-apps/apps/api/documents/api.js";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "https://documentserver/ConvertService.ashx";
$GLOBALS['DOC_SERV_API_URL'] = "https://documentserver/web-apps/apps/api/documents/api.js";
$GLOBALS['DOC_SERV_PRELOADER_URL'] = "http://documentserver/web-apps/apps/api/documents/cache-scripts.html";
$GLOBALS['DOC_SERV_PRELOADER_URL'] = "https://documentserver/web-apps/apps/api/documents/cache-scripts.html";
$GLOBALS['EXAMPLE_URL'] = "";
@ -24,16 +24,16 @@ $GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|el
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".csv");
".ods", ".fods", ".ots", ".csv");
$GLOBALS['ExtsPresentation'] = array(".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp");
".odp", ".fodp", ".otp");
$GLOBALS['ExtsDocument'] = array(".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".rtf", ".txt",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps");

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -62,7 +62,7 @@
if(!@copy(dirname(__FILE__) . DIRECTORY_SEPARATOR . "app_data" . DIRECTORY_SEPARATOR . $demoName, getStoragePath($demoFilename)))
{
sendlog("Copy file error to ". getStoragePath($demoFilename), "logs/common.log");
sendlog("Copy file error to ". getStoragePath($demoFilename), "common.log");
//Copy error!!!
}
@ -128,7 +128,7 @@
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -213,7 +213,7 @@
},
},
events: {
'onReady': onReady,
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
@ -228,23 +228,6 @@
window.attachEvent("load", сonnectEditor);
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (ex) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
</script>
</head>
<body>

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -69,7 +69,7 @@
<body>
<form id="form1">
<header>
<a href="/">
<a href="">
<img src ="css/images/logo.png" alt="ONLYOFFICE" />
</a>
</header>
@ -177,7 +177,7 @@
echo ' <a class="stored-edit '.$storeFile->documentType.'" href="doceditor.php?fileID='.urlencode($storeFile->name).'&user='.$user.'" target="_blank">';
echo ' <span title="'.$storeFile->name.'">'.$storeFile->name.'</span>';
echo ' </a>';
echo ' <a href="webeditor-ajax.php?type=download&filename='.$storeFile->name.'">';
echo ' <a href="'.FileUri($storeFile->name).'">';
echo ' <img class="icon-download" src="css/images/download-24.png" alt="Download" title="Download" /></a>';
echo ' </a>';
echo ' <a class="delete-file" data="'.$storeFile->name.'">';

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -4,16 +4,6 @@
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="300000000">
<headerLimits>
<add header="Content-type" sizeLimit="100"/>
</headerLimits>
</requestLimits>
</requestFiltering>
</security>
<modules/>
<defaultDocument enabled="true" />
<httpErrors errorMode="Detailed"/>
<urlCompression doDynamicCompression="false"/>

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -52,7 +52,7 @@ if (isset($_GET["type"]) && !empty($_GET["type"])) { //Checks if type value exis
nocache_headers();
sendlog(serialize($_GET),"logs/webedior-ajax.log");
sendlog(serialize($_GET), "webedior-ajax.log");
$type = $_GET["type"];
@ -61,9 +61,6 @@ if (isset($_GET["type"]) && !empty($_GET["type"])) { //Checks if type value exis
$response_array = upload();
$response_array['status'] = isset($response_array['error']) ? 'error' : 'success';
die (json_encode($response_array));
case "download":
download();
exit;
case "convert":
$response_array = convert();
$response_array['status'] = 'success';
@ -128,24 +125,9 @@ function upload() {
return $result;
}
function download() {
$fileName = $_GET["filename"];
$filePath = getStoragePath($fileName);
if (!file_exists($filePath)) {
http_response_code(404);
return;
}
header("Content-Length: " . filesize($filePath));
header("Content-Type: " . mime_content_type($fileName));
header("Content-Disposition: attachment; filename=\"".basename($filePath)."\"");
readfile($filePath);
}
function track() {
sendlog("Track START", "logs/webedior-ajax.log");
sendlog("_GET params: " . serialize( $_GET ), "logs/webedior-ajax.log");
sendlog("Track START", "webedior-ajax.log");
sendlog("_GET params: " . serialize( $_GET ), "webedior-ajax.log");
global $_trackerStatus;
$data;
@ -163,7 +145,7 @@ function track() {
return $result;
}
sendlog("InputStream data: " . serialize($data), "logs/webedior-ajax.log");
sendlog("InputStream data: " . serialize($data), "webedior-ajax.log");
$status = $_trackerStatus[$data["status"]];
@ -183,12 +165,12 @@ function track() {
$key = getDocEditorKey(downloadUri);
try {
sendlog("Convert " . $downloadUri . " from " . $downloadExt . " to " . $curExt, "logs/webedior-ajax.log");
sendlog("Convert " . $downloadUri . " from " . $downloadExt . " to " . $curExt, "webedior-ajax.log");
$convertedUri;
$percent = GetConvertedUri($downloadUri, $downloadExt, $curExt, $key, FALSE, $convertedUri);
$downloadUri = $convertedUri;
} catch (Exception $e) {
sendlog("Convert after save ".$e->getMessage(), "logs/webedior-ajax.log");
sendlog("Convert after save ".$e->getMessage(), "webedior-ajax.log");
$result["error"] = "error: " . $e->getMessage();
return $result;
}
@ -208,7 +190,7 @@ function track() {
break;
}
sendlog("track result: " . serialize($result), "logs/webedior-ajax.log");
sendlog("track result: " . serialize($result), "webedior-ajax.log");
return $result;
}
@ -274,7 +256,7 @@ function delete() {
unlink($filePath);
}
catch (Exception $e) {
sendlog("Deletion ".$e->getMessage(), "logs/webedior-ajax.log");
sendlog("Deletion ".$e->getMessage(), "webedior-ajax.log");
$result["error"] = "error: " . $e->getMessage();
return $result;
}

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2019 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/*
Copyright (c) Ascensio System SIA 2017. All rights reserved.
Copyright (c) Ascensio System SIA 2019. All rights reserved.
http://www.onlyoffice.com
*/
if (typeof jQuery != "undefined") {

View File

@ -1,5 +1,5 @@
/*
Copyright (c) Ascensio System SIA 2017. All rights reserved.
Copyright (c) Ascensio System SIA 2019. All rights reserved.
http://www.onlyoffice.com
*/
html {

View File

@ -1,5 +1,5 @@
/*
Copyright (c) Ascensio System SIA 2017. All rights reserved.
Copyright (c) Ascensio System SIA 2019. All rights reserved.
http://www.onlyoffice.com
*/
html {

View File

@ -1,10 +1,10 @@
class FileUtility
@@exts_document = %w(.doc .docx .docm .dot .dotx .dotm .odt .fodt .rtf .txt .html .htm .mht .pdf .djvu .fb2 .epub .xps)
@@exts_document = %w(.doc .docx .docm .dot .dotx .dotm .odt .fodt .ott .rtf .txt .html .htm .mht .pdf .djvu .fb2 .epub .xps)
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .xlt .xltx .xltm .ods .fods .csv)
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .xlt .xltx .xltm .ods .fods .ots .csv)
@@exts_presentation = %w(.pps .ppsx .ppsm .ppt .pptx .pptm .pot .potx .potm .odp .fodp)
@@exts_presentation = %w(.pps .ppsx .ppsm .ppt .pptx .pptm .pot .potx .potm .odp .fodp .otp)
class << self

View File

@ -16,7 +16,7 @@
console.log(message);
};
var onReady = function () {
var onAppReady = function () {
innerAlert("Document editor ready");
};
@ -91,7 +91,7 @@
},
},
events: {
'onReady': onReady,
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
@ -105,21 +105,4 @@
window.attachEvent("load", сonnectEditor);
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (ex) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
</script>

View File

@ -36,12 +36,12 @@ module OnlineEditorsExampleRuby
Rails.configuration.timeout=120
Rails.configuration.viewedDocs=".pdf|.djvu|.xps"
Rails.configuration.editedDocs=".docx|.xlsx|.csv|.pptx|.ppsx|.txt"
Rails.configuration.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.rtf|.mht|.html|.htm|.epub"
Rails.configuration.editedDocs=".docx|.xlsx|.csv|.pptx|.txt"
Rails.configuration.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.epub"
Rails.configuration.urlConverter="http://documentserver/ConvertService.ashx"
Rails.configuration.urlApi="http://documentserver/web-apps/apps/api/documents/api.js"
Rails.configuration.urlPreloader="http://documentserver/web-apps/apps/api/documents/cache-scripts.html"
Rails.configuration.urlConverter="https://documentserver/ConvertService.ashx"
Rails.configuration.urlApi="https://documentserver/web-apps/apps/api/documents/api.js"
Rails.configuration.urlPreloader="https://documentserver/web-apps/apps/api/documents/cache-scripts.html"
end
end

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System SIA 2019
*
* The MIT License (MIT)
*
@ -90,6 +90,6 @@ onlyoffice4enterprise/documentserver-ee</pre>
</div>
</div>
<footer>© Ascensio Systems Inc 2017. All rights reserved.</footer>
<footer>© Ascensio Systems SIA 2019. All rights reserved.</footer>
</body>
</html>