Merge remote-tracking branch 'remotes/origin/develop' into feature/jwtHistoryFiles

# Conflicts:
#	web/documentserver-example/java/README.md
This commit is contained in:
Sergey Linnik
2022-02-11 10:22:04 +03:00
74 changed files with 268 additions and 186 deletions

View File

@ -1,10 +1,11 @@
## Integration examples
Test examples are simple document management systems that can be built into your
application for testing (please, do not use it for production without proper code
modifications).
Test examples are simple document management systems that can be built into your application for testing.
Do NOT use these integration examples on your own server without proper code modifications!
In case you enabled any of the test examples, disable it before going for production.
These examples show the way to integrate [ONLYOFFICE Docs][2] into your own website or application using one of the programming languages. The package contains examples written in .Net (C# MVC), .Net (C#), Java, Node.js, PHP and Ruby.
These examples show the way to integrate [ONLYOFFICE Docs][2] into your own website or application using one of the programming languages.
The package contains examples written in .Net (C# MVC), .Net (C#), Java, Node.js, PHP and Ruby.
You should change `http://documentserver` to your server address in these files:
* [.Net (C# MVC)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp-mvc) - `web/documentserver-example/csharp-mvc/web.appsettings.config`

View File

@ -734,12 +734,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -30,7 +30,8 @@ namespace OnlineEditorsExampleMVC.Helpers
"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 create files from templates using data from the editor",
"Can see the information about all users"
};
static List<string> descr_user_2 = new List<string>()
@ -39,7 +40,8 @@ namespace OnlineEditorsExampleMVC.Helpers
"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",
"This file is marked as favorite",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
};
static List<string> descr_user_3 = new List<string>()
@ -51,7 +53,8 @@ namespace OnlineEditorsExampleMVC.Helpers
"Cant copy data from the file to clipboard",
"Cant download the file",
"Cant print the file",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about Group2 users"
};
static List<string> descr_user_0 = new List<string>()
@ -62,7 +65,8 @@ namespace OnlineEditorsExampleMVC.Helpers
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor"
"Can't create new files from the editor",
"Cant see anyones information"
};
private static List<User> users = new List<User>() {
@ -74,6 +78,7 @@ namespace OnlineEditorsExampleMVC.Helpers
null,
new Dictionary<string, object>(),
null,
null,
new List<string>(),
descr_user_1,
true
@ -90,6 +95,7 @@ namespace OnlineEditorsExampleMVC.Helpers
{ "edit", new List<string>() { "group-2", "" } },
{ "remove", new List<string>() { "group-2" } }
},
new List<string>() { "group-2", "" },
true,
new List<string>(),
descr_user_2,
@ -107,6 +113,7 @@ namespace OnlineEditorsExampleMVC.Helpers
{ "edit", new List<string>() { "group-2" } },
{ "remove", new List<string>() { } }
},
new List<string>() { "group-2" },
false,
new List<string>() { "copy", "download", "print" },
descr_user_3,
@ -119,6 +126,7 @@ namespace OnlineEditorsExampleMVC.Helpers
"",
null,
new Dictionary<string,object>(),
new List<string>(),
null,
new List<string>(),
descr_user_0,
@ -173,8 +181,9 @@ namespace OnlineEditorsExampleMVC.Helpers
public List<string> deniedPermissions;
public List<string> descriptions;
public bool templates;
public List<string> userInfoGroups;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates)
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)
{
this.id = id;
this.name = name;
@ -186,6 +195,7 @@ namespace OnlineEditorsExampleMVC.Helpers
this.deniedPermissions = deniedPermissions;
this.descriptions = descriptions;
this.templates = templates;
this.userInfoGroups = userInfoGroups;
}
}
}

View File

@ -149,7 +149,8 @@ namespace OnlineEditorsExampleMVC.Models
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", canEdit && (editorsMode == "edit" || editorsMode == "review") },
{ "reviewGroups", user.reviewGroups },
{ "commentGroups", user.commentGroups }
{ "commentGroups", user.commentGroups },
{ "userInfoGroups", user.userInfoGroups }
}
}
}

View File

@ -55,7 +55,7 @@ namespace OnlineEditorsExampleMVC.Models
// spreadsheet extensions
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm",
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application written in .Net (C# MVC).
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## Step 1. Install ONLYOFFICE Docs

View File

@ -145,6 +145,7 @@
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>
<% foreach (User user in Users.getAllUsers())
{ %>

View File

@ -9,7 +9,7 @@
<add key="files.docservice.fillform-docs" value=".oform|.docx"/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps|.oxps"/>
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.txt|.docxf"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.secret" value="" />
<add key="files.docservice.header" value="Authorization" />

View File

@ -738,12 +738,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -146,6 +146,7 @@
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>
<% foreach (User user in Users.getAllUsers())
{ %>

View File

@ -35,7 +35,7 @@ namespace OnlineEditorsExample
// the spreadsheet extension list
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm",
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};

View File

@ -217,7 +217,8 @@ namespace OnlineEditorsExample
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", canEdit && (editorsMode == "edit" || editorsMode == "review") },
{ "reviewGroups", user.reviewGroups },
{ "commentGroups", user.commentGroups }
{ "commentGroups", user.commentGroups },
{ "userInfoGroups", user.userInfoGroups }
}
}
}

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application written in .Net (C#).
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## Step 1. Install ONLYOFFICE Docs

View File

@ -29,7 +29,8 @@ namespace OnlineEditorsExample
"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 create files from templates using data from the editor",
"Can see the information about all users"
};
static List<string> descr_user_2 = new List<string>()
@ -38,7 +39,8 @@ namespace OnlineEditorsExample
"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",
"This file is marked as favorite",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
};
static List<string> descr_user_3 = new List<string>()
@ -50,7 +52,8 @@ namespace OnlineEditorsExample
"Cant copy data from the file to clipboard",
"Cant download the file",
"Cant print the file",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about Group2 users"
};
static List<string> descr_user_0 = new List<string>()
@ -61,7 +64,8 @@ namespace OnlineEditorsExample
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor"
"Can't create new files from the editor",
"Cant see anyones information"
};
private static List<User> users = new List<User>() {
@ -73,6 +77,7 @@ namespace OnlineEditorsExample
null,
new Dictionary<string, object>(),
null,
null,
new List<string>(),
descr_user_1,
true
@ -89,6 +94,7 @@ namespace OnlineEditorsExample
{ "edit", new List<string>() { "group-2", "" } },
{ "remove", new List<string>() { "group-2" } }
},
new List<string>() { "group-2", "" },
true,
new List<string>(),
descr_user_2,
@ -106,6 +112,7 @@ namespace OnlineEditorsExample
{ "edit", new List<string>() { "group-2" } },
{ "remove", new List<string>() { } }
},
new List<string>() { "group-2" },
false,
new List<string>() { "copy", "download", "print" },
descr_user_3,
@ -118,6 +125,7 @@ namespace OnlineEditorsExample
"",
null,
new Dictionary<string, object>(),
new List<string>(),
null,
new List<string>(),
descr_user_0,
@ -173,8 +181,9 @@ namespace OnlineEditorsExample
public List<string> deniedPermissions;
public List<string> descriptions;
public bool templates;
public List<string> userInfoGroups;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates)
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)
{
this.id = id;
this.name = name;
@ -186,6 +195,7 @@ namespace OnlineEditorsExample
this.deniedPermissions = deniedPermissions;
this.descriptions = descriptions;
this.templates = templates;
this.userInfoGroups = userInfoGroups;
}
}
}

View File

@ -9,7 +9,7 @@
<add key="files.docservice.fillform-docs" value=".oform|.docx"/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps|.oxps"/>
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.txt|.docxf"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.secret" value="" />
<add key="files.docservice.header" value="Authorization" />

View File

@ -6,7 +6,8 @@ with Spring Boot.
Spring Boot has a lot of functionality, but its most significant features are: dependency management,
auto-configuration, and built-in servlet containers.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## For Windows
### Step 1. Install ONLYOFFICE Docs

View File

@ -40,7 +40,8 @@ public class ExampleData {
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor"
"Can't create new files from the editor",
"Cant see anyones information"
);
List<String> description_user_1 = List.of( // the description for user 1
"File author by default",
@ -48,14 +49,16 @@ public class ExampleData {
"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 create a file from a template with data from the editor",
"Can see the information about all users"
);
List<String> description_user_2 = List.of( // the description for user 2
"He belongs to Group2",
"He can review only his own changes or the changes made by the users who dont 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",
"This file is favorite",
"Can create a file from an editor"
"Can create a file from an editor",
"Can see the information about users from Group2 and users who dont belong to any group"
);
List<String> description_user_3 = List.of( // the description for user 3
"He belongs to Group3",
@ -65,21 +68,24 @@ public class ExampleData {
"He cant copy data from the file into the clipboard",
"He cant download the file",
"He cant print the file",
"Can create a file from an editor"
"Can create a file from an editor",
"Can see the information about Group2 users"
);
userService.createUser("John Smith", "smith@example.com", // create user 1 with the specified parameters
description_user_1, "", List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), null);
List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()),
null);
userService.createUser("Mark Pottato", "pottato@example.com", // create user 2 with the specified parameters
description_user_2, "group-2", List.of("","group-2"), List.of(FilterState.NULL.toString()),
List.of("group-2", ""), List.of("group-2"), true);
List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true);
userService.createUser("Hamish Mitchell", "mitchell@example.com", // create user 3 with the specified parameters
description_user_3, "group-3", List.of("group-2"), List.of("group-2", "group-3"),
List.of("group-2"), new ArrayList<>(), false);
List.of("group-2"), new ArrayList<>(), List.of("group-2"), false);
userService.createUser("Anonymous",null, // create user 0 with the specified parameters
description_user_0,"", List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()), null);
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()), new ArrayList<>(),null);
}
}

View File

@ -47,4 +47,6 @@ public class Permission extends AbstractModel { // the permission for the docum
private List<String> reviewGroups; // the groups whose changes the user can accept/reject
@Autowired
private CommentGroup commentGroups; // the groups whose comments the user can edit, remove and/or view
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
private List<String> userInfoGroups;
}

View File

@ -59,7 +59,7 @@ public class DefaultFileUtility implements FileUtility {
// spreadsheet extensions
private List<String> ExtsSpreadsheet = Arrays.asList(
".xls", ".xlsx", ".xlsm",
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv");

View File

@ -47,4 +47,6 @@ public class Permission extends AbstractEntity {
private List<Group> commentsEditGroups;
@ManyToMany
private List<Group> commentsRemoveGroups;
@ManyToMany
private List<Group> userInfoGroups;
}

View File

@ -54,5 +54,6 @@ public class PermissionsMapper extends AbstractMapper<Permission, com.onlyoffice
source.getCommentsRemoveGroups().stream().map(g -> g.getName()).collect(Collectors.toList())
)
);
destination.setUserInfoGroups(source.getUserInfoGroups().stream().map(g -> g.getName()).collect(Collectors.toList()));
}
}

View File

@ -36,13 +36,15 @@ public class PermissionServices {
public Permission createPermission(List<Group> reviewGroups,
List<Group> commentViewGroups,
List<Group> commentEditGroups,
List<Group> commentRemoveGroups){
List<Group> commentRemoveGroups,
List<Group> userInfoGroups){
Permission permission = new Permission();
permission.setReviewGroups(reviewGroups); // define the groups whose changes the user can accept/reject
permission.setCommentsViewGroups(commentViewGroups); // defines the groups whose comments the user can view
permission.setCommentsEditGroups(commentEditGroups); // defines the groups whose comments the user can edit
permission.setCommentsRemoveGroups(commentRemoveGroups); // defines the groups whose comments the user can remove
permission.setUserInfoGroups(userInfoGroups);
permissionRepository.save(permission); // save new permissions

View File

@ -56,7 +56,7 @@ public class UserServices {
List<String> reviewGroups,
List<String> viewGroups,
List<String> editGroups,
List<String> removeGroups, Boolean favoriteDoc){
List<String> removeGroups, List<String> userInfoGroups, Boolean favoriteDoc){
User newUser = new User();
newUser.setName(name); // set the user name
newUser.setEmail(email); // set the user email
@ -68,9 +68,10 @@ public class UserServices {
List<Group> commentGroupsView = groupServices.createGroups(viewGroups); // defines the groups whose comments the user can view
List<Group> commentGroupsEdit = groupServices.createGroups(editGroups); // defines the groups whose comments the user can edit
List<Group> commentGroupsRemove = groupServices.createGroups(removeGroups); // defines the groups whose comments the user can remove
List<Group> usInfoGroups = groupServices.createGroups(userInfoGroups);
Permission permission = permissionService
.createPermission(groupsReview, commentGroupsView, commentGroupsEdit, commentGroupsRemove); // specify permissions for the current user
.createPermission(groupsReview, commentGroupsView, commentGroupsEdit, commentGroupsRemove, usInfoGroups); // specify permissions for the current user
newUser.setPermissions(permission);
userRepository.save(newUser); // save a new user

View File

@ -11,7 +11,7 @@ files.storage.folder=documents
files.docservice.fillforms-docs=.oform|.docx
files.docservice.viewed-docs=.pdf|.djvu|.xps|.oxps
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt|.docxf
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2
files.docservice.timeout=120000
files.docservice.history.postfix=-hist

View File

@ -744,12 +744,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -133,6 +133,7 @@
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>
</div>
<th:block th:if="${not #lists.isEmpty(files)}">

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application written in Java.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## For Windows

View File

@ -267,6 +267,7 @@ public class FileModel
public Boolean review;
public List<String> reviewGroups;
public CommentGroups commentGroups;
public List<String> userInfoGroups;
// defines what can be done with a document
public Permissions(String mode, String type, Boolean canEdit, User user)
@ -282,6 +283,7 @@ public class FileModel
review = canEdit && (mode.equals("edit") || mode.equals("review"));
reviewGroups = user.reviewGroups;
commentGroups = user.commentGroups;
userInfoGroups = user.userInfoGroups;
}
}

View File

@ -31,8 +31,9 @@ public class User {
public List<String> deniedPermissions;
public List<String> descriptions;
public Boolean templates;
public List<String> userInfoGroups;
public User(String id, String name, String email, String group, List<String> reviewGroups, CommentGroups commentGroups,
public User(String id, String name, String email, String group, List<String> reviewGroups, CommentGroups commentGroups, List<String> userInfoGroups,
Boolean favorite, List<String> deniedPermissions, List<String> descriptions, Boolean templates) {
this.id = id;
this.name = name;
@ -44,5 +45,6 @@ public class User {
this.deniedPermissions = deniedPermissions;
this.descriptions = descriptions;
this.templates = templates;
this.userInfoGroups = userInfoGroups;
}
}

View File

@ -63,7 +63,7 @@ public class FileUtility
// spreadsheet extensions
public static List<String> ExtsSpreadsheet = Arrays.asList
(
".xls", ".xlsx", ".xlsm",
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
);

View File

@ -31,6 +31,7 @@ public class Users {
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");
}};
static List<String> descr_user_2 = new ArrayList<String>() {{
@ -39,6 +40,7 @@ public class Users {
add("Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only");
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 dont belong to any group");
}};
static List<String> descr_user_3 = new ArrayList<String>() {{
@ -50,6 +52,7 @@ public class Users {
add("Cant download the file");
add("Cant print the file");
add("Can create new files from the editor");
add("Can see the information about Group2 users");
}};
static List<String> descr_user_0 = new ArrayList<String>() {{
@ -60,20 +63,21 @@ public class Users {
add("The file favorite state is undefined");
add("Can't mention others in comments");
add("Can't create new files from the editor");
add("Cant see anyones information");
}};
private static List<User> users = new ArrayList<User>() {{
add(new User("uid-1", "John Smith", "smith@example.com",
"", null, new CommentGroups(),
"", null, new CommentGroups(), null,
null, new ArrayList<String>(), descr_user_1, true));
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")),
"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>(), descr_user_2, false));
add(new User("uid-3", "Hamish Mitchell", "mitchell@example.com",
"group-3", Arrays.asList("group-2"), new CommentGroups(Arrays.asList("group-3", "group-2"), Arrays.asList("group-2"), new ArrayList<String>()),
"group-3", Arrays.asList("group-2"), new CommentGroups(Arrays.asList("group-3", "group-2"), Arrays.asList("group-2"), new ArrayList<String>()), Arrays.asList("group-2"),
false, Arrays.asList("copy", "download", "print"), descr_user_3, false));
add(new User("uid-0", null, null,
"", null, new CommentGroups(),
"", null, new CommentGroups(), new ArrayList<String>(),
null, new ArrayList<String>(), descr_user_0, false));
}};

View File

@ -6,7 +6,7 @@ storage-folder=app_data
files.docservice.fill-docs=.oform|.docx
files.docservice.viewed-docs=.pdf|.djvu|.xps|.oxps
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt|.docxf
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2
files.docservice.timeout=120000
files.docservice.url.site=http://documentserver/

View File

@ -741,12 +741,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -145,6 +145,7 @@
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>
<% for (User user : Users.getAllUsers()) { %>
<div class="user-descr">

View File

@ -66,7 +66,7 @@ function key(k) {
var getDocumentType = function (ext) {
if (".doc.docx.docm.dot.dotx.dotm.odt.fodt.ott.rtf.txt.html.htm.mht.xml.pdf.djvu.fb2.epub.xps.oxps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.xlsm.xlt.xltx.xltm.ods.fods.ots.csv".indexOf(ext) != -1) return "spreadsheet";
if (".xls.xlsx.xlsm.xlsb.xlt.xltx.xltm.ods.fods.ots.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppsm.ppt.pptx.pptm.pot.potx.potm.odp.fodp.otp".indexOf(ext) != -1) return "presentation";
return null;
};

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application on Node.js.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## For Windows

View File

@ -754,7 +754,16 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
var userid = user.id;
var name = user.name;
var actionData = req.query.action ? req.query.action : "null";
var actionData = "null";
if (req.query.action){
try {
actionData = JSON.stringify(JSON.parse(req.query.action));
}
catch (ex) {
console.log(ex);
}
}
var templatesImageUrl = docManager.getTemplateImageUrl(fileUtility.getFileType(fileName));
var createUrl = docManager.getCreateUrl(fileUtility.getFileType(fileName), userid, type, lang);
@ -774,6 +783,7 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
var userGroup = user.group;
var reviewGroups = user.reviewGroups;
var commentGroups = user.commentGroups;
var userInfoGroups = user.userInfoGroups;
if (fileExt != null) {
var fileName = docManager.createDemo(!!req.query.sample, fileExt, userid, name, false); // create demo document of a given extension
@ -795,10 +805,14 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
var url = docManager.getDownloadUrl(fileName);
var urlUser = path.isAbsolute(storageFolder) ? docManager.getDownloadUrl(fileName) + "&dmode=emb" : docManager.getlocalFileUri(fileName, 0, false);
var mode = req.query.mode || "edit"; // mode: view/edit/review/comment/fillForms/embedded
var type = req.query.type || ""; // type: embedded/mobile/desktop
if (type == "") {
type = new RegExp(configServer.get("mobileRegEx"), "i").test(req.get('User-Agent')) ? "mobile" : "desktop";
}
type = new RegExp(configServer.get("mobileRegEx"), "i").test(req.get('User-Agent')) ? "mobile" : "desktop";
} else if (type != "mobile"
&& type != "embedded") {
type = "desktop";
}
var canEdit = configServer.get('editedDocs').indexOf(fileExt) != -1; // check if this file can be edited
if ((!canEdit && mode == "edit" || mode == "fillForms") && configServer.get('fillDocs').indexOf(fileExt) != -1) {
@ -903,6 +917,7 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
userGroup: userGroup,
reviewGroups: JSON.stringify(reviewGroups),
commentGroups: JSON.stringify(commentGroups),
userInfoGroups: JSON.stringify(userInfoGroups),
fileChoiceUrl: fileChoiceUrl,
submitForm: submitForm,
plugins: JSON.stringify(plugins),

View File

@ -25,7 +25,7 @@
"viewedDocs": [".pdf", ".djvu", ".xps", ".oxps"],
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".txt", ".docxf"],
"fillDocs": [".docx", ".oform"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".xml", ".epub", ".fb2"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xlsb", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".xml", ".epub", ".fb2"],
"storageFolder": "./files",
"storagePath": "/files",
"maxFileSize": 1073741824,

View File

@ -58,7 +58,7 @@ docManager.init = function (dir, req, res) {
// get the language from the request
docManager.getLang = function () {
if (docManager.req.query.lang) {
if (new RegExp("^[a-z]{2}(-[A-Z]{2})?$", "i").test(docManager.req.query.lang)) {
return docManager.req.query.lang;
} else { // the default language value is English
return "en"

View File

@ -66,7 +66,7 @@ fileUtility.fileType = {
fileUtility.documentExts = [".doc", ".docx", ".oform", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".fodt", ".ott", ".rtf", ".txt", ".html", ".htm", ".mht", ".xml", ".pdf", ".djvu", ".fb2", ".epub", ".xps", ".oxps"];
// the spreadsheet extension list
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".ots", ".csv"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlsb", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".ots", ".csv"];
// the presentation extension list
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp", ".fodp", ".otp"];

View File

@ -23,6 +23,7 @@ var descr_user_1 = [
"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",
//"Can submit forms"
];
@ -32,6 +33,7 @@ var descr_user_2 = [
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
"This file is marked as favorite",
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group",
//"Cant submit forms"
];
@ -44,6 +46,7 @@ var descr_user_3 = [
"Cant download the file",
"Cant print the file",
"Can create new files from the editor",
"Can see the information about Group2 users",
//"Cant submit forms"
];
@ -55,39 +58,41 @@ var descr_user_0 = [
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor",
"Cant see anyones information",
//"Cant submit forms"
];
var users = [
new User("uid-1", "John Smith", "smith@example.com",
null, null, {},
null, null, {}, null,
null, [], descr_user_1, true),
new User("uid-2", "Mark Pottato", "pottato@example.com",
"group-2", ["group-2", ""], {
view: "",
edit: ["group-2", ""],
remove: ["group-2"]
},
}, ["group-2", ""],
true, [], descr_user_2, false), // own and without group
new User("uid-3", "Hamish Mitchell", "mitchell@example.com",
"group-3", ["group-2"], {
view: ["group-3", "group-2"],
edit: ["group-2"],
remove: []
},
}, ["group-2"],
false, ["copy", "download", "print"], descr_user_3, false), // other group only
new User("uid-0", null, null,
null, null, {},
null, null, {}, [],
null, [], descr_user_0, false),
];
function User(id, name, email, group, reviewGroups, commentGroups, favorite, deniedPermissions, descriptions, templates) {
function User(id, name, email, group, reviewGroups, commentGroups, userInfoGroups, favorite, deniedPermissions, descriptions, templates) {
this.id = id;
this.name = name;
this.email = email;
this.group = group;
this.reviewGroups = reviewGroups;
this.commentGroups = commentGroups;
this.userInfoGroups = userInfoGroups;
this.favorite = favorite;
this.deniedPermissions = deniedPermissions;
this.descriptions = descriptions;

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 19H8.11111L8.84845 18.2627L5.73734 15.1516L5 15.8889V19ZM10.2627 16.8484L19 8.11111V6.55556H17.4444V5H15.8889L7.15155 13.7373L10.2627 16.8484Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 316 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C8.17879 6 4.71351 8.10432 2.15649 11.5223C1.94784 11.8023 1.94784 12.1935 2.15649 12.4736C4.71351 15.8957 8.17879 18 12 18C15.8212 18 19.2865 15.8957 21.8435 12.4777C22.0522 12.1977 22.0522 11.8065 21.8435 11.5264C19.2865 8.10432 15.8212 6 12 6ZM12.2607 15.9919C9.84844 16.1436 7.8564 14.1554 8.00813 11.7393C8.13264 9.74729 9.74728 8.13265 11.7393 8.00815C14.1516 7.85641 16.1436 9.84456 15.9919 12.2607C15.8635 14.2488 14.2488 15.8635 12.2607 15.9919ZM12.1282 13.9959C10.9219 14.0718 9.92498 13.0783 10.0044 11.8718C10.0658 10.8747 10.8749 10.0691 11.8718 10.0041C13.0781 9.92821 14.075 10.9217 13.9956 12.1282C13.9305 13.1289 13.1215 13.9345 12.1282 13.9959Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 838 B

View File

@ -752,12 +752,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -24,7 +24,8 @@
"modifyContentControl": <%- editor.modifyContentControl %>,
"review": <%- editor.review %>,
"reviewGroups": <%- editor.reviewGroups %>,
"commentGroups": <%- editor.commentGroups %>
"commentGroups": <%- editor.commentGroups %>,
"userInfoGroups": <%- editor.userInfoGroups %>
}
},
"editorConfig": {

View File

@ -139,6 +139,7 @@
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>
<% users.forEach(user => { %>
<div class="user-descr">
@ -181,10 +182,6 @@
<a href="editor?type=desktop&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/desktop.svg" alt="Open in editor for full size screens" title="Open in editor for full size screens" /></a>
</td>
<td class="contentCells contentCells-icon">
<a href="editor?type=mobile&mode=edit&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/mobile.svg" alt="Open in editor for mobile devices" title="Open in editor for mobile devices" /></a>
</td>
<td class="contentCells contentCells-icon">
<a href="editor?type=desktop&mode=comment&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/comment.svg" alt="Open in editor for comment" title="Open in editor for comment" /></a>
@ -212,26 +209,30 @@
<td class="contentCells contentCells-icon "></td>
<% } %>
<% if (fillExts.indexOf(storedFiles[i].name.substring(storedFiles[i].name.lastIndexOf('.')).trim().toLowerCase()) !== -1) { %>
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
<td class="contentCells contentCells-icon">
<a href="editor?type=desktop&mode=fillForms&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms" /></a>
</td>
<% } else {%>
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift"></td>
<td class="contentCells contentCells-icon"></td>
<%}%>
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
<a href="editor?type=mobile&mode=edit&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/mobile.svg" alt="Open in editor for mobile devices" title="Open in editor for mobile devices" /></a>
</td>
<% } else if (fillExts.indexOf(storedFiles[i].name.substring(storedFiles[i].name.lastIndexOf('.')).trim().toLowerCase()) !== -1) { %>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon">
<a href="editor?type=mobile&mode=fillForms&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/mobile-fill-forms.svg" alt="Open in editor for filling in forms for mobile devices" title="Open in editor for filling in forms for mobile devices" /></a>
</td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-icon "></td>
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift"">
<a href="editor?type=desktop&mode=fillForms&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms" /></a>
</td>
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
<a href="editor?type=mobile&mode=fillForms&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/mobile-fill-forms.svg" alt="Open in editor for filling in forms for mobile devices" title="Open in editor for filling in forms for mobile devices" /></a>
</td>
<% } else { %>
<td class="contentCells contentCells-shift contentCells-icon contentCellsEmpty" colspan="6"></td>
<% } %>

View File

@ -149,6 +149,7 @@
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>
<% } %>
</div>
@ -187,9 +188,9 @@
<% if (storedFiles[i].actions[j].name != "editnew") { %>
<a href="<%= serverUrl %>/wopi-action/<%= encodeURIComponent(storedFiles[i].name) %>?action=<%= storedFiles[i].actions[j].name %><%= params %>" target="_blank">
<% if (storedFiles[i].actions[j].name == "edit") { %>
<img src="images/fill-forms.svg" alt="<%= storedFiles[i].actions[j].name %>" title="<%= storedFiles[i].actions[j].name %>" />
<img src="images/editor.svg" alt="<%= storedFiles[i].actions[j].name %>" title="<%= storedFiles[i].actions[j].name %>" />
<%} else { %>
<img src="images/desktop.svg" alt="<%= storedFiles[i].actions[j].name %>" title="<%= storedFiles[i].actions[j].name %>" />
<img src="images/view.svg" alt="<%= storedFiles[i].actions[j].name %>" title="<%= storedFiles[i].actions[j].name %>" />
<% } %>
</a>
<% } %>

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application written in PHP.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## For Windows

View File

@ -9,7 +9,7 @@ $GLOBALS['ALONE'] = FALSE;
$GLOBALS['DOC_SERV_FILLFORMS'] = array(".oform", ".docx");
$GLOBALS['DOC_SERV_VIEWD'] = array(".pdf", ".djvu", ".xps", ".oxps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".xlsx", ".csv", ".pptx", ".txt", ".docxf");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".xml", ".epub", ".fb2");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xlsb", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".xml", ".epub", ".fb2");
$GLOBALS['DOC_SERV_TIMEOUT'] = "120000";
@ -29,7 +29,7 @@ $GLOBALS['EXAMPLE_URL'] = "";
$GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino";
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm",
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv");

View File

@ -734,12 +734,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -107,7 +107,8 @@
"modifyContentControl" => $editorsMode != "blockcontent",
"review" => $canEdit && ($editorsMode == "edit" || $editorsMode == "review"),
"reviewGroups" => $user->reviewGroups,
"commentGroups" => $user->commentGroups
"commentGroups" => $user->commentGroups,
"userInfoGroups" => $user->userInfoGroups
]
],
"editorConfig" => [

View File

@ -151,6 +151,7 @@
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>
<?php foreach(getAllUsers() as $user_l) {
$name = $user_l->name ? $user_l->name : "Anonymous";

View File

@ -18,7 +18,7 @@
*/
class User {
function __construct($id, $name, $email, $group, $reviewGroups, $commentGroups, $favorite, $deniedPermissions, $descriptions, $templates)
function __construct($id, $name, $email, $group, $reviewGroups, $commentGroups, $userInfoGroups, $favorite, $deniedPermissions, $descriptions, $templates)
{
$this->id = $id;
$this->name = $name;
@ -30,6 +30,7 @@ class User {
$this->deniedPermissions = $deniedPermissions;
$this->descriptions = $descriptions;
$this->templates = $templates;
$this->userInfoGroups = $userInfoGroups;
}
}
@ -39,7 +40,8 @@ $descr_user_1 = [
"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 create files from templates using data from the editor",
"Can see the information about all users"
];
$descr_user_2 = [
@ -47,7 +49,8 @@ $descr_user_2 = [
"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",
"This file is marked as favorite",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
];
$descr_user_3 = [
@ -58,7 +61,8 @@ $descr_user_3 = [
"Cant copy data from the file to clipboard",
"Cant download the file",
"Cant print the file",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about Group2 users"
];
$descr_user_0 = [
@ -68,12 +72,13 @@ $descr_user_0 = [
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor"
"Can't create new files from the editor",
"Cant see anyones information"
];
$users = [
new User("uid-1", "John Smith", "smith@example.com",
"", null, [],
"", null, [], null,
null, [], $descr_user_1, true),
new User("uid-2", "Mark Pottato", "pottato@example.com",
"group-2", ["group-2", ""], [
@ -81,6 +86,7 @@ $users = [
"edit" => ["group-2", ""],
"remove" => ["group-2"]
],
["group-2", ""],
true, [], $descr_user_2, false),
new User("uid-3", "Hamish Mitchell", "mitchell@example.com",
"group-3", ["group-2"], [
@ -88,9 +94,10 @@ $users = [
"edit" => ["group-2"],
"remove" => []
],
["group-2"],
false, ["copy", "download", "print"], $descr_user_3, false),
new User("uid-0", null, null,
"", null, [],
"", null, [], [],
null, [], $descr_user_0, false)
];

View File

@ -10,7 +10,7 @@ DOC_SERV_VIEWED = [".pdf", ".djvu", ".xps", ".oxps"] # file extensions that can
DOC_SERV_EDITED = [".docx", ".xlsx", ".csv", ".pptx", ".txt", ".docxf"] # file extensions that can be edited
DOC_SERV_CONVERT = [ # file extensions that can be converted
".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt",
".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm",
".fodt", ".ott", ".xlsm", ".xlsb", ".xls", ".xltx", ".xltm",
".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt",
".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot",
".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".xml", ".epub", ".fb2"
@ -31,7 +31,7 @@ DOC_SERV_JWT_SECRET = '' # the secret key for generating token
DOC_SERV_JWT_HEADER = 'Authorization'
EXT_SPREADSHEET = [
".xls", ".xlsx", ".xlsm",
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
]

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application written in Python.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## Step 1. Install ONLYOFFICE Docs

View File

@ -27,7 +27,7 @@
from urllib.parse import unquote
class User:
def __init__(self, id, name, email, group, reviewGroups, commentGroups, favorite, deniedPermissions, descriptions, templates):
def __init__(self, id, name, email, group, reviewGroups, commentGroups, userInfoGroups, favorite, deniedPermissions, descriptions, templates):
self.id = id
self.name = name
self.email = email
@ -38,6 +38,7 @@ class User:
self.deniedPermissions = deniedPermissions
self.descriptions = descriptions
self.templates = templates
self.userInfoGroups = userInfoGroups
descr_user_1 = [
"File author by default",
@ -45,7 +46,8 @@ descr_user_1 = [
"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 create files from templates using data from the editor",
"Can see the information about all users"
]
descr_user_2 = [
@ -53,7 +55,8 @@ descr_user_2 = [
"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",
"This file is marked as favorite",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
]
descr_user_3 = [
@ -64,7 +67,8 @@ descr_user_3 = [
"Cant copy data from the file to clipboard",
"Cant download the file",
"Cant print the file",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about Group2 users"
]
descr_user_0 = [
@ -74,12 +78,13 @@ descr_user_0 = [
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor"
"Can't create new files from the editor",
"Cant see anyones information"
]
USERS = [
User('uid-1', 'John Smith', 'smith@example.com',
'', None, {},
'', None, {}, None,
None, [], descr_user_1, True),
User('uid-2', 'Mark Pottato', 'pottato@example.com',
'group-2', ['group-2', ''], {
@ -87,16 +92,17 @@ USERS = [
'edit': ["group-2", ""],
'remove': ["group-2"]
},
['group-2', ''],
True, [], descr_user_2, False),
User('uid-3', 'Hamish Mitchell', 'mitchell@example.com',
'group-3', ['group-2'], {
'view': ["group-3", "group-2"],
'edit': ["group-2"],
'remove': []
},
}, ['group-2'],
False, ["copy", "download", "print"], descr_user_3, False),
User('uid-0', None, None,
'', None, {},
'', None, {}, [],
None, [], descr_user_0, False)
]

View File

@ -168,7 +168,8 @@ def edit(request):
submitForm = edMode == 'fillForms' and user.id == 'uid-1' and False # if the Submit form button is displayed or hidden
mode = 'edit' if canEdit & (edMode != 'view') else 'view' # if the file can't be edited, the mode is view
edType = request.GET.get('type') if request.GET.get('type') else 'desktop' # get the editor type: embedded/mobile/desktop (the default type is desktop)
types = ['desktop', 'mobile', 'embedded']
edType = request.GET.get('type') if request.GET.get('type') in types else 'desktop' # get the editor type: embedded/mobile/desktop (the default type is desktop)
lang = request.COOKIES.get('ulang') if request.COOKIES.get('ulang') else 'en' # get the editor language (the default language is English)
storagePath = docManager.getStoragePath(filename, request)
@ -225,7 +226,8 @@ def edit(request):
'modifyContentControl': edMode != "blockcontent",
'review': canEdit & ((edMode == 'edit') | (edMode == 'review')),
'reviewGroups': user.reviewGroups,
'commentGroups': user.commentGroups
'commentGroups': user.commentGroups,
'userInfoGroups': user.userInfoGroups
}
},
'editorConfig': {

View File

@ -743,12 +743,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -117,9 +117,10 @@
{% endif %}
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</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>
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>
{% for user in users %}
<div class="user-descr">

View File

@ -2,7 +2,7 @@
This example will help you integrate ONLYOFFICE Docs into your web application written on Ruby.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## Step 1. Install ONLYOFFICE Docs

View File

@ -736,12 +736,9 @@ html {
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.portal-descr:nth-child(3) {
margin-bottom: 20px;
}

View File

@ -128,7 +128,8 @@ class FileModel
:modifyContentControl => !editorsmode.eql?("blockcontent"),
:review => canEdit && (editorsmode.eql?("edit") || editorsmode.eql?("review")),
:reviewGroups => @user.reviewGroups,
:commentGroups => @user.commentGroups
:commentGroups => @user.commentGroups,
:userInfoGroups => @user.userInfoGroups
}
},
:editorConfig => {

View File

@ -21,7 +21,7 @@ class FileUtility
@@exts_document = %w(.doc .docx .docm .oform .dot .dotx .dotm .odt .fodt .ott .rtf .txt .html .htm .mht .xml .pdf .djvu .fb2 .epub .xps .oxps)
# the spreadsheet extension list
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .xlt .xltx .xltm .ods .fods .ots .csv)
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .xlsb .xlt .xltx .xltm .ods .fods .ots .csv)
# the presentation extension list
@@exts_presentation = %w(.pps .ppsx .ppsm .ppt .pptx .pptm .pot .potx .potm .odp .fodp .otp)

View File

@ -15,9 +15,9 @@
#
class User
attr_accessor :id, :name, :email, :group, :reviewGroups, :commentGroups, :favorite, :deniedPermissions, :descriptions, :templates
attr_accessor :id, :name, :email, :group, :reviewGroups, :commentGroups, :userInfoGroups, :favorite, :deniedPermissions, :descriptions, :templates
def initialize (id, name, email, group, reviewGroups, commentGroups, favorite, deniedPermissions, descriptions, templates)
def initialize (id, name, email, group, reviewGroups, commentGroups, userInfoGroups, favorite, deniedPermissions, descriptions, templates)
@id = id
@name = name
@email = email
@ -28,6 +28,7 @@ class User
@deniedPermissions = deniedPermissions
@descriptions = descriptions
@templates = templates
@userInfoGroups = userInfoGroups
end
end
@ -38,7 +39,8 @@ class Users
"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 create files from templates using data from the editor",
"Can see the information about all users"
];
@@descr_user_2 = [
@ -46,7 +48,8 @@ class Users
"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",
"This file is marked as favorite",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
];
@@descr_user_3 = [
@ -57,7 +60,8 @@ class Users
"Cant copy data from the file to clipboard",
"Cant download the file",
"Cant print the file",
"Can create new files from the editor"
"Can create new files from the editor",
"Can see the information about Group2 users",
];
@@descr_user_0 = [
@ -67,12 +71,13 @@ class Users
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor"
"Can't create new files from the editor",
"Cant see anyones information"
];
@@users = [
User.new("uid-1", "John Smith", "smith@example.com",
"", nil, {},
"", nil, {}, nil,
nil, [], @@descr_user_1, true),
User.new("uid-2", "Mark Pottato", "pottato@example.com",
"group-2", ["group-2", ""], {
@ -80,6 +85,7 @@ class Users
:edit => ["group-2", ""],
:remove => ["group-2"]
},
["group-2", ""],
true, [], @@descr_user_2, false),
User.new("uid-3", "Hamish Mitchell", "mitchell@example.com",
"group-3", ["group-2"], {
@ -87,9 +93,10 @@ class Users
:edit => ["group-2"],
:remove => []
},
["group-2"],
false, ["copy", "download", "print"], @@descr_user_3, false),
User.new("uid-0", nil, nil,
"", nil, {},
"", nil, {}, [],
nil, [], @@descr_user_0, false)
]

View File

@ -123,6 +123,7 @@
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>
<% for user in Users.get_all_users() do %>
<div class="user-descr">

View File

@ -35,7 +35,7 @@ module OnlineEditorsExampleRuby
Rails.configuration.fillDocs=".oform|.docx"
Rails.configuration.viewedDocs=".pdf|.djvu|.xps|.oxps"
Rails.configuration.editedDocs=".docx|.xlsx|.csv|.pptx|.txt|.docxf"
Rails.configuration.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2"
Rails.configuration.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xlsb|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2"
Rails.configuration.urlSite="http://documentserver/"
Rails.configuration.urlConverter="ConvertService.ashx"