Compare commits

...

46 Commits

Author SHA1 Message Date
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
89 changed files with 317 additions and 306 deletions

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2018 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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2018 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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* 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 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

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

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

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

View File

@ -11,10 +11,10 @@
<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.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* 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

@ -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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

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

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2018 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 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

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

View File

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

View File

@ -7,10 +7,10 @@
<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.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.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

@ -0,0 +1,9 @@
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y software-properties-common \
python-software-properties
RUN add-apt-repository -y ppa:webupd8team/java
RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
RUN apt-get update && apt-get install -y oracle-java8-installer \
maven
COPY . /java
CMD mvn -f /java package

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2018 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,61 @@
## 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 build . -t java-example
docker run -it -v $PWD/target:/java/target java-example
```
After it, all bin files will be passed to `./target` folder

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>

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -56,7 +56,7 @@ public class IndexServlet extends HttpServlet
{
String action = request.getParameter("type");
if(action == null)
if (action == null)
{
request.getRequestDispatcher("index.jsp").forward(request, response);
return;
@ -249,7 +249,7 @@ public class IndexServlet extends HttpServlet
long status = (long) jsonObj.get("status");
int saved = 0;
if(status == 2 || status == 3)//MustSave, Corrupted
if (status == 2 || status == 3)//MustSave, Corrupted
{
String downloadUri = (String) jsonObj.get("url");

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -117,7 +117,7 @@ public class DocumentManager
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);
@ -126,7 +126,7 @@ public class DocumentManager
file.mkdir();
}
directory = directory + hostAddress + "\\";
directory = directory + hostAddress + File.separator;
file = new File(directory);
if (!file.exists())
@ -181,11 +181,11 @@ public class DocumentManager
{
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;
}
@ -197,12 +197,12 @@ public class DocumentManager
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
{

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -58,7 +58,7 @@ public class FileUtility
(
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".rtf", ".txt",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
);
@ -67,7 +67,7 @@ public class FileUtility
(
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".csv"
".ods", ".fods", ".ots", ".csv"
);
public static List<String> ExtsPresentation = Arrays.asList
@ -75,7 +75,7 @@ public class FileUtility
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp"
".odp", ".fodp", ".otp"
);

View File

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

View File

@ -3,10 +3,10 @@ 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.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -146,23 +146,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>

View File

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

View File

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

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2018 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 Limited 2010-2018
*
* 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 Limited 2010-2018
*
* 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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 ONLYOFFICE
Copyright (c) 2018 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 Limited 2010-2018
*
* The MIT License (MIT)
*
@ -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;
}
@ -519,7 +534,7 @@ app.get("/editor", function (req, res) {
var fileName = fileUtility.getFileName(req.query.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 +613,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",
@ -21,7 +21,7 @@
"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"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,7 @@
"use strict";
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -303,7 +304,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 Limited 2010-2018
*
* 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,
@ -185,6 +184,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 +218,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 Limited 2010-2018
*
* 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 Limited 2010-2018
*
* The MIT License (MIT)
*

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* 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) {

View File

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

View File

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

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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -130,7 +130,7 @@
<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>
@ -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">
@ -241,7 +245,7 @@
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
<footer>&copy; Ascensio Systems Inc 2017. All rights reserved.</footer>
<footer>&copy; Ascensio Systems Inc 2018. 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) 2018 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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* 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

@ -8,14 +8,14 @@ $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_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* 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!!!
}
@ -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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* The MIT License (MIT)
*
@ -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 Limited 2010-2018
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System Limited 2010-2017
* (c) Copyright Ascensio System Limited 2010-2018
*
* 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) 2018 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 2018. 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 2018. 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 2018. 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

@ -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

@ -37,11 +37,11 @@ module OnlineEditorsExampleRuby
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.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.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 Limited 2010-2018
*
* 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 Limited 2010-2018
*
* 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 Inc 2018. All rights reserved.</footer>
</body>
</html>