Compare commits
198 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4096952ed1 | |||
| c973d1e8d5 | |||
| 64021ceded | |||
| 2a0384c875 | |||
| 906050f9bc | |||
| 7743b8a71b | |||
| c138c653f0 | |||
| 9d3c4a83f4 | |||
| 24d2f595da | |||
| c9717c402b | |||
| ef54a2899b | |||
| 564a077cdb | |||
| 01786b3059 | |||
| 9947c96266 | |||
| d2bea39ada | |||
| b269edf116 | |||
| 34e0c4fc92 | |||
| 55fbdf7ba2 | |||
| f483c9a71d | |||
| 3a4b300c64 | |||
| 4f87ac132c | |||
| 5e4f1de764 | |||
| 10ce2da945 | |||
| 835679183d | |||
| 057af70f2e | |||
| f9272eb4e7 | |||
| 5b8a3519a6 | |||
| 43d2887bd8 | |||
| 5a1329f12e | |||
| 8ed8e99eaa | |||
| 9367a682a8 | |||
| 3345549436 | |||
| e1d5c9a91b | |||
| c858c4fdce | |||
| fbec8b4d19 | |||
| 9906960c69 | |||
| 9c1d998384 | |||
| cfe9b8b386 | |||
| 90a0124eb5 | |||
| 135aa85046 | |||
| 48eb9ed2e6 | |||
| 79419537ea | |||
| a11f1a27e2 | |||
| 8086cb8e33 | |||
| 728d5720bd | |||
| add2ca8ba0 | |||
| 183f7edd70 | |||
| a9627feb27 | |||
| 48da865ce3 | |||
| 911f3e9723 | |||
| a8b23d82d9 | |||
| 0df21c3f8e | |||
| 00296b90c8 | |||
| 3eae49253f | |||
| c8d28ec950 | |||
| 403ff78807 | |||
| bfa121f343 | |||
| f38e2779be | |||
| afdd56388c | |||
| e8a68fad5a | |||
| 1654d4978f | |||
| 86bf4d083a | |||
| 540a8ea98b | |||
| 729c67ab8f | |||
| 3d529bf57c | |||
| 7f2dfc37d4 | |||
| 6c386f852d | |||
| 7469285d0c | |||
| 863eee6db7 | |||
| 74ff4cec88 | |||
| 209881f280 | |||
| 32b4c49f6e | |||
| 9545bd4375 | |||
| 2bc8081b04 | |||
| 9ce708913b | |||
| 0db101a270 | |||
| 5660b1f1c2 | |||
| ef294de17f | |||
| 1759180e13 | |||
| 1ef8d40b50 | |||
| 8f9d99faf8 | |||
| 0d0ecc73f8 | |||
| 3117231ac8 | |||
| 0b61d7ff21 | |||
| cda6534e5b | |||
| c51e3b8837 | |||
| a18a5ee73f | |||
| a0651092f7 | |||
| aba434f46d | |||
| edb43ab59d | |||
| dabd5816f1 | |||
| 0c7eabdf3c | |||
| 11ef9d8a80 | |||
| eb9e9f7db4 | |||
| eb0a556333 | |||
| 1f661f588b | |||
| b6577bd184 | |||
| 5e1e23176c | |||
| 6045fefe43 | |||
| 68f73f543a | |||
| ff745e0b71 | |||
| b7e267842f | |||
| dc54716171 | |||
| 60376861ce | |||
| 108f655fec | |||
| 4a5da5ee4e | |||
| 6a10d55e2b | |||
| af53ccb534 | |||
| acf09aa5ef | |||
| 36866764ce | |||
| b1df939a1a | |||
| ada58ecb95 | |||
| c78f1bd2ce | |||
| 91643fe247 | |||
| 538666f6c1 | |||
| 9402f769c6 | |||
| 94f4995f3b | |||
| bb736d85f8 | |||
| 721f2fbf6c | |||
| bb22b73431 | |||
| 704d8bceb9 | |||
| 74097ec485 | |||
| 0dd9cbca36 | |||
| fe0d985555 | |||
| 9aa6e58bfc | |||
| 0d894df803 | |||
| b93338d5e9 | |||
| 8c18df7e4c | |||
| 5b5593240f | |||
| 770b8bbe70 | |||
| dd0987a6fc | |||
| 70affcc0e8 | |||
| ceacac691d | |||
| 345e272cbb | |||
| 9116eae2a1 | |||
| e8b384f49a | |||
| 8cf84391c0 | |||
| dec01fe8b2 | |||
| 46d308c1b8 | |||
| f40f1a4704 | |||
| 88e541971e | |||
| 6239e05032 | |||
| e25f957605 | |||
| 5c0c2f7baa | |||
| 974e728d8b | |||
| 14dabe7789 | |||
| 18de6a1616 | |||
| 983fa34c9f | |||
| 95a28b15b4 | |||
| 6290abf5dd | |||
| d11115e452 | |||
| 39a32011f8 | |||
| 938212cb6a | |||
| 267e14edde | |||
| 90710b9710 | |||
| 1794ce39ab | |||
| 95218e4fe4 | |||
| 13ccad5fbd | |||
| 15c23bfc40 | |||
| f5a11721bd | |||
| 9a3865e36e | |||
| d8ea6a6dbb | |||
| aaf8ac5328 | |||
| 11bbbebec1 | |||
| 27f21fd6f5 | |||
| e76faa4671 | |||
| 4d7fe321ba | |||
| aeda04b9e7 | |||
| 699370936a | |||
| ba95202084 | |||
| 2f72904deb | |||
| cd033ac3bd | |||
| 6b9e5503c3 | |||
| d6d9ea024c | |||
| f74fb7384e | |||
| 14458f82dd | |||
| f4a11e2047 | |||
| 0f9f09d346 | |||
| ed0a70f071 | |||
| dadba2a81f | |||
| fe56ec24b5 | |||
| 6a11ac4ced | |||
| 5169b1dc97 | |||
| dabb51bf8a | |||
| f15f48eba5 | |||
| 12753dee19 | |||
| 598e914452 | |||
| 099a53b24b | |||
| d01263917c | |||
| 0f3c40e0b1 | |||
| bf2f32b7cb | |||
| 534eedfae1 | |||
| 77775754b6 | |||
| bfebc197af | |||
| a3d7b159da | |||
| f12cb242ea | |||
| 8a5f37da3f | |||
| 5c9fe8f8f5 |
2
.github/workflows/lint-go.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
go-version: '1.23.10'
|
||||
|
||||
- name: Lint Golangci
|
||||
run: |
|
||||
|
||||
18
CHANGELOG.md
@ -1,11 +1,27 @@
|
||||
# Change Log
|
||||
|
||||
## 1.15.0
|
||||
- php-laravel: fix custom jwt header
|
||||
- formats for ds v9.1
|
||||
- user role
|
||||
- start filling
|
||||
- update demo files
|
||||
- set users by parts
|
||||
- open the conversion dialog box with a gray check mark on the type selection step
|
||||
- preload frame moved from uploading popup
|
||||
- change tab title on rename
|
||||
- change uploaded file name in popup if converted
|
||||
- features tips for anonymous
|
||||
- view odg, md
|
||||
- edit xlsb
|
||||
- support vsdx in diagram editor
|
||||
|
||||
## 1.14.1
|
||||
- nodejs: formats for ds v9.1
|
||||
|
||||
## 1.14.0
|
||||
- nodejs: set users by parts
|
||||
- nodejs: preload frame moved from uploading popap
|
||||
- nodejs: preload frame moved from uploading popup
|
||||
- nodejs: view odg, md
|
||||
- nodejs: edit xlsb
|
||||
- nodejs: support vsdx in diagram editor
|
||||
|
||||
@ -19,7 +19,7 @@ You should change `http://documentserver` to your server address in these files:
|
||||
* [Python](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/python) - `web/documentserver-example/python/src/configuration/configuration.py`
|
||||
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/app/configuration/configuration.rb`
|
||||
|
||||
More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview")
|
||||
More information on how to use these examples can be found here: [https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/)
|
||||
|
||||
## API methods for test examples
|
||||
|
||||
|
||||
BIN
web/documentserver-example/csharp-mvc/Content/images/diagram.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,6 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
|
||||
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
|
||||
<path d="M5 8h6v1H5zm0 1h1v1H5zm5 0h1v1h-1zM7 6h2v2H7z" fill="#5951BB"/>
|
||||
<path stroke="#5951BB" d="M4.5 10.5h2v2h-2zm5 0h2v2h-2z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 469 B |
@ -511,10 +511,6 @@ label .checkbox {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
@ -631,6 +627,11 @@ footer table tr td:first-child {
|
||||
background-image: url("images/icon_pdf.svg");
|
||||
}
|
||||
|
||||
.stored-edit.diagram,
|
||||
.uploadFileName.diagram {
|
||||
background-image: url("images/icon_vsdx.svg");
|
||||
}
|
||||
|
||||
.stored-edit span {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
|
||||
@ -26,14 +26,16 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
static List<string> descr_user_1 = new List<string>()
|
||||
{
|
||||
"File author by default",
|
||||
"Doesn’t belong to any group",
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"The file favorite state is undefined",
|
||||
"Can create files from templates using data from the editor",
|
||||
"Can see the information about all users",
|
||||
"This file isn't marked as favorite",
|
||||
"Can create files from templates using data from the editor",
|
||||
"Has an avatar",
|
||||
"Can submit forms"
|
||||
"Can submit forms",
|
||||
"Has no roles",
|
||||
"Can start filling"
|
||||
};
|
||||
|
||||
static List<string> descr_user_2 = new List<string>()
|
||||
@ -41,11 +43,13 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
"Belongs to Group2",
|
||||
"Can review only his own changes or changes made by users with no group",
|
||||
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
|
||||
"Can see the information about users from Group2 and users who don't belong to any group",
|
||||
"This file is marked as favorite",
|
||||
"Can create new files from the editor",
|
||||
"Can see the information about users from Group2 and users who don’t belong to any group",
|
||||
"Has an avatar",
|
||||
"Can’t submit forms"
|
||||
"Can't submit forms",
|
||||
"Has role 'Anyone'",
|
||||
"Can start filling"
|
||||
};
|
||||
|
||||
static List<string> descr_user_3 = new List<string>()
|
||||
@ -53,33 +57,38 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
"Belongs to Group3",
|
||||
"Can review changes made by Group2 users",
|
||||
"Can view comments left by Group2 and Group3 users. Can edit comments left by the Group2 users",
|
||||
"This file isn’t marked as favorite",
|
||||
"Can’t copy data from the file to clipboard",
|
||||
"Can’t download the file",
|
||||
"Can’t print the file",
|
||||
"Can create new files from the editor",
|
||||
"Can see the information about Group2 users",
|
||||
"Can’t submit forms",
|
||||
"The file favorite state is undefined",
|
||||
"Can't copy data from the file to clipboard",
|
||||
"Can't download the file",
|
||||
"Can't print the file",
|
||||
"Can create new files from the editor",
|
||||
"Can't submit forms",
|
||||
"Can't close history",
|
||||
"Can't restore the file version"
|
||||
"Can't restore the file version",
|
||||
"Has role 'role'",
|
||||
"Can start filling"
|
||||
};
|
||||
|
||||
static List<string> descr_user_0 = new List<string>()
|
||||
{
|
||||
"The name is requested when the editor is opened",
|
||||
"Doesn’t belong to any group",
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"Can't see anyone's information",
|
||||
"The file favorite state is undefined",
|
||||
"Can't mention others in comments",
|
||||
"Can't create new files from the editor",
|
||||
"Can’t see anyone’s information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration",
|
||||
"Can’t submit forms",
|
||||
"Can’t refresh outdated file"
|
||||
"Can't refresh outdated file",
|
||||
"Can't submit forms",
|
||||
"Tour of tips when opening a document",
|
||||
"Has empty role",
|
||||
"Can't start filling"
|
||||
};
|
||||
|
||||
private static List<User> users = new List<User>() {
|
||||
@ -91,13 +100,14 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
null,
|
||||
new Dictionary<string, object>(),
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
new List<string>(),
|
||||
descr_user_1,
|
||||
true,
|
||||
true,
|
||||
new Goback(null, false),
|
||||
new Close(null, false)
|
||||
new Close(null, false),
|
||||
null
|
||||
),
|
||||
new User(
|
||||
"uid-2",
|
||||
@ -118,7 +128,8 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
false,
|
||||
true,
|
||||
new Goback("Go to Documents", null),
|
||||
new Close(null, true)
|
||||
new Close(null, true),
|
||||
new List<string>() { "Anyone" }
|
||||
),
|
||||
new User(
|
||||
"uid-3",
|
||||
@ -133,13 +144,14 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
{ "remove", new List<string>() { } }
|
||||
},
|
||||
new List<string>() { "group-2" },
|
||||
false,
|
||||
null,
|
||||
new List<string>() { "copy", "download", "print" },
|
||||
descr_user_3,
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
new Close(null, true)
|
||||
new Close(null, true),
|
||||
new List<string>() { "role" }
|
||||
),
|
||||
new User(
|
||||
"uid-0",
|
||||
@ -155,7 +167,8 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
null
|
||||
null,
|
||||
new List<string>()
|
||||
)
|
||||
};
|
||||
|
||||
@ -248,8 +261,9 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
|
||||
public Goback goback;
|
||||
public Close close;
|
||||
public List<string> roles;
|
||||
|
||||
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
|
||||
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close, List<string> roles)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
@ -265,6 +279,7 @@ namespace OnlineEditorsExampleMVC.Helpers
|
||||
this.avatar = avatar;
|
||||
this.goback = goback;
|
||||
this.close = close;
|
||||
this.roles = roles;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -190,6 +190,7 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{
|
||||
{ "id", !user.id.Equals("uid-0") ? user.id : null },
|
||||
{ "name", user.name },
|
||||
{ "roles", user.roles },
|
||||
{ "group", user.group },
|
||||
{ "image", user.avatar ? DocManagerHelper.GetServerUrl(false) + "/Content/images/" + user.id + ".png" : null}
|
||||
}
|
||||
@ -227,6 +228,12 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{ "text", user.close.text },
|
||||
{ "visible", user.close. visible }
|
||||
} : new Dictionary<string, object>{}
|
||||
},
|
||||
{
|
||||
"features", new Dictionary<string, object>
|
||||
{
|
||||
{ "featuresTips", user.id.Equals("uid-0") }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -380,7 +387,7 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
var jss = new JavaScriptSerializer();
|
||||
var id = request.Cookies.GetOrDefault("uid", null);
|
||||
var user = Users.getUser(id);
|
||||
usersForMentions = !user.id.Equals("uid-0") ? jss.Serialize(Users.getUsersForMentions(user.id)) : null;
|
||||
usersForMentions = jss.Serialize(!user.id.Equals("uid-0") ? Users.getUsersForMentions(user.id) : null);
|
||||
}
|
||||
|
||||
public void GetUsersInfo(HttpRequest request, out string usersInfo)
|
||||
@ -397,7 +404,7 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
var jss = new JavaScriptSerializer();
|
||||
var id = request.Cookies.GetOrDefault("uid", null);
|
||||
var user = Users.getUser(id);
|
||||
usersForProtect = !user.id.Equals("uid-0") ? jss.Serialize(Users.getUsersForProtect(user.id)) : null;
|
||||
usersForProtect = jss.Serialize(!user.id.Equals("uid-0") ? Users.getUsersForProtect(user.id) : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -35,7 +35,8 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
Word,
|
||||
Cell,
|
||||
Slide,
|
||||
Pdf
|
||||
Pdf,
|
||||
Diagram
|
||||
}
|
||||
|
||||
// get file type
|
||||
@ -47,6 +48,7 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
if (FormatManager.DocumentExtensions().Contains(ext)) return FileType.Word; // word type for document extensions
|
||||
if (FormatManager.SpreadsheetExtensions().Contains(ext)) return FileType.Cell; // cell type for spreadsheet extensions
|
||||
if (FormatManager.PresentationExtensions().Contains(ext)) return FileType.Slide; // slide type for presentation extensions
|
||||
if (FormatManager.DiagramExtensions().Contains(ext)) return FileType.Diagram; // diagram type for diagram extensions
|
||||
|
||||
return FileType.Null; // the default type is word
|
||||
}
|
||||
@ -202,6 +204,20 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<string> DiagramExtensions()
|
||||
{
|
||||
return Diagrams()
|
||||
.Select(format => format.Extension())
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<Format> Diagrams()
|
||||
{
|
||||
return All()
|
||||
.Where(format => format.Type == FileType.Diagram)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<string> AllExtensions()
|
||||
{
|
||||
return All()
|
||||
|
||||
@ -12,7 +12,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
|
||||
|
||||
## Step 2. Download the .Net (C# MVC) code for the editors integration
|
||||
|
||||
Download the [.Net (C# MVC) example](https://api.onlyoffice.com/editors/demopreview) from our site.
|
||||
Download the [.Net (C# MVC) example](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/) from our site.
|
||||
|
||||
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the *web.appsettings.config* file:
|
||||
```
|
||||
@ -21,10 +21,10 @@ To connect the editors to your website, specify the path to the editors installa
|
||||
```
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storage-path** is the path where files will be created and stored. You can set an absolute path.
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) in the *DocEditor.aspx* file.
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/docs/docs-api/usage-api/advanced-parameters/) in the *DocEditor.aspx* file.
|
||||
|
||||
## Step 3. Install the prerequisites
|
||||
Сheck if your system meets the system requirements:
|
||||
Check if your system meets the system requirements:
|
||||
* **Microsoft .NET Framework**: version 4.5 (download it from the [official Microsoft website](https://www.microsoft.com/en-US/download/details.aspx?id=30653));
|
||||
* **Internet Information Services**: version 7 or later.
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
if (!formatManager.isAutoConvertible(posExt)) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -182,36 +182,16 @@ if (typeof jQuery != "undefined") {
|
||||
if (response.step && response.step < 100) {
|
||||
checkConvert(filePass, fileType);
|
||||
} else {
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = '<iframe id="iframeScripts" width=1 height=1 style="position: absolute; visibility: hidden;" ></iframe>';
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
var onuploaded = function () {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
@ -273,7 +253,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
@ -354,7 +334,7 @@ if (typeof jQuery != "undefined") {
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(fileName);
|
||||
jq("#convertStep1").addClass("done");
|
||||
jq("#convertStep1").addClass("error");
|
||||
jq("#convertStep2").addClass("waiting");
|
||||
});
|
||||
|
||||
@ -364,6 +344,7 @@ if (typeof jQuery != "undefined") {
|
||||
let fileExt = jq(`#${id}`).attr("data");
|
||||
jq(`#${id}`).addClass("orange");
|
||||
jq("td[name='convertingTypeButton']").addClass("disable");
|
||||
jq("#convertStep1").removeClass("error").addClass("done");
|
||||
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
|
||||
jq("#convertStep2").text('2. File conversion');
|
||||
jq("#convert-descr").removeClass("disable");
|
||||
|
||||
@ -117,6 +117,10 @@
|
||||
|
||||
// the meta information of the document is changed via the meta command
|
||||
var onMetaChange = function (event) {
|
||||
if (event.data.title !== undefined) {
|
||||
document.title = event.data.title + " - ONLYOFFICE";
|
||||
}
|
||||
|
||||
if (event.data.favorite !== undefined) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
@ -358,10 +362,33 @@
|
||||
default:
|
||||
users = <%= usersForMentions %>;
|
||||
}
|
||||
docEditor.setUsers({
|
||||
if ((c === "protect" || c === "mention") && users && event.data.count) {
|
||||
let from = event.data.from;
|
||||
let count = event.data.count;
|
||||
let search = event.data.search;
|
||||
if (from != 0) users = [];
|
||||
var resultCount = 234;
|
||||
for (var i = Math.max(users.length, from); i < Math.min(from + count, resultCount); i++){
|
||||
users.push({
|
||||
email: "test@test.test" + (i + 1),
|
||||
id: "id" + (i + 1),
|
||||
name: "test_" + search + (i + 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var result = {
|
||||
"c": c,
|
||||
"users": users,
|
||||
});
|
||||
};
|
||||
if (resultCount) {
|
||||
// support v9.0
|
||||
result.total = 1 + (!event.data.count || users.length < event.data.count ? 0 : (event.data.from + event.data.count));
|
||||
// since v9.0.1
|
||||
result.isPaginated = true;
|
||||
}
|
||||
|
||||
docEditor.setUsers(result);
|
||||
};
|
||||
|
||||
var onRequestSendNotify = function (event) {
|
||||
@ -370,6 +397,18 @@
|
||||
innerAlert("onRequestSendNotify: " + data);
|
||||
};
|
||||
|
||||
var onRequestStartFilling = function(event) {
|
||||
var data = event.data;
|
||||
var submit = confirm("Start filling?\n" + JSON.stringify(data));
|
||||
if (submit) {
|
||||
docEditor.startFilling(true);
|
||||
}
|
||||
};
|
||||
|
||||
var onStartFilling = function(event) {
|
||||
innerAlert("The form is ready to fill out.");
|
||||
};
|
||||
|
||||
config = <%= Model.GetDocConfig(Request, Url) %>;
|
||||
|
||||
config.width = "100%";
|
||||
@ -390,6 +429,8 @@
|
||||
|
||||
if (config.editorConfig.user.id) {
|
||||
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
|
||||
config.events['onRequestStartFilling'] = onRequestStartFilling;
|
||||
config.events['onStartFilling'] = onStartFilling;
|
||||
config.events['onRequestClose'] = onRequestClose;
|
||||
// the user is trying to show the document version history
|
||||
config.events['onRequestHistory'] = onRequestHistory;
|
||||
@ -421,7 +462,7 @@
|
||||
config.events['onRequestReferenceSource'] = onRequestReferenceSource;
|
||||
}
|
||||
|
||||
var сonnectEditor = function () {
|
||||
var connectEditor = function () {
|
||||
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
|
||||
};
|
||||
|
||||
@ -433,9 +474,9 @@
|
||||
};
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("load", сonnectEditor);
|
||||
window.addEventListener("load", connectEditor);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("load", сonnectEditor);
|
||||
window.attachEvent("load", connectEditor);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -154,13 +154,18 @@
|
||||
</menu>
|
||||
<% var storedFiles = DocManagerHelper.GetStoredFiles(); %>
|
||||
<div id="portal-info" style="display: <%= storedFiles.Any() ? "none" : "table-cell" %>">
|
||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
|
||||
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
|
||||
<span class="portal-descr">
|
||||
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
|
||||
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
|
||||
You can test editing features in real-time and explore multi-user collaboration:
|
||||
<ul>
|
||||
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
|
||||
<li>Upload your own files to test using the Upload file button</li>
|
||||
<li>Select your username and language to simulate different users and environments</li>
|
||||
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
|
||||
</ul>
|
||||
</span>
|
||||
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
|
||||
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
|
||||
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
|
||||
<% foreach (User user in Users.getAllUsers())
|
||||
{ %>
|
||||
<div class="user-descr" onclick="toggleUserDescr(event)">
|
||||
@ -362,10 +367,7 @@
|
||||
<span class="errorPass"></span>
|
||||
<br />
|
||||
</div>
|
||||
<span id="step3" class="step">3. Loading editor scripts.</span>
|
||||
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
|
||||
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
|
||||
<br />
|
||||
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
|
||||
<br />
|
||||
<div class="error-message">
|
||||
@ -410,7 +412,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" data-docs="<%= WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.preloader"] %>"></span>
|
||||
<iframe id="iframeScripts" src="<%= WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.preloader"] %>" width=1 height=1 style="position: absolute; visibility: hidden; top: 0;" ></iframe>
|
||||
|
||||
<footer>
|
||||
<div class="center">
|
||||
@ -418,7 +420,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.14.0"/>
|
||||
<add key="version" value="1.15.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
|
||||
BIN
web/documentserver-example/csharp/App_Themes/images/diagram.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,6 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
|
||||
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
|
||||
<path d="M5 8h6v1H5zm0 1h1v1H5zm5 0h1v1h-1zM7 6h2v2H7z" fill="#5951BB"/>
|
||||
<path stroke="#5951BB" d="M4.5 10.5h2v2h-2zm5 0h2v2h-2z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 469 B |
@ -511,10 +511,6 @@ label .checkbox {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
@ -635,6 +631,11 @@ footer a:hover {
|
||||
background-image: url("images/icon_pdf.svg");
|
||||
}
|
||||
|
||||
.stored-edit.diagram,
|
||||
.uploadFileName.diagram {
|
||||
background-image: url("images/icon_vsdx.svg");
|
||||
}
|
||||
|
||||
.stored-edit span {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
|
||||
@ -156,13 +156,18 @@
|
||||
<% } %>
|
||||
</menu>
|
||||
<div id="portal-info" style="display: <%= storedFiles.Any() ? "none" : "table-cell" %>">
|
||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
|
||||
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
|
||||
<span class="portal-descr">
|
||||
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
|
||||
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
|
||||
You can test editing features in real-time and explore multi-user collaboration:
|
||||
<ul>
|
||||
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
|
||||
<li>Upload your own files to test using the Upload file button</li>
|
||||
<li>Select your username and language to simulate different users and environments</li>
|
||||
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
|
||||
</ul>
|
||||
</span>
|
||||
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
|
||||
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
|
||||
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
|
||||
<% foreach (User user in Users.getAllUsers())
|
||||
{ %>
|
||||
<div class="user-descr" onclick="toggleUserDescr(event)">
|
||||
@ -364,10 +369,7 @@
|
||||
<span class="errorPass"></span>
|
||||
<br />
|
||||
</div>
|
||||
<span id="step3" class="step">3. Loading editor scripts.</span>
|
||||
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
|
||||
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
|
||||
<br />
|
||||
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
|
||||
<br />
|
||||
<div class="error-message">
|
||||
@ -412,7 +414,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" data-docs="<%= UrlPreloadScripts %>"></span>
|
||||
<iframe id="iframeScripts" src="<%= UrlPreloadScripts %>" width=1 height=1 style="position: absolute; visibility: hidden; top: 0;" ></iframe>
|
||||
|
||||
<footer>
|
||||
<div class="center">
|
||||
@ -420,7 +422,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -254,6 +254,7 @@ namespace OnlineEditorsExample
|
||||
if (FormatManager.DocumentExtensions().Contains(ext)) return "word"; // word for text document extensions
|
||||
if (FormatManager.SpreadsheetExtensions().Contains(ext)) return "cell"; // cell for spreadsheet extensions
|
||||
if (FormatManager.PresentationExtensions().Contains(ext)) return "slide"; // slide for presentation extensions
|
||||
if (FormatManager.DiagramExtensions().Contains(ext)) return "diagram"; // diagram for diagram extensions
|
||||
|
||||
return "word"; // the default document type is word
|
||||
}
|
||||
|
||||
@ -135,6 +135,10 @@
|
||||
|
||||
// the meta information of the document is changed via the meta command
|
||||
var onMetaChange = function (event) {
|
||||
if (event.data.title !== undefined) {
|
||||
document.title = event.data.title + " - ONLYOFFICE";
|
||||
}
|
||||
|
||||
if (event.data.favorite !== undefined) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
@ -323,10 +327,33 @@
|
||||
default:
|
||||
users = <%= UsersForMentions %>;
|
||||
}
|
||||
docEditor.setUsers({
|
||||
if ((c === "protect" || c === "mention") && users && event.data.count) {
|
||||
let from = event.data.from;
|
||||
let count = event.data.count;
|
||||
let search = event.data.search;
|
||||
if (from != 0) users = [];
|
||||
var resultCount = 234;
|
||||
for (var i = Math.max(users.length, from); i < Math.min(from + count, resultCount); i++){
|
||||
users.push({
|
||||
email: "test@test.test" + (i + 1),
|
||||
id: "id" + (i + 1),
|
||||
name: "test_" + search + (i + 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var result = {
|
||||
"c": c,
|
||||
"users": users,
|
||||
});
|
||||
};
|
||||
if (resultCount) {
|
||||
// support v9.0
|
||||
result.total = 1 + (!event.data.count || users.length < event.data.count ? 0 : (event.data.from + event.data.count));
|
||||
// since v9.0.1
|
||||
result.isPaginated = true;
|
||||
}
|
||||
|
||||
docEditor.setUsers(result);
|
||||
};
|
||||
|
||||
var onRequestSendNotify = function (event) {
|
||||
@ -335,6 +362,18 @@
|
||||
innerAlert("onRequestSendNotify: " + data);
|
||||
};
|
||||
|
||||
var onRequestStartFilling = function(event) {
|
||||
var data = event.data;
|
||||
var submit = confirm("Start filling?\n" + JSON.stringify(data));
|
||||
if (submit) {
|
||||
docEditor.startFilling(true);
|
||||
}
|
||||
};
|
||||
|
||||
var onStartFilling = function(event) {
|
||||
innerAlert("The form is ready to fill out.");
|
||||
};
|
||||
|
||||
config = <%= DocConfig %>;
|
||||
|
||||
config.width = "100%";
|
||||
@ -356,6 +395,8 @@
|
||||
if (config.editorConfig.user.id) {
|
||||
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
|
||||
config.events['onRequestClose'] = onRequestClose;
|
||||
config.events['onRequestStartFilling'] = onRequestStartFilling;
|
||||
config.events['onStartFilling'] = onStartFilling;
|
||||
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
@ -421,7 +462,7 @@
|
||||
config.events['onRequestReferenceSource'] = onRequestReferenceSource;
|
||||
}
|
||||
|
||||
var сonnectEditor = function () {
|
||||
var connectEditor = function () {
|
||||
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
|
||||
};
|
||||
|
||||
@ -433,9 +474,9 @@
|
||||
};
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("load", сonnectEditor);
|
||||
window.addEventListener("load", connectEditor);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("load", сonnectEditor);
|
||||
window.attachEvent("load", connectEditor);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -257,6 +257,7 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
{ "id", !user.id.Equals("uid-0") ? user.id : null },
|
||||
{ "name", user.name },
|
||||
{ "roles", user.roles },
|
||||
{ "group", user.group },
|
||||
{ "image", user.avatar ? _Default.GetServerUrl(false) + "/App_Themes/images/"+ user.id + ".png" : null }
|
||||
}
|
||||
@ -294,6 +295,12 @@ namespace OnlineEditorsExample
|
||||
{ "visible", user.close.visible },
|
||||
{ "text", user.close.text }
|
||||
} : new Dictionary<string, object>{}
|
||||
},
|
||||
{
|
||||
"features", new Dictionary<string, object>
|
||||
{
|
||||
{ "featuresTips", user.id.Equals("uid-0") }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -327,14 +334,14 @@ namespace OnlineEditorsExample
|
||||
|
||||
// get users for mentions
|
||||
List<Dictionary<string, object>> usersData = Users.getUsersForMentions(user.id);
|
||||
UsersForMentions = !user.id.Equals("uid-0") ? jss.Serialize(usersData) : null;
|
||||
UsersForMentions = jss.Serialize(!user.id.Equals("uid-0") ? usersData : null);
|
||||
|
||||
List<Dictionary<string, object>> usersInfo = Users.getUsersInfo(user.id);
|
||||
UsersInfo = jss.Serialize(usersData);
|
||||
|
||||
// get users for protect
|
||||
List<Dictionary<string, object>> usersProtectData = Users.getUsersForProtect(user.id);
|
||||
UsersForProtect = !user.id.Equals("uid-0") ? jss.Serialize(usersProtectData) : null;
|
||||
UsersForProtect = jss.Serialize(!user.id.Equals("uid-0") ? usersProtectData : null);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -164,6 +164,20 @@ namespace OnlineEditorsExample
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<string> DiagramExtensions()
|
||||
{
|
||||
return Diagrams()
|
||||
.Select(format => format.Extension())
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<Format> Diagrams()
|
||||
{
|
||||
return All()
|
||||
.Where(format => format.Type == "diagram")
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<string> AllExtensions()
|
||||
{
|
||||
return All()
|
||||
|
||||
@ -12,7 +12,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
|
||||
|
||||
## Step 2. Download the .Net (C#) code for the editors integration
|
||||
|
||||
Download the [.Net (C#) example](https://api.onlyoffice.com/editors/demopreview) from our site.
|
||||
Download the [.Net (C#) example](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/) from our site.
|
||||
|
||||
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the *settings.config* file:
|
||||
```
|
||||
@ -21,7 +21,7 @@ To connect the editors to your website, specify the path to the editors installa
|
||||
```
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storage-path** is the path where files will be created and stored. You can set an absolute path.
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) in the *DocEditor.aspx* file.
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/docs/docs-api/usage-api/advanced-parameters/) in the *DocEditor.aspx* file.
|
||||
|
||||
## Step 3. Install the prerequisites
|
||||
|
||||
|
||||
@ -25,14 +25,16 @@ namespace OnlineEditorsExample
|
||||
static List<string> descr_user_1 = new List<string>()
|
||||
{
|
||||
"File author by default",
|
||||
"Doesn’t belong to any group",
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"The file favorite state is undefined",
|
||||
"Can create files from templates using data from the editor",
|
||||
"Can see the information about all users",
|
||||
"This file isn't marked as favorite",
|
||||
"Can create files from templates using data from the editor",
|
||||
"Has an avatar",
|
||||
"Can submit forms"
|
||||
"Can submit forms",
|
||||
"Has no roles",
|
||||
"Can start filling"
|
||||
};
|
||||
|
||||
static List<string> descr_user_2 = new List<string>()
|
||||
@ -40,11 +42,13 @@ namespace OnlineEditorsExample
|
||||
"Belongs to Group2",
|
||||
"Can review only his own changes or changes made by users with no group",
|
||||
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
|
||||
"Can see the information about users from Group2 and users who don't belong to any group",
|
||||
"This file is marked as favorite",
|
||||
"Can create new files from the editor",
|
||||
"Can see the information about users from Group2 and users who don’t belong to any group",
|
||||
"Has an avatar",
|
||||
"Can’t submit forms"
|
||||
"Can't submit forms",
|
||||
"Has role 'Anyone'",
|
||||
"Can start filling"
|
||||
};
|
||||
|
||||
static List<string> descr_user_3 = new List<string>()
|
||||
@ -52,33 +56,38 @@ namespace OnlineEditorsExample
|
||||
"Belongs to Group3",
|
||||
"Can review changes made by Group2 users",
|
||||
"Can view comments left by Group2 and Group3 users. Can edit comments left by the Group2 users",
|
||||
"This file isn’t marked as favorite",
|
||||
"Can’t copy data from the file to clipboard",
|
||||
"Can’t download the file",
|
||||
"Can’t print the file",
|
||||
"Can create new files from the editor",
|
||||
"Can see the information about Group2 users",
|
||||
"Can’t submit forms",
|
||||
"The file favorite state is undefined",
|
||||
"Can't copy data from the file to clipboard",
|
||||
"Can't download the file",
|
||||
"Can't print the file",
|
||||
"Can create new files from the editor",
|
||||
"Can't close history",
|
||||
"Can't restore the file version"
|
||||
"Can't restore the file version",
|
||||
"Can't submit forms",
|
||||
"Has role 'role'",
|
||||
"Can start filling"
|
||||
};
|
||||
|
||||
static List<string> descr_user_0 = new List<string>()
|
||||
{
|
||||
"The name is requested when the editor is opened",
|
||||
"Doesn’t belong to any group",
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"Can't see anyone's information",
|
||||
"The file favorite state is undefined",
|
||||
"Can't mention others in comments",
|
||||
"Can't create new files from the editor",
|
||||
"Can’t see anyone’s information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration",
|
||||
"Can’t submit forms",
|
||||
"Can’t refresh outdated file"
|
||||
"Can't refresh outdated file",
|
||||
"Can't submit forms",
|
||||
"Tour of tips when opening a document",
|
||||
"Has empty role",
|
||||
"Can't start filling"
|
||||
};
|
||||
|
||||
private static List<User> users = new List<User>() {
|
||||
@ -90,13 +99,14 @@ namespace OnlineEditorsExample
|
||||
null,
|
||||
new Dictionary<string, object>(),
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
new List<string>(),
|
||||
descr_user_1,
|
||||
true,
|
||||
true,
|
||||
new Goback(null, false),
|
||||
new Close(null, false)
|
||||
new Close(null, false),
|
||||
null
|
||||
),
|
||||
new User(
|
||||
"uid-2",
|
||||
@ -117,7 +127,8 @@ namespace OnlineEditorsExample
|
||||
false,
|
||||
true,
|
||||
new Goback("Go to Documents",null),
|
||||
new Close(null, true)
|
||||
new Close(null, true),
|
||||
new List<string>() { "Anyone" }
|
||||
),
|
||||
new User(
|
||||
"uid-3",
|
||||
@ -132,13 +143,14 @@ namespace OnlineEditorsExample
|
||||
{ "remove", new List<string>() { } }
|
||||
},
|
||||
new List<string>() { "group-2" },
|
||||
false,
|
||||
null,
|
||||
new List<string>() { "copy", "download", "print" },
|
||||
descr_user_3,
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
new Close(null, true)
|
||||
new Close(null, true),
|
||||
new List<string>() { "role" }
|
||||
),
|
||||
new User(
|
||||
"uid-0",
|
||||
@ -154,7 +166,8 @@ namespace OnlineEditorsExample
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
null
|
||||
null,
|
||||
new List<string>()
|
||||
)
|
||||
};
|
||||
|
||||
@ -248,8 +261,9 @@ namespace OnlineEditorsExample
|
||||
public bool avatar;
|
||||
public Goback goback;
|
||||
public Close close;
|
||||
public List<string> roles;
|
||||
|
||||
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
|
||||
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close, List<string> roles)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
@ -265,6 +279,7 @@ namespace OnlineEditorsExample
|
||||
this.avatar = avatar;
|
||||
this.goback = goback;
|
||||
this.close = close;
|
||||
this.roles = roles;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
if (!formatManager.isAutoConvertible(posExt)) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -182,36 +182,16 @@ if (typeof jQuery != "undefined") {
|
||||
if (response.step && response.step < 100) {
|
||||
checkConvert(filePass, fileType);
|
||||
} else {
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = '<iframe id="iframeScripts" width=1 height=1 style="position: absolute; visibility: hidden;" ></iframe>';
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
var onuploaded = function () {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
@ -273,7 +253,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
@ -354,7 +334,7 @@ if (typeof jQuery != "undefined") {
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(fileName);
|
||||
jq("#convertStep1").addClass("done");
|
||||
jq("#convertStep1").addClass("error");
|
||||
jq("#convertStep2").addClass("waiting");
|
||||
});
|
||||
|
||||
@ -364,6 +344,7 @@ if (typeof jQuery != "undefined") {
|
||||
let fileExt = jq(`#${id}`).attr("data");
|
||||
jq(`#${id}`).addClass("orange");
|
||||
jq("td[name='convertingTypeButton']").addClass("disable");
|
||||
jq("#convertStep1").removeClass("error").addClass("done");
|
||||
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
|
||||
jq("#convertStep2").text('2. File conversion');
|
||||
jq("#convert-descr").removeClass("disable");
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<appSettings>
|
||||
<clear />
|
||||
<add key="version" value="1.14.0"/>
|
||||
<add key="version" value="1.15.0"/>
|
||||
|
||||
<add key="filesize-max" value="52428800"/>
|
||||
<add key="storage-path" value=""/>
|
||||
|
||||
@ -13,7 +13,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
|
||||
|
||||
### Step 2. Download the Go code for the editors integration
|
||||
|
||||
Download the [Go example](https://api.onlyoffice.com/editors/demopreview) from our site.
|
||||
Download the [Go example](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/) from our site.
|
||||
|
||||
To connect the editors to your website, specify the path to the editors installation, server protocol, address and port in the *configuration.env* file:
|
||||
|
||||
@ -31,7 +31,7 @@ JWT_HEADER=Authorization
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed.
|
||||
**address** is the address of the server, **port** is the server port.
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) it the *templates/editor.html* file.
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/docs/docs-api/usage-api/advanced-parameters/) it the *templates/editor.html* file.
|
||||
|
||||
### Step 3. Install the prerequisites
|
||||
To run the Go example code, install the Go compiler:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"VERSION": "1.14.0",
|
||||
"VERSION": "1.15.0",
|
||||
|
||||
"SERVER_ADDRESS" : "",
|
||||
"SERVER_PORT" : 3000,
|
||||
|
||||
@ -29,4 +29,5 @@ type ExtensionTypes struct {
|
||||
Presentation []string `json:"presentation"`
|
||||
Document []string `json:"document"`
|
||||
Pdf []string `json:"pdf"`
|
||||
Diagram []string `json:"diagram"`
|
||||
}
|
||||
|
||||
@ -93,6 +93,7 @@ func NewSpecification() (specification SpecificationConfig, err error) {
|
||||
fm.GetPresentationExtensions(),
|
||||
fm.GetDocumentExtensions(),
|
||||
fm.GetPdfExtensions(),
|
||||
fm.GetDiagramExtensions(),
|
||||
}
|
||||
specification = SpecificationConfig{
|
||||
exts,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
module github.com/ONLYOFFICE/document-server-integration
|
||||
|
||||
go 1.21
|
||||
go 1.23.10
|
||||
|
||||
require (
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/gorilla/schema v1.4.1
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
|
||||
@ -6,8 +6,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
|
||||
@ -27,7 +27,7 @@ import (
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/managers"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/shared"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
func (srv *DefaultServerEndpointsHandler) Config(w http.ResponseWriter, r *http.Request) {
|
||||
@ -73,9 +73,9 @@ func (srv *DefaultServerEndpointsHandler) Config(w http.ResponseWriter, r *http.
|
||||
),
|
||||
Mode: "edit",
|
||||
},
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * srv.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * srv.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ import (
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/shared"
|
||||
"github.com/ONLYOFFICE/document-server-integration/utils"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
func (srv *DefaultServerEndpointsHandler) Reference(w http.ResponseWriter, r *http.Request) {
|
||||
@ -97,9 +97,9 @@ func (srv *DefaultServerEndpointsHandler) Reference(w http.ResponseWriter, r *ht
|
||||
},
|
||||
Link: remoteAddr + "/editor?filename=" + url.QueryEscape(fileName),
|
||||
Path: fileName,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * srv.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * srv.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
type DocumentManager interface {
|
||||
|
||||
@ -27,7 +27,7 @@ import (
|
||||
|
||||
"github.com/ONLYOFFICE/document-server-integration/config"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/managers"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
type DefaultCommandManager struct {
|
||||
@ -40,13 +40,13 @@ type CommandPayload struct {
|
||||
Key string `json:"key"`
|
||||
Meta interface{} `json:"meta"`
|
||||
Token string `json:"token"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
type CommandRequestHeaderPayload struct {
|
||||
Query map[string]string `json:"query"`
|
||||
Payload CommandPayload `json:"payload"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
func NewDefaultCommandManager(config config.ApplicationConfig, jmanager managers.JwtManager) managers.CommandManager {
|
||||
@ -60,9 +60,9 @@ func (cm DefaultCommandManager) CommandRequest(method string, docKey string, met
|
||||
payload := CommandPayload{
|
||||
C: method,
|
||||
Key: docKey,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * cm.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * cm.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
if meta != nil {
|
||||
@ -119,9 +119,9 @@ func fillJwtByUrl(uri string, payload CommandPayload, config config.ApplicationC
|
||||
return CommandRequestHeaderPayload{
|
||||
Query: queryMap,
|
||||
Payload: payload,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ import (
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/managers"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/shared"
|
||||
"github.com/ONLYOFFICE/document-server-integration/utils"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -68,6 +68,9 @@ func (cm DefaultConversionManager) GetFileType(filename string) string {
|
||||
if utils.IsInList(ext, exts.Presentation) {
|
||||
return shared.ONLYOFFICE_PRESENTATION
|
||||
}
|
||||
if utils.IsInList(ext, exts.Diagram) {
|
||||
return shared.ONLYOFFICE_DIAGRAM
|
||||
}
|
||||
|
||||
return shared.ONLYOFFICE_DOCUMENT
|
||||
}
|
||||
@ -112,9 +115,9 @@ func (cm DefaultConversionManager) GetConverterUri(
|
||||
Title: title,
|
||||
Key: docKey,
|
||||
Async: isAsync,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * cm.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * cm.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
|
||||
@ -125,9 +128,9 @@ func (cm DefaultConversionManager) GetConverterUri(
|
||||
if secret != "" && cm.config.JwtEnabled {
|
||||
headerPayload := managers.ConvertRequestHeaderPayload{
|
||||
Payload: payload,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * cm.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * cm.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
headerToken, err = cm.JwtManager.JwtSign(headerPayload, []byte(secret))
|
||||
|
||||
@ -28,7 +28,7 @@ import (
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/managers"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/ONLYOFFICE/document-server-integration/utils"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -222,11 +222,14 @@ func (dm DefaultDocumentManager) BuildDocumentConfig(
|
||||
Goback: models.Goback{
|
||||
RequestClose: false,
|
||||
},
|
||||
Features: models.Features{
|
||||
FeaturesTips: user.Id == "uid-0",
|
||||
},
|
||||
},
|
||||
},
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * dm.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * dm.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ import (
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/shared"
|
||||
"github.com/ONLYOFFICE/document-server-integration/utils"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -197,9 +197,9 @@ func (hm DefaultHistoryManager) fetchNextHistoryEntry(
|
||||
Key: key,
|
||||
Url: url,
|
||||
Version: version,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * hm.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * hm.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -267,9 +267,9 @@ func (hm DefaultHistoryManager) GetHistory(
|
||||
Url: hm.StorageManager.GeneratePublicFileUri(filename, remoteAddress, managers.FileMeta{}),
|
||||
Version: version,
|
||||
ChangesUrl: changesUrl,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
ExpiresAt: time.Now().Add(time.Minute * hm.config.JwtExpiresIn).Unix(),
|
||||
IssuedAt: time.Now().Unix(),
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * hm.config.JwtExpiresIn)),
|
||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ import (
|
||||
"github.com/ONLYOFFICE/document-server-integration/config"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/managers"
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -45,6 +45,7 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
|
||||
Avatar: false,
|
||||
Goback: nil,
|
||||
Close: nil,
|
||||
Roles: []string{},
|
||||
},
|
||||
{
|
||||
Id: "uid-1",
|
||||
@ -54,7 +55,7 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
|
||||
ReviewGroups: nil,
|
||||
CommentGroups: nil,
|
||||
UserInfoGroups: nil,
|
||||
Favorite: -1,
|
||||
Favorite: 0,
|
||||
DeniedPermissions: nil,
|
||||
Description: descriptionUser1,
|
||||
Templates: true,
|
||||
@ -65,6 +66,7 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
|
||||
Close: map[string]interface{}{
|
||||
"visible": false,
|
||||
},
|
||||
Roles: nil,
|
||||
},
|
||||
{
|
||||
Id: "uid-2",
|
||||
@ -89,6 +91,7 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
|
||||
Close: map[string]interface{}{
|
||||
"visible": true,
|
||||
},
|
||||
Roles: []string{"Anyone"},
|
||||
},
|
||||
{
|
||||
Id: "uid-3",
|
||||
@ -102,7 +105,7 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
|
||||
"remove": "",
|
||||
},
|
||||
UserInfoGroups: []string{"group-2"},
|
||||
Favorite: 0,
|
||||
Favorite: -1,
|
||||
DeniedPermissions: []string{"copy", "download", "print"},
|
||||
Description: descriptionUser3,
|
||||
Templates: false,
|
||||
@ -111,6 +114,7 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
|
||||
Close: map[string]interface{}{
|
||||
"visible": true,
|
||||
},
|
||||
Roles: []string{"role"},
|
||||
},
|
||||
}
|
||||
return &DefaultUserManager{
|
||||
@ -124,51 +128,60 @@ var descriptionUser0 []string = []string{
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"Can't see anyone's information",
|
||||
"The file favorite state is undefined",
|
||||
"Can't mention others in comments",
|
||||
"Can't create new files from the editor",
|
||||
"Can't see anyone's information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration",
|
||||
"Can't submit forms",
|
||||
"Can't refresh outdated file",
|
||||
"Can't submit forms",
|
||||
"Tour of tips when opening a document",
|
||||
"Has empty role",
|
||||
"Can't start filling",
|
||||
}
|
||||
var descriptionUser1 []string = []string{
|
||||
"File author by default",
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"The file favorite state is undefined",
|
||||
"Can create files from templates using data from the editor",
|
||||
"Can see the information about all users",
|
||||
"This file isn't marked as favorite",
|
||||
"Can create files from templates using data from the editor",
|
||||
"Can submit forms",
|
||||
"Has an avatar",
|
||||
"Has no roles",
|
||||
"Can start filling",
|
||||
}
|
||||
var descriptionUser2 []string = []string{
|
||||
"Belongs to Group2",
|
||||
"Can review only his own changes or changes made by users with no group",
|
||||
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
|
||||
"Can see the information about users from Group2 and users who don't belong to any group",
|
||||
"This file is marked as favorite",
|
||||
"Can create new files from the editor",
|
||||
"Can see the information about users from Group2 and users who don’t belong to any group",
|
||||
"Can't submit forms",
|
||||
"Has an avatar",
|
||||
"Can't submit forms",
|
||||
"Has role 'Anyone'",
|
||||
"Can start filling",
|
||||
}
|
||||
var descriptionUser3 []string = []string{
|
||||
"Belongs to Group3",
|
||||
"Can review changes made by Group2 users",
|
||||
"Can view comments left by Group2 and Group3 users. Can edit comments left by the Group2 users",
|
||||
"This file isn't marked as favorite",
|
||||
"Can see the information about Group2 users",
|
||||
"The file favorite state is undefined",
|
||||
"Can't copy data from the file to clipboard",
|
||||
"Can't download the file",
|
||||
"Can't print the file",
|
||||
"Can create new files from the editor",
|
||||
"Can see the information about Group2 users",
|
||||
"Can't submit forms",
|
||||
"Can't close history",
|
||||
"Can't restore the file version",
|
||||
"Can't submit forms",
|
||||
"Has role 'role'",
|
||||
"Can start filling",
|
||||
}
|
||||
|
||||
func (um DefaultUserManager) GetUsers() []models.User {
|
||||
@ -197,6 +210,7 @@ func (um DefaultUserManager) GetUserInfoById(uid string, serverAddress string) m
|
||||
return models.UserInfo{
|
||||
Id: user.Id,
|
||||
Name: user.Username,
|
||||
Roles: user.Roles,
|
||||
Email: user.Email,
|
||||
Image: image,
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ import (
|
||||
"errors"
|
||||
|
||||
"github.com/ONLYOFFICE/document-server-integration/server/models"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
var ErrInvalidFilename = errors.New("invalid filename")
|
||||
@ -39,7 +39,7 @@ type HistorySet struct {
|
||||
Url string `json:"url"`
|
||||
Version int `json:"version"`
|
||||
Token string `json:"token,omitempty"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
type HistoryPrevious struct {
|
||||
@ -99,10 +99,10 @@ type ConvertRequestPayload struct {
|
||||
Key string `json:"key"`
|
||||
Async bool `json:"async"`
|
||||
JwtToken string `json:"token,omitempty"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
type ConvertRequestHeaderPayload struct {
|
||||
Payload ConvertRequestPayload `json:"payload"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
package models
|
||||
|
||||
import "github.com/golang-jwt/jwt"
|
||||
import "github.com/golang-jwt/jwt/v5"
|
||||
|
||||
type Command int
|
||||
|
||||
@ -38,9 +38,9 @@ func (c Command) Ordinal() int {
|
||||
}
|
||||
|
||||
type CommandBody struct {
|
||||
Command string `json:"c"`
|
||||
Token string `json:"token,omitempty"`
|
||||
jwt.StandardClaims `json:"-"`
|
||||
Command string `json:"c"`
|
||||
Token string `json:"token,omitempty"`
|
||||
jwt.RegisteredClaims `json:"-"`
|
||||
}
|
||||
|
||||
type CommandResponse struct {
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
package models
|
||||
|
||||
import "github.com/golang-jwt/jwt"
|
||||
import "github.com/golang-jwt/jwt/v5"
|
||||
|
||||
type Config struct {
|
||||
Type string `json:"type"`
|
||||
@ -25,5 +25,5 @@ type Config struct {
|
||||
DocumentType string `json:"documentType"`
|
||||
EditorConfig EditorConfig `json:"editorConfig"`
|
||||
Token string `json:"token,omitempty"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
@ -21,6 +21,10 @@ type Goback struct {
|
||||
RequestClose bool `json:"requestClose"`
|
||||
}
|
||||
|
||||
type Features struct {
|
||||
FeaturesTips bool `json:"featuresTips"`
|
||||
}
|
||||
|
||||
type Customization struct {
|
||||
About bool `json:"about"`
|
||||
Comments bool `json:"comments,omitempty"`
|
||||
@ -28,6 +32,7 @@ type Customization struct {
|
||||
Forcesave bool `json:"forcesave,omitempty"`
|
||||
SubmitForm bool `json:"submitForm,omitempty"`
|
||||
Goback Goback `json:"goback,omitempty"`
|
||||
Features Features `json:"features,omitempty"`
|
||||
Close map[string]interface{} `json:"close,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
package models
|
||||
|
||||
import "github.com/golang-jwt/jwt"
|
||||
import "github.com/golang-jwt/jwt/v5"
|
||||
|
||||
type ReferenceData struct {
|
||||
FileKey string `json:"fileKey"`
|
||||
@ -32,5 +32,5 @@ type Reference struct {
|
||||
Key string `json:"key"`
|
||||
Url string `json:"url"`
|
||||
Token string `json:"token,omitempty"`
|
||||
jwt.StandardClaims
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
@ -32,11 +32,13 @@ type User struct {
|
||||
Avatar bool `json:"avatar"`
|
||||
Goback map[string]interface{} `json:"goback"`
|
||||
Close map[string]interface{} `json:"close"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
|
||||
type UserInfo struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Image string `json:"image"`
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Roles []string `json:"roles"`
|
||||
Email string `json:"email"`
|
||||
Image string `json:"image"`
|
||||
}
|
||||
|
||||
@ -22,5 +22,6 @@ const (
|
||||
ONLYOFFICE_SPREADSHEET = "cell"
|
||||
ONLYOFFICE_PRESENTATION = "slide"
|
||||
ONLYOFFICE_PDF = "pdf"
|
||||
ONLYOFFICE_DIAGRAM = "diagram"
|
||||
ONLYOFFICE_HISTORY_POSTFIX = "-hist"
|
||||
)
|
||||
|
||||
BIN
web/documentserver-example/go/static/images/diagram.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,6 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
|
||||
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
|
||||
<path d="M5 8h6v1H5zm0 1h1v1H5zm5 0h1v1h-1zM7 6h2v2H7z" fill="#5951BB"/>
|
||||
<path stroke="#5951BB" d="M4.5 10.5h2v2h-2zm5 0h2v2h-2z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 469 B |
@ -114,7 +114,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
if (!formatManager.isAutoConvertible(posExt)) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -169,36 +169,16 @@ if (typeof jQuery !== "undefined") {
|
||||
if (response.step != undefined && response.step < 100) {
|
||||
checkConvert(filePass, fileType);
|
||||
} else {
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = "<iframe id=\"iframeScripts\" width=1 height=1 style=\"position: absolute; visibility: hidden;\" ></iframe>";
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
var onuploaded = function () {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
@ -260,7 +240,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
@ -341,7 +321,7 @@ if (typeof jQuery !== "undefined") {
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(fileName);
|
||||
jq("#convertStep1").addClass("done");
|
||||
jq("#convertStep1").addClass("error");
|
||||
jq("#convertStep2").addClass("waiting");
|
||||
});
|
||||
|
||||
@ -351,6 +331,7 @@ if (typeof jQuery !== "undefined") {
|
||||
let fileExt = jq(`#${id}`).attr("data");
|
||||
jq(`#${id}`).addClass("orange");
|
||||
jq("td[name='convertingTypeButton']").addClass("disable");
|
||||
jq("#convertStep1").removeClass("error").addClass("done");
|
||||
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
|
||||
jq("#convertStep2").text('2. File conversion');
|
||||
jq("#convert-descr").removeClass("disable");
|
||||
|
||||
@ -511,10 +511,6 @@ label .checkbox {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
@ -632,6 +628,11 @@ footer table tr td:first-child {
|
||||
background-image: url("../images/icon_pdf.svg");
|
||||
}
|
||||
|
||||
.stored-edit.diagram,
|
||||
.uploadFileName.diagram {
|
||||
background-image: url("../images/icon_vsdx.svg");
|
||||
}
|
||||
|
||||
.stored-edit span {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
|
||||
@ -83,6 +83,10 @@
|
||||
};
|
||||
|
||||
var onMetaChange = function (event) { // the meta information of the document is changed via the meta command
|
||||
if (event.data.title !== undefined) {
|
||||
document.title = event.data.title + " - ONLYOFFICE";
|
||||
}
|
||||
|
||||
if (event.data.favorite) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
@ -236,10 +240,33 @@
|
||||
users = {{.usersForMentions}};
|
||||
}
|
||||
|
||||
docEditor.setUsers({
|
||||
if ((c === "protect" || c === "mention") && users && event.data.count) {
|
||||
let from = event.data.from;
|
||||
let count = event.data.count;
|
||||
let search = event.data.search;
|
||||
if (from != 0) users = [];
|
||||
var resultCount = 234;
|
||||
for (var i = Math.max(users.length, from); i < Math.min(from + count, resultCount); i++){
|
||||
users.push({
|
||||
email: "test@test.test" + (i + 1),
|
||||
id: "id" + (i + 1),
|
||||
name: "test_" + search + (i + 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var result = {
|
||||
"c": c,
|
||||
"users": users,
|
||||
});
|
||||
};
|
||||
if (resultCount) {
|
||||
// support v9.0
|
||||
result.total = 1 + (!event.data.count || users.length < event.data.count ? 0 : (event.data.from + event.data.count));
|
||||
// since v9.0.1
|
||||
result.isPaginated = true;
|
||||
}
|
||||
|
||||
docEditor.setUsers(result);
|
||||
};
|
||||
|
||||
var onRequestSendNotify = function(event) { // the user is mentioned in a comment
|
||||
@ -377,6 +404,18 @@
|
||||
innerAlert(xhr.responseText);
|
||||
docEditor.refreshFile(JSON.parse(xhr.responseText));
|
||||
};
|
||||
};
|
||||
|
||||
var onRequestStartFilling = function(event) {
|
||||
var data = event.data;
|
||||
var submit = confirm("Start filling?\n" + JSON.stringify(data));
|
||||
if (submit) {
|
||||
docEditor.startFilling(true);
|
||||
}
|
||||
};
|
||||
|
||||
var onStartFilling = function(event) {
|
||||
innerAlert("The form is ready to fill out.");
|
||||
};
|
||||
|
||||
var events = {
|
||||
@ -397,6 +436,8 @@
|
||||
|
||||
if (config.editorConfig.user.id !== "uid-0") {
|
||||
events["onRequestRefreshFile"] = onRequestRefreshFile;
|
||||
events['onRequestStartFilling'] = onRequestStartFilling;
|
||||
events['onStartFilling'] = onStartFilling;
|
||||
events["onRequestClose"] = onRequestClose;
|
||||
events["onRequestSendNotify"] = onRequestSendNotify;
|
||||
events["onRequestEditRights"] = onRequestEditRights;
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -146,13 +146,18 @@
|
||||
{{ else }}
|
||||
<div id="portal-info" style="display: table-cell">
|
||||
{{ end }}
|
||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
|
||||
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
|
||||
<span class="portal-descr">
|
||||
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
|
||||
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
|
||||
You can test editing features in real-time and explore multi-user collaboration:
|
||||
<ul>
|
||||
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
|
||||
<li>Upload your own files to test using the Upload file button</li>
|
||||
<li>Select your username and language to simulate different users and environments</li>
|
||||
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
|
||||
</ul>
|
||||
</span>
|
||||
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
|
||||
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
|
||||
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
|
||||
{{ range .Users }}
|
||||
<div class="user-descr" onclick="toggleUserDescr(event)">
|
||||
<b>{{ if eq .Username "" }} Anonymous {{ else }} {{ .Username }} {{ end }}</b>
|
||||
@ -341,10 +346,7 @@
|
||||
<span class="errorPass"></span>
|
||||
<br />
|
||||
</div>
|
||||
<span id="step3" class="step">3. Loading editor scripts.</span>
|
||||
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
|
||||
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
|
||||
<br />
|
||||
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
|
||||
<br />
|
||||
<div class="error-message">
|
||||
@ -388,7 +390,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" data-docs="{{ .Preloader }}"></span>
|
||||
<iframe id="iframeScripts" src="{{ .Preloader }}" width=1 height=1 style="position: absolute; visibility: hidden; top: 0;" ></iframe>
|
||||
|
||||
<footer>
|
||||
<div class="center">
|
||||
@ -396,7 +398,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -48,6 +48,7 @@ type FormatManager interface {
|
||||
GetSpreadsheetExtensions() []string
|
||||
GetPresentationExtensions() []string
|
||||
GetPdfExtensions() []string
|
||||
GetDiagramExtensions() []string
|
||||
}
|
||||
|
||||
func NewFormatManager() (FormatManager, error) {
|
||||
@ -141,10 +142,19 @@ func (fm DefaultFormatManager) GetPresentationExtensions() (slide []string) {
|
||||
return
|
||||
}
|
||||
|
||||
func (fm DefaultFormatManager) GetPdfExtensions() (slide []string) {
|
||||
func (fm DefaultFormatManager) GetPdfExtensions() (pdf []string) {
|
||||
for _, f := range fm.formats {
|
||||
if f.FormatType == "pdf" {
|
||||
slide = append(slide, f.Name)
|
||||
pdf = append(pdf, f.Name)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (fm DefaultFormatManager) GetDiagramExtensions() (diagram []string) {
|
||||
for _, f := range fm.formats {
|
||||
if f.FormatType == "diagram" {
|
||||
diagram = append(diagram, f.Name)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
@ -18,7 +18,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
|
||||
|
||||
### Step 2. Download the Java code for the editors integration
|
||||
|
||||
Download the [Java-Spring example](https://api.onlyoffice.com/editors/demopreview) from our site.
|
||||
Download the [Java-Spring example](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/) from our site.
|
||||
|
||||
To connect the editors to your website, specify the path to the editors installation, server port and the path to the storage folder in the *src/main/resources/application.properties* file:
|
||||
|
||||
@ -30,7 +30,7 @@ To connect the editors to your website, specify the path to the editors installa
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Docs installed, **port** is any available port and **files.storage** is the path where files will be created and stored (in the project folder by default). You can set an absolute path. For example, *D:\\\\folder*. Please note that on Windows OS the double backslash must be used as a separator.
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) it the *\src\main\resources\editor.html* file.
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/docs/docs-api/usage-api/advanced-parameters/) it the *\src\main\resources\editor.html* file.
|
||||
|
||||
### Step 3. Install the prerequisites
|
||||
To run the Java example code, install the Java version 11 appropriate for your OS and framework **Apache Maven**:
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.13.4</version>
|
||||
<version>2.15.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
@ -84,7 +84,7 @@
|
||||
<dependency>
|
||||
<groupId>com.onlyoffice</groupId>
|
||||
<artifactId>docs-integration-sdk</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<version>1.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.core5</groupId>
|
||||
@ -94,7 +94,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>5.4</version>
|
||||
<version>5.4.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -38,48 +38,55 @@ public class ExampleData {
|
||||
// the description for user 0
|
||||
List<String> descriptionUserZero = List.of(
|
||||
"The name is requested when the editor is opened",
|
||||
"Doesn’t belong to any group",
|
||||
"Doesn't belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"Can't see anyone's information",
|
||||
"The file favorite state is undefined",
|
||||
"Can't mention others in comments",
|
||||
"Can't create new files from the editor",
|
||||
"Can’t see anyone’s information",
|
||||
"Can't rename files from the editor",
|
||||
"Can't view chat",
|
||||
"Can't protect file",
|
||||
"View file without collaboration",
|
||||
"Can’t submit forms",
|
||||
"Can't refresh outdated file"
|
||||
"Can't refresh outdated file",
|
||||
"Can't submit forms",
|
||||
"Tour of tips when opening a document",
|
||||
"Has empty role",
|
||||
"Can't start filling"
|
||||
);
|
||||
|
||||
// the description for user 1
|
||||
List<String> descriptionUserFirst = List.of(
|
||||
"File author by default",
|
||||
"He doesn’t belong to any of the groups",
|
||||
"He doesn't belong to any of the groups",
|
||||
"He can review all the changes",
|
||||
"He can do everything with the comments",
|
||||
"The file favorite state is undefined",
|
||||
"Can create a file from a template with data from the editor",
|
||||
"Can see the information about all users",
|
||||
"This file isn't favorite",
|
||||
"Can create a file from a template with data from the editor",
|
||||
"Can view chat",
|
||||
"Has an avatar",
|
||||
"Can submit forms"
|
||||
"Can submit forms",
|
||||
"Has no roles",
|
||||
"Can start filling"
|
||||
);
|
||||
|
||||
// the description for user 2
|
||||
List<String> descriptionUserSecond = List.of(
|
||||
"He belongs to Group2",
|
||||
"He can review only his own changes or the changes made by the users who don’t belong"
|
||||
"He can review only his own changes or the changes made by the users who don't belong"
|
||||
+ " to any of the groups",
|
||||
"He can view every comment, edit his comments and the comments left by the users "
|
||||
+ "who don't belong to any of the groups and remove only his comments",
|
||||
"Can see the information about users from Group2 and users who don't belong to any group",
|
||||
"This file is favorite",
|
||||
"Can create a file from an editor",
|
||||
"Can see the information about users from Group2 and users who don’t belong to any group",
|
||||
"Can view chat",
|
||||
"Has an avatar",
|
||||
"Can’t submit forms"
|
||||
"Can't submit forms",
|
||||
"Has role 'Anyone'",
|
||||
"Can start filling"
|
||||
);
|
||||
|
||||
// the description for user 3
|
||||
@ -88,41 +95,43 @@ public class ExampleData {
|
||||
"He can review only the changes made by the users from Group2",
|
||||
"He can view the comments left by the users from Group2 and Group3 and edit the comments left by "
|
||||
+ "the users from Group2",
|
||||
"This file isn’t favorite",
|
||||
"He can’t copy data from the file into the clipboard",
|
||||
"He can’t download the file",
|
||||
"He can’t print the file",
|
||||
"Can create a file from an editor",
|
||||
"Can see the information about Group2 users",
|
||||
"The file favorite state is undefined",
|
||||
"He can't copy data from the file into the clipboard",
|
||||
"He can't download the file",
|
||||
"He can't print the file",
|
||||
"Can create a file from an editor",
|
||||
"Can view chat",
|
||||
"Can’t submit forms",
|
||||
"Can't close history",
|
||||
"Can't restore the file version"
|
||||
"Can't restore the file version",
|
||||
"Can't submit forms",
|
||||
"Has role 'role'",
|
||||
"Can start filling"
|
||||
);
|
||||
|
||||
// create user 1 with the specified parameters
|
||||
userService.createUser("John Smith", "smith@example.com", descriptionUserFirst,
|
||||
"", List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()), null, true, true, true,
|
||||
new Goback(null, false), new Close(null, false), true);
|
||||
List.of(FilterState.NULL.toString()), false, true, true, true,
|
||||
new Goback(null, false), new Close(null, false), null, true);
|
||||
|
||||
// create user 2 with the specified parameters
|
||||
userService.createUser("Mark Pottato", "pottato@example.com", descriptionUserSecond,
|
||||
"group-2", List.of("", "group-2"), List.of(FilterState.NULL.toString()),
|
||||
List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true, true,
|
||||
true, true, new Goback("Go to Documents", null), new Close(null, true), false);
|
||||
true, true, new Goback("Go to Documents", null), new Close(null, true), List.of("Anyone"), false);
|
||||
|
||||
// create user 3 with the specified parameters
|
||||
userService.createUser("Hamish Mitchell", null, descriptionUserThird,
|
||||
"group-3", List.of("group-2"), List.of("group-2", "group-3"), List.of("group-2"),
|
||||
new ArrayList<>(), List.of("group-2"), false, true, true, false,
|
||||
null, new Close(null, true), false);
|
||||
new ArrayList<>(), List.of("group-2"), null, true, true, false,
|
||||
null, new Close(null, true), List.of("role"), false);
|
||||
|
||||
// create user 0 with the specified parameters
|
||||
userService.createUser("Anonymous", null, descriptionUserZero, "",
|
||||
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
|
||||
new ArrayList<>(), null, false, false, false, null, null, false);
|
||||
new ArrayList<>(), null, false, false, false, null, null, new ArrayList<>(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,18 +19,16 @@
|
||||
package com.onlyoffice.integration;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.onlyoffice.client.ApacheHttpclientDocumentServerClient;
|
||||
import com.onlyoffice.client.DocumentServerClient;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
import com.onlyoffice.manager.document.DocumentManager;
|
||||
import com.onlyoffice.manager.request.DefaultRequestManager;
|
||||
import com.onlyoffice.manager.request.RequestManager;
|
||||
import com.onlyoffice.manager.security.DefaultJwtManager;
|
||||
import com.onlyoffice.manager.security.JwtManager;
|
||||
import com.onlyoffice.manager.settings.SettingsManager;
|
||||
import com.onlyoffice.manager.url.UrlManager;
|
||||
import com.onlyoffice.service.command.CommandService;
|
||||
import com.onlyoffice.service.command.DefaultCommandService;
|
||||
import com.onlyoffice.service.convert.ConvertService;
|
||||
import com.onlyoffice.service.convert.DefaultConvertService;
|
||||
import com.onlyoffice.service.convert.DefaultConvertServiceV2;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.modelmapper.convention.MatchingStrategies;
|
||||
@ -83,21 +81,14 @@ public class IntegrationConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RequestManager requestManager(final UrlManager urlManager, final JwtManager jwtManager,
|
||||
final SettingsManager settingsManager) {
|
||||
return new DefaultRequestManager(urlManager, jwtManager, settingsManager);
|
||||
public DocumentServerClient documentServerClient(final SettingsManager settingsManager,
|
||||
final UrlManager urlManager) {
|
||||
return new ApacheHttpclientDocumentServerClient(settingsManager, urlManager);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ConvertService convertService(final DocumentManager documentManager, final UrlManager urlManager,
|
||||
final RequestManager requestManager,
|
||||
final SettingsManager settingsManager) {
|
||||
return new DefaultConvertService(documentManager, urlManager, requestManager, settingsManager);
|
||||
final DocumentServerClient documentServerClient) {
|
||||
return new DefaultConvertServiceV2(documentManager, urlManager, documentServerClient);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandService commandService(final RequestManager requestManager) {
|
||||
return new DefaultCommandService(requestManager);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.onlyoffice.client.DocumentServerClient;
|
||||
import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
@ -39,7 +40,6 @@ import com.onlyoffice.integration.sdk.manager.DocumentManager;
|
||||
import com.onlyoffice.integration.sdk.service.ConfigService;
|
||||
import com.onlyoffice.integration.services.UserServices;
|
||||
|
||||
import com.onlyoffice.manager.request.RequestManager;
|
||||
import com.onlyoffice.manager.security.JwtManager;
|
||||
import com.onlyoffice.manager.settings.SettingsManager;
|
||||
import com.onlyoffice.manager.url.UrlManager;
|
||||
@ -51,10 +51,8 @@ import com.onlyoffice.model.convertservice.ConvertRequest;
|
||||
import com.onlyoffice.model.convertservice.ConvertResponse;
|
||||
import com.onlyoffice.model.documenteditor.Callback;
|
||||
import com.onlyoffice.model.documenteditor.config.document.ReferenceData;
|
||||
import com.onlyoffice.service.command.CommandService;
|
||||
import com.onlyoffice.service.convert.ConvertService;
|
||||
import com.onlyoffice.service.documenteditor.callback.CallbackService;
|
||||
import org.apache.hc.core5.http.HttpEntity;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
@ -83,10 +81,8 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
@ -120,14 +116,12 @@ public class FileController {
|
||||
@Autowired
|
||||
private ConvertService convertService;
|
||||
@Autowired
|
||||
private RequestManager requestManager;
|
||||
private DocumentServerClient documentServerClient;
|
||||
@Autowired
|
||||
private SettingsManager settingsManager;
|
||||
@Autowired
|
||||
private CallbackService callbackService;
|
||||
@Autowired
|
||||
private CommandService commandService;
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
@Autowired
|
||||
private UrlManager urlManager;
|
||||
@ -281,26 +275,20 @@ public class FileController {
|
||||
String nameWithInternalExt = documentManager.getBaseName(fileName) + "." + newFileType;
|
||||
String correctedName = documentManager.getCorrectName(nameWithInternalExt);
|
||||
|
||||
fileName = requestManager.executeGetRequest(newFileUri, new RequestManager.Callback<String>() {
|
||||
public String doWork(final Object response) throws IOException {
|
||||
InputStream stream = ((HttpEntity) response).getContent(); // get input stream of the converted
|
||||
// file
|
||||
File file = storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(correctedName)));
|
||||
try {
|
||||
documentServerClient.getFile(newFileUri, Files.newOutputStream(file.toPath()));
|
||||
} catch (Exception e) {
|
||||
file.delete();
|
||||
|
||||
if (stream == null) {
|
||||
throw new RuntimeException("Input stream is null");
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (!keepOriginal) {
|
||||
storageMutator.deleteFile(oldFileName);
|
||||
}
|
||||
|
||||
// remove source file
|
||||
if (!keepOriginal) {
|
||||
storageMutator.deleteFile(oldFileName);
|
||||
}
|
||||
|
||||
// create the converted file with input stream
|
||||
storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(correctedName)), stream);
|
||||
return correctedName;
|
||||
}
|
||||
});
|
||||
fileName = correctedName;
|
||||
}
|
||||
|
||||
// create meta information about the converted file with the user ID and name specified
|
||||
@ -480,20 +468,18 @@ public class FileController {
|
||||
|
||||
url = urlManager.replaceToInnerDocumentServerUrl(url);
|
||||
|
||||
return requestManager.executeGetRequest(url, new RequestManager.Callback<String>() {
|
||||
@Override
|
||||
public String doWork(final Object response) throws Exception {
|
||||
InputStream stream = ((HttpEntity) response).getContent();
|
||||
File file = storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(fileName)));
|
||||
try {
|
||||
documentServerClient.getFile(url, Files.newOutputStream(file.toPath()));
|
||||
} catch (Exception e) {
|
||||
file.delete();
|
||||
|
||||
if (documentManager.getMaxFileSize() < stream.available() || stream.available() <= 0) {
|
||||
return "{\"error\":\"File size is incorrect\"}";
|
||||
}
|
||||
storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(fileName)), stream);
|
||||
createUserMetadata(uid, fileName);
|
||||
throw e;
|
||||
}
|
||||
|
||||
return "{\"file\": \"" + fileName + "\"}";
|
||||
}
|
||||
});
|
||||
createUserMetadata(uid, fileName);
|
||||
|
||||
return "{\"file\": \"" + fileName + "\"}";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
|
||||
@ -513,7 +499,7 @@ public class FileController {
|
||||
|
||||
try {
|
||||
|
||||
CommandResponse commandResponse = commandService.processCommand(commandRequest, body.getFileName());
|
||||
CommandResponse commandResponse = documentServerClient.command(commandRequest);
|
||||
return commandResponse.getError().getDescription();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -681,12 +667,14 @@ public class FileController {
|
||||
Files.move(sourcePathFile, bumpedFile);
|
||||
|
||||
if (body.getUrl() != null) {
|
||||
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) new URL(body.getUrl())
|
||||
.openConnection();
|
||||
InputStream stream = connection.getInputStream();
|
||||
storageMutator.createFile(sourcePathFile, stream);
|
||||
stream.close();
|
||||
connection.disconnect();
|
||||
File file = storageMutator.createFile(sourcePathFile);
|
||||
try {
|
||||
documentServerClient.getFile(body.getUrl(), Files.newOutputStream(file.toPath()));
|
||||
} catch (Exception e) {
|
||||
file.delete();
|
||||
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
String recoveryVersionStringDirectory = historyManager.versionDir(
|
||||
historyDirectory,
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
package com.onlyoffice.integration.controllers;
|
||||
|
||||
import com.onlyoffice.client.DocumentServerClient;
|
||||
import com.onlyoffice.integration.dto.ForgottenFile;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -34,7 +35,6 @@ import com.onlyoffice.model.commandservice.CommandRequest;
|
||||
import com.onlyoffice.model.commandservice.CommandResponse;
|
||||
import com.onlyoffice.model.commandservice.commandrequest.Command;
|
||||
import com.onlyoffice.manager.document.DocumentManager;
|
||||
import com.onlyoffice.service.command.CommandService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -50,10 +50,10 @@ public class ForgottenController {
|
||||
private String enableForgotten;
|
||||
|
||||
@Autowired
|
||||
private CommandService commandService;
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
private DocumentServerClient documentServerClient;
|
||||
|
||||
@GetMapping("${url.forgotten}")
|
||||
public String index(final Model model) {
|
||||
@ -74,14 +74,14 @@ public class ForgottenController {
|
||||
CommandRequest commandRequest = CommandRequest.builder()
|
||||
.c(Command.GET_FORGOTTEN_LIST)
|
||||
.build();
|
||||
CommandResponse commandResponse = commandService.processCommand(commandRequest, null);
|
||||
CommandResponse commandResponse = documentServerClient.command(commandRequest);
|
||||
List<String> keys = commandResponse.getKeys();
|
||||
for (int i = 0; i < keys.size(); i++) {
|
||||
commandRequest = CommandRequest.builder()
|
||||
.c(Command.GET_FORGOTTEN)
|
||||
.key(keys.get(i))
|
||||
.build();
|
||||
commandResponse = commandService.processCommand(commandRequest, null);
|
||||
commandResponse = documentServerClient.command(commandRequest);
|
||||
ForgottenFile file = new ForgottenFile(
|
||||
commandResponse.getKey(),
|
||||
documentManager.getDocumentType(commandResponse.getUrl()).toString().toLowerCase(),
|
||||
@ -111,7 +111,7 @@ public class ForgottenController {
|
||||
.key(filename)
|
||||
.build();
|
||||
|
||||
CommandResponse commandResponse = commandService.processCommand(commandRequest, null);
|
||||
CommandResponse commandResponse = documentServerClient.command(commandRequest);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@ -19,12 +19,12 @@
|
||||
package com.onlyoffice.integration.documentserver.managers.callback;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.onlyoffice.client.DocumentServerClient;
|
||||
import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
|
||||
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
|
||||
import com.onlyoffice.integration.sdk.manager.DocumentManager;
|
||||
import com.onlyoffice.integration.sdk.manager.UrlManager;
|
||||
import com.onlyoffice.manager.request.RequestManager;
|
||||
import com.onlyoffice.model.commandservice.CommandRequest;
|
||||
import com.onlyoffice.model.commandservice.commandrequest.Command;
|
||||
import com.onlyoffice.model.convertservice.ConvertRequest;
|
||||
@ -33,19 +33,15 @@ import com.onlyoffice.model.documenteditor.Callback;
|
||||
import com.onlyoffice.model.documenteditor.callback.Action;
|
||||
import com.onlyoffice.model.documenteditor.callback.ForcesaveType;
|
||||
import com.onlyoffice.model.documenteditor.callback.action.Type;
|
||||
import com.onlyoffice.service.command.CommandService;
|
||||
import com.onlyoffice.service.convert.ConvertService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.hc.core5.http.HttpEntity;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
@ -65,46 +61,13 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
@Autowired
|
||||
private ConvertService convertService;
|
||||
@Autowired
|
||||
private RequestManager requestManager;
|
||||
@Autowired
|
||||
private CommandService commandService;
|
||||
private DocumentServerClient documentServerClient;
|
||||
@Autowired
|
||||
private HistoryManager historyManager;
|
||||
|
||||
@Autowired
|
||||
private UrlManager urlManager;
|
||||
|
||||
// download file from url
|
||||
@SneakyThrows
|
||||
private byte[] getDownloadFile(final String url) {
|
||||
if (url == null || url.isEmpty()) {
|
||||
throw new RuntimeException("Url argument is not specified"); // URL isn't specified
|
||||
}
|
||||
|
||||
return requestManager.executeGetRequest(url, new RequestManager.Callback<byte[]>() {
|
||||
public byte[] doWork(final Object response) throws IOException {
|
||||
InputStream stream = ((HttpEntity) response).getContent(); // get input stream of the converted
|
||||
// file
|
||||
|
||||
if (stream == null) {
|
||||
throw new RuntimeException("Input stream is null");
|
||||
}
|
||||
|
||||
return stream.readAllBytes();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// file saving
|
||||
@SneakyThrows
|
||||
private void saveFile(final byte[] byteArray, final Path path) {
|
||||
if (path == null) {
|
||||
throw new RuntimeException("Path argument is not specified"); // file isn't specified
|
||||
}
|
||||
// update a file or create a new one
|
||||
storageMutator.createOrUpdateFile(path, new ByteArrayInputStream(byteArray));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processEditing(final Callback callback, final String fileName) {
|
||||
Action action = callback.getActions().get(0); // get the user ID who is editing the document
|
||||
@ -118,7 +81,7 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
|
||||
// create a command request to forcibly save the document being edited without closing it
|
||||
try {
|
||||
commandService.processCommand(commandRequest, fileName);
|
||||
documentServerClient.command(commandRequest);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@ -173,8 +136,6 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
}
|
||||
}
|
||||
|
||||
byte[] byteArrayFile = getDownloadFile(downloadUri); // download document file
|
||||
|
||||
Path lastVersion = Paths.get(storagePathBuilder
|
||||
.getFileLocation(fileName)); // get the path to the last file version
|
||||
|
||||
@ -194,11 +155,23 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
|
||||
lastVersion.toFile().renameTo(new File(versionDir + File.separator + "prev." + curExt));
|
||||
|
||||
saveFile(byteArrayFile, toSave); // save document file
|
||||
File file = storageMutator.createFile(toSave);
|
||||
try {
|
||||
documentServerClient.getFile(downloadUri, Files.newOutputStream(file.toPath()));
|
||||
} catch (Exception e) {
|
||||
file.delete();
|
||||
|
||||
byte[] byteArrayChanges = getDownloadFile(changesUri); // download file changes
|
||||
saveFile(byteArrayChanges, Path
|
||||
.of(versionDir + File.separator + "diff.zip")); // save file changes to the diff.zip archive
|
||||
throw e;
|
||||
}
|
||||
|
||||
File diff = storageMutator.createFile(Path.of(versionDir + File.separator + "diff.zip"));
|
||||
try {
|
||||
documentServerClient.getFile(changesUri, Files.newOutputStream(diff.toPath()));
|
||||
} catch (Exception e) {
|
||||
diff.delete();
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
JSONObject jsonChanges = new JSONObject(); // create a json object for document changes
|
||||
jsonChanges.put("changes", callback.getHistory().getChanges()); // put the changes to the json object
|
||||
@ -262,7 +235,6 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
}
|
||||
}
|
||||
|
||||
byte[] byteArrayFile = getDownloadFile(downloadUri); // download document file
|
||||
String forcesavePath = "";
|
||||
|
||||
// todo: Use ENUMS
|
||||
@ -297,9 +269,15 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
.getBaseName(fileName) + ".txt");
|
||||
String formsPath = storagePathBuilder.getFileLocation(formsName);
|
||||
|
||||
byte[] byteArrayFormsData = getDownloadFile(formsDataUrl);
|
||||
|
||||
saveFile(byteArrayFormsData, Paths.get(formsPath));
|
||||
File forms = storageMutator.createFile(Paths.get(formsPath));
|
||||
try {
|
||||
documentServerClient.getFile(formsDataUrl, Files.newOutputStream(forms.toPath()));
|
||||
} catch (Exception e) {
|
||||
forms.delete();
|
||||
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("Document editing service did not return formsDataUrl");
|
||||
}
|
||||
@ -318,6 +296,14 @@ public class DefaultCallbackManager implements CallbackManager {
|
||||
}
|
||||
}
|
||||
|
||||
saveFile(byteArrayFile, Path.of(forcesavePath));
|
||||
|
||||
File forcesave = storageMutator.createFile(Path.of(forcesavePath));
|
||||
try {
|
||||
documentServerClient.getFile(downloadUri, Files.newOutputStream(forcesave.toPath()));
|
||||
} catch (Exception e) {
|
||||
forcesave.delete();
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ package com.onlyoffice.integration.documentserver.storage;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
@ -29,6 +28,7 @@ import java.nio.file.Path;
|
||||
public interface FileStorageMutator {
|
||||
void createDirectory(Path path); // create a new directory if it does not exist
|
||||
boolean createFile(Path path, InputStream stream); // create a new file if it does not exist
|
||||
File createFile(Path path); // create a new file if it does not exist
|
||||
boolean deleteFile(String fileName); // delete a file
|
||||
boolean deleteFileHistory(String fileName); // delete file history
|
||||
boolean deleteUserFolder(); // delete the user's folder recursively
|
||||
@ -39,5 +39,4 @@ public interface FileStorageMutator {
|
||||
Resource loadFileAsResourceHistory(String fileName, String version, String file); // load file as a resource
|
||||
File[] getStoredFiles(); // get a collection of all the stored files
|
||||
void createMeta(String fileName, String uid, String uname); // create the file meta information
|
||||
boolean createOrUpdateFile(Path path, ByteArrayInputStream stream); // create or update a file
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
@ -164,6 +163,18 @@ public class LocalFileStorage implements FileStorageMutator, FileStoragePathBuil
|
||||
return false;
|
||||
}
|
||||
|
||||
public File createFile(final Path path) {
|
||||
if (Files.exists(path)) {
|
||||
return path.toFile();
|
||||
}
|
||||
|
||||
try {
|
||||
return Files.createFile(path).toFile();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// delete a file
|
||||
public boolean deleteFile(final String fileNameParam) {
|
||||
String fileName = URLDecoder
|
||||
@ -349,22 +360,6 @@ public class LocalFileStorage implements FileStorageMutator, FileStoragePathBuil
|
||||
}
|
||||
}
|
||||
|
||||
// create or update a file
|
||||
public boolean createOrUpdateFile(final Path path, final ByteArrayInputStream stream) {
|
||||
if (!Files.exists(path)) { // if the specified file does not exist
|
||||
return createFile(path, stream); // create it in the specified directory
|
||||
} else {
|
||||
try {
|
||||
Files.write(path, stream
|
||||
.readAllBytes()); // otherwise, write new information in the bytes format to the file
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the server URL
|
||||
public String getServerUrl(final Boolean forDocumentServer) {
|
||||
if (forDocumentServer && !docserviceUrlExample.equals("")) {
|
||||
|
||||
@ -49,4 +49,7 @@ public class User extends AbstractEntity {
|
||||
private String image;
|
||||
private Goback goback;
|
||||
private Close close;
|
||||
@ElementCollection
|
||||
@CollectionTable(name = "user_roles")
|
||||
private List<String> roles;
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ import com.onlyoffice.model.documenteditor.config.editorconfig.Mode;
|
||||
import com.onlyoffice.model.documenteditor.config.editorconfig.Template;
|
||||
import com.onlyoffice.model.documenteditor.config.editorconfig.customization.Goback;
|
||||
import com.onlyoffice.model.documenteditor.config.editorconfig.customization.Close;
|
||||
import com.onlyoffice.model.documenteditor.config.editorconfig.customization.Features;
|
||||
import com.onlyoffice.model.documenteditor.config.editorconfig.embedded.Toolbar;
|
||||
import com.onlyoffice.service.documenteditor.config.DefaultConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -214,6 +215,7 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
|
||||
.id(String.valueOf(appUser.getId()))
|
||||
.name(appUser.getName())
|
||||
.group(appUser.getGroup().getName())
|
||||
.roles(appUser.getRoles())
|
||||
.build();
|
||||
|
||||
if (appUser.getAvatar()) {
|
||||
@ -251,6 +253,14 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
|
||||
close.setVisible(appUser.getClose().getVisible());
|
||||
}
|
||||
|
||||
Features features = Features.builder()
|
||||
.featuresTips(false)
|
||||
.build();
|
||||
|
||||
if (appUser == null || String.valueOf(appUser.getId()).equals("4")) {
|
||||
features.setFeaturesTips(true);
|
||||
}
|
||||
|
||||
Customization customization = Customization.builder()
|
||||
.autosave(true) // if the Autosave menu option is enabled or disabled
|
||||
.comments(true) // if the Comments menu button is displayed or hidden
|
||||
@ -265,6 +275,7 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
|
||||
.feedback(true)
|
||||
.goback(goback)
|
||||
.close(close)
|
||||
.features(features)
|
||||
.build();
|
||||
|
||||
return customization;
|
||||
|
||||
@ -68,6 +68,7 @@ public class UserServices {
|
||||
final Boolean avatar,
|
||||
final Goback goback,
|
||||
final Close close,
|
||||
final List<String> roles,
|
||||
final Boolean submitForm) {
|
||||
User newUser = new User();
|
||||
newUser.setName(name); // set the user name
|
||||
@ -102,6 +103,8 @@ public class UserServices {
|
||||
|
||||
newUser.setClose(close);
|
||||
|
||||
newUser.setRoles(roles);
|
||||
|
||||
userRepository.save(newUser); // save a new user
|
||||
|
||||
return newUser;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
server.version=1.14.0
|
||||
server.version=1.15.0
|
||||
|
||||
server.address=
|
||||
server.port=4000
|
||||
|
||||
@ -511,10 +511,6 @@ label .checkbox {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
|
||||
@ -114,7 +114,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
if (!formatManager.isAutoConvertible(posExt)) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -168,36 +168,16 @@ if (typeof jQuery !== "undefined") {
|
||||
checkConvert(filePass, fileType);
|
||||
} else {
|
||||
jq("#hiddenFileName").val(response.filename);
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = "<iframe id=\"iframeScripts\" width=1 height=1 style=\"position: absolute; visibility: hidden;\" ></iframe>";
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
var onuploaded = function () {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
@ -265,7 +245,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
@ -346,7 +326,7 @@ if (typeof jQuery !== "undefined") {
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(fileName);
|
||||
jq("#convertStep1").addClass("done");
|
||||
jq("#convertStep1").addClass("error");
|
||||
jq("#convertStep2").addClass("waiting");
|
||||
});
|
||||
|
||||
@ -356,6 +336,7 @@ if (typeof jQuery !== "undefined") {
|
||||
let fileExt = jq(`#${id}`).attr("data");
|
||||
jq(`#${id}`).addClass("orange");
|
||||
jq("td[name='convertingTypeButton']").addClass("disable");
|
||||
jq("#convertStep1").removeClass("error").addClass("done");
|
||||
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
|
||||
jq("#convertStep2").text('2. File conversion');
|
||||
jq("#convert-descr").removeClass("disable");
|
||||
|
||||
@ -100,6 +100,10 @@
|
||||
|
||||
// the meta information of the document is changed via the meta command
|
||||
var onMetaChange = function (event) {
|
||||
if (event.data.title !== undefined) {
|
||||
document.title = event.data.title + " - ONLYOFFICE";
|
||||
}
|
||||
|
||||
if (event.data.favorite !== undefined) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
@ -352,10 +356,33 @@
|
||||
users = [[${usersForMentions}]];
|
||||
}
|
||||
|
||||
docEditor.setUsers({
|
||||
if ((c === "protect" || c === "mention") && users && event.data.count) {
|
||||
let from = event.data.from;
|
||||
let count = event.data.count;
|
||||
let search = event.data.search;
|
||||
if (from != 0) users = [];
|
||||
var resultCount = 234;
|
||||
for (var i = Math.max(users.length, from); i < Math.min(from + count, resultCount); i++){
|
||||
users.push({
|
||||
email: "test@test.test" + (i + 1),
|
||||
id: "id" + (i + 1),
|
||||
name: "test_" + search + (i + 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var result = {
|
||||
"c": c,
|
||||
"users": users,
|
||||
});
|
||||
};
|
||||
if (resultCount) {
|
||||
// support v9.0
|
||||
result.total = 1 + (!event.data.count || users.length < event.data.count ? 0 : (event.data.from + event.data.count));
|
||||
// since v9.0.1
|
||||
result.isPaginated = true;
|
||||
}
|
||||
|
||||
docEditor.setUsers(result);
|
||||
};
|
||||
|
||||
var onRequestSendNotify = function(event) { // the user is mentioned in a comment
|
||||
@ -364,6 +391,17 @@
|
||||
innerAlert("onRequestSendNotify: " + data);
|
||||
};
|
||||
|
||||
var onRequestStartFilling = function(event) {
|
||||
var data = event.data;
|
||||
var submit = confirm("Start filling?\n" + JSON.stringify(data));
|
||||
if (submit) {
|
||||
docEditor.startFilling(true);
|
||||
}
|
||||
};
|
||||
var onStartFilling = function(event) {
|
||||
innerAlert("The form is ready to fill out.");
|
||||
};
|
||||
|
||||
config.width = "100%";
|
||||
config.height = "100%";
|
||||
config.events = {
|
||||
@ -380,6 +418,8 @@
|
||||
};
|
||||
|
||||
if (config.editorConfig.user.id != 4) {
|
||||
config.events['onRequestStartFilling'] = onRequestStartFilling;
|
||||
config.events['onStartFilling'] = onStartFilling;
|
||||
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
|
||||
config.events['onRequestClose'] = onRequestClose;
|
||||
// add mentions for not anonymous users
|
||||
@ -402,7 +442,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var сonnectEditor = function () {
|
||||
var connectEditor = function () {
|
||||
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
|
||||
};
|
||||
|
||||
@ -414,9 +454,9 @@
|
||||
};
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("load", сonnectEditor);
|
||||
window.addEventListener("load", connectEditor);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("load", сonnectEditor);
|
||||
window.attachEvent("load", connectEditor);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -130,13 +130,18 @@
|
||||
</li>
|
||||
</menu>
|
||||
<div id="portal-info" th:attr="tooltip=${tooltip}" th:style="${not #lists.isEmpty(files)} ? 'display: none' : 'display: table-cell' ">
|
||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
|
||||
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
|
||||
<span class="portal-descr">
|
||||
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
|
||||
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
|
||||
</span>
|
||||
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
|
||||
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
|
||||
You can test editing features in real-time and explore multi-user collaboration:
|
||||
<ul>
|
||||
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
|
||||
<li>Upload your own files to test using the Upload file button</li>
|
||||
<li>Select your username and language to simulate different users and environments</li>
|
||||
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
|
||||
</ul>
|
||||
</span>
|
||||
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
|
||||
</div>
|
||||
<th:block th:if="${not #lists.isEmpty(files)}">
|
||||
<div class="stored-list">
|
||||
@ -327,10 +332,7 @@
|
||||
<span class="errorPass"></span>
|
||||
<br />
|
||||
</div>
|
||||
<span id="step3" class="step">3. Loading editor scripts.</span>
|
||||
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
|
||||
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
|
||||
<br />
|
||||
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
|
||||
<br />
|
||||
<div class="error-message">
|
||||
@ -375,7 +377,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" th:attr="data-docs=${datadocs}"></span>
|
||||
<iframe id="iframeScripts" th:attr="src=${datadocs}" width=1 height=1 style="position: absolute; visibility: hidden; top: 0;" ></iframe>
|
||||
|
||||
<footer>
|
||||
<div class="center">
|
||||
@ -383,7 +385,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -14,7 +14,7 @@ See the detailed guide to learn how to [install Document Server for Windows](htt
|
||||
|
||||
### Step 2. Download the Java code for the editors integration
|
||||
|
||||
Download the [Java example](https://api.onlyoffice.com/editors/demopreview) from our site.
|
||||
Download the [Java example](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/) from our site.
|
||||
|
||||
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the *src/main/resources/settings.properties* file:
|
||||
|
||||
@ -25,7 +25,7 @@ files.docservice.url.site=https://documentserver/
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storage-folder** is the path where files will be created and stored. You can set an absolute path. For example, *D:\\\\folder*. Please note that on Windows OS the double backslash must be used as a separator.
|
||||
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) in the *\src\main\webapp\editor.jsp* file.
|
||||
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/docs/docs-api/usage-api/advanced-parameters/) in the *\src\main\webapp\editor.jsp* file.
|
||||
|
||||
### Step 3. Install the prerequisites
|
||||
|
||||
|
||||
@ -14,6 +14,18 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson</groupId>
|
||||
<artifactId>jackson-bom</artifactId>
|
||||
<version>2.19.0</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
@ -29,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.9</version>
|
||||
<version>2.13.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.inversoft</groupId>
|
||||
|
||||
@ -110,10 +110,14 @@ public class FileModel {
|
||||
// write user information to the config (id, name and group)
|
||||
editorConfig.getUser().setId(!user.getId().equals("uid-0") ? user.getId() : null);
|
||||
editorConfig.getUser().setName(user.getName());
|
||||
editorConfig.getUser().setRoles(user.getRoles());
|
||||
editorConfig.getUser().setGroup(user.getGroup());
|
||||
editorConfig.getUser().setImage(user.getAvatar() ? DocumentManager.getServerUrl(false)
|
||||
+ "/css/img/" + user.getId() + ".png" : null);
|
||||
|
||||
editorConfig.getCustomization().getFeatures()
|
||||
.setFeaturesTips(user.getId().equals("uid-0"));
|
||||
|
||||
if (user.getGoback() != null) {
|
||||
// write the absolute URL to the file location
|
||||
editorConfig.getCustomization().getGoback()
|
||||
@ -301,7 +305,7 @@ public class FileModel {
|
||||
public Permissions(final String modeParam, final String typeParam, final Boolean canEdit, final User user) {
|
||||
comment = !modeParam.equals("view") && !modeParam.equals("fillForms") && !modeParam.equals("embedded")
|
||||
&& !modeParam.equals("blockcontent");
|
||||
copy = !user.getDeniedPermissions().contains("сopy");
|
||||
copy = !user.getDeniedPermissions().contains("copy");
|
||||
download = !user.getDeniedPermissions().contains("download");
|
||||
edit = canEdit && (modeParam.equals("edit") || modeParam.equals("view") || modeParam.equals("filter")
|
||||
|| modeParam.equals("blockcontent"));
|
||||
@ -537,6 +541,7 @@ public class FileModel {
|
||||
public class User {
|
||||
private String id;
|
||||
private String name;
|
||||
private List<String> roles;
|
||||
private String group;
|
||||
private String image;
|
||||
|
||||
@ -567,10 +572,15 @@ public class FileModel {
|
||||
public void setImage(final String imageParam) {
|
||||
this.image = imageParam;
|
||||
}
|
||||
|
||||
public void setRoles(final List<String> rolesParam) {
|
||||
this.roles = rolesParam;
|
||||
}
|
||||
}
|
||||
|
||||
// customization parameters
|
||||
public class Customization {
|
||||
private Features features;
|
||||
private Goback goback;
|
||||
private Close close;
|
||||
private Boolean forcesave;
|
||||
@ -592,10 +602,15 @@ public class FileModel {
|
||||
comments = true;
|
||||
feedback = true;
|
||||
forcesave = false;
|
||||
features = new Features();
|
||||
goback = new Goback();
|
||||
close = new Close();
|
||||
}
|
||||
|
||||
public Features getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
public Goback getGoback() {
|
||||
return goback;
|
||||
}
|
||||
@ -624,6 +639,18 @@ public class FileModel {
|
||||
return feedback;
|
||||
}
|
||||
|
||||
public class Features {
|
||||
private Boolean featuresTips;
|
||||
|
||||
public Boolean getFeaturesTips() {
|
||||
return featuresTips;
|
||||
}
|
||||
|
||||
public void setFeaturesTips(final Boolean featuresTipsParam) {
|
||||
this.featuresTips = featuresTipsParam;
|
||||
}
|
||||
}
|
||||
|
||||
public class Goback {
|
||||
private String url;
|
||||
private String text;
|
||||
|
||||
@ -33,5 +33,8 @@ public enum FileType {
|
||||
SLIDE,
|
||||
@JsonProperty("pdf")
|
||||
@SerializedName("pdf")
|
||||
PDF
|
||||
PDF,
|
||||
@JsonProperty("diagram")
|
||||
@SerializedName("diagram")
|
||||
DIAGRAM
|
||||
}
|
||||
|
||||
@ -35,13 +35,14 @@ public class User {
|
||||
private final Boolean avatar;
|
||||
private final Goback goback;
|
||||
private final Close close;
|
||||
private final List<String> roles;
|
||||
|
||||
public User(final String idParam, final String nameParam, final String emailParam, final String groupParam,
|
||||
final List<String> reviewGroupsParam, final CommentGroups commentGroupsParam,
|
||||
final List<String> userInfoGroupsParam, final Boolean favoriteParam,
|
||||
final List<String> deniedPermissionsParam, final List<String> descriptionsParam,
|
||||
final Boolean templatesParam, final Boolean avatarParam, final Goback gobackParam,
|
||||
final Close closeParam) {
|
||||
final Close closeParam, final List<String> rolesParam) {
|
||||
this.id = idParam;
|
||||
this.name = nameParam;
|
||||
this.email = emailParam;
|
||||
@ -56,6 +57,7 @@ public class User {
|
||||
this.avatar = avatarParam;
|
||||
this.goback = gobackParam;
|
||||
this.close = closeParam;
|
||||
this.roles = rolesParam;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
@ -113,4 +115,8 @@ public class User {
|
||||
public Close getClose() {
|
||||
return close;
|
||||
}
|
||||
|
||||
public List<String> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,14 +33,16 @@ public final class Users {
|
||||
|
||||
private static List<String> descriptionUserFirst = new ArrayList<String>() {{
|
||||
add("File author by default");
|
||||
add("Doesn’t belong to any group");
|
||||
add("Doesn't belong to any group");
|
||||
add("Can review all the changes");
|
||||
add("Can perform all actions with comments");
|
||||
add("The file favorite state is undefined");
|
||||
add("Can create files from templates using data from the editor");
|
||||
add("Can see the information about all users");
|
||||
add("This file isn't marked as favorite");
|
||||
add("Can create files from templates using data from the editor");
|
||||
add("Has an avatar");
|
||||
add("Can submit forms");
|
||||
add("Has no roles");
|
||||
add("Can start filling");
|
||||
}};
|
||||
|
||||
private static List<String> descriptionUserSecond = new ArrayList<String>() {{
|
||||
@ -48,63 +50,71 @@ public final class Users {
|
||||
add("Can review only his own changes or changes made by users with no group");
|
||||
add("Can view comments, edit his own comments and comments left by users with no group."
|
||||
+ " Can remove his own comments only");
|
||||
add("Can see the information about users from Group2 and users who don't belong to any group");
|
||||
add("This file is marked as favorite");
|
||||
add("Can create new files from the editor");
|
||||
add("Can see the information about users from Group2 and users who don’t belong to any group");
|
||||
add("Has an avatar");
|
||||
add("Can’t submit forms");
|
||||
add("Can't submit forms");
|
||||
add("Has role 'Anyone'");
|
||||
add("Can start filling");
|
||||
}};
|
||||
|
||||
private static List<String> descriptionUserThird = new ArrayList<String>() {{
|
||||
add("Belongs to Group3");
|
||||
add("Can review changes made by Group2 users");
|
||||
add("Can view comments left by Group2 and Group3 users. Can edit comments left by the Group2 users");
|
||||
add("This file isn’t marked as favorite");
|
||||
add("Can’t copy data from the file to clipboard");
|
||||
add("Can’t download the file");
|
||||
add("Can’t print the file");
|
||||
add("Can create new files from the editor");
|
||||
add("Can see the information about Group2 users");
|
||||
add("Can’t submit forms");
|
||||
add("The file favorite state is undefined");
|
||||
add("Can't copy data from the file to clipboard");
|
||||
add("Can't download the file");
|
||||
add("Can't print the file");
|
||||
add("Can create new files from the editor");
|
||||
add("Can't close history");
|
||||
add("Can't restore the file version");
|
||||
add("Can't submit forms");
|
||||
add("Has role 'role'");
|
||||
add("Can start filling");
|
||||
}};
|
||||
|
||||
private static List<String> descriptionUserZero = new ArrayList<String>() {{
|
||||
add("The name is requested when the editor is opened");
|
||||
add("Doesn’t belong to any group");
|
||||
add("Doesn't belong to any group");
|
||||
add("Can review all the changes");
|
||||
add("Can perform all actions with comments");
|
||||
add("Can't see anyone's information");
|
||||
add("The file favorite state is undefined");
|
||||
add("Can't mention others in comments");
|
||||
add("Can't create new files from the editor");
|
||||
add("Can’t see anyone’s information");
|
||||
add("Can't rename files from the editor");
|
||||
add("Can't view chat");
|
||||
add("Can't protect file");
|
||||
add("View file without collaboration");
|
||||
add("Can’t submit forms");
|
||||
add("Can't refresh outdated file");
|
||||
add("Can't submit forms");
|
||||
add("Tour of tips when opening a document");
|
||||
add("Has empty role");
|
||||
add("Can't start filling");
|
||||
}};
|
||||
|
||||
private static List<User> users = new ArrayList<User>() {{
|
||||
add(new User("uid-1", "John Smith", "smith@example.com",
|
||||
"", null, new CommentGroups(), null,
|
||||
null, new ArrayList<String>(), descriptionUserFirst, true, true, new Goback(null, false),
|
||||
new Close(null, false)));
|
||||
false, new ArrayList<String>(), descriptionUserFirst, true, true, new Goback(null, false),
|
||||
new Close(null, false), null));
|
||||
add(new User("uid-2", "Mark Pottato", "pottato@example.com",
|
||||
"group-2", Arrays.asList("group-2", ""), new CommentGroups(null,
|
||||
Arrays.asList("group-2", ""), Arrays.asList("group-2")), Arrays.asList("group-2", ""),
|
||||
true, new ArrayList<String>(), descriptionUserSecond, false, true,
|
||||
new Goback("Go to Documents", false), new Close(null, true)));
|
||||
new Goback("Go to Documents", false), new Close(null, true), Arrays.asList("Anyone")));
|
||||
add(new User("uid-3", "Hamish Mitchell", null,
|
||||
"group-3", Arrays.asList("group-2"), new CommentGroups(Arrays.asList("group-3", "group-2"),
|
||||
Arrays.asList("group-2"), null), Arrays.asList("group-2"),
|
||||
false, Arrays.asList("copy", "download", "print"),
|
||||
descriptionUserThird, false, false, null, new Close(null, true)));
|
||||
null, Arrays.asList("copy", "download", "print"),
|
||||
descriptionUserThird, false, false, null, new Close(null, true), Arrays.asList("role")));
|
||||
add(new User("uid-0", null, null,
|
||||
"", null, null, null,
|
||||
null, Arrays.asList("protect"), descriptionUserZero, false, false, null, null));
|
||||
null, Arrays.asList("protect"), descriptionUserZero, false, false, null, null,
|
||||
new ArrayList<String>()));
|
||||
}};
|
||||
|
||||
private Users() { }
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version=1.14.0
|
||||
version=1.15.0
|
||||
|
||||
filesize-max=5242880
|
||||
storage-folder=app_data
|
||||
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,6 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.5 3.707V15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V1A.5.5 0 0 1 3 .5h7.293z" fill="#fff" stroke="#BBB"/>
|
||||
<path d="M9.5 1v2.7c0 .28 0 .42.055.527a.5.5 0 0 0 .218.218c.107.055.247.055.527.055H13" stroke="#BBB"/>
|
||||
<path d="M5 8h6v1H5zm0 1h1v1H5zm5 0h1v1h-1zM7 6h2v2H7z" fill="#5951BB"/>
|
||||
<path stroke="#5951BB" d="M4.5 10.5h2v2h-2zm5 0h2v2h-2z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 469 B |
@ -511,10 +511,6 @@ label .checkbox {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
@ -634,6 +630,11 @@ footer table tr td:first-child {
|
||||
background-image: url("img/icon_pdf.svg");
|
||||
}
|
||||
|
||||
.stored-edit.diagram,
|
||||
.uploadFileName.diagram {
|
||||
background-image: url("img/icon_vsdx.svg");
|
||||
}
|
||||
|
||||
.stored-edit span {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
|
||||
@ -107,6 +107,10 @@
|
||||
|
||||
// the meta information of the document is changed via the meta command
|
||||
var onMetaChange = function (event) {
|
||||
if (event.data.title !== undefined) {
|
||||
document.title = event.data.title + " - ONLYOFFICE";
|
||||
}
|
||||
|
||||
if (event.data.favorite !== undefined) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
@ -355,10 +359,33 @@
|
||||
users = <%=(String) request.getAttribute("usersForMentions")%>;
|
||||
}
|
||||
|
||||
docEditor.setUsers({
|
||||
if ((c === "protect" || c === "mention") && users && event.data.count) {
|
||||
let from = event.data.from;
|
||||
let count = event.data.count;
|
||||
let search = event.data.search;
|
||||
if (from != 0) users = [];
|
||||
var resultCount = 234;
|
||||
for (var i = Math.max(users.length, from); i < Math.min(from + count, resultCount); i++){
|
||||
users.push({
|
||||
email: "test@test.test" + (i + 1),
|
||||
id: "id" + (i + 1),
|
||||
name: "test_" + search + (i + 1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var result = {
|
||||
"c": c,
|
||||
"users": users,
|
||||
});
|
||||
};
|
||||
if (resultCount) {
|
||||
// support v9.0
|
||||
result.total = 1 + (!event.data.count || users.length < event.data.count ? 0 : (event.data.from + event.data.count));
|
||||
// since v9.0.1
|
||||
result.isPaginated = true;
|
||||
}
|
||||
|
||||
docEditor.setUsers(result);
|
||||
};
|
||||
|
||||
var onRequestSendNotify = function(event) { // the user is mentioned in a comment
|
||||
@ -367,6 +394,18 @@
|
||||
innerAlert("onRequestSendNotify: " + data);
|
||||
};
|
||||
|
||||
var onRequestStartFilling = function(event) {
|
||||
var data = event.data;
|
||||
var submit = confirm("Start filling?\n" + JSON.stringify(data));
|
||||
if (submit) {
|
||||
docEditor.startFilling(true);
|
||||
}
|
||||
};
|
||||
|
||||
var onStartFilling = function(event) {
|
||||
innerAlert("The form is ready to fill out.");
|
||||
};
|
||||
|
||||
config = JSON.parse('<%= FileModel.serialize(Model) %>');
|
||||
config.width = "100%";
|
||||
config.height = "100%";
|
||||
@ -384,6 +423,8 @@
|
||||
};
|
||||
|
||||
if (config.editorConfig.user.id) {
|
||||
config.events['onRequestStartFilling'] = onRequestStartFilling;
|
||||
config.events['onStartFilling'] = onStartFilling;
|
||||
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
|
||||
config.events['onRequestClose'] = onRequestClose;
|
||||
// add mentions for not anonymous users
|
||||
@ -406,7 +447,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var сonnectEditor = function () {
|
||||
var connectEditor = function () {
|
||||
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
|
||||
};
|
||||
|
||||
@ -418,9 +459,9 @@
|
||||
};
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("load", сonnectEditor);
|
||||
window.addEventListener("load", connectEditor);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("load", сonnectEditor);
|
||||
window.attachEvent("load", connectEditor);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -153,13 +153,18 @@
|
||||
<% } %>
|
||||
</menu>
|
||||
<div id="portal-info" style="display: <%= files.length > 0 ? "none" : "table-cell" %>">
|
||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
|
||||
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
|
||||
<span class="portal-descr">
|
||||
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
|
||||
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
|
||||
You can test editing features in real-time and explore multi-user collaboration:
|
||||
<ul>
|
||||
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
|
||||
<li>Upload your own files to test using the Upload file button</li>
|
||||
<li>Select your username and language to simulate different users and environments</li>
|
||||
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
|
||||
</ul>
|
||||
</span>
|
||||
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
|
||||
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
|
||||
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
|
||||
<% for (User user : Users.getAllUsers()) { %>
|
||||
<div class="user-descr" onclick="toggleUserDescr(event)">
|
||||
<b><%= user.getName() == null ? "Anonymous" : user.getName() %></b>
|
||||
@ -366,10 +371,7 @@
|
||||
<span class="errorPass"></span>
|
||||
<br />
|
||||
</div>
|
||||
<span id="step3" class="step">3. Loading editor scripts.</span>
|
||||
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
|
||||
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
|
||||
<br />
|
||||
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
|
||||
<br />
|
||||
<div class="error-message">
|
||||
@ -414,7 +416,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" data-docs="<%= ConfigManager.getProperty("files.docservice.url.site") + ConfigManager.getProperty("files.docservice.url.preloader") %>"></span>
|
||||
<iframe id="iframeScripts" src="<%= ConfigManager.getProperty("files.docservice.url.site") + ConfigManager.getProperty("files.docservice.url.preloader") %>" width=1 height=1 style="position: absolute; visibility: hidden; top: 0;" ></iframe>
|
||||
|
||||
<footer>
|
||||
<div class="center">
|
||||
@ -422,7 +424,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
|
||||
<a href="https://api.onlyoffice.com/docs/docs-api/get-started/how-it-works/" target="_blank">API Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
|
||||
|
||||
@ -126,7 +126,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
if (!formatManager.isAutoConvertible(posExt)) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -181,36 +181,16 @@ if (typeof jQuery !== "undefined") {
|
||||
if (response.step && response.step < 100) {
|
||||
checkConvert(filePass, fileType);
|
||||
} else {
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = "<iframe id=\"iframeScripts\" width=1 height=1 style=\"position: absolute; visibility: hidden;\" ></iframe>";
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
var onuploaded = function () {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
@ -272,7 +252,7 @@ if (typeof jQuery !== "undefined") {
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
@ -353,7 +333,7 @@ if (typeof jQuery !== "undefined") {
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(fileName);
|
||||
jq("#convertStep1").addClass("done");
|
||||
jq("#convertStep1").addClass("error");
|
||||
jq("#convertStep2").addClass("waiting");
|
||||
});
|
||||
|
||||
@ -363,6 +343,7 @@ if (typeof jQuery !== "undefined") {
|
||||
let fileExt = jq(`#${id}`).attr("data");
|
||||
jq(`#${id}`).addClass("orange");
|
||||
jq("td[name='convertingTypeButton']").addClass("disable");
|
||||
jq("#convertStep1").removeClass("error").addClass("done");
|
||||
jq("#convertStep2").removeClass("waiting").removeClass("done").addClass("current");
|
||||
jq("#convertStep2").text('2. File conversion');
|
||||
jq("#convert-descr").removeClass("disable");
|
||||
|
||||
@ -16,6 +16,5 @@ module.exports = {
|
||||
'no-continue': 'off',
|
||||
'no-extend-native': ['error', { exceptions: ['String'] }],
|
||||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
||||
'no-prototype-builtins': 'off',
|
||||
},
|
||||
};
|
||||
|
||||