Просмотр исходного кода

Merge branch 'bgy' of SH-Arbitrate/OnlyOffice-Backend into dev

bgy 2 лет назад
Родитель
Сommit
986ba53816
100 измененных файлов: 789 добавлений и 6847 удалений
  1. 33
    0
      .gitignore
  2. 0
    70
      3rd-Party.license
  3. 0
    4
      Dockerfile
  4. 127
    201
      LICENSE
  5. 313
    224
      README.md
  6. 0
    13
      checkstyle-suppressions.xml
  7. 0
    199
      checkstyle.xml
  8. 0
    15
      docker-compose.yaml
  9. Двоичные данные
      documents/5242880/new (1).docx
  10. 0
    1
      documents/5242880/new (1).docx-hist/createdInfo.json
  11. Двоичные данные
      documents/5242880/new (2).docx
  12. 0
    1
      documents/5242880/new (2).docx-hist/createdInfo.json
  13. Двоичные данные
      documents/5242880/new.docx
  14. 0
    1
      documents/5242880/new.docx-hist/createdInfo.json
  15. Двоичные данные
      documents/5242880/new.pptx
  16. 0
    1
      documents/5242880/new.pptx-hist/createdInfo.json
  17. Двоичные данные
      documents/5242880/new.xlsx
  18. 0
    1
      documents/5242880/new.xlsx-hist/createdInfo.json
  19. 0
    104
      integration.iml
  20. Двоичные данные
      jpg/QQ截图20230805221213.jpg
  21. Двоичные данные
      jpg/docx-pdf.jpg
  22. Двоичные данные
      jpg/edit.jpg
  23. Двоичные данные
      jpg/editppt.jpg
  24. Двоичные данные
      jpg/editxlsx.jpg
  25. Двоичные данные
      jpg/f.jpg
  26. Двоичные данные
      jpg/view.jpg
  27. Двоичные данные
      jpg/viewppt.jpg
  28. Двоичные данные
      jpg/viewxls.jpg
  29. Двоичные данные
      jpg/xlsx2pdf.jpg
  30. 0
    70
      licenses/3rd-Party.license
  31. 0
    202
      licenses/JSON.simple.license
  32. 0
    202
      licenses/gson.license
  33. 0
    250
      licenses/h2database.license
  34. 0
    9
      licenses/jQuery.BlockUI.license
  35. 0
    20
      licenses/jQuery.FileUpload.license
  36. 0
    36
      licenses/jQuery.Migrate.license
  37. 0
    43
      licenses/jQuery.UI.license
  38. 0
    20
      licenses/jQuery.iframe-transport.license
  39. 0
    20
      licenses/jQuery.license
  40. 0
    202
      licenses/jackson-databind.license
  41. 0
    104
      licenses/lombok.license
  42. 0
    177
      licenses/modelmapper.license
  43. 0
    201
      licenses/prime-jwt.license
  44. 0
    202
      licenses/spring-boot.license
  45. 0
    202
      licenses/spring-data-jpa.license
  46. 0
    310
      mvnw
  47. 0
    182
      mvnw.cmd
  48. 0
    17
      onlyoffice.header
  49. 3
    0
      plugins/externallistener/README.md
  50. 25
    0
      plugins/externallistener/config.json
  51. 28
    0
      plugins/externallistener/index.html
  52. Двоичные данные
      plugins/externallistener/resources/img/icon.png
  53. Двоичные данные
      plugins/externallistener/resources/img/icon@2x.png
  54. 103
    0
      plugins/externallistener/scripts/code.js
  55. 3
    0
      plugins/externallistener/translations/langs.json
  56. 3
    0
      plugins/externallistener/translations/zh-CN.json
  57. 151
    109
      pom.xml
  58. 0
    115
      src/main/java/com/onlyoffice/integration/ExampleData.java
  59. 0
    32
      src/main/java/com/onlyoffice/integration/IntegrationApplication.java
  60. 0
    87
      src/main/java/com/onlyoffice/integration/IntegrationConfiguration.java
  61. 0
    239
      src/main/java/com/onlyoffice/integration/controllers/EditorController.java
  62. 0
    624
      src/main/java/com/onlyoffice/integration/controllers/FileController.java
  63. 0
    147
      src/main/java/com/onlyoffice/integration/controllers/IndexController.java
  64. 0
    32
      src/main/java/com/onlyoffice/integration/documentserver/callbacks/Callback.java
  65. 0
    50
      src/main/java/com/onlyoffice/integration/documentserver/callbacks/CallbackHandler.java
  66. 0
    35
      src/main/java/com/onlyoffice/integration/documentserver/callbacks/Status.java
  67. 0
    59
      src/main/java/com/onlyoffice/integration/documentserver/callbacks/implementations/EditCallback.java
  68. 0
    50
      src/main/java/com/onlyoffice/integration/documentserver/callbacks/implementations/ForcesaveCallback.java
  69. 0
    50
      src/main/java/com/onlyoffice/integration/documentserver/callbacks/implementations/SaveCallback.java
  70. 0
    28
      src/main/java/com/onlyoffice/integration/documentserver/managers/callback/CallbackManager.java
  71. 0
    333
      src/main/java/com/onlyoffice/integration/documentserver/managers/callback/DefaultCallbackManager.java
  72. 0
    246
      src/main/java/com/onlyoffice/integration/documentserver/managers/document/DefaultDocumentManager.java
  73. 0
    42
      src/main/java/com/onlyoffice/integration/documentserver/managers/document/DocumentManager.java
  74. 0
    183
      src/main/java/com/onlyoffice/integration/documentserver/managers/history/DefaultHistoryManager.java
  75. 0
    26
      src/main/java/com/onlyoffice/integration/documentserver/managers/history/HistoryManager.java
  76. 0
    135
      src/main/java/com/onlyoffice/integration/documentserver/managers/jwt/DefaultJwtManager.java
  77. 0
    33
      src/main/java/com/onlyoffice/integration/documentserver/managers/jwt/JwtManager.java
  78. 0
    70
      src/main/java/com/onlyoffice/integration/documentserver/managers/template/SampleTemplateManager.java
  79. 0
    28
      src/main/java/com/onlyoffice/integration/documentserver/managers/template/TemplateManager.java
  80. 0
    24
      src/main/java/com/onlyoffice/integration/documentserver/models/AbstractModel.java
  81. 0
    53
      src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Customization.java
  82. 0
    40
      src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Embedded.java
  83. 0
    48
      src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Goback.java
  84. 0
    45
      src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Info.java
  85. 0
    38
      src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Logo.java
  86. 0
    32
      src/main/java/com/onlyoffice/integration/documentserver/models/enums/Action.java
  87. 0
    48
      src/main/java/com/onlyoffice/integration/documentserver/models/enums/ConvertErrorType.java
  88. 0
    25
      src/main/java/com/onlyoffice/integration/documentserver/models/enums/DocumentType.java
  89. 0
    24
      src/main/java/com/onlyoffice/integration/documentserver/models/enums/Mode.java
  90. 0
    24
      src/main/java/com/onlyoffice/integration/documentserver/models/enums/ToolbarDocked.java
  91. 0
    25
      src/main/java/com/onlyoffice/integration/documentserver/models/enums/Type.java
  92. 0
    41
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/CommentGroup.java
  93. 0
    49
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/Document.java
  94. 0
    59
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/EditorConfig.java
  95. 0
    44
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/FileModel.java
  96. 0
    55
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/Permission.java
  97. 0
    42
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/ReferenceData.java
  98. 0
    32
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/Template.java
  99. 0
    42
      src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/User.java
  100. 0
    0
      src/main/java/com/onlyoffice/integration/documentserver/serializers/FilterState.java

+ 33
- 0
.gitignore Просмотреть файл

@@ -0,0 +1,33 @@
1
+HELP.md
2
+target/
3
+!.mvn/wrapper/maven-wrapper.jar
4
+!**/src/main/**/target/
5
+!**/src/test/**/target/
6
+
7
+### STS ###
8
+.apt_generated
9
+.classpath
10
+.factorypath
11
+.project
12
+.settings
13
+.springBeans
14
+.sts4-cache
15
+
16
+### IntelliJ IDEA ###
17
+.idea
18
+*.iws
19
+*.iml
20
+*.ipr
21
+
22
+### NetBeans ###
23
+/nbproject/private/
24
+/nbbuild/
25
+/dist/
26
+/nbdist/
27
+/.nb-gradle/
28
+build/
29
+!**/src/main/**/build/
30
+!**/src/test/**/build/
31
+
32
+### VS Code ###
33
+.vscode/

+ 0
- 70
3rd-Party.license Просмотреть файл

@@ -1,70 +0,0 @@
1
-ONLYOFFICE Applications example uses code from the following 3rd party projects:
2
-
3
-
4
-Gson          - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
5
-License:        Apache 2.0
6
-License File:   gson.license
7
-
8
-H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
9
-License:        MPL 2.0 or EPL 1.0
10
-License File:   h2database.license
11
-
12
-Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
13
-License:        Apache 2.0
14
-License File:   jackson-databind.license
15
-
16
-jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
17
-License:        MIT, GPL
18
-License File:   jQuery.BlockUI.license
19
-
20
-jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
21
-License:        MIT
22
-License File:   jQuery.FileUpload.license
23
-
24
-jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
25
-License:        MIT
26
-License File:   jQuery.iframe-transport.license
27
-
28
-jQuery        - jQuery is a new kind of JavaScript Library.        jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.        NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
29
-License:        MIT
30
-License File:   jQuery.license
31
-
32
-jQuery.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
33
-License:        OpenJS
34
-License File:   jQuery.Migrate.license
35
-
36
-jQuery.UI     - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
37
-License:        MIT
38
-License File:   jQuery.UI.license
39
-
40
-JSON.simple   - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
41
-License:        Apache 2.0
42
-License File:   JSON.simple.license
43
-
44
-Project Lombok - Project Lombok is a java library that automatically plugs into your editor and build tools. (https://mvnrepository.com/artifact/org.projectlombok/lombok).
45
-License:        MIT
46
-License File    lombok.license
47
-
48
-ModelMapper   - ModelMapper is an intelligent object mapping library that automatically maps objects to each other. (https://github.com/modelmapper/modelmapper)
49
-License:        Apache 2.0
50
-License File    modelmapper.license
51
-
52
-Prime JWT     - is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson. (https://github.com/ws-apps/prime-jwt/blob/master/LICENSE)
53
-License:        Apache 2.0
54
-License File:   prime-jwt.license
55
-
56
-Spring Boot   - Helps create Spring-powered, production-grade applications and services. Has external dependencies on Spring Framework. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
57
-License:        Apache 2.0
58
-License File:   spring-boot.license
59
-
60
-Spring Boot Devtools - Provides fast application restarts, LiveReload, and configurations for enhanced development experience. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
61
-License:        Apache 2.0
62
-License File:   spring-boot.license
63
-
64
-Spring Boot Starter Thymeleaf - A modern server-side Java template engine for both web and standalone environments. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
65
-License:        Apache 2.0
66
-License File:   spring-boot.license
67
-
68
-Spring Data JPA - Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate. (https://github.com/spring-projects/spring-data-jpa/blob/main/LICENSE.txt)
69
-License:        Apache 2.0
70
-License File:   spring-data-jpa.license

+ 0
- 4
Dockerfile Просмотреть файл

@@ -1,4 +0,0 @@
1
-FROM maven:3.8.1-jdk-8
2
-COPY . /usr/src/app
3
-WORKDIR /usr/src/app
4
-RUN mvn -f /usr/src/app/pom.xml clean 

+ 127
- 201
LICENSE Просмотреть файл

@@ -1,201 +1,127 @@
1
-                                 Apache License
2
-                           Version 2.0, January 2004
3
-                        http://www.apache.org/licenses/
4
-
5
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
-   1. Definitions.
8
-
9
-      "License" shall mean the terms and conditions for use, reproduction,
10
-      and distribution as defined by Sections 1 through 9 of this document.
11
-
12
-      "Licensor" shall mean the copyright owner or entity authorized by
13
-      the copyright owner that is granting the License.
14
-
15
-      "Legal Entity" shall mean the union of the acting entity and all
16
-      other entities that control, are controlled by, or are under common
17
-      control with that entity. For the purposes of this definition,
18
-      "control" means (i) the power, direct or indirect, to cause the
19
-      direction or management of such entity, whether by contract or
20
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
-      outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
-      "You" (or "Your") shall mean an individual or Legal Entity
24
-      exercising permissions granted by this License.
25
-
26
-      "Source" form shall mean the preferred form for making modifications,
27
-      including but not limited to software source code, documentation
28
-      source, and configuration files.
29
-
30
-      "Object" form shall mean any form resulting from mechanical
31
-      transformation or translation of a Source form, including but
32
-      not limited to compiled object code, generated documentation,
33
-      and conversions to other media types.
34
-
35
-      "Work" shall mean the work of authorship, whether in Source or
36
-      Object form, made available under the License, as indicated by a
37
-      copyright notice that is included in or attached to the work
38
-      (an example is provided in the Appendix below).
39
-
40
-      "Derivative Works" shall mean any work, whether in Source or Object
41
-      form, that is based on (or derived from) the Work and for which the
42
-      editorial revisions, annotations, elaborations, or other modifications
43
-      represent, as a whole, an original work of authorship. For the purposes
44
-      of this License, Derivative Works shall not include works that remain
45
-      separable from, or merely link (or bind by name) to the interfaces of,
46
-      the Work and Derivative Works thereof.
47
-
48
-      "Contribution" shall mean any work of authorship, including
49
-      the original version of the Work and any modifications or additions
50
-      to that Work or Derivative Works thereof, that is intentionally
51
-      submitted to Licensor for inclusion in the Work by the copyright owner
52
-      or by an individual or Legal Entity authorized to submit on behalf of
53
-      the copyright owner. For the purposes of this definition, "submitted"
54
-      means any form of electronic, verbal, or written communication sent
55
-      to the Licensor or its representatives, including but not limited to
56
-      communication on electronic mailing lists, source code control systems,
57
-      and issue tracking systems that are managed by, or on behalf of, the
58
-      Licensor for the purpose of discussing and improving the Work, but
59
-      excluding communication that is conspicuously marked or otherwise
60
-      designated in writing by the copyright owner as "Not a Contribution."
61
-
62
-      "Contributor" shall mean Licensor and any individual or Legal Entity
63
-      on behalf of whom a Contribution has been received by Licensor and
64
-      subsequently incorporated within the Work.
65
-
66
-   2. Grant of Copyright License. Subject to the terms and conditions of
67
-      this License, each Contributor hereby grants to You a perpetual,
68
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
-      copyright license to reproduce, prepare Derivative Works of,
70
-      publicly display, publicly perform, sublicense, and distribute the
71
-      Work and such Derivative Works in Source or Object form.
72
-
73
-   3. Grant of Patent License. Subject to the terms and conditions of
74
-      this License, each Contributor hereby grants to You a perpetual,
75
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
-      (except as stated in this section) patent license to make, have made,
77
-      use, offer to sell, sell, import, and otherwise transfer the Work,
78
-      where such license applies only to those patent claims licensable
79
-      by such Contributor that are necessarily infringed by their
80
-      Contribution(s) alone or by combination of their Contribution(s)
81
-      with the Work to which such Contribution(s) was submitted. If You
82
-      institute patent litigation against any entity (including a
83
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
-      or a Contribution incorporated within the Work constitutes direct
85
-      or contributory patent infringement, then any patent licenses
86
-      granted to You under this License for that Work shall terminate
87
-      as of the date such litigation is filed.
88
-
89
-   4. Redistribution. You may reproduce and distribute copies of the
90
-      Work or Derivative Works thereof in any medium, with or without
91
-      modifications, and in Source or Object form, provided that You
92
-      meet the following conditions:
93
-
94
-      (a) You must give any other recipients of the Work or
95
-          Derivative Works a copy of this License; and
96
-
97
-      (b) You must cause any modified files to carry prominent notices
98
-          stating that You changed the files; and
99
-
100
-      (c) You must retain, in the Source form of any Derivative Works
101
-          that You distribute, all copyright, patent, trademark, and
102
-          attribution notices from the Source form of the Work,
103
-          excluding those notices that do not pertain to any part of
104
-          the Derivative Works; and
105
-
106
-      (d) If the Work includes a "NOTICE" text file as part of its
107
-          distribution, then any Derivative Works that You distribute must
108
-          include a readable copy of the attribution notices contained
109
-          within such NOTICE file, excluding those notices that do not
110
-          pertain to any part of the Derivative Works, in at least one
111
-          of the following places: within a NOTICE text file distributed
112
-          as part of the Derivative Works; within the Source form or
113
-          documentation, if provided along with the Derivative Works; or,
114
-          within a display generated by the Derivative Works, if and
115
-          wherever such third-party notices normally appear. The contents
116
-          of the NOTICE file are for informational purposes only and
117
-          do not modify the License. You may add Your own attribution
118
-          notices within Derivative Works that You distribute, alongside
119
-          or as an addendum to the NOTICE text from the Work, provided
120
-          that such additional attribution notices cannot be construed
121
-          as modifying the License.
122
-
123
-      You may add Your own copyright statement to Your modifications and
124
-      may provide additional or different license terms and conditions
125
-      for use, reproduction, or distribution of Your modifications, or
126
-      for any such Derivative Works as a whole, provided Your use,
127
-      reproduction, and distribution of the Work otherwise complies with
128
-      the conditions stated in this License.
129
-
130
-   5. Submission of Contributions. Unless You explicitly state otherwise,
131
-      any Contribution intentionally submitted for inclusion in the Work
132
-      by You to the Licensor shall be under the terms and conditions of
133
-      this License, without any additional terms or conditions.
134
-      Notwithstanding the above, nothing herein shall supersede or modify
135
-      the terms of any separate license agreement you may have executed
136
-      with Licensor regarding such Contributions.
137
-
138
-   6. Trademarks. This License does not grant permission to use the trade
139
-      names, trademarks, service marks, or product names of the Licensor,
140
-      except as required for reasonable and customary use in describing the
141
-      origin of the Work and reproducing the content of the NOTICE file.
142
-
143
-   7. Disclaimer of Warranty. Unless required by applicable law or
144
-      agreed to in writing, Licensor provides the Work (and each
145
-      Contributor provides its Contributions) on an "AS IS" BASIS,
146
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
-      implied, including, without limitation, any warranties or conditions
148
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
-      PARTICULAR PURPOSE. You are solely responsible for determining the
150
-      appropriateness of using or redistributing the Work and assume any
151
-      risks associated with Your exercise of permissions under this License.
152
-
153
-   8. Limitation of Liability. In no event and under no legal theory,
154
-      whether in tort (including negligence), contract, or otherwise,
155
-      unless required by applicable law (such as deliberate and grossly
156
-      negligent acts) or agreed to in writing, shall any Contributor be
157
-      liable to You for damages, including any direct, indirect, special,
158
-      incidental, or consequential damages of any character arising as a
159
-      result of this License or out of the use or inability to use the
160
-      Work (including but not limited to damages for loss of goodwill,
161
-      work stoppage, computer failure or malfunction, or any and all
162
-      other commercial damages or losses), even if such Contributor
163
-      has been advised of the possibility of such damages.
164
-
165
-   9. Accepting Warranty or Additional Liability. While redistributing
166
-      the Work or Derivative Works thereof, You may choose to offer,
167
-      and charge a fee for, acceptance of support, warranty, indemnity,
168
-      or other liability obligations and/or rights consistent with this
169
-      License. However, in accepting such obligations, You may act only
170
-      on Your own behalf and on Your sole responsibility, not on behalf
171
-      of any other Contributor, and only if You agree to indemnify,
172
-      defend, and hold each Contributor harmless for any liability
173
-      incurred by, or claims asserted against, such Contributor by reason
174
-      of your accepting any such warranty or additional liability.
175
-
176
-   END OF TERMS AND CONDITIONS
177
-
178
-   APPENDIX: How to apply the Apache License to your work.
179
-
180
-      To apply the Apache License to your work, attach the following
181
-      boilerplate notice, with the fields enclosed by brackets "[]"
182
-      replaced with your own identifying information. (Don't include
183
-      the brackets!)  The text should be enclosed in the appropriate
184
-      comment syntax for the file format. We also recommend that a
185
-      file or class name and description of purpose be included on the
186
-      same "printed page" as the copyright notice for easier
187
-      identification within third-party archives.
188
-
189
-   Copyright [yyyy] [name of copyright owner]
190
-
191
-   Licensed under the Apache License, Version 2.0 (the "License");
192
-   you may not use this file except in compliance with the License.
193
-   You may obtain a copy of the License at
194
-
195
-       http://www.apache.org/licenses/LICENSE-2.0
196
-
197
-   Unless required by applicable law or agreed to in writing, software
198
-   distributed under the License is distributed on an "AS IS" BASIS,
199
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
-   See the License for the specific language governing permissions and
201
-   limitations under the License.
1
+                     木兰宽松许可证, 第2版
2
+
3
+   木兰宽松许可证, 第2版 
4
+   2020年1月 http://license.coscl.org.cn/MulanPSL2
5
+
6
+
7
+   您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
8
+
9
+   0. 定义
10
+
11
+      “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
12
+
13
+      “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
14
+
15
+      “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
16
+
17
+      “法人实体”是指提交贡献的机构及其“关联实体”。
18
+
19
+      “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
20
+
21
+   1. 授予版权许可
22
+
23
+      每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
24
+
25
+   2. 授予专利许可
26
+
27
+      每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
28
+
29
+   3. 无商标许可
30
+
31
+      “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
32
+
33
+   4. 分发限制
34
+
35
+      您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
36
+
37
+   5. 免责声明与责任限制
38
+
39
+      “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 
40
+
41
+   6. 语言
42
+      “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
43
+
44
+   条款结束 
45
+
46
+   如何将木兰宽松许可证,第2版,应用到您的软件
47
+   
48
+   如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
49
+
50
+      1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
51
+
52
+      2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
53
+
54
+      3, 请将如下声明文本放入每个源文件的头部注释中。
55
+
56
+   Copyright (c) [Year] [name of copyright holder]
57
+   [Software Name] is licensed under Mulan PSL v2.
58
+   You can use this software according to the terms and conditions of the Mulan PSL v2. 
59
+   You may obtain a copy of Mulan PSL v2 at:
60
+            http://license.coscl.org.cn/MulanPSL2 
61
+   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
62
+   See the Mulan PSL v2 for more details.  
63
+
64
+
65
+                     Mulan Permissive Software License,Version 2
66
+
67
+   Mulan Permissive Software License,Version 2 (Mulan PSL v2)
68
+   January 2020 http://license.coscl.org.cn/MulanPSL2
69
+
70
+   Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: 
71
+   
72
+   0. Definition
73
+   
74
+      Software means the program and related documents which are licensed under this License and comprise all Contribution(s). 
75
+   
76
+      Contribution means the copyrightable work licensed by a particular Contributor under this License.
77
+   
78
+      Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
79
+   
80
+      Legal Entity means the entity making a Contribution and all its Affiliates.
81
+   
82
+      Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
83
+
84
+   1. Grant of Copyright License
85
+
86
+      Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
87
+
88
+   2. Grant of Patent License 
89
+
90
+      Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
91
+
92
+   3. No Trademark License
93
+
94
+      No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4.
95
+
96
+   4. Distribution Restriction
97
+
98
+      You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
99
+
100
+   5. Disclaimer of Warranty and Limitation of Liability
101
+
102
+      THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
103
+
104
+   6. Language
105
+
106
+      THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
107
+
108
+   END OF THE TERMS AND CONDITIONS
109
+
110
+   How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
111
+
112
+      To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
113
+
114
+      i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; 
115
+
116
+      ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package;
117
+
118
+      iii Attach the statement to the appropriate annotated syntax at the beginning of each source file.
119
+
120
+
121
+   Copyright (c) [Year] [name of copyright holder]
122
+   [Software Name] is licensed under Mulan PSL v2.
123
+   You can use this software according to the terms and conditions of the Mulan PSL v2. 
124
+   You may obtain a copy of Mulan PSL v2 at:
125
+               http://license.coscl.org.cn/MulanPSL2 
126
+   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
127
+   See the Mulan PSL v2 for more details.  

+ 313
- 224
README.md Просмотреть файл

@@ -1,247 +1,336 @@
1
-## Overview
2
-
3
-This example will help you integrate ONLYOFFICE Docs into your web application written in Java 
4
-with Spring Boot.
5
-
6
-Spring Boot has a lot of functionality, but its most significant features are: dependency management, 
7
-auto-configuration, and built-in servlet containers.
8
-
9
-**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.
10
-
11
-## For Windows
12
-
13
-### Step 1. Install ONLYOFFICE Docs
14
-
15
-Download and install ONLYOFFICE Docs (packaged as Document Server).
16
-
17
-See the detailed guide to learn how to install Document Server [for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx). 
18
-
19
-### Step 2. Download the Java code for the editors integration
20
-
21
-Download the [Java-Spring example](https://api.onlyoffice.com/editors/demopreview) from our site.
22
-
23
-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:
24
-
25
-```
26
- files.storage=
27
- server.port=port
28
- files.docservice.url.site=https://documentserver/
29
-```
30
-
31
-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.
32
-
33
-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.
34
-
35
-### Step 3. Install the prerequisites
36
-To run the Java example code, install the Java version 11 appropriate for your OS and framework  **Apache Maven**:
37
-
38
-* Java (download from [the Oracle official website](https://www.oracle.com/ru/java/technologies/javase-jdk11-downloads.html));
39
-* Apache Maven (download from [the official website](https://maven.apache.org/download.cgi)).
40
-
41
-### Step 4. Set environment variables
42
-
43
-1. After you have installed Java on Windows, set the **JAVA_HOME** environment variable to point to the Java installation directory.
44
-
45
-	Find out where Java is installed. If you didn't change the path during installation, it will be something like this:
46
-
47
-	```
48
-	C:\Program Files\Java\jdk11
49
-	```
50
-
51
-	In **Windows 7** right click **My Computer** and select **Properties**, then click **Advanced**.
52
-
53
-	In **Windows 8** go to **Control Panel** -> **System** -> **Advanced System Settings**.
54
-
55
-	Click the **Environment Variables** button.
56
-
57
-	Under **System Variables**, click **New**.
58
-
59
-	In the **Variable Name** field, enter **JAVA_HOME** if you installed the **JDK** (Java Development Kit) or **JRE_HOME** if you installed the **JRE** (Java Runtime Environment).
60
-
61
-	In the **Variable Value** field, enter your **JDK** or **JRE** installation path, for example C:\Program Files\Java\jdk11.
62
-
63
-	Check if the variable created successfully by **echo** command in the **Command Prompt**:
64
-
65
-	```
66
-	echo %JAVA_HOME%
67
-	```
68
-
69
-2. Set the **MAVEN_HOME** environment variable:
70
-
71
-    Unzip the downloaded archive with the maven to any directory, it will be something like this:
72
-
73
-    ```
74
-    C:\apache-maven-3.8.1
75
-   ```
76
-    In **Windows 7** right click **My Computer** and select **Properties**, then click **Advanced**.
77
-
78
-	In **Windows 8** go to **Control Panel** -> **System** -> **Advanced System Settings**.
79
-
80
-	Click the **Environment Variables** button.
81
-
82
-	Under **System Variables**, click **New**.
83
-
84
-	In the **Variable Name** field, enter **MAVEN_HOME**.
85
-
86
-	In the **Variable Value** field, enter your **JDK** or **JRE** installation path, for example C:\apache-maven-3.8.1.
87
-
88
-	Add C:\apache-maven-3.8.1\bin to the PATH system variable:
89
-	In system variables, find PATH, clicks on the Edit... button. In “Edit environment variable” dialog, clicks on the New button and add this C:\apache-maven-3.8.1\bin
90
-
91
-	Check if the variable created successfully by **echo** command in the **Command Prompt**:
92
-
93
-	```
94
-	echo %MAVEN_HOME%
95
-	```
96
-
97
-
98
-### Step 5. Start application with Maven
99
-
100
-1. Open the console and go the java-spring folder using the **cd** command, for example:
101
-	```
102
-	cd C:\Program Files\document-server-integration\web\documentserver-example\java-spring
103
-	```
104
-2. In the open console enter the following commands:
105
-	```
106
-	mvn clean
107
-	mvn package
108
-	mvn spring-boot:run
109
-	```
110
-3. Open your browser using **server.address** and **server.port**:
111
- 
112
-     ```
113
-     http://server.address:server.port/
114
-     ```
115
-
116
-### Step 6. Check accessibility
117
-
118
- In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files. 
119
-
120
-Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
121
-
122
-## For Linux
123
-### Step 1. Install ONLYOFFICE Docs
124
-
125
-Download and install ONLYOFFICE Docs (packaged as Document Server). 
126
-
127
-See the detailed guide to learn how to install Document Server [for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx). 
128
-
129
-### Step 2. Install the prerequisites and run the website with the editors
130
-
131
-1. Install **Java**:
132
-
133
-    ```
134
-    sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java11-installer
135
-    ```
136
-
137
-2. Download the archive with the Java-Spring example and unpack the archive or clone git repository:
138
-
139
-    a) archive with Java-Spring:
140
-
141
-    ```
142
-    wget https://api.onlyoffice.com/app_data/editor/Java%20Spring%20Example.zip
143
-    ```
144
-    
145
-    ```
146
-    unzip Java\ Spring\ Example.zip
147
-    ```
148
-    b) git repository:
149
-    ```
150
-    git clone https://github.com/ONLYOFFICE/document-server-integration.git
151
-    ```
152
-
153
-
154
-3. Change the current directory for the project directory:
155
-
156
-    a) from archive
157
-
158
-    ```
159
-   cd Java\ Spring\ Example/
160
-   ```
161
-   b) from git repository 
162
-    ```
163
-    cd document-server-integration/web/documentserver-example/java-spring
164
-    ```
165
-4. Edit the *application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.
166
-
167
-    ```
168
-    nano src/main/resources/application.properties
169
-    ```
170
-
171
-	Edit the following lines:
172 1
 
2
+# Spring-Boot-onlyOffice(集成onlyOffice服务)
3
+
4
+springboot集成onlyOffice的实现。在参考网络上的资料结合自身实际情况总结,让集成oo方便快捷。 封装了oo服务的API和统一了配置。
5
+- 在线编辑,查看,转换
6
+
7
+
8
+* onlyOffice.yml配置文件
9
+* 如果解决了你地方问题,请给个 **star** 
10
+-----------------------------------
11
+# 对外使用的java类 —— OnlyServiceAPI
12
+## 核心方法
13
+
14
+<table>
15
+    <thead>
16
+        <tr>
17
+            <th>方法名称</th>
18
+            <th>参数</th>
19
+            <th>参数说明</th>
20
+            <th>返回值</th>
21
+        </tr>
22
+    </thead>
23
+    <tbody>
24
+        <tr>
25
+            <td rowspan="3">openDocument()</td>
26
+            <td> Map&lt;String,Object&gt; map</td>
27
+            <td> 文件数据信息<br>
28
+                {<br>
29
+                    必填 fileId<br>
30
+                    必填 fileName<br>
31
+                    必填 fileType<br>
32
+                    必填 fileSize<br>
33
+                    可用携带其它值<br>
34
+                }
35
+            </td>
36
+            <td rowspan="3">
37
+                <pre>
38
+{
39
+"editorConfig": {
40
+    "mode": "edit",
41
+    "customization": {
42
+        "feedback": {
43
+            "visible": false
44
+        },
45
+        "help": false,
46
+        "goback": {
47
+            "blank": false
48
+        },
49
+        "macros": false,
50
+        "autosave": false,
51
+        "comments": false,
52
+        "review": {},
53
+        "hideRightMenu": true,
54
+        "anonymous": {
55
+            "request": false
56
+        },
57
+        "forcesave": true,
58
+        "logo": {},
59
+        "hideNotes": true
60
+    },
61
+    "plugins": {
62
+        "pluginsData": [],
63
+        "autostart": []
64
+    },
65
+    "callbackUrl": "http://172.31.240.1:9090/onlyOffice/save",
66
+    "lang": "zh-CN",
67
+    "user": {
68
+        "name": "TongHuic7bba5",
69
+        "id": "c7bba5"
70
+    }
71
+  },
72
+"docServiceApiUrl": "http://172.31.240.1:8886/web-apps/apps/api/documents/api.js",
73
+"documentType": "word",
74
+"document": {
75
+    "permissions": {
76
+        "edit": true,
77
+        "chat": false,
78
+        "review": false
79
+    },
80
+    "title": "fdfs.docx",
81
+    "fileType": "docx",
82
+    "key": "63f560ec03a94654b10cd4fdeebec05a",
83
+    "url": "http://172.31.240.1:9090/download/09cee8767dd3476280fa865bacfaf213",
84
+    "info": {
85
+        "sharingSettings": [{
86
+            "isLink": true,
87
+            "permissions": ["Full Access"],
88
+            "user": "TongHuic7bba5"
89
+        }],
90
+        "created": "2023-08-05 21:38:25"
91
+    }
92
+},
93
+"type": "desktop",
94
+"token": ""
95
+}</pre>
96
+            </td>
97
+        </tr>
98
+        <tr>
99
+            <td>String mode</td>
100
+            <td>打开方式  <br>edit<br>view</td>
101
+        </tr>
102
+        <tr>
103
+            <td>boolean collaborativeEditing</td>
104
+            <td>是否协同编辑</td>
105
+        </tr>
106
+        <tr>
107
+            <td>handlerStatus()</td>
108
+            <td>JSONObject jsonObject</td>
109
+            <td>onlyOffice 回调传来的值。<br>https://api.onlyoffice.com/editors/callback</td>
110
+            <td></td>
111
+        </tr>
112
+        <tr>
113
+            <td rowspan="2">save():触发保存回调。</td>
114
+            <td>String key</td>
115
+            <td>是openDocument()返回值中的key</td>
116
+            <td rowspan="2">String : 提示信息</td>
117
+        </tr>
118
+        <tr>   
119
+            <td>String userId</td>
120
+            <td>用户Id</td>
121
+        </tr>
122
+        <tr>
123
+            <td rowspan="5">converted()</td>
124
+            <td>String filetype</td>
125
+            <td>文件类型</td>
126
+            <td rowspan="5">转换后的文件下载地址</td>
127
+        </tr>
128
+        <tr>
129
+            <td>String fileId</td>
130
+            <td>文件Id</td>
131
+        </tr>
132
+        <tr>
133
+            <td>String outputtype</td>
134
+            <td>转化类型</td>
135
+        </tr>
136
+        <tr>
137
+            <td>String title</td>
138
+            <td>转换后的文件名称</td>
139
+        </tr>
140
+        <tr>
141
+            <td>String password</td>
142
+            <td>文档密码</td>
143
+        </tr>
144
+    </tbody>
145
+</table>
146
+
147
+**注意:**
148
+ * 外部触发保存操作,save()方法。
149
+ * `autosave`/`forcesave` 参数为默认值时有效
150
+ * 修改文件后,没有执行回调方法。在点击保存后执行回调
151
+
152
+![](jpg/f.jpg)
153
+
154
+
155
+快速使用
156
+-----------------------------------
157
+
158
+- 必须的依赖
159
+
160
+``` pom
161
+    <dependency>
162
+        <groupId>org.springframework.boot</groupId>
163
+        <artifactId>spring-boot-starter-data-redis</artifactId>
164
+    </dependency>
165
+    <dependency>
166
+        <groupId>org.projectlombok</groupId>
167
+        <artifactId>lombok</artifactId>
168
+        <optional>true</optional>
169
+    </dependency>
170
+    <dependency>
171
+        <groupId>com.alibaba</groupId>
172
+        <artifactId>fastjson</artifactId>
173
+        <version>2.0.25</version>
174
+    </dependency>
175
+    <dependency>
176
+        <groupId>cn.hutool</groupId>
177
+        <artifactId>hutool-all</artifactId>
178
+        <version>5.8.16</version>
179
+    </dependency>
180
+    <dependency>
181
+        <groupId>com.inversoft</groupId>
182
+        <artifactId>prime-jwt</artifactId>
183
+        <version>1.3.1</version>
184
+    </dependency>
185
+    <dependency>
186
+        <groupId>org.apache.commons</groupId>
187
+        <artifactId>commons-pool2</artifactId>
188
+    </dependency>
189
+``` 
190
+
191
+- 定义关键接口(oo服务回调使用) `重要`
192
+  
193
+    1.保存接口
173 194
     ```
174
-    files.storage=
175
-    server.port=port
176
-    files.docservice.url.site=https://documentserver/
195
+        参考:demo/controller/IndexController.saveFile()
196
+        对应配置文件参数:oo.call-back-url
197
+        回调状态
198
+          0 - 找不到具有密钥标识符的文档
199
+          1 - 正在编辑文档(打开文件回调)
200
+          2 - 文档已准备好保存
201
+          3 - 发生文档保存错误
202
+          4 - 不作任何更改就关闭文档(关闭回调)
203
+          6 - 正在编辑文档,但保存当前文档状态(保存回调)
204
+          7 - 强制保存文档时发生错误
177 205
     ```
178 206
 
179
-	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.
180
-   
181
-
182
-5. Install **Maven**:
183
-
207
+    2.下载文件地址
184 208
     ```
185
-    sudo apt-get install maven
209
+        参考:demo/controller/IndexController.download()
210
+        对应配置文件参数:oo.download-file
211
+        对应openDocument()方法返回值中的 document.url
212
+        打开文件后oo服务要下载对应的文件
186 213
     ```
187
-    
188
-6. Build:
189
-
214
+- 实现SaveFileProcessor类
190 215
     ```
191
-    mvn package
216
+    参考:demo.service.DemoService
192 217
     ```
218
+    <table>
219
+        <thead>
220
+            <tr>   
221
+                <th> 方法名称 </th>
222
+                <th> 方法说明 </th>
223
+                <th> 参数 </th>
224
+                <th> 参数说明 </th>
225
+                <th> 返回值 </th>
226
+            </tr>
227
+        </thead>
228
+        <tbody>
229
+            <tr>
230
+                <td rowspan="3">saveBeforeInitialization()</td>
231
+                <td rowspan="3">保存前置方法</td>
232
+                <td>Map&lt;String, Object&gt; map</td>
233
+                <td>在openDocument()方法中传入的文件数据信息</td>
234
+                <td rowspan="3"></td>
235
+            </tr>
236
+            <tr>
237
+                <td>byte[] bytes</td>
238
+                <td>文件二进制数据</td>
239
+            </tr>
240
+            <tr>
241
+                <td>String fileExtension</td>
242
+                <td>文件后缀</td>
243
+            </tr>
244
+            <tr>
245
+                <td rowspan="4">save()</td>
246
+                <td rowspan="4">保存方法,实现自己的保存逻辑</td>
247
+                <td>Map&lt;String, Object&gt; map</td>
248
+                <td>在openDocument()方法中传入的文件数据信息</td>
249
+                <td rowspan="4">Map&lt;String, Object&gt; 更新内存中的信息</td>
250
+            </tr>
251
+            <tr>
252
+                <td>byte[] bytes</td>
253
+                <td>文件二进制数据</td>
254
+            </tr>
255
+            <tr>
256
+                <td>byte[] changes</td>
257
+                <td>当前文件和保存之前文件的区别。changes.zip</td>
258
+            </tr>
259
+            <tr>
260
+                <td>String key</td>
261
+                <td>是openDocument()返回值中的key</td>
262
+            </tr>
263
+            <tr>
264
+                <td rowspan="3">saveAfterInitialization()</td>
265
+                <td rowspan="3">保存后置方法</td>
266
+                <td>Map&lt;String, Object&gt; map</td>
267
+                <td>在openDocument()方法中传入的文件数据信息</td>
268
+                <td rowspan="3"></td>
269
+            </tr>
270
+            <tr>
271
+                <td>byte[] bytes</td>
272
+                <td>文件二进制数据</td>
273
+            </tr>
274
+            <tr>
275
+                <td>String fileExtension</td>
276
+                <td>文件后缀</td>
277
+            </tr>
278
+        </tbody>
279
+    </table>
280
+
281
+
282
+## 更新记录
283
+
284
+- [x] 修复关闭文件后快速再次打开该文件后,保存时报错的bug 2023/11/10
285
+- [x] 修复内存文件信息在保存后没有修改的bug 2023/10/23
286
+- [x] 实现和编辑器的数据通信 2023/9/9 (更新链接)
287
+  https://blog.xenosp.cn/posts/87468caf/
288
+- [x] 修复文件转pdf时只有第一页的bug 2023/8/13
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+-----------------------------------
297
+
298
+
299
+# 页面集成
300
+### html
301
+```
302
+参考 onlyOffice.html
303
+style.js 中的openDocument()
304
+```
305
+### vue
306
+```
307
+参考 onlyOffice.vue
308
+```
309
+-----------------------------------
193 310
 
194
- 7. Start Java-Spring example:
195
-     ```
196
-     ./mvnw spring-boot:run
197
-     ```
198
- 8. Open your browser using **server.address** and **server.port**:
199
-
200
-     ```
201
-     http://server.address:server.port/
202
-     ```
203
-  
311
+![](jpg/QQ截图20230805221213.jpg)
312
+### 编辑
204 313
 
205
-### Step 3. Check accessibility
314
+![](jpg/edit.jpg)
315
+![](jpg/editxlsx.jpg)
316
+![](jpg/editppt.jpg)
317
+### 查看
206 318
 
207
-In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files. 
319
+![](jpg/view.jpg)
320
+![](jpg/viewxls.jpg)
321
+![](jpg/viewppt.jpg)
322
+### 文件转换
323
+![](jpg/docx-pdf.jpg)
324
+![](jpg/xlsx2pdf.jpg)
208 325
 
209
-Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
210 326
 
211
-##  For Docker
212 327
 
213
-1. Edit the *application.properties* configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed ([installation instructions](https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx)).
214 328
 
215
-	```
216
-	nano src/main/resources/application.properties
217
-	```
218
-	
219
-2. Edit the following lines:
220 329
 
221
-   ```
222
-   files.storage=
223
-   server.port=port
224
-   files.docservice.url.site=https://documentserver/
225
-   ```
226 330
 
227
-    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.
228 331
 
229
-3. Run the next command in the java example directory:
230 332
 
231
-	```
232
-	docker-compose up
233
-	```
234
-4. Open your browser using **server.address** and **server.port**:
235 333
 
236
-      ```
237
-      http://server.address:server.port/
238
-      ```
239 334
 
240
-## Important security info
241 335
 
242
-Please keep in mind the following security aspects when you are using test examples:
243 336
 
244
-* There is no protection of the storage from unauthorized access since there is no need for authorization.
245
-* There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
246
-* There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
247
-* There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.

+ 0
- 13
checkstyle-suppressions.xml Просмотреть файл

@@ -1,13 +0,0 @@
1
-<?xml version="1.0"?>
2
-<!DOCTYPE suppressions PUBLIC
3
-        "-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
4
-        "https://checkstyle.org/dtds/suppressions_1_0.dtd">
5
-
6
-<suppressions>
7
-    <suppress checks="HideUtilityClassConstructor" files="IntegrationApplication.java"/>
8
-    <suppress checks="DesignForExtension" files="."/>
9
-    <suppress checks="ParameterNumber" files="."/>
10
-    <suppress checks="JavadocPackage" files="."/>
11
-    <suppress checks="JavadocVariable" files="."/>
12
-    <suppress checks="MissingJavadocMethod" files="."/>
13
-</suppressions>

+ 0
- 199
checkstyle.xml Просмотреть файл

@@ -1,199 +0,0 @@
1
-<?xml version="1.0"?>
2
-<!DOCTYPE module PUBLIC
3
-        "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4
-        "https://checkstyle.org/dtds/configuration_1_3.dtd">
5
-
6
-<!--
7
-
8
-  Checkstyle configuration that checks the sun coding conventions from:
9
-
10
-    - the Java Language Specification at
11
-      https://docs.oracle.com/javase/specs/jls/se11/html/index.html
12
-
13
-    - the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
14
-
15
-    - the Javadoc guidelines at
16
-      https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
17
-
18
-    - the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
19
-
20
-    - some best practices
21
-
22
-  Checkstyle is very configurable. Be sure to read the documentation at
23
-  https://checkstyle.org (or in your downloaded distribution).
24
-
25
-  Most Checks are configurable, be sure to consult the documentation.
26
-
27
-  To completely disable a check, just comment it out or delete it from the file.
28
-  To suppress certain violations please review suppression filters.
29
-
30
-  Finally, it is worth reading the documentation.
31
-
32
--->
33
-
34
-<module name="Checker">
35
-    <!--
36
-        If you set the basedir property below, then all reported file
37
-        names will be relative to the specified directory. See
38
-        https://checkstyle.org/config.html#Checker
39
-
40
-        <property name="basedir" value="${basedir}"/>
41
-    -->
42
-    <property name="severity" value="error"/>
43
-
44
-    <property name="fileExtensions" value="java, properties, xml"/>
45
-
46
-    <!-- Excludes all 'module-info.java' files              -->
47
-    <!-- See https://checkstyle.org/config_filefilters.html -->
48
-    <module name="BeforeExecutionExclusionFileFilter">
49
-        <property name="fileNamePattern" value="module\-info\.java$"/>
50
-    </module>
51
-
52
-    <!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
53
-    <module name="SuppressionFilter">
54
-        <property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
55
-                  default="checkstyle-suppressions.xml" />
56
-        <property name="optional" value="true"/>
57
-    </module>
58
-
59
-    <!-- Checks that a package-info.java file exists for each package.     -->
60
-    <!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
61
-    <module name="JavadocPackage"/>
62
-
63
-    <!-- Checks whether files end with a new line.                        -->
64
-    <!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
65
-    <module name="NewlineAtEndOfFile"/>
66
-
67
-    <!-- Checks that property files contain the same keys.         -->
68
-    <!-- See https://checkstyle.org/config_misc.html#Translation -->
69
-    <module name="Translation"/>
70
-
71
-    <!-- Checks for Size Violations.                    -->
72
-    <!-- See https://checkstyle.org/config_sizes.html -->
73
-    <module name="FileLength"/>
74
-    <module name="LineLength">
75
-        <property name="fileExtensions" value="java"/>
76
-        <property name="max" value="120"/>
77
-    </module>
78
-
79
-    <!-- Checks for whitespace                               -->
80
-    <!-- See https://checkstyle.org/config_whitespace.html -->
81
-    <module name="FileTabCharacter"/>
82
-
83
-    <!-- Miscellaneous other checks.                   -->
84
-    <!-- See https://checkstyle.org/config_misc.html -->
85
-    <module name="RegexpSingleline">
86
-        <property name="format" value="\s+$"/>
87
-        <property name="minimum" value="0"/>
88
-        <property name="maximum" value="0"/>
89
-        <property name="message" value="Line has trailing spaces."/>
90
-    </module>
91
-
92
-    <!-- Checks for Headers                                -->
93
-    <!-- See https://checkstyle.org/config_header.html   -->
94
-     <module name="Header">
95
-       <property name="headerFile" value="onlyoffice.header"/>
96
-       <property name="fileExtensions" value="java"/>
97
-     </module>
98
-
99
-    <module name="TreeWalker">
100
-
101
-        <!-- Checks for Javadoc comments.                     -->
102
-        <!-- See https://checkstyle.org/config_javadoc.html -->
103
-        <module name="InvalidJavadocPosition"/>
104
-        <module name="JavadocMethod"/>
105
-        <module name="JavadocType"/>
106
-        <module name="JavadocVariable"/>
107
-        <module name="JavadocStyle"/>
108
-        <module name="MissingJavadocMethod"/>
109
-
110
-        <!-- Checks for Naming Conventions.                  -->
111
-        <!-- See https://checkstyle.org/config_naming.html -->
112
-        <module name="ConstantName"/>
113
-        <module name="LocalFinalVariableName"/>
114
-        <module name="LocalVariableName"/>
115
-        <module name="MemberName"/>
116
-        <module name="MethodName"/>
117
-        <module name="PackageName"/>
118
-        <module name="ParameterName"/>
119
-        <module name="StaticVariableName"/>
120
-        <module name="TypeName"/>
121
-
122
-        <!-- Checks for imports                              -->
123
-        <!-- See https://checkstyle.org/config_imports.html -->
124
-        <module name="AvoidStarImport"/>
125
-        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
126
-        <module name="RedundantImport"/>
127
-        <module name="UnusedImports">
128
-            <property name="processJavadoc" value="false"/>
129
-        </module>
130
-
131
-        <!-- Checks for Size Violations.                    -->
132
-        <!-- See https://checkstyle.org/config_sizes.html -->
133
-        <module name="MethodLength"/>
134
-        <module name="ParameterNumber"/>
135
-
136
-        <!-- Checks for whitespace                               -->
137
-        <!-- See https://checkstyle.org/config_whitespace.html -->
138
-        <module name="EmptyForIteratorPad"/>
139
-        <module name="GenericWhitespace"/>
140
-        <module name="MethodParamPad"/>
141
-        <module name="NoWhitespaceAfter"/>
142
-        <module name="NoWhitespaceBefore"/>
143
-        <module name="OperatorWrap"/>
144
-        <module name="ParenPad"/>
145
-        <module name="TypecastParenPad"/>
146
-        <module name="WhitespaceAfter"/>
147
-        <module name="WhitespaceAround"/>
148
-
149
-        <!-- Modifier Checks                                    -->
150
-        <!-- See https://checkstyle.org/config_modifier.html -->
151
-        <module name="ModifierOrder"/>
152
-        <module name="RedundantModifier"/>
153
-
154
-        <!-- Checks for blocks. You know, those {}'s         -->
155
-        <!-- See https://checkstyle.org/config_blocks.html -->
156
-        <module name="AvoidNestedBlocks"/>
157
-        <module name="EmptyBlock"/>
158
-        <module name="LeftCurly"/>
159
-        <module name="NeedBraces"/>
160
-        <module name="RightCurly"/>
161
-
162
-        <!-- Checks for common coding problems               -->
163
-        <!-- See https://checkstyle.org/config_coding.html -->
164
-        <module name="EmptyStatement"/>
165
-        <module name="EqualsHashCode"/>
166
-        <module name="HiddenField"/>
167
-        <module name="IllegalInstantiation"/>
168
-        <module name="InnerAssignment"/>
169
-        <module name="MagicNumber"/>
170
-        <module name="MissingSwitchDefault"/>
171
-        <module name="MultipleVariableDeclarations"/>
172
-        <module name="SimplifyBooleanExpression"/>
173
-        <module name="SimplifyBooleanReturn"/>
174
-
175
-        <!-- Checks for class design                         -->
176
-        <!-- See https://checkstyle.org/config_design.html -->
177
-        <module name="DesignForExtension"/>
178
-        <module name="FinalClass"/>
179
-        <module name="HideUtilityClassConstructor"/>
180
-        <module name="InterfaceIsType"/>
181
-        <module name="VisibilityModifier"/>
182
-
183
-        <!-- Miscellaneous other checks.                   -->
184
-        <!-- See https://checkstyle.org/config_misc.html -->
185
-        <module name="ArrayTypeStyle"/>
186
-        <module name="FinalParameters"/>
187
-        <module name="TodoComment"/>
188
-        <module name="UpperEll"/>
189
-
190
-        <!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
191
-        <module name="SuppressionXpathFilter">
192
-            <property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
193
-                      default="checkstyle-xpath-suppressions.xml" />
194
-            <property name="optional" value="true"/>
195
-        </module>
196
-
197
-    </module>
198
-
199
-</module>

+ 0
- 15
docker-compose.yaml Просмотреть файл

@@ -1,15 +0,0 @@
1
-version: '3'
2
-services:
3
-    java-spring:
4
-        build:
5
-            context: ./
6
-            dockerfile: Dockerfile
7
-        image: maven:3.8.1
8
-        working_dir: /java-spring
9
-        volumes:
10
-            - .:/java-spring
11
-        ports: 
12
-            - 4000:4000
13
-        command: mvn clean spring-boot:run
14
-            
15
-            

Двоичные данные
documents/5242880/new (1).docx Просмотреть файл


+ 0
- 1
documents/5242880/new (1).docx-hist/createdInfo.json Просмотреть файл

@@ -1 +0,0 @@
1
-{"created":"2024-02-06 15:04:31","name":"John Smith","id":"1"}

Двоичные данные
documents/5242880/new (2).docx Просмотреть файл


+ 0
- 1
documents/5242880/new (2).docx-hist/createdInfo.json Просмотреть файл

@@ -1 +0,0 @@
1
-{"created":"2024-02-06 15:29:41","name":"John Smith","id":"1"}

Двоичные данные
documents/5242880/new.docx Просмотреть файл


+ 0
- 1
documents/5242880/new.docx-hist/createdInfo.json Просмотреть файл

@@ -1 +0,0 @@
1
-{"created":"2024-02-06 15:02:16","name":"John Smith","id":"1"}

Двоичные данные
documents/5242880/new.pptx Просмотреть файл


+ 0
- 1
documents/5242880/new.pptx-hist/createdInfo.json Просмотреть файл

@@ -1 +0,0 @@
1
-{"created":"2024-02-06 15:29:53","name":"John Smith","id":"1"}

Двоичные данные
documents/5242880/new.xlsx Просмотреть файл


+ 0
- 1
documents/5242880/new.xlsx-hist/createdInfo.json Просмотреть файл

@@ -1 +0,0 @@
1
-{"created":"2024-02-06 15:29:48","name":"John Smith","id":"1"}

+ 0
- 104
integration.iml Просмотреть файл

@@ -1,104 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="FacetManager">
4
-    <facet type="web" name="Web">
5
-      <configuration>
6
-        <webroots />
7
-      </configuration>
8
-    </facet>
9
-    <facet type="jpa" name="JPA">
10
-      <configuration>
11
-        <setting name="validation-enabled" value="true" />
12
-        <setting name="provider-name" value="Hibernate" />
13
-        <datasource-mapping />
14
-        <naming-strategy-map />
15
-      </configuration>
16
-    </facet>
17
-    <facet type="Spring" name="Spring">
18
-      <configuration />
19
-    </facet>
20
-  </component>
21
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
22
-    <output url="file://$MODULE_DIR$/target/classes" />
23
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
24
-    <content url="file://$MODULE_DIR$">
25
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
26
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
27
-      <excludeFolder url="file://$MODULE_DIR$/target" />
28
-    </content>
29
-    <orderEntry type="inheritedJdk" />
30
-    <orderEntry type="sourceFolder" forTests="false" />
31
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.5.1" level="project" />
32
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.5.1" level="project" />
33
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.5.1" level="project" />
34
-    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
35
-    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
36
-    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.14.1" level="project" />
37
-    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.14.1" level="project" />
38
-    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
39
-    <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
40
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.8" level="project" />
41
-    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.8" level="project" />
42
-    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
43
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.5.1" level="project" />
44
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.3" level="project" />
45
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3" level="project" />
46
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.3" level="project" />
47
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.5.1" level="project" />
48
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.46" level="project" />
49
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.46" level="project" />
50
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.46" level="project" />
51
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.8" level="project" />
52
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.8" level="project" />
53
-    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.8" level="project" />
54
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.8" level="project" />
55
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.8" level="project" />
56
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.8" level="project" />
57
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-devtools:2.5.1" level="project" />
58
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.5.1" level="project" />
59
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.5.1" level="project" />
60
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.5.1" level="project" />
61
-    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.12.RELEASE" level="project" />
62
-    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.12.RELEASE" level="project" />
63
-    <orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.5.RELEASE" level="project" />
64
-    <orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.6.RELEASE" level="project" />
65
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
66
-    <orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE" level="project" />
67
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.5.1" level="project" />
68
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.5.1" level="project" />
69
-    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
70
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.5.1" level="project" />
71
-    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
72
-    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.8" level="project" />
73
-    <orderEntry type="library" name="Maven: jakarta.transaction:jakarta.transaction-api:1.3.3" level="project" />
74
-    <orderEntry type="library" name="Maven: jakarta.persistence:jakarta.persistence-api:2.2.3" level="project" />
75
-    <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.4.32.Final" level="project" />
76
-    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.2.Final" level="project" />
77
-    <orderEntry type="library" name="Maven: org.javassist:javassist:3.27.0-GA" level="project" />
78
-    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
79
-    <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
80
-    <orderEntry type="library" name="Maven: org.jboss:jandex:2.2.3.Final" level="project" />
81
-    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
82
-    <orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.3" level="project" />
83
-    <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.1.2.Final" level="project" />
84
-    <orderEntry type="library" name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.4" level="project" />
85
-    <orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
86
-    <orderEntry type="library" name="Maven: org.glassfish.jaxb:txw2:2.3.4" level="project" />
87
-    <orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:3.0.12" level="project" />
88
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
89
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:2.5.1" level="project" />
90
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.5.1" level="project" />
91
-    <orderEntry type="library" name="Maven: org.springframework:spring-orm:5.3.8" level="project" />
92
-    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.8" level="project" />
93
-    <orderEntry type="library" name="Maven: org.springframework:spring-aspects:5.3.8" level="project" />
94
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.h2database:h2:1.4.200" level="project" />
95
-    <orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1" level="project" />
96
-    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
97
-    <orderEntry type="library" name="Maven: com.inversoft:prime-jwt:1.3.1" level="project" />
98
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.3" level="project" />
99
-    <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
100
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.4" level="project" />
101
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.4.2" level="project" />
102
-    <orderEntry type="library" name="Maven: org.modelmapper:modelmapper:2.4.2" level="project" />
103
-  </component>
104
-</module>

Двоичные данные
jpg/QQ截图20230805221213.jpg Просмотреть файл


Двоичные данные
jpg/docx-pdf.jpg Просмотреть файл


Двоичные данные
jpg/edit.jpg Просмотреть файл


Двоичные данные
jpg/editppt.jpg Просмотреть файл


Двоичные данные
jpg/editxlsx.jpg Просмотреть файл


Двоичные данные
jpg/f.jpg Просмотреть файл


Двоичные данные
jpg/view.jpg Просмотреть файл


Двоичные данные
jpg/viewppt.jpg Просмотреть файл


Двоичные данные
jpg/viewxls.jpg Просмотреть файл


Двоичные данные
jpg/xlsx2pdf.jpg Просмотреть файл


+ 0
- 70
licenses/3rd-Party.license Просмотреть файл

@@ -1,70 +0,0 @@
1
-ONLYOFFICE Applications example uses code from the following 3rd party projects:
2
-
3
-
4
-Gson          - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
5
-License:        Apache 2.0
6
-License File:   gson.license
7
-
8
-H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
9
-License:        MPL 2.0 or EPL 1.0
10
-License File:   h2database.license
11
-
12
-Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
13
-License:        Apache 2.0
14
-License File:   jackson-databind.license
15
-
16
-jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
17
-License:        MIT, GPL
18
-License File:   jQuery.BlockUI.license
19
-
20
-jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
21
-License:        MIT
22
-License File:   jQuery.FileUpload.license
23
-
24
-jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
25
-License:        MIT
26
-License File:   jQuery.iframe-transport.license
27
-
28
-jQuery        - jQuery is a new kind of JavaScript Library.        jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.        NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
29
-License:        MIT
30
-License File:   jQuery.license
31
-
32
-jQuery.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
33
-License:        OpenJS
34
-License File:   jQuery.Migrate.license
35
-
36
-jQuery.UI     - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
37
-License:        MIT
38
-License File:   jQuery.UI.license
39
-
40
-JSON.simple   - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
41
-License:        Apache 2.0
42
-License File:   JSON.simple.license
43
-
44
-Project Lombok - Project Lombok is a java library that automatically plugs into your editor and build tools. (https://mvnrepository.com/artifact/org.projectlombok/lombok).
45
-License:        MIT
46
-License File    lombok.license
47
-
48
-ModelMapper   - ModelMapper is an intelligent object mapping library that automatically maps objects to each other. (https://github.com/modelmapper/modelmapper)
49
-License:        Apache 2.0
50
-License File    modelmapper.license
51
-
52
-Prime JWT     - is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson. (https://github.com/ws-apps/prime-jwt/blob/master/LICENSE)
53
-License:        Apache 2.0
54
-License File:   prime-jwt.license
55
-
56
-Spring Boot   - Helps create Spring-powered, production-grade applications and services. Has external dependencies on Spring Framework. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
57
-License:        Apache 2.0
58
-License File:   spring-boot.license
59
-
60
-Spring Boot Devtools - Provides fast application restarts, LiveReload, and configurations for enhanced development experience. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
61
-License:        Apache 2.0
62
-License File:   spring-boot.license
63
-
64
-Spring Boot Starter Thymeleaf - A modern server-side Java template engine for both web and standalone environments. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
65
-License:        Apache 2.0
66
-License File:   spring-boot.license
67
-
68
-Spring Data JPA - Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate. (https://github.com/spring-projects/spring-data-jpa/blob/main/LICENSE.txt)
69
-License:        Apache 2.0
70
-License File:   spring-data-jpa.license

+ 0
- 202
licenses/JSON.simple.license Просмотреть файл

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "[]"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright [yyyy] [name of copyright owner]
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       http://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 202
licenses/gson.license Просмотреть файл

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "[]"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright [yyyy] [name of copyright owner]
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       http://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 250
licenses/h2database.license Просмотреть файл

@@ -1,250 +0,0 @@
1
-Summary and License FAQ
2
-
3
-H2 is dual licensed and available under the MPL 2.0 (Mozilla Public License Version 2.0) or under the EPL 1.0 (Eclipse Public License). There is a license FAQ for both the MPL and the EPL.
4
-
5
-    You can use H2 for free.
6
-    You can integrate it into your applications (including in commercial applications) and distribute it.
7
-    Files containing only your code are not covered by this license (it is 'commercial friendly').
8
-    Modifications to the H2 source code must be published.
9
-    You don't need to provide the source code of H2 if you did not modify anything.
10
-    If you distribute a binary that includes H2, you need to add a disclaimer of liability - see the example below. 
11
-
12
-However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine and visit old web pages of http://www.bungisoft.com.
13
-
14
-About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code.
15
-
16
-If you distribute a binary that includes H2, you need to add the license and a disclaimer of liability (as you should do for your own code). You should add a disclaimer for each open source library you use. For example, add a file 3rdparty_license.txt in the directory where the jar files are, and list all open source libraries, each one with its license and disclaimer. For H2, a simple solution is to copy the following text below. You may also include a copy of the complete license.
17
-
18
-This software contains unmodified binary redistributions for
19
-H2 database engine (https://h2database.com/),
20
-which is dual licensed and available under the MPL 2.0
21
-(Mozilla Public License) or under the EPL 1.0 (Eclipse Public License).
22
-An original copy of the license agreement can be found at:
23
-https://h2database.com/html/license.html
24
-
25
-Mozilla Public License Version 2.0
26
-1. Definitions
27
-
28
-1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
29
-
30
-1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution.
31
-
32
-1.3. "Contribution" means Covered Software of a particular Contributor.
33
-
34
-1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
35
-
36
-1.5. "Incompatible With Secondary Licenses" means
37
-
38
-a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
39
-
40
-b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
41
-
42
-1.6. "Executable Form" means any form of the work other than Source Code Form.
43
-
44
-1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.
45
-
46
-1.8. "License" means this document.
47
-
48
-1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.
49
-
50
-1.10. "Modifications" means any of the following:
51
-
52
-a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
53
-
54
-b. any new file in Source Code Form that contains any Covered Software.
55
-
56
-1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
57
-
58
-1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.
59
-
60
-1.13. "Source Code Form" means the form of the work preferred for making modifications.
61
-
62
-1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
63
-2. License Grants and Conditions
64
-2.1. Grants
65
-
66
-Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
67
-
68
-    under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
69
-
70
-    under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
71
-
72
-2.2. Effective Date
73
-
74
-The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.
75
-2.3. Limitations on Grant Scope
76
-
77
-The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:
78
-
79
-    for any code that a Contributor has removed from Covered Software; or
80
-
81
-    for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
82
-
83
-    under Patent Claims infringed by Covered Software in the absence of its Contributions.
84
-
85
-This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).
86
-2.4. Subsequent Licenses
87
-
88
-No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).
89
-2.5. Representation
90
-
91
-Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.
92
-2.6. Fair Use
93
-
94
-This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.
95
-2.7. Conditions
96
-
97
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.
98
-3. Responsibilities
99
-3.1. Distribution of Source Form
100
-
101
-All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form.
102
-3.2. Distribution of Executable Form
103
-
104
-If You distribute Covered Software in Executable Form then:
105
-
106
-    such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
107
-
108
-    You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License.
109
-
110
-3.3. Distribution of a Larger Work
111
-
112
-You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).
113
-3.4. Notices
114
-
115
-You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.
116
-3.5. Application of Additional Terms
117
-
118
-You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.
119
-4. Inability to Comply Due to Statute or Regulation
120
-
121
-If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
122
-5. Termination
123
-
124
-5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
125
-
126
-5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
127
-
128
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.
129
-6. Disclaimer of Warranty
130
-
131
-Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
132
-7. Limitation of Liability
133
-
134
-Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
135
-8. Litigation
136
-
137
-Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims.
138
-9. Miscellaneous
139
-
140
-This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
141
-10. Versions of the License
142
-10.1. New Versions
143
-
144
-Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
145
-10.2. Effect of New Versions
146
-
147
-You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.
148
-10.3. Modified Versions
149
-
150
-If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).
151
-10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
152
-
153
-If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
154
-Exhibit A - Source Code Form License Notice
155
-
156
-This Source Code Form is subject to the terms of the Mozilla
157
-Public License, v. 2.0. If a copy of the MPL was not distributed
158
-with this file, you can obtain one at http://mozilla.org/MPL/2.0
159
-
160
-If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
161
-
162
-You may add additional accurate notices of copyright ownership.
163
-Exhibit B - "Incompatible With Secondary Licenses" Notice
164
-
165
-This Source Code Form is "Incompatible With Secondary Licenses",
166
-as defined by the Mozilla Public License, v. 2.0.
167
-
168
-Eclipse Public License - Version 1.0
169
-
170
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
171
-1. DEFINITIONS
172
-
173
-"Contribution" means:
174
-
175
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
176
-
177
-b) in the case of each subsequent Contributor:
178
-
179
-i) changes to the Program, and
180
-
181
-ii) additions to the Program;
182
-
183
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
184
-
185
-"Contributor" means any person or entity that distributes the Program.
186
-
187
-"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
188
-
189
-"Program" means the Contributions distributed in accordance with this Agreement.
190
-
191
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
192
-2. GRANT OF RIGHTS
193
-
194
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
195
-
196
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
197
-
198
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
199
-
200
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
201
-3. REQUIREMENTS
202
-
203
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
204
-
205
-a) it complies with the terms and conditions of this Agreement; and
206
-
207
-b) its license agreement:
208
-
209
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
210
-
211
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
212
-
213
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
214
-
215
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
216
-
217
-When the Program is made available in source code form:
218
-
219
-a) it must be made available under this Agreement; and
220
-
221
-b) a copy of this Agreement must be included with each copy of the Program.
222
-
223
-Contributors may not remove or alter any copyright notices contained within the Program.
224
-
225
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
226
-4. COMMERCIAL DISTRIBUTION
227
-
228
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
229
-
230
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
231
-5. NO WARRANTY
232
-
233
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
234
-6. DISCLAIMER OF LIABILITY
235
-
236
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
237
-7. GENERAL
238
-
239
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
240
-
241
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
242
-
243
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
244
-
245
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
246
-
247
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
248
-Export Control Classification Number (ECCN)
249
-
250
-As far as we know, the U.S. Export Control Classification Number (ECCN) for this software is 5D002. However, for legal reasons, we can make no warranty that this information is correct. For details, see also the Apache Software Foundation Export Classifications page. 

+ 0
- 9
licenses/jQuery.BlockUI.license Просмотреть файл

@@ -1,9 +0,0 @@
1
-Copyright © 2007-2013 M. Alsup.
2
-
3
-The BlockUI plugin is dual licensed under the MIT and GPL licenses.
4
-
5
-You may use either license. The MIT license is recommended for most projects because it is simple and easy to understand and it places almost no restrictions on what you can do with the plugin.
6
-
7
-If the GPL suits your project better you are also free to use the plugin under that license.
8
-
9
-You do not have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. You are free to use the BlockUI plugin in commercial projects as long as the copyright header is left intact.

+ 0
- 20
licenses/jQuery.FileUpload.license Просмотреть файл

@@ -1,20 +0,0 @@
1
-MIT License
2
-
3
-Copyright © 2010 Sebastian Tschan, https://blueimp.net
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy of
6
-this software and associated documentation files (the "Software"), to deal in
7
-the Software without restriction, including without limitation the rights to
8
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
-the Software, and to permit persons to whom the Software is furnished to do so,
10
-subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in all
13
-copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 36
licenses/jQuery.Migrate.license Просмотреть файл

@@ -1,36 +0,0 @@
1
-Copyright OpenJS Foundation and other contributors, https://openjsf.org/
2
-
3
-This software consists of voluntary contributions made by many
4
-individuals. For exact contribution history, see the revision history
5
-available at https://github.com/jquery/jquery-migrate
6
-
7
-The following license applies to all parts of this software except as
8
-documented below:
9
-
10
-====
11
-
12
-Permission is hereby granted, free of charge, to any person obtaining
13
-a copy of this software and associated documentation files (the
14
-"Software"), to deal in the Software without restriction, including
15
-without limitation the rights to use, copy, modify, merge, publish,
16
-distribute, sublicense, and/or sell copies of the Software, and to
17
-permit persons to whom the Software is furnished to do so, subject to
18
-the following conditions:
19
-
20
-The above copyright notice and this permission notice shall be
21
-included in all copies or substantial portions of the Software.
22
-
23
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
-
31
-====
32
-
33
-All files located in the node_modules and external directories are
34
-externally maintained libraries used by this software which have their
35
-own licenses; we recommend you read them, as their terms may differ from
36
-the terms above.

+ 0
- 43
licenses/jQuery.UI.license Просмотреть файл

@@ -1,43 +0,0 @@
1
-Copyright jQuery Foundation and other contributors, https://jquery.org/
2
-
3
-This software consists of voluntary contributions made by many
4
-individuals. For exact contribution history, see the revision history
5
-available at https://github.com/jquery/jquery-ui
6
-
7
-The following license applies to all parts of this software except as
8
-documented below:
9
-
10
-====
11
-
12
-Permission is hereby granted, free of charge, to any person obtaining
13
-a copy of this software and associated documentation files (the
14
-"Software"), to deal in the Software without restriction, including
15
-without limitation the rights to use, copy, modify, merge, publish,
16
-distribute, sublicense, and/or sell copies of the Software, and to
17
-permit persons to whom the Software is furnished to do so, subject to
18
-the following conditions:
19
-
20
-The above copyright notice and this permission notice shall be
21
-included in all copies or substantial portions of the Software.
22
-
23
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
-
31
-====
32
-
33
-Copyright and related rights for sample code are waived via CC0. Sample
34
-code is defined as all source code contained within the demos directory.
35
-
36
-CC0: http://creativecommons.org/publicdomain/zero/1.0/
37
-
38
-====
39
-
40
-All files located in the node_modules and external directories are
41
-externally maintained libraries used by this software which have their
42
-own licenses; we recommend you read them, as their terms may differ from
43
-the terms above.

+ 0
- 20
licenses/jQuery.iframe-transport.license Просмотреть файл

@@ -1,20 +0,0 @@
1
-MIT License
2
-
3
-Copyright © 2010 Sebastian Tschan, https://blueimp.net
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy of
6
-this software and associated documentation files (the "Software"), to deal in
7
-the Software without restriction, including without limitation the rights to
8
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
-the Software, and to permit persons to whom the Software is furnished to do so,
10
-subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in all
13
-copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 20
licenses/jQuery.license Просмотреть файл

@@ -1,20 +0,0 @@
1
-Copyright OpenJS Foundation and other contributors, https://openjsf.org/
2
-
3
-Permission is hereby granted, free of charge, to any person obtaining
4
-a copy of this software and associated documentation files (the
5
-"Software"), to deal in the Software without restriction, including
6
-without limitation the rights to use, copy, modify, merge, publish,
7
-distribute, sublicense, and/or sell copies of the Software, and to
8
-permit persons to whom the Software is furnished to do so, subject to
9
-the following conditions:
10
-
11
-The above copyright notice and this permission notice shall be
12
-included in all copies or substantial portions of the Software.
13
-
14
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 202
licenses/jackson-databind.license Просмотреть файл

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "[]"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright [yyyy] [name of copyright owner]
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       http://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 104
licenses/lombok.license Просмотреть файл

@@ -1,104 +0,0 @@
1
-Copyright (C) 2009-2021 The Project Lombok Authors.
2
-
3
-Permission is hereby granted, free of charge, to any person obtaining a copy
4
-of this software and associated documentation files (the "Software"), to deal
5
-in the Software without restriction, including without limitation the rights
6
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
-copies of the Software, and to permit persons to whom the Software is
8
-furnished to do so, subject to the following conditions:
9
-
10
-The above copyright notice and this permission notice shall be included in
11
-all copies or substantial portions of the Software.
12
-
13
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
-THE SOFTWARE.
20
-
21
-==============================================================================
22
-Licenses for included components:
23
-
24
-org.ow2.asm:asm
25
-org.ow2.asm:asm-analysis
26
-org.ow2.asm:asm-commons
27
-org.ow2.asm:asm-tree
28
-org.ow2.asm:asm-util
29
-ASM: a very small and fast Java bytecode manipulation framework
30
- Copyright (c) 2000-2011 INRIA, France Telecom
31
- All rights reserved.
32
-
33
- Redistribution and use in source and binary forms, with or without
34
- modification, are permitted provided that the following conditions
35
- are met:
36
- 1. Redistributions of source code must retain the above copyright
37
-    notice, this list of conditions and the following disclaimer.
38
- 2. Redistributions in binary form must reproduce the above copyright
39
-    notice, this list of conditions and the following disclaimer in the
40
-    documentation and/or other materials provided with the distribution.
41
- 3. Neither the name of the copyright holders nor the names of its
42
-    contributors may be used to endorse or promote products derived from
43
-    this software without specific prior written permission.
44
-
45
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
46
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
49
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
50
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
51
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
52
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
53
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
55
- THE POSSIBILITY OF SUCH DAMAGE.
56
-
57
-------------------------------------------------------------------------------
58
-rzwitserloot/com.zwitserloot.cmdreader
59
-
60
- Copyright © 2010 Reinier Zwitserloot.
61
-
62
- Permission is hereby granted, free of charge, to any person obtaining a copy
63
- of this software and associated documentation files (the "Software"), to deal
64
- in the Software without restriction, including without limitation the rights
65
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
- copies of the Software, and to permit persons to whom the Software is
67
- furnished to do so, subject to the following conditions:
68
-
69
- The above copyright notice and this permission notice shall be included in
70
- all copies or substantial portions of the Software.
71
-
72
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
78
- THE SOFTWARE.
79
-
80
-------------------------------------------------------------------------------
81
-
82
-projectlombok/lombok.patcher
83
-
84
- Copyright (C) 2009-2021 The Project Lombok Authors.
85
-
86
- Permission is hereby granted, free of charge, to any person obtaining a copy
87
- of this software and associated documentation files (the "Software"), to deal
88
- in the Software without restriction, including without limitation the rights
89
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
90
- copies of the Software, and to permit persons to whom the Software is
91
- furnished to do so, subject to the following conditions:
92
-
93
- The above copyright notice and this permission notice shall be included in
94
- all copies or substantial portions of the Software.
95
-
96
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
99
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
101
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
102
- THE SOFTWARE.
103
-
104
-------------------------------------------------------------------------------

+ 0
- 177
licenses/modelmapper.license Просмотреть файл

@@ -1,177 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS

+ 0
- 201
licenses/prime-jwt.license Просмотреть файл

@@ -1,201 +0,0 @@
1
-Apache License
2
-                           Version 2.0, January 2004
3
-                        http://www.apache.org/licenses/
4
-
5
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
-   1. Definitions.
8
-
9
-      "License" shall mean the terms and conditions for use, reproduction,
10
-      and distribution as defined by Sections 1 through 9 of this document.
11
-
12
-      "Licensor" shall mean the copyright owner or entity authorized by
13
-      the copyright owner that is granting the License.
14
-
15
-      "Legal Entity" shall mean the union of the acting entity and all
16
-      other entities that control, are controlled by, or are under common
17
-      control with that entity. For the purposes of this definition,
18
-      "control" means (i) the power, direct or indirect, to cause the
19
-      direction or management of such entity, whether by contract or
20
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
-      outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
-      "You" (or "Your") shall mean an individual or Legal Entity
24
-      exercising permissions granted by this License.
25
-
26
-      "Source" form shall mean the preferred form for making modifications,
27
-      including but not limited to software source code, documentation
28
-      source, and configuration files.
29
-
30
-      "Object" form shall mean any form resulting from mechanical
31
-      transformation or translation of a Source form, including but
32
-      not limited to compiled object code, generated documentation,
33
-      and conversions to other media types.
34
-
35
-      "Work" shall mean the work of authorship, whether in Source or
36
-      Object form, made available under the License, as indicated by a
37
-      copyright notice that is included in or attached to the work
38
-      (an example is provided in the Appendix below).
39
-
40
-      "Derivative Works" shall mean any work, whether in Source or Object
41
-      form, that is based on (or derived from) the Work and for which the
42
-      editorial revisions, annotations, elaborations, or other modifications
43
-      represent, as a whole, an original work of authorship. For the purposes
44
-      of this License, Derivative Works shall not include works that remain
45
-      separable from, or merely link (or bind by name) to the interfaces of,
46
-      the Work and Derivative Works thereof.
47
-
48
-      "Contribution" shall mean any work of authorship, including
49
-      the original version of the Work and any modifications or additions
50
-      to that Work or Derivative Works thereof, that is intentionally
51
-      submitted to Licensor for inclusion in the Work by the copyright owner
52
-      or by an individual or Legal Entity authorized to submit on behalf of
53
-      the copyright owner. For the purposes of this definition, "submitted"
54
-      means any form of electronic, verbal, or written communication sent
55
-      to the Licensor or its representatives, including but not limited to
56
-      communication on electronic mailing lists, source code control systems,
57
-      and issue tracking systems that are managed by, or on behalf of, the
58
-      Licensor for the purpose of discussing and improving the Work, but
59
-      excluding communication that is conspicuously marked or otherwise
60
-      designated in writing by the copyright owner as "Not a Contribution."
61
-
62
-      "Contributor" shall mean Licensor and any individual or Legal Entity
63
-      on behalf of whom a Contribution has been received by Licensor and
64
-      subsequently incorporated within the Work.
65
-
66
-   2. Grant of Copyright License. Subject to the terms and conditions of
67
-      this License, each Contributor hereby grants to You a perpetual,
68
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
-      copyright license to reproduce, prepare Derivative Works of,
70
-      publicly display, publicly perform, sublicense, and distribute the
71
-      Work and such Derivative Works in Source or Object form.
72
-
73
-   3. Grant of Patent License. Subject to the terms and conditions of
74
-      this License, each Contributor hereby grants to You a perpetual,
75
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
-      (except as stated in this section) patent license to make, have made,
77
-      use, offer to sell, sell, import, and otherwise transfer the Work,
78
-      where such license applies only to those patent claims licensable
79
-      by such Contributor that are necessarily infringed by their
80
-      Contribution(s) alone or by combination of their Contribution(s)
81
-      with the Work to which such Contribution(s) was submitted. If You
82
-      institute patent litigation against any entity (including a
83
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
-      or a Contribution incorporated within the Work constitutes direct
85
-      or contributory patent infringement, then any patent licenses
86
-      granted to You under this License for that Work shall terminate
87
-      as of the date such litigation is filed.
88
-
89
-   4. Redistribution. You may reproduce and distribute copies of the
90
-      Work or Derivative Works thereof in any medium, with or without
91
-      modifications, and in Source or Object form, provided that You
92
-      meet the following conditions:
93
-
94
-      (a) You must give any other recipients of the Work or
95
-          Derivative Works a copy of this License; and
96
-
97
-      (b) You must cause any modified files to carry prominent notices
98
-          stating that You changed the files; and
99
-
100
-      (c) You must retain, in the Source form of any Derivative Works
101
-          that You distribute, all copyright, patent, trademark, and
102
-          attribution notices from the Source form of the Work,
103
-          excluding those notices that do not pertain to any part of
104
-          the Derivative Works; and
105
-
106
-      (d) If the Work includes a "NOTICE" text file as part of its
107
-          distribution, then any Derivative Works that You distribute must
108
-          include a readable copy of the attribution notices contained
109
-          within such NOTICE file, excluding those notices that do not
110
-          pertain to any part of the Derivative Works, in at least one
111
-          of the following places: within a NOTICE text file distributed
112
-          as part of the Derivative Works; within the Source form or
113
-          documentation, if provided along with the Derivative Works; or,
114
-          within a display generated by the Derivative Works, if and
115
-          wherever such third-party notices normally appear. The contents
116
-          of the NOTICE file are for informational purposes only and
117
-          do not modify the License. You may add Your own attribution
118
-          notices within Derivative Works that You distribute, alongside
119
-          or as an addendum to the NOTICE text from the Work, provided
120
-          that such additional attribution notices cannot be construed
121
-          as modifying the License.
122
-
123
-      You may add Your own copyright statement to Your modifications and
124
-      may provide additional or different license terms and conditions
125
-      for use, reproduction, or distribution of Your modifications, or
126
-      for any such Derivative Works as a whole, provided Your use,
127
-      reproduction, and distribution of the Work otherwise complies with
128
-      the conditions stated in this License.
129
-
130
-   5. Submission of Contributions. Unless You explicitly state otherwise,
131
-      any Contribution intentionally submitted for inclusion in the Work
132
-      by You to the Licensor shall be under the terms and conditions of
133
-      this License, without any additional terms or conditions.
134
-      Notwithstanding the above, nothing herein shall supersede or modify
135
-      the terms of any separate license agreement you may have executed
136
-      with Licensor regarding such Contributions.
137
-
138
-   6. Trademarks. This License does not grant permission to use the trade
139
-      names, trademarks, service marks, or product names of the Licensor,
140
-      except as required for reasonable and customary use in describing the
141
-      origin of the Work and reproducing the content of the NOTICE file.
142
-
143
-   7. Disclaimer of Warranty. Unless required by applicable law or
144
-      agreed to in writing, Licensor provides the Work (and each
145
-      Contributor provides its Contributions) on an "AS IS" BASIS,
146
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
-      implied, including, without limitation, any warranties or conditions
148
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
-      PARTICULAR PURPOSE. You are solely responsible for determining the
150
-      appropriateness of using or redistributing the Work and assume any
151
-      risks associated with Your exercise of permissions under this License.
152
-
153
-   8. Limitation of Liability. In no event and under no legal theory,
154
-      whether in tort (including negligence), contract, or otherwise,
155
-      unless required by applicable law (such as deliberate and grossly
156
-      negligent acts) or agreed to in writing, shall any Contributor be
157
-      liable to You for damages, including any direct, indirect, special,
158
-      incidental, or consequential damages of any character arising as a
159
-      result of this License or out of the use or inability to use the
160
-      Work (including but not limited to damages for loss of goodwill,
161
-      work stoppage, computer failure or malfunction, or any and all
162
-      other commercial damages or losses), even if such Contributor
163
-      has been advised of the possibility of such damages.
164
-
165
-   9. Accepting Warranty or Additional Liability. While redistributing
166
-      the Work or Derivative Works thereof, You may choose to offer,
167
-      and charge a fee for, acceptance of support, warranty, indemnity,
168
-      or other liability obligations and/or rights consistent with this
169
-      License. However, in accepting such obligations, You may act only
170
-      on Your own behalf and on Your sole responsibility, not on behalf
171
-      of any other Contributor, and only if You agree to indemnify,
172
-      defend, and hold each Contributor harmless for any liability
173
-      incurred by, or claims asserted against, such Contributor by reason
174
-      of your accepting any such warranty or additional liability.
175
-
176
-   END OF TERMS AND CONDITIONS
177
-
178
-   APPENDIX: How to apply the Apache License to your work.
179
-
180
-      To apply the Apache License to your work, attach the following
181
-      boilerplate notice, with the fields enclosed by brackets "{}"
182
-      replaced with your own identifying information. (Don't include
183
-      the brackets!)  The text should be enclosed in the appropriate
184
-      comment syntax for the file format. We also recommend that a
185
-      file or class name and description of purpose be included on the
186
-      same "printed page" as the copyright notice for easier
187
-      identification within third-party archives.
188
-
189
-   Copyright {yyyy} {name of copyright owner}
190
-
191
-   Licensed under the Apache License, Version 2.0 (the "License");
192
-   you may not use this file except in compliance with the License.
193
-   You may obtain a copy of the License at
194
-
195
-       http://www.apache.org/licenses/LICENSE-2.0
196
-
197
-   Unless required by applicable law or agreed to in writing, software
198
-   distributed under the License is distributed on an "AS IS" BASIS,
199
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
-   See the License for the specific language governing permissions and
201
-   limitations under the License.

+ 0
- 202
licenses/spring-boot.license Просмотреть файл

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        https://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "{}"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright {yyyy} {name of copyright owner}
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       https://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 202
licenses/spring-data-jpa.license Просмотреть файл

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        https://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "{}"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright {yyyy} {name of copyright owner}
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       https://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 310
mvnw Просмотреть файл

@@ -1,310 +0,0 @@
1
-#!/bin/sh
2
-# ----------------------------------------------------------------------------
3
-# Licensed to the Apache Software Foundation (ASF) under one
4
-# or more contributor license agreements.  See the NOTICE file
5
-# distributed with this work for additional information
6
-# regarding copyright ownership.  The ASF licenses this file
7
-# to you under the Apache License, Version 2.0 (the
8
-# "License"); you may not use this file except in compliance
9
-# with the License.  You may obtain a copy of the License at
10
-#
11
-#    https://www.apache.org/licenses/LICENSE-2.0
12
-#
13
-# Unless required by applicable law or agreed to in writing,
14
-# software distributed under the License is distributed on an
15
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
-# KIND, either express or implied.  See the License for the
17
-# specific language governing permissions and limitations
18
-# under the License.
19
-# ----------------------------------------------------------------------------
20
-
21
-# ----------------------------------------------------------------------------
22
-# Maven Start Up Batch script
23
-#
24
-# Required ENV vars:
25
-# ------------------
26
-#   JAVA_HOME - location of a JDK home dir
27
-#
28
-# Optional ENV vars
29
-# -----------------
30
-#   M2_HOME - location of maven2's installed home dir
31
-#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
32
-#     e.g. to debug Maven itself, use
33
-#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34
-#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35
-# ----------------------------------------------------------------------------
36
-
37
-if [ -z "$MAVEN_SKIP_RC" ] ; then
38
-
39
-  if [ -f /etc/mavenrc ] ; then
40
-    . /etc/mavenrc
41
-  fi
42
-
43
-  if [ -f "$HOME/.mavenrc" ] ; then
44
-    . "$HOME/.mavenrc"
45
-  fi
46
-
47
-fi
48
-
49
-# OS specific support.  $var _must_ be set to either true or false.
50
-cygwin=false;
51
-darwin=false;
52
-mingw=false
53
-case "`uname`" in
54
-  CYGWIN*) cygwin=true ;;
55
-  MINGW*) mingw=true;;
56
-  Darwin*) darwin=true
57
-    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58
-    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59
-    if [ -z "$JAVA_HOME" ]; then
60
-      if [ -x "/usr/libexec/java_home" ]; then
61
-        export JAVA_HOME="`/usr/libexec/java_home`"
62
-      else
63
-        export JAVA_HOME="/Library/Java/Home"
64
-      fi
65
-    fi
66
-    ;;
67
-esac
68
-
69
-if [ -z "$JAVA_HOME" ] ; then
70
-  if [ -r /etc/gentoo-release ] ; then
71
-    JAVA_HOME=`java-config --jre-home`
72
-  fi
73
-fi
74
-
75
-if [ -z "$M2_HOME" ] ; then
76
-  ## resolve links - $0 may be a link to maven's home
77
-  PRG="$0"
78
-
79
-  # need this for relative symlinks
80
-  while [ -h "$PRG" ] ; do
81
-    ls=`ls -ld "$PRG"`
82
-    link=`expr "$ls" : '.*-> \(.*\)$'`
83
-    if expr "$link" : '/.*' > /dev/null; then
84
-      PRG="$link"
85
-    else
86
-      PRG="`dirname "$PRG"`/$link"
87
-    fi
88
-  done
89
-
90
-  saveddir=`pwd`
91
-
92
-  M2_HOME=`dirname "$PRG"`/..
93
-
94
-  # make it fully qualified
95
-  M2_HOME=`cd "$M2_HOME" && pwd`
96
-
97
-  cd "$saveddir"
98
-  # echo Using m2 at $M2_HOME
99
-fi
100
-
101
-# For Cygwin, ensure paths are in UNIX format before anything is touched
102
-if $cygwin ; then
103
-  [ -n "$M2_HOME" ] &&
104
-    M2_HOME=`cygpath --unix "$M2_HOME"`
105
-  [ -n "$JAVA_HOME" ] &&
106
-    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107
-  [ -n "$CLASSPATH" ] &&
108
-    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109
-fi
110
-
111
-# For Mingw, ensure paths are in UNIX format before anything is touched
112
-if $mingw ; then
113
-  [ -n "$M2_HOME" ] &&
114
-    M2_HOME="`(cd "$M2_HOME"; pwd)`"
115
-  [ -n "$JAVA_HOME" ] &&
116
-    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117
-fi
118
-
119
-if [ -z "$JAVA_HOME" ]; then
120
-  javaExecutable="`which javac`"
121
-  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
122
-    # readlink(1) is not available as standard on Solaris 10.
123
-    readLink=`which readlink`
124
-    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
125
-      if $darwin ; then
126
-        javaHome="`dirname \"$javaExecutable\"`"
127
-        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
128
-      else
129
-        javaExecutable="`readlink -f \"$javaExecutable\"`"
130
-      fi
131
-      javaHome="`dirname \"$javaExecutable\"`"
132
-      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
133
-      JAVA_HOME="$javaHome"
134
-      export JAVA_HOME
135
-    fi
136
-  fi
137
-fi
138
-
139
-if [ -z "$JAVACMD" ] ; then
140
-  if [ -n "$JAVA_HOME"  ] ; then
141
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
142
-      # IBM's JDK on AIX uses strange locations for the executables
143
-      JAVACMD="$JAVA_HOME/jre/sh/java"
144
-    else
145
-      JAVACMD="$JAVA_HOME/bin/java"
146
-    fi
147
-  else
148
-    JAVACMD="`which java`"
149
-  fi
150
-fi
151
-
152
-if [ ! -x "$JAVACMD" ] ; then
153
-  echo "Error: JAVA_HOME is not defined correctly." >&2
154
-  echo "  We cannot execute $JAVACMD" >&2
155
-  exit 1
156
-fi
157
-
158
-if [ -z "$JAVA_HOME" ] ; then
159
-  echo "Warning: JAVA_HOME environment variable is not set."
160
-fi
161
-
162
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
163
-
164
-# traverses directory structure from process work directory to filesystem root
165
-# first directory with .mvn subdirectory is considered project base directory
166
-find_maven_basedir() {
167
-
168
-  if [ -z "$1" ]
169
-  then
170
-    echo "Path not specified to find_maven_basedir"
171
-    return 1
172
-  fi
173
-
174
-  basedir="$1"
175
-  wdir="$1"
176
-  while [ "$wdir" != '/' ] ; do
177
-    if [ -d "$wdir"/.mvn ] ; then
178
-      basedir=$wdir
179
-      break
180
-    fi
181
-    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
182
-    if [ -d "${wdir}" ]; then
183
-      wdir=`cd "$wdir/.."; pwd`
184
-    fi
185
-    # end of workaround
186
-  done
187
-  echo "${basedir}"
188
-}
189
-
190
-# concatenates all lines of a file
191
-concat_lines() {
192
-  if [ -f "$1" ]; then
193
-    echo "$(tr -s '\n' ' ' < "$1")"
194
-  fi
195
-}
196
-
197
-BASE_DIR=`find_maven_basedir "$(pwd)"`
198
-if [ -z "$BASE_DIR" ]; then
199
-  exit 1;
200
-fi
201
-
202
-##########################################################################################
203
-# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
204
-# This allows using the maven wrapper in projects that prohibit checking in binary data.
205
-##########################################################################################
206
-if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
207
-    if [ "$MVNW_VERBOSE" = true ]; then
208
-      echo "Found .mvn/wrapper/maven-wrapper.jar"
209
-    fi
210
-else
211
-    if [ "$MVNW_VERBOSE" = true ]; then
212
-      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213
-    fi
214
-    if [ -n "$MVNW_REPOURL" ]; then
215
-      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
216
-    else
217
-      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
218
-    fi
219
-    while IFS="=" read key value; do
220
-      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
221
-      esac
222
-    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
223
-    if [ "$MVNW_VERBOSE" = true ]; then
224
-      echo "Downloading from: $jarUrl"
225
-    fi
226
-    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
227
-    if $cygwin; then
228
-      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
229
-    fi
230
-
231
-    if command -v wget > /dev/null; then
232
-        if [ "$MVNW_VERBOSE" = true ]; then
233
-          echo "Found wget ... using wget"
234
-        fi
235
-        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
236
-            wget "$jarUrl" -O "$wrapperJarPath"
237
-        else
238
-            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
239
-        fi
240
-    elif command -v curl > /dev/null; then
241
-        if [ "$MVNW_VERBOSE" = true ]; then
242
-          echo "Found curl ... using curl"
243
-        fi
244
-        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
245
-            curl -o "$wrapperJarPath" "$jarUrl" -f
246
-        else
247
-            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
248
-        fi
249
-
250
-    else
251
-        if [ "$MVNW_VERBOSE" = true ]; then
252
-          echo "Falling back to using Java to download"
253
-        fi
254
-        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
255
-        # For Cygwin, switch paths to Windows format before running javac
256
-        if $cygwin; then
257
-          javaClass=`cygpath --path --windows "$javaClass"`
258
-        fi
259
-        if [ -e "$javaClass" ]; then
260
-            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
261
-                if [ "$MVNW_VERBOSE" = true ]; then
262
-                  echo " - Compiling MavenWrapperDownloader.java ..."
263
-                fi
264
-                # Compiling the Java class
265
-                ("$JAVA_HOME/bin/javac" "$javaClass")
266
-            fi
267
-            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
268
-                # Running the downloader
269
-                if [ "$MVNW_VERBOSE" = true ]; then
270
-                  echo " - Running MavenWrapperDownloader.java ..."
271
-                fi
272
-                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
273
-            fi
274
-        fi
275
-    fi
276
-fi
277
-##########################################################################################
278
-# End of extension
279
-##########################################################################################
280
-
281
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
282
-if [ "$MVNW_VERBOSE" = true ]; then
283
-  echo $MAVEN_PROJECTBASEDIR
284
-fi
285
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
286
-
287
-# For Cygwin, switch paths to Windows format before running java
288
-if $cygwin; then
289
-  [ -n "$M2_HOME" ] &&
290
-    M2_HOME=`cygpath --path --windows "$M2_HOME"`
291
-  [ -n "$JAVA_HOME" ] &&
292
-    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
293
-  [ -n "$CLASSPATH" ] &&
294
-    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
295
-  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
296
-    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
297
-fi
298
-
299
-# Provide a "standardized" way to retrieve the CLI args that will
300
-# work with both Windows and non-Windows executions.
301
-MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
302
-export MAVEN_CMD_LINE_ARGS
303
-
304
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
305
-
306
-exec "$JAVACMD" \
307
-  $MAVEN_OPTS \
308
-  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
309
-  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
310
-  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 0
- 182
mvnw.cmd Просмотреть файл

@@ -1,182 +0,0 @@
1
-@REM ----------------------------------------------------------------------------
2
-@REM Licensed to the Apache Software Foundation (ASF) under one
3
-@REM or more contributor license agreements.  See the NOTICE file
4
-@REM distributed with this work for additional information
5
-@REM regarding copyright ownership.  The ASF licenses this file
6
-@REM to you under the Apache License, Version 2.0 (the
7
-@REM "License"); you may not use this file except in compliance
8
-@REM with the License.  You may obtain a copy of the License at
9
-@REM
10
-@REM    https://www.apache.org/licenses/LICENSE-2.0
11
-@REM
12
-@REM Unless required by applicable law or agreed to in writing,
13
-@REM software distributed under the License is distributed on an
14
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-@REM KIND, either express or implied.  See the License for the
16
-@REM specific language governing permissions and limitations
17
-@REM under the License.
18
-@REM ----------------------------------------------------------------------------
19
-
20
-@REM ----------------------------------------------------------------------------
21
-@REM Maven Start Up Batch script
22
-@REM
23
-@REM Required ENV vars:
24
-@REM JAVA_HOME - location of a JDK home dir
25
-@REM
26
-@REM Optional ENV vars
27
-@REM M2_HOME - location of maven2's installed home dir
28
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31
-@REM     e.g. to debug Maven itself, use
32
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34
-@REM ----------------------------------------------------------------------------
35
-
36
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37
-@echo off
38
-@REM set title of command window
39
-title %0
40
-@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41
-@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
42
-
43
-@REM set %HOME% to equivalent of $HOME
44
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45
-
46
-@REM Execute a user defined script before this one
47
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
49
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51
-:skipRcPre
52
-
53
-@setlocal
54
-
55
-set ERROR_CODE=0
56
-
57
-@REM To isolate internal variables from possible post scripts, we use another setlocal
58
-@setlocal
59
-
60
-@REM ==== START VALIDATION ====
61
-if not "%JAVA_HOME%" == "" goto OkJHome
62
-
63
-echo.
64
-echo Error: JAVA_HOME not found in your environment. >&2
65
-echo Please set the JAVA_HOME variable in your environment to match the >&2
66
-echo location of your Java installation. >&2
67
-echo.
68
-goto error
69
-
70
-:OkJHome
71
-if exist "%JAVA_HOME%\bin\java.exe" goto init
72
-
73
-echo.
74
-echo Error: JAVA_HOME is set to an invalid directory. >&2
75
-echo JAVA_HOME = "%JAVA_HOME%" >&2
76
-echo Please set the JAVA_HOME variable in your environment to match the >&2
77
-echo location of your Java installation. >&2
78
-echo.
79
-goto error
80
-
81
-@REM ==== END VALIDATION ====
82
-
83
-:init
84
-
85
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86
-@REM Fallback to current working directory if not found.
87
-
88
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90
-
91
-set EXEC_DIR=%CD%
92
-set WDIR=%EXEC_DIR%
93
-:findBaseDir
94
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
95
-cd ..
96
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
97
-set WDIR=%CD%
98
-goto findBaseDir
99
-
100
-:baseDirFound
101
-set MAVEN_PROJECTBASEDIR=%WDIR%
102
-cd "%EXEC_DIR%"
103
-goto endDetectBaseDir
104
-
105
-:baseDirNotFound
106
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107
-cd "%EXEC_DIR%"
108
-
109
-:endDetectBaseDir
110
-
111
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112
-
113
-@setlocal EnableExtensions EnableDelayedExpansion
114
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116
-
117
-:endReadAdditionalConfig
118
-
119
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122
-
123
-set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
124
-
125
-FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126
-    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127
-)
128
-
129
-@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130
-@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131
-if exist %WRAPPER_JAR% (
132
-    if "%MVNW_VERBOSE%" == "true" (
133
-        echo Found %WRAPPER_JAR%
134
-    )
135
-) else (
136
-    if not "%MVNW_REPOURL%" == "" (
137
-        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
138
-    )
139
-    if "%MVNW_VERBOSE%" == "true" (
140
-        echo Couldn't find %WRAPPER_JAR%, downloading it ...
141
-        echo Downloading from: %DOWNLOAD_URL%
142
-    )
143
-
144
-    powershell -Command "&{"^
145
-		"$webclient = new-object System.Net.WebClient;"^
146
-		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147
-		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148
-		"}"^
149
-		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150
-		"}"
151
-    if "%MVNW_VERBOSE%" == "true" (
152
-        echo Finished downloading %WRAPPER_JAR%
153
-    )
154
-)
155
-@REM End of extension
156
-
157
-@REM Provide a "standardized" way to retrieve the CLI args that will
158
-@REM work with both Windows and non-Windows executions.
159
-set MAVEN_CMD_LINE_ARGS=%*
160
-
161
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162
-if ERRORLEVEL 1 goto error
163
-goto end
164
-
165
-:error
166
-set ERROR_CODE=1
167
-
168
-:end
169
-@endlocal & set ERROR_CODE=%ERROR_CODE%
170
-
171
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
172
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
173
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
175
-:skipRcPost
176
-
177
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
179
-
180
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
181
-
182
-exit /B %ERROR_CODE%

+ 0
- 17
onlyoffice.header Просмотреть файл

@@ -1,17 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */

+ 3
- 0
plugins/externallistener/README.md Просмотреть файл

@@ -0,0 +1,3 @@
1
+## Overview
2
+
3
+(Linux服务器安装好)把当前文件夹放到路径: /var/www/onlyoffice/documentserver/sdkjs-plugins

+ 25
- 0
plugins/externallistener/config.json Просмотреть файл

@@ -0,0 +1,25 @@
1
+{
2
+    "name"       : "Listener",
3
+    "guid"       : "asc.{A8705DEE-7544-4C33-B3D5-168406D92F72}",
4
+    "baseUrl"    : "",
5
+    "variations" : [
6
+        {
7
+            "description"         : "Listener",
8
+            "url"                 : "index.html",
9
+            "icons"               : ["resources/img/icon.png", "resources/img/icon@2x.png"],
10
+            "isViewer"            : false,
11
+            "EditorsSupport"      : ["word", "cell", "slide"],
12
+            "isVisual"            : false,
13
+            "isModal"             : true,
14
+            "isInsideMode"        : false,
15
+            "isSystem"            : true,
16
+            "initDataType"        : "none",
17
+            "initData"            : "",
18
+            "isUpdateOleOnResize" : true,
19
+            "buttons"             : [],
20
+            "events"              : [
21
+                "onExternalPluginMessage"
22
+            ]
23
+        }
24
+    ]
25
+}

+ 28
- 0
plugins/externallistener/index.html Просмотреть файл

@@ -0,0 +1,28 @@
1
+<!--
2
+ (c) Copyright Ascensio System SIA 2020
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+     http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ -->
16
+<!DOCTYPE html>
17
+<html>
18
+<head>
19
+    <meta charset="UTF-8" />
20
+    <title>Listener</title>
21
+    <script type="text/javascript" src="../v1/plugins.js"></script>
22
+    <script type="text/javascript" src="../v1/plugins-ui.js"></script>
23
+    <link rel="stylesheet" href="../v1/plugins.css">
24
+    <script type="text/javascript" src="scripts/code.js"></script>
25
+</head>
26
+<body>
27
+</body>
28
+</html>

Двоичные данные
plugins/externallistener/resources/img/icon.png Просмотреть файл


Двоичные данные
plugins/externallistener/resources/img/icon@2x.png Просмотреть файл


+ 103
- 0
plugins/externallistener/scripts/code.js Просмотреть файл

@@ -0,0 +1,103 @@
1
+/**
2
+ *
3
+ * (c) Copyright Ascensio System SIA 2020
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ *     http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+(function(window, undefined){
19
+
20
+	window.Asc.plugin.init = function() {
21
+		console.log("插件初始化")
22
+
23
+		// none
24
+		window.parent.Common.Gateway.on('internalcommand', function(data){
25
+			console.log(data); // 接受到123参数console.log(data.data); // 接受到321参数
26
+			var data_ = data.data
27
+			switch (data.command){
28
+				case "insertText":
29
+					let text = "${"+data_.text+"}"
30
+					window.Asc.plugin.executeMethod ("PasteText", [text]);
31
+					if(window.Asc.plugin.info.editorType == 'cell'){
32
+						CorrectText('insertText')
33
+					}
34
+					break;
35
+				case 'getText':
36
+					CorrectText('getText')
37
+					break
38
+			}
39
+		});
40
+
41
+		var _info = window.Asc.plugin.info;
42
+		var userName =_info.userName
43
+		var userId = _info.userId
44
+
45
+		function CorrectText (command) {
46
+			let data = {
47
+				command:command,
48
+				text:""
49
+			}
50
+			switch (window.Asc.plugin.info.editorType) {
51
+				case 'word':
52
+				case 'slide': {
53
+					window.Asc.plugin.executeMethod ("GetSelectedText", [{"Numbering": false, "Math": false, "TableCellSeparator": '\n', "ParaSeparator": '\n', "TabSymbol": String.fromCharCode(9)}], function (e) {
54
+						let text = e.trim()
55
+						data.text = text
56
+						window.parent.parent.postMessage(JSON.stringify(data),'*');
57
+					});
58
+					break;
59
+				}
60
+				case 'cell': {
61
+					Asc.scope.command = command;
62
+					window.Asc.plugin.callCommand (function () {
63
+						var oWorksheet = Api.GetActiveSheet();
64
+						var oActiveCell = oWorksheet.GetActiveCell();
65
+						let str = oActiveCell.Text
66
+						if(str.indexOf("${") != -1){
67
+							str = str.substring(2,str.length-1)
68
+						}
69
+						let data = {
70
+							command:Asc.scope.command,
71
+							sheetName:oWorksheet.Name,
72
+							text:str,
73
+							x:oActiveCell.Row,
74
+							y:oActiveCell.Col
75
+						}
76
+
77
+						localStorage.setItem('dataInfo', JSON.stringify(data))
78
+					}, false,false,function(){
79
+						window.parent.parent.postMessage(localStorage.getItem('dataInfo'),'*');
80
+						localStorage.removeItem('dataInfo')
81
+					});
82
+					/*		window.Asc.plugin.executeMethod ("GetSelectedText", [{"Numbering": false, "Math": false, "TableCellSeparator": '\n', "ParaSeparator": '\n', "TabSymbol": String.fromCharCode(9)}], function (e) {
83
+                                let text = e.trim()
84
+                                console.log(text)
85
+                                data.text = text
86
+                                if (text == '') {
87
+                                    text = text.replace (/\t/g, '\n');
88
+                                    window.parent.parent.postMessage(JSON.stringify(data),'*');
89
+                                }
90
+                                else {
91
+
92
+                                }
93
+                            });*/
94
+					break;
95
+				}
96
+			}
97
+		}
98
+	};
99
+
100
+	window.Asc.plugin.button = function(id) {
101
+	};
102
+
103
+})(window, undefined);

+ 3
- 0
plugins/externallistener/translations/langs.json Просмотреть файл

@@ -0,0 +1,3 @@
1
+[
2
+	"zh-CN"
3
+]

+ 3
- 0
plugins/externallistener/translations/zh-CN.json Просмотреть файл

@@ -0,0 +1,3 @@
1
+{
2
+
3
+}

+ 151
- 109
pom.xml Просмотреть файл

@@ -1,112 +1,154 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
-	<modelVersion>4.0.0</modelVersion>
5
-	<parent>
6
-		<groupId>org.springframework.boot</groupId>
7
-		<artifactId>spring-boot-starter-parent</artifactId>
8
-		<version>2.5.1</version>
9
-		<relativePath/> <!-- lookup parent from repository -->
10
-	</parent>
11
-	<groupId>com.onlyoffice</groupId>
12
-	<artifactId>integration</artifactId>
13
-	<version>1.0</version>
14
-	<name>Java Spring Integration Example</name>
15
-	<description>ONLYOFFICE Java Spring Integration</description>
16
-	<properties>
17
-		<java.version>11</java.version>
18
-	</properties>
19
-	<dependencies>
20
-		<dependency>
21
-			<groupId>org.springframework.boot</groupId>
22
-			<artifactId>spring-boot-starter-web</artifactId>
23
-		</dependency>
24
-		<dependency>
25
-			<groupId>org.springframework.boot</groupId>
26
-			<artifactId>spring-boot-devtools</artifactId>
27
-			<optional>true</optional>
28
-		</dependency>
29
-		<dependency>
30
-			<groupId>org.springframework.boot</groupId>
31
-			<artifactId>spring-boot-starter-thymeleaf</artifactId>
32
-			<version>2.5.1</version>
33
-		</dependency>
34
-		<dependency>
35
-			<groupId>org.springframework.boot</groupId>
36
-			<artifactId>spring-boot-starter-data-jpa</artifactId>
37
-		</dependency>
38
-		<dependency>
39
-			<groupId>com.h2database</groupId>
40
-			<artifactId>h2</artifactId>
41
-			<scope>runtime</scope>
42
-		</dependency>
43
-		<dependency>
44
-			<groupId>com.googlecode.json-simple</groupId>
45
-			<artifactId>json-simple</artifactId>
46
-			<version>1.1</version>
47
-		</dependency>
48
-		<dependency>
49
-			<groupId>com.google.code.gson</groupId>
50
-			<artifactId>gson</artifactId>
51
-			<version>2.8.9</version>
52
-		</dependency>
53
-		<dependency>
54
-			<groupId>com.inversoft</groupId>
55
-			<artifactId>prime-jwt</artifactId>
56
-			<version>1.3.1</version>
57
-		</dependency>
58
-		<dependency>
59
-			<groupId>org.projectlombok</groupId>
60
-			<artifactId>lombok</artifactId>
61
-			<version>1.18.20</version>
62
-			<scope>provided</scope>
63
-		</dependency>
64
-		<dependency>
65
-			<groupId>com.fasterxml.jackson.core</groupId>
66
-			<artifactId>jackson-core</artifactId>
67
-			<version>2.13.4</version>
68
-		</dependency>
69
-		<dependency>
70
-			<groupId>com.fasterxml.jackson.core</groupId>
71
-			<artifactId>jackson-databind</artifactId>
72
-			<version>2.13.4.2</version>
73
-		</dependency>
74
-		<dependency>
75
-			<groupId>org.modelmapper</groupId>
76
-			<artifactId>modelmapper</artifactId>
77
-			<version>2.4.2</version>
78
-		</dependency>
79
-	</dependencies>
80
-	<build>
81
-		<plugins>
82
-			<plugin>
83
-				<groupId>org.springframework.boot</groupId>
84
-				<artifactId>spring-boot-maven-plugin</artifactId>
85
-			</plugin>
86
-			<plugin>
87
-				<groupId>org.apache.maven.plugins</groupId>
88
-				<artifactId>maven-checkstyle-plugin</artifactId>
89
-				<version>3.2.0</version>
90
-				<executions>
91
-					<execution>
92
-						<id>validate</id>
93
-						<phase>validate</phase>
94
-						<configuration>
95
-							<configLocation>checkstyle.xml</configLocation>
96
-							<failsOnError>true</failsOnError>
97
-							<failOnViolation>true</failOnViolation>
98
-							<logViolationsToConsole>true</logViolationsToConsole>
99
-							<violationSeverity>warning</violationSeverity>
100
-							<consoleOutput>true</consoleOutput>
101
-							<includeTestSourceDirectory>true
102
-							</includeTestSourceDirectory>
103
-						</configuration>
104
-						<goals>
105
-							<goal>check</goal>
106
-						</goals>
107
-					</execution>
108
-				</executions>
109
-			</plugin>
110
-		</plugins>
111
-	</build>
3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <parent>
6
+        <groupId>org.springframework.boot</groupId>
7
+        <artifactId>spring-boot-starter-parent</artifactId>
8
+        <version>2.6.6</version>
9
+        <relativePath/> <!-- lookup parent from repository -->
10
+    </parent>
11
+    <groupId>com.oo</groupId>
12
+    <artifactId>Spring-Boot-onlyOffice</artifactId>
13
+    <version>0.0.1-SNAPSHOT</version>
14
+    <name>Spring-Boot-onlyOffice</name>
15
+    <description>Demo project for Spring Boot</description>
16
+    <properties>
17
+        <java.version>1.8</java.version>
18
+    </properties>
19
+    <dependencies>
20
+
21
+    
22
+        <dependency>
23
+            <groupId>org.springframework.boot</groupId>
24
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
25
+        </dependency>
26
+        <dependency>
27
+            <groupId>org.springframework.boot</groupId>
28
+            <artifactId>spring-boot-starter-web</artifactId>
29
+        </dependency>
30
+
31
+        <dependency>
32
+            <groupId>org.springframework.boot</groupId>
33
+            <artifactId>spring-boot-devtools</artifactId>
34
+            <optional>true</optional>
35
+        </dependency>
36
+        <dependency>
37
+            <groupId>org.projectlombok</groupId>
38
+            <artifactId>lombok</artifactId>
39
+            <optional>true</optional>
40
+        </dependency>
41
+        <dependency>
42
+            <groupId>org.springframework.boot</groupId>
43
+            <artifactId>spring-boot-starter-test</artifactId>
44
+            <scope>test</scope>
45
+        </dependency>
46
+        <dependency>
47
+            <groupId>com.baomidou</groupId>
48
+            <artifactId>mybatis-plus-boot-starter</artifactId>
49
+            <version>3.5.1</version>
50
+        </dependency>
51
+        <dependency>
52
+            <groupId>com.baomidou</groupId>
53
+            <artifactId>mybatis-plus-generator</artifactId>
54
+            <version>3.5.1</version>
55
+        </dependency>
56
+        <dependency>
57
+            <groupId>com.alibaba</groupId>
58
+            <artifactId>druid-spring-boot-starter</artifactId>
59
+            <version>1.1.22</version>
60
+        </dependency>
61
+        <dependency>
62
+            <groupId>mysql</groupId>
63
+            <artifactId>mysql-connector-java</artifactId>
64
+            <version>8.0.17</version>
65
+        </dependency>
66
+        <dependency>
67
+            <groupId>com.alibaba</groupId>
68
+            <artifactId>fastjson</artifactId>
69
+            <version>2.0.25</version>
70
+        </dependency>
71
+        <dependency>
72
+            <groupId>cn.hutool</groupId>
73
+            <artifactId>hutool-all</artifactId>
74
+            <version>5.8.16</version>
75
+        </dependency>
76
+        <dependency>
77
+            <groupId>com.inversoft</groupId>
78
+            <artifactId>prime-jwt</artifactId>
79
+            <version>1.3.1</version>
80
+        </dependency>
81
+        <dependency>
82
+            <groupId>org.apache.commons</groupId>
83
+            <artifactId>commons-pool2</artifactId>
84
+        </dependency>
85
+        <dependency>
86
+            <groupId>org.springframework.boot</groupId>
87
+            <artifactId>spring-boot-starter-data-redis</artifactId>
88
+        </dependency>
89
+        <dependency>
90
+            <groupId>commons-fileupload</groupId>
91
+            <artifactId>commons-fileupload</artifactId>
92
+            <version>1.4</version>
93
+        </dependency>
94
+        <!--websocket-->
95
+        <dependency>
96
+            <groupId>org.springframework.boot</groupId>
97
+            <artifactId>spring-boot-starter-websocket</artifactId>
98
+        </dependency>
99
+    </dependencies>
100
+
101
+    <build>
102
+        <plugins>
103
+            <plugin>
104
+                <groupId>org.springframework.boot</groupId>
105
+                <artifactId>spring-boot-maven-plugin</artifactId>
106
+                <configuration>
107
+                    <excludes>
108
+                        <exclude>
109
+                            <groupId>org.projectlombok</groupId>
110
+                            <artifactId>lombok</artifactId>
111
+                        </exclude>
112
+                    </excludes>
113
+                </configuration>
114
+            </plugin>
115
+        </plugins>
116
+    </build>
117
+    <repositories>
118
+        <repository>
119
+            <id>spring-milestones</id>
120
+            <name>Spring Milestones</name>
121
+            <url>https://repo.spring.io/milestone</url>
122
+            <snapshots>
123
+                <enabled>false</enabled>
124
+            </snapshots>
125
+        </repository>
126
+        <repository>
127
+            <id>spring-snapshots</id>
128
+            <name>Spring Snapshots</name>
129
+            <url>https://repo.spring.io/snapshot</url>
130
+            <releases>
131
+                <enabled>false</enabled>
132
+            </releases>
133
+        </repository>
134
+    </repositories>
135
+    <pluginRepositories>
136
+        <pluginRepository>
137
+            <id>spring-milestones</id>
138
+            <name>Spring Milestones</name>
139
+            <url>https://repo.spring.io/milestone</url>
140
+            <snapshots>
141
+                <enabled>false</enabled>
142
+            </snapshots>
143
+        </pluginRepository>
144
+        <pluginRepository>
145
+            <id>spring-snapshots</id>
146
+            <name>Spring Snapshots</name>
147
+            <url>https://repo.spring.io/snapshot</url>
148
+            <releases>
149
+                <enabled>false</enabled>
150
+            </releases>
151
+        </pluginRepository>
152
+    </pluginRepositories>
153
+
112 154
 </project>

+ 0
- 115
src/main/java/com/onlyoffice/integration/ExampleData.java Просмотреть файл

@@ -1,115 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration;
20
-
21
-import com.onlyoffice.integration.documentserver.serializers.FilterState;
22
-import com.onlyoffice.integration.services.UserServices;
23
-import org.springframework.beans.factory.annotation.Autowired;
24
-import org.springframework.stereotype.Component;
25
-
26
-import javax.annotation.PostConstruct;
27
-import java.util.ArrayList;
28
-import java.util.List;
29
-
30
-@Component
31
-public class ExampleData {
32
-    @Autowired
33
-    private UserServices userService;
34
-    @PostConstruct
35
-    public void init() {
36
-        // the description for user 0
37
-        List<String> descriptionUserZero = List.of(
38
-                "The name is requested when the editor is opened",
39
-                "Doesn’t belong to any group",
40
-                "Can review all the changes",
41
-                "Can perform all actions with comments",
42
-                "The file favorite state is undefined",
43
-                "Can't mention others in comments",
44
-                "Can't create new files from the editor",
45
-                "Can’t see anyone’s information",
46
-                "Can't rename files from the editor",
47
-                "Can't view chat",
48
-                "Can't protect file",
49
-                "View file without collaboration"
50
-        );
51
-
52
-        // the description for user 1
53
-        List<String> descriptionUserFirst = List.of(
54
-                "File author by default",
55
-                "He doesn’t belong to any of the groups",
56
-                "He can review all the changes",
57
-                "He can do everything with the comments",
58
-                "The file favorite state is undefined",
59
-                "Can create a file from a template with data from the editor",
60
-                "Can see the information about all users",
61
-                "Can view chat"
62
-        );
63
-
64
-        // the description for user 2
65
-        List<String> descriptionUserSecond = List.of(
66
-                "He belongs to Group2",
67
-                "He can review only his own changes or the changes made by the users who don’t belong"
68
-                        + " to any of the groups",
69
-                "He can view every comment, edit his comments and the comments left by the users "
70
-                        + "who don't belong to any of the groups and remove only his comments",
71
-                "This file is favorite",
72
-                "Can create a file from an editor",
73
-                "Can see the information about users from Group2 and users who don’t belong to any group",
74
-                "Can view chat"
75
-        );
76
-
77
-        // the description for user 3
78
-        List<String> descriptionUserThird = List.of(
79
-                "He belongs to Group3",
80
-                "He can review only the changes made by the users from Group2",
81
-                "He can view the comments left by the users from Group2 and Group3 and edit the comments left by "
82
-                        + "the users from Group2",
83
-                "This file isn’t favorite",
84
-                "He can’t copy data from the file into the clipboard",
85
-                "He can’t download the file",
86
-                "He can’t print the file",
87
-                "Can create a file from an editor",
88
-                "Can see the information about Group2 users",
89
-                "Can view chat"
90
-        );
91
-
92
-        // create user 1 with the specified parameters
93
-        userService.createUser("John Smith", "smith@example.com", descriptionUserFirst,
94
-                "", List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
95
-                List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
96
-                List.of(FilterState.NULL.toString()), null, true, true);
97
-
98
-        // create user 2 with the specified parameters
99
-        userService.createUser("Mark Pottato", "pottato@example.com", descriptionUserSecond,
100
-                "group-2", List.of("", "group-2"), List.of(FilterState.NULL.toString()),
101
-                List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true, true,
102
-                true);
103
-
104
-        // create user 3 with the specified parameters
105
-        userService.createUser("Hamish Mitchell", "mitchell@example.com", descriptionUserThird,
106
-                "group-3", List.of("group-2"), List.of("group-2", "group-3"), List.of("group-2"),
107
-                new ArrayList<>(), List.of("group-2"), false, true, true);
108
-
109
-        // create user 0 with the specified parameters
110
-        userService.createUser("Anonymous", null, descriptionUserZero, "",
111
-                List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
112
-                List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
113
-                new ArrayList<>(), null, false, false);
114
-    }
115
-}

+ 0
- 32
src/main/java/com/onlyoffice/integration/IntegrationApplication.java Просмотреть файл

@@ -1,32 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration;
20
-
21
-import org.springframework.boot.SpringApplication;
22
-import org.springframework.boot.autoconfigure.SpringBootApplication;
23
-
24
-@SpringBootApplication
25
-public class IntegrationApplication {
26
-
27
-    // run the SpringApplication from the IntagrationApplication with the specified parameters
28
-    public static void main(final String[] args) {
29
-        SpringApplication.run(IntegrationApplication.class, args);
30
-    }
31
-
32
-}

+ 0
- 87
src/main/java/com/onlyoffice/integration/IntegrationConfiguration.java Просмотреть файл

@@ -1,87 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration;
20
-
21
-import com.fasterxml.jackson.databind.ObjectMapper;
22
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
23
-import org.json.simple.parser.JSONParser;
24
-import org.modelmapper.ModelMapper;
25
-import org.modelmapper.convention.MatchingStrategies;
26
-import org.springframework.beans.factory.annotation.Autowired;
27
-import org.springframework.beans.factory.annotation.Value;
28
-import org.springframework.context.annotation.Bean;
29
-import org.springframework.context.annotation.Configuration;
30
-
31
-import javax.annotation.PostConstruct;
32
-
33
-import com.onlyoffice.integration.documentserver.util.SSLUtils;
34
-
35
-@Configuration
36
-public class IntegrationConfiguration {
37
-
38
-    @Value("${files.storage}")
39
-    private String storageAddress;
40
-
41
-    @Value("${files.docservice.verify-peer-off}")
42
-    private String verifyPerrOff;
43
-
44
-    @Autowired
45
-    private FileStoragePathBuilder storagePathBuilder;
46
-
47
-    @Autowired
48
-    private SSLUtils ssl;
49
-
50
-    @Bean
51
-    public ModelMapper mapper() {  // create the model mapper
52
-        ModelMapper mapper = new ModelMapper();
53
-        mapper.getConfiguration()  // get the mapper configuration and set new parameters to it
54
-                .setMatchingStrategy(MatchingStrategies.STRICT)  // specify the STRICT matching strategy
55
-                .setFieldMatchingEnabled(true)  // define if the field matching is enabled or not
56
-                .setSkipNullEnabled(true)  // define if null value will be skipped or not
57
-                .setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE);  /* specify
58
-                 the PRIVATE field access level */
59
-        return mapper;
60
-    }
61
-
62
-    @Bean
63
-    public JSONParser jsonParser() {  // create JSON parser
64
-        return new JSONParser();
65
-    }
66
-
67
-    @PostConstruct
68
-    public void init() {  // initialize the storage path builder
69
-        storagePathBuilder.configure(storageAddress.isBlank() ? null : storageAddress);
70
-        if (!verifyPerrOff.isEmpty()) {
71
-            try {
72
-                if (verifyPerrOff.equals("true")) {
73
-                    ssl.turnOffSslChecking(); //the certificate will be ignored
74
-                } else {
75
-                    ssl.turnOnSslChecking(); //the certificate will be verified
76
-                }
77
-            } catch (Exception e) {
78
-                e.printStackTrace();
79
-            }
80
-        }
81
-    }
82
-
83
-    @Bean
84
-    public ObjectMapper objectMapper() {  // create the object mapper
85
-        return new ObjectMapper();
86
-    }
87
-}

+ 0
- 239
src/main/java/com/onlyoffice/integration/controllers/EditorController.java Просмотреть файл

@@ -1,239 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.controllers;
20
-
21
-import com.fasterxml.jackson.core.JsonProcessingException;
22
-import com.fasterxml.jackson.databind.ObjectMapper;
23
-import com.onlyoffice.integration.documentserver.managers.history.HistoryManager;
24
-import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
25
-import com.onlyoffice.integration.documentserver.models.enums.Action;
26
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
27
-import com.onlyoffice.integration.entities.User;
28
-import com.onlyoffice.integration.dto.Mentions;
29
-import com.onlyoffice.integration.documentserver.models.enums.Type;
30
-import com.onlyoffice.integration.documentserver.models.filemodel.FileModel;
31
-import com.onlyoffice.integration.services.UserServices;
32
-import com.onlyoffice.integration.services.configurers.FileConfigurer;
33
-import com.onlyoffice.integration.services.configurers.wrappers.DefaultFileWrapper;
34
-import lombok.SneakyThrows;
35
-import org.springframework.beans.factory.annotation.Autowired;
36
-import org.springframework.beans.factory.annotation.Value;
37
-import org.springframework.stereotype.Controller;
38
-import org.springframework.ui.Model;
39
-import org.springframework.web.bind.annotation.CookieValue;
40
-import org.springframework.web.bind.annotation.CrossOrigin;
41
-import org.springframework.web.bind.annotation.GetMapping;
42
-import org.springframework.web.bind.annotation.RequestParam;
43
-
44
-import java.util.ArrayList;
45
-import java.util.Arrays;
46
-import java.util.HashMap;
47
-import java.util.List;
48
-import java.util.Locale;
49
-import java.util.Map;
50
-import java.util.Optional;
51
-
52
-import static com.onlyoffice.integration.documentserver.util.Constants.ANONYMOUS_USER_ID;
53
-
54
-@CrossOrigin("*")
55
-@Controller
56
-public class EditorController {
57
-
58
-    @Value("${files.docservice.url.site}")
59
-    private String docserviceSite;
60
-
61
-    @Value("${files.docservice.url.api}")
62
-    private String docserviceApiUrl;
63
-
64
-    @Value("${files.docservice.languages}")
65
-    private String langs;
66
-
67
-    @Autowired
68
-    private FileStoragePathBuilder storagePathBuilder;
69
-
70
-    @Autowired
71
-    private JwtManager jwtManager;
72
-
73
-    @Autowired
74
-    private UserServices userService;
75
-
76
-    @Autowired
77
-    private HistoryManager historyManager;
78
-
79
-    @Autowired
80
-    private ObjectMapper objectMapper;
81
-
82
-    @Autowired
83
-    private FileConfigurer<DefaultFileWrapper> fileConfigurer;
84
-
85
-    @GetMapping(path = "${url.editor}")
86
-    // process request to open the editor page
87
-    public String index(@RequestParam("fileName") final String fileName,
88
-                        @RequestParam(value = "action", required = false) final String actionParam,
89
-                        @RequestParam(value = "type", required = false) final String typeParam,
90
-                        @RequestParam(value = "actionLink", required = false) final String actionLink,
91
-                        @RequestParam(value = "directUrl", required = false,
92
-                                defaultValue = "false") final Boolean directUrl,
93
-                        @CookieValue(value = "uid") final String uid,
94
-                        @CookieValue(value = "ulang") final String lang,
95
-                        final Model model) throws JsonProcessingException {
96
-        Action action = Action.edit;
97
-        Type type = Type.desktop;
98
-        Locale locale = new Locale("en");
99
-
100
-        if (actionParam != null) {
101
-            action = Action.valueOf(actionParam);
102
-        }
103
-        if (typeParam != null) {
104
-            type = Type.valueOf(typeParam);
105
-        }
106
-
107
-        List<String> langsAndKeys = Arrays.asList(langs.split("\\|"));
108
-        for (String langAndKey : langsAndKeys) {
109
-            String[] couple = langAndKey.split(":");
110
-            if (couple[0].equals(lang)) {
111
-                String[] langAndCountry = couple[0].split("-");
112
-                locale = new Locale(langAndCountry[0], langAndCountry.length > 1 ? langAndCountry[1] : "");
113
-            }
114
-        }
115
-
116
-        Optional<User> optionalUser = userService.findUserById(Integer.parseInt(uid));
117
-
118
-        // if the user is not present, return the ONLYOFFICE start page
119
-        if (!optionalUser.isPresent()) {
120
-            return "index.html";
121
-        }
122
-
123
-        User user = optionalUser.get();
124
-
125
-        // get file model with the default file parameters
126
-        FileModel fileModel = fileConfigurer.getFileModel(
127
-                DefaultFileWrapper
128
-                        .builder()
129
-                        .fileName(fileName)
130
-                        .type(type)
131
-                        .lang(locale.toLanguageTag())
132
-                        .action(action)
133
-                        .user(user)
134
-                        .actionData(actionLink)
135
-                        .isEnableDirectUrl(directUrl)
136
-                        .build()
137
-        );
138
-
139
-        // add attributes to the specified model
140
-        // add file model with the default parameters to the original model
141
-        model.addAttribute("model", fileModel);
142
-
143
-        // get file history and add it to the model
144
-        model.addAttribute("fileHistory", historyManager.getHistory(fileModel.getDocument()));
145
-
146
-        // create the document service api URL and add it to the model
147
-        model.addAttribute("docserviceApiUrl", docserviceSite + docserviceApiUrl);
148
-
149
-        // get an image and add it to the model
150
-        model.addAttribute("dataInsertImage",  getInsertImage(directUrl));
151
-
152
-        // get a document for comparison and add it to the model
153
-        model.addAttribute("dataCompareFile",  getCompareFile(directUrl));
154
-
155
-        // get recipients data for mail merging and add it to the model
156
-        model.addAttribute("dataMailMergeRecipients", getMailMerge(directUrl));
157
-
158
-        // get user data for mentions and add it to the model
159
-        model.addAttribute("usersForMentions", getUserMentions(uid));
160
-        return "editor.html";
161
-    }
162
-
163
-    private List<Mentions> getUserMentions(final String uid) {  // get user data for mentions
164
-        List<Mentions> usersForMentions = new ArrayList<>();
165
-        if (uid != null && !uid.equals("4")) {
166
-            List<User> list = userService.findAll();
167
-            for (User u : list) {
168
-                if (u.getId() != Integer.parseInt(uid) && u.getId() != ANONYMOUS_USER_ID) {
169
-
170
-                    // user data includes user names and emails
171
-                    usersForMentions.add(new Mentions(u.getName(), u.getEmail()));
172
-                }
173
-            }
174
-        }
175
-
176
-        return usersForMentions;
177
-    }
178
-
179
-    @SneakyThrows
180
-    private String getInsertImage(final Boolean directUrl) {  // get an image that will be inserted into the document
181
-        Map<String, Object> dataInsertImage = new HashMap<>();
182
-        dataInsertImage.put("fileType", "png");
183
-        dataInsertImage.put("url", storagePathBuilder.getServerUrl(true) + "/css/img/logo.png");
184
-        if (directUrl) {
185
-            dataInsertImage.put("directUrl", storagePathBuilder
186
-                    .getServerUrl(false) + "/css/img/logo.png");
187
-        }
188
-
189
-        // check if the document token is enabled
190
-        if (jwtManager.tokenEnabled()) {
191
-
192
-            // create token from the dataInsertImage object
193
-            dataInsertImage.put("token", jwtManager.createToken(dataInsertImage));
194
-        }
195
-
196
-        return objectMapper.writeValueAsString(dataInsertImage)
197
-                .substring(1, objectMapper.writeValueAsString(dataInsertImage).length() - 1);
198
-    }
199
-
200
-    // get a document that will be compared with the current document
201
-    @SneakyThrows
202
-    private String getCompareFile(final Boolean directUrl) {
203
-        Map<String, Object> dataCompareFile = new HashMap<>();
204
-        dataCompareFile.put("fileType", "docx");
205
-        dataCompareFile.put("url", storagePathBuilder.getServerUrl(true) + "/assets?name=sample.docx");
206
-        if (directUrl) {
207
-            dataCompareFile.put("directUrl", storagePathBuilder
208
-                    .getServerUrl(false) + "/assets?name=sample.docx");
209
-        }
210
-
211
-        // check if the document token is enabled
212
-        if (jwtManager.tokenEnabled()) {
213
-
214
-            // create token from the dataCompareFile object
215
-            dataCompareFile.put("token", jwtManager.createToken(dataCompareFile));
216
-        }
217
-
218
-        return objectMapper.writeValueAsString(dataCompareFile);
219
-    }
220
-
221
-    @SneakyThrows
222
-    private String getMailMerge(final Boolean directUrl) {
223
-        Map<String, Object> dataMailMergeRecipients = new HashMap<>();  // get recipients data for mail merging
224
-        dataMailMergeRecipients.put("fileType", "csv");
225
-        dataMailMergeRecipients.put("url", storagePathBuilder.getServerUrl(true) + "/csv");
226
-        if (directUrl) {
227
-            dataMailMergeRecipients.put("directUrl", storagePathBuilder.getServerUrl(false) + "/csv");
228
-        }
229
-
230
-        // check if the document token is enabled
231
-        if (jwtManager.tokenEnabled()) {
232
-
233
-            // create token from the dataMailMergeRecipients object
234
-            dataMailMergeRecipients.put("token", jwtManager.createToken(dataMailMergeRecipients));
235
-        }
236
-
237
-        return objectMapper.writeValueAsString(dataMailMergeRecipients);
238
-    }
239
-}

+ 0
- 624
src/main/java/com/onlyoffice/integration/controllers/FileController.java Просмотреть файл

@@ -1,624 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.controllers;
20
-
21
-import com.fasterxml.jackson.databind.ObjectMapper;
22
-import com.google.gson.Gson;
23
-import com.google.gson.GsonBuilder;
24
-import com.onlyoffice.integration.documentserver.callbacks.CallbackHandler;
25
-import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
26
-import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
27
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
28
-import com.onlyoffice.integration.dto.Converter;
29
-import com.onlyoffice.integration.dto.ConvertedData;
30
-import com.onlyoffice.integration.dto.Track;
31
-import com.onlyoffice.integration.entities.User;
32
-import com.onlyoffice.integration.documentserver.models.enums.DocumentType;
33
-import com.onlyoffice.integration.services.UserServices;
34
-import com.onlyoffice.integration.documentserver.util.file.FileUtility;
35
-import com.onlyoffice.integration.documentserver.util.service.ServiceConverter;
36
-import com.onlyoffice.integration.documentserver.managers.document.DocumentManager;
37
-import com.onlyoffice.integration.documentserver.managers.callback.CallbackManager;
38
-
39
-import org.json.simple.JSONArray;
40
-import org.json.simple.JSONObject;
41
-import org.json.simple.parser.JSONParser;
42
-import org.springframework.beans.factory.annotation.Autowired;
43
-import org.springframework.beans.factory.annotation.Value;
44
-import org.springframework.core.io.Resource;
45
-import org.springframework.http.HttpHeaders;
46
-import org.springframework.http.MediaType;
47
-import org.springframework.http.ResponseEntity;
48
-import org.springframework.stereotype.Controller;
49
-import org.springframework.ui.Model;
50
-import org.springframework.web.bind.annotation.CookieValue;
51
-import org.springframework.web.bind.annotation.CrossOrigin;
52
-import org.springframework.web.bind.annotation.GetMapping;
53
-import org.springframework.web.bind.annotation.PostMapping;
54
-import org.springframework.web.bind.annotation.PutMapping;
55
-import org.springframework.web.bind.annotation.RequestBody;
56
-import org.springframework.web.bind.annotation.RequestParam;
57
-import org.springframework.web.bind.annotation.ResponseBody;
58
-import org.springframework.web.multipart.MultipartFile;
59
-
60
-import javax.servlet.http.HttpServletRequest;
61
-import java.io.File;
62
-import java.io.FileInputStream;
63
-import java.io.FileWriter;
64
-import java.io.IOException;
65
-import java.io.InputStream;
66
-import java.net.InetAddress;
67
-import java.net.URL;
68
-import java.net.URLEncoder;
69
-import java.nio.charset.StandardCharsets;
70
-import java.nio.file.Files;
71
-import java.nio.file.Path;
72
-import java.nio.file.Paths;
73
-import java.text.SimpleDateFormat;
74
-import java.util.ArrayList;
75
-import java.util.Date;
76
-import java.util.HashMap;
77
-import java.util.LinkedHashMap;
78
-import java.util.Map;
79
-import java.util.Optional;
80
-
81
-@CrossOrigin("*")
82
-@Controller
83
-public class FileController {
84
-
85
-    @Value("${files.docservice.header}")
86
-    private String documentJwtHeader;
87
-
88
-    @Value("${filesize-max}")
89
-    private String filesizeMax;
90
-
91
-    @Value("${files.docservice.url.site}")
92
-    private String docserviceUrlSite;
93
-
94
-    @Value("${files.docservice.url.command}")
95
-    private String docserviceUrlCommand;
96
-
97
-    @Autowired
98
-    private FileUtility fileUtility;
99
-    @Autowired
100
-    private DocumentManager documentManager;
101
-    @Autowired
102
-    private JwtManager jwtManager;
103
-    @Autowired
104
-    private FileStorageMutator storageMutator;
105
-    @Autowired
106
-    private FileStoragePathBuilder storagePathBuilder;
107
-    @Autowired
108
-    private UserServices userService;
109
-    @Autowired
110
-    private CallbackHandler callbackHandler;
111
-    @Autowired
112
-    private ObjectMapper objectMapper;
113
-    @Autowired
114
-    private ServiceConverter serviceConverter;
115
-    @Autowired
116
-    private CallbackManager callbackManager;
117
-
118
-    // create user metadata
119
-    private String createUserMetadata(final String uid, final String fullFileName) {
120
-        Optional<User> optionalUser = userService.findUserById(Integer.parseInt(uid));  // find a user by their ID
121
-        String documentType = fileUtility.getDocumentType(fullFileName).toString().toLowerCase();  // get document type
122
-        if (optionalUser.isPresent()) {
123
-            User user = optionalUser.get();
124
-            storageMutator.createMeta(fullFileName,  // create meta information with the user ID and name specified
125
-                    String.valueOf(user.getId()), user.getName());
126
-        }
127
-        return "{ \"filename\": \"" + fullFileName + "\", \"documentType\": \"" + documentType + "\" }";
128
-    }
129
-
130
-    // download data from the specified file
131
-    private ResponseEntity<Resource> downloadFile(final String fileName) {
132
-        Resource resource = storageMutator.loadFileAsResource(fileName);  // load the specified file as a resource
133
-        String contentType = "application/octet-stream";
134
-
135
-        // create a response with the content type, header and body with the file data
136
-        return ResponseEntity.ok()
137
-                .contentType(MediaType.parseMediaType(contentType))
138
-                .header(HttpHeaders.CONTENT_DISPOSITION,
139
-                        "attachment; filename=\"" + resource.getFilename() + "\"")
140
-                .body(resource);
141
-    }
142
-
143
-    // download data from the specified history file
144
-    private ResponseEntity<Resource> downloadFileHistory(final String fileName,
145
-                                                         final String version,
146
-                                                         final String file) {
147
-
148
-        // load the specified file as a resource
149
-        Resource resource = storageMutator.loadFileAsResourceHistory(fileName, version, file);
150
-        String contentType = "application/octet-stream";
151
-
152
-        // create a response with the content type, header and body with the file data
153
-        return ResponseEntity.ok()
154
-                .contentType(MediaType.parseMediaType(contentType))
155
-                .header(HttpHeaders.CONTENT_DISPOSITION,
156
-                        "attachment; filename=\"" + resource.getFilename() + "\"")
157
-                .body(resource);
158
-    }
159
-
160
-    @PostMapping("/upload")
161
-    @ResponseBody
162
-    public String upload(@RequestParam("file") final MultipartFile file,  // upload a file
163
-                             @CookieValue("uid") final String uid) {
164
-        try {
165
-            String fullFileName = file.getOriginalFilename();  // get file name
166
-            String fileExtension = fileUtility.getFileExtension(fullFileName);  // get file extension
167
-            long fileSize = file.getSize();  // get file size
168
-            byte[] bytes = file.getBytes();  // get file in bytes
169
-
170
-            // check if the file size exceeds the maximum file size or is less than 0
171
-            if (fileUtility.getMaxFileSize() < fileSize || fileSize <= 0) {
172
-                return "{ \"error\": \"File size is incorrect\"}";  // if so, write an error message to the response
173
-            }
174
-
175
-            // check if file extension is supported by the editor
176
-            if (!fileUtility.getFileExts().contains(fileExtension)) {
177
-
178
-                // if not, write an error message to the response
179
-                return "{ \"error\": \"File type is not supported\"}";
180
-            }
181
-
182
-            String fileNamePath = storageMutator.updateFile(fullFileName, bytes);  // update a file
183
-            if (fileNamePath.isBlank()) {
184
-                throw new IOException("Could not update a file");  // if the file cannot be updated, an error occurs
185
-            }
186
-
187
-            fullFileName = fileUtility.getFileNameWithoutExtension(fileNamePath) + fileExtension;  // get full file name
188
-
189
-            return createUserMetadata(uid, fullFileName);  // create user metadata and return it
190
-        } catch (Exception e) {
191
-            e.printStackTrace();
192
-        }
193
-
194
-        // if the operation of file uploading is unsuccessful, an error occurs
195
-        return "{ \"error\": \"Something went wrong when uploading the file.\"}";
196
-    }
197
-
198
-    @PostMapping(path = "${url.converter}")
199
-    @ResponseBody
200
-    public String convert(@RequestBody final Converter body,  // convert a file
201
-                          @CookieValue("uid") final String uid, @CookieValue("ulang") final String lang) {
202
-        // get file name
203
-        String fileName = body.getFileName();
204
-
205
-        // get URL for downloading a file with the specified name
206
-        String fileUri = documentManager.getDownloadUrl(fileName, true);
207
-
208
-        // get file password if it exists
209
-        String filePass = body.getFilePass() != null ? body.getFilePass() : null;
210
-
211
-        // get file extension
212
-        String fileExt = fileUtility.getFileExtension(fileName);
213
-
214
-        // get document type (word, cell or slide)
215
-        DocumentType type = fileUtility.getDocumentType(fileName);
216
-
217
-        // convert to .ooxml
218
-        String internalFileExt = "ooxml";
219
-
220
-        try {
221
-            // check if the file with such an extension can be converted
222
-            if (fileUtility.getConvertExts().contains(fileExt)) {
223
-                String key = serviceConverter.generateRevisionId(fileUri);  // generate document key
224
-                ConvertedData response = serviceConverter  // get the URL to the converted file
225
-                        .getConvertedData(fileUri, fileExt, internalFileExt, key, filePass, true, lang);
226
-
227
-                String newFileUri = response.getUri();
228
-                String newFileType = "." + response.getFileType();
229
-
230
-                if (newFileUri.isEmpty()) {
231
-                    return "{ \"step\" : \"0\", \"filename\" : \"" + fileName + "\"}";
232
-                }
233
-
234
-                /* get a file name of an internal file extension with an index if the file
235
-                 with such a name already exists */
236
-                String nameWithInternalExt = fileUtility.getFileNameWithoutExtension(fileName) + newFileType;
237
-                String correctedName = documentManager.getCorrectName(nameWithInternalExt);
238
-
239
-                URL url = new URL(newFileUri);
240
-                java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
241
-                InputStream stream = connection.getInputStream();  // get input stream of the converted file
242
-
243
-                if (stream == null) {
244
-                    connection.disconnect();
245
-                    throw new RuntimeException("Input stream is null");
246
-                }
247
-
248
-                // remove source file
249
-                storageMutator.deleteFile(fileName);
250
-
251
-                // create the converted file with input stream
252
-                storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(correctedName)), stream);
253
-                fileName = correctedName;
254
-            }
255
-
256
-            // create meta information about the converted file with the user ID and name specified
257
-            return createUserMetadata(uid, fileName);
258
-        } catch (Exception e) {
259
-            e.printStackTrace();
260
-        }
261
-        // if the operation of file converting is unsuccessful, an error occurs
262
-        return "{ \"error\": \"" + "The file can't be converted.\"}";
263
-    }
264
-
265
-    @PostMapping("/delete")
266
-    @ResponseBody
267
-    public String delete(@RequestBody final Converter body) {  // delete a file
268
-        try {
269
-            String fullFileName = fileUtility.getFileName(body.getFileName());  // get full file name
270
-
271
-            // delete a file from the storage and return the status of this operation (true or false)
272
-            boolean fileSuccess = storageMutator.deleteFile(fullFileName);
273
-
274
-            // delete file history and return the status of this operation (true or false)
275
-            boolean historySuccess = storageMutator.deleteFileHistory(fullFileName);
276
-
277
-            return "{ \"success\": \"" + (fileSuccess && historySuccess) + "\"}";
278
-        } catch (Exception e) {
279
-            // if the operation of file deleting is unsuccessful, an error occurs
280
-            return "{ \"error\": \"" + e.getMessage() + "\"}";
281
-        }
282
-    }
283
-
284
-    @GetMapping("/downloadhistory")
285
-    public ResponseEntity<Resource> downloadHistory(final HttpServletRequest request, // download a file
286
-                                             @RequestParam("fileName") final String fileName,
287
-                                             @RequestParam("ver") final String version,
288
-                                             @RequestParam("file") final String file) { // history file
289
-        try {
290
-            // check if a token is enabled or not
291
-            if (jwtManager.tokenEnabled() && jwtManager.tokenUseForRequest()) {
292
-                String header = request.getHeader(documentJwtHeader == null  // get the document JWT header
293
-                        || documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
294
-                if (header != null && !header.isEmpty()) {
295
-                    String token = header
296
-                            .replace("Bearer ", "");  // token is the header without the Bearer prefix
297
-                    jwtManager.readToken(token);  // read the token
298
-                } else {
299
-                    return null;
300
-                }
301
-            }
302
-            return downloadFileHistory(fileName, version, file);  // download data from the specified file
303
-        } catch (Exception e) {
304
-            return null;
305
-        }
306
-    }
307
-
308
-    @GetMapping(path = "${url.download}")
309
-    public ResponseEntity<Resource> download(final HttpServletRequest request,  // download a file
310
-                                             @RequestParam("fileName") final String fileName,
311
-                                             @RequestParam(value = "userAddress", required = false)
312
-                                                 final String userAddress) {
313
-        try {
314
-            // check if a token is enabled or not
315
-            if (jwtManager.tokenEnabled() && userAddress != null && jwtManager.tokenUseForRequest()) {
316
-                String header = request.getHeader(documentJwtHeader == null // get the document JWT header
317
-                        || documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
318
-                if (header != null && !header.isEmpty()) {
319
-                    String token = header
320
-                            .replace("Bearer ", "");  // token is the header without the Bearer prefix
321
-                    jwtManager.readToken(token);  // read the token
322
-                } else {
323
-                    return null;
324
-                }
325
-            }
326
-            return downloadFile(fileName);  // download data from the specified file
327
-        } catch (Exception e) {
328
-            return null;
329
-        }
330
-    }
331
-
332
-    @GetMapping("/create")
333
-    public String create(@RequestParam("fileExt")
334
-                             final String fileExt, // create a sample file of the specified extension
335
-                         @RequestParam(value = "sample", required = false) final Optional<Boolean> isSample,
336
-                         @CookieValue(value = "uid", required = false) final String uid,
337
-                         final Model model) {
338
-        // specify if the sample data exists or not
339
-        Boolean sampleData = (isSample.isPresent() && !isSample.isEmpty()) && isSample.get();
340
-        if (fileExt != null) {
341
-            try {
342
-                Optional<User> user = userService.findUserById(Integer.parseInt(uid));  // find a user by their ID
343
-                if (!user.isPresent()) {
344
-                    // if the user with the specified ID doesn't exist, an error occurs
345
-                    throw new RuntimeException("Could not fine any user with id = " + uid);
346
-                }
347
-                String fileName = documentManager.createDemo(fileExt,
348
-                        sampleData,
349
-                        uid,
350
-                        user.get().getName());  // create a demo document with the sample data
351
-                if (fileName.isBlank() || fileName == null) {
352
-                    throw new RuntimeException("You must have forgotten to add asset files");
353
-                }
354
-                return "redirect:editor?fileName=" + URLEncoder
355
-                        .encode(fileName, StandardCharsets.UTF_8);  // redirect the request
356
-            } catch (Exception ex) {
357
-                model.addAttribute("error", ex.getMessage());
358
-                return "error.html";
359
-            }
360
-        }
361
-        return "redirect:/";
362
-    }
363
-
364
-    @GetMapping("/assets")
365
-    public ResponseEntity<Resource> assets(@RequestParam("name")
366
-                                               final String name) {  // get sample files from the assests
367
-        String fileName = Path.of("assets", "document-templates", "sample", fileUtility.getFileName(name)).toString();
368
-        return downloadFile(fileName);
369
-    }
370
-
371
-    @GetMapping("/csv")
372
-    public ResponseEntity<Resource> csv() {  // download a csv file
373
-        String fileName = Path.of("assets", "document-templates", "sample", "csv.csv").toString();
374
-        return downloadFile(fileName);
375
-    }
376
-
377
-    @GetMapping("/files")
378
-    @ResponseBody
379
-    public ArrayList<Map<String, Object>> files(@RequestParam(value = "fileId", required = false)
380
-                                                    final String fileId) {  // get files information
381
-        return fileId == null ? documentManager.getFilesInfo() : documentManager.getFilesInfo(fileId);
382
-    }
383
-
384
-    @PostMapping(path = "${url.track}")
385
-    @ResponseBody
386
-    public String track(final HttpServletRequest request,  // track file changes
387
-                        @RequestParam("fileName") final String fileName,
388
-                        @RequestParam("userAddress") final String userAddress,
389
-                        @RequestBody final Track body) {
390
-        Track track;
391
-        try {
392
-            String bodyString = objectMapper
393
-                    .writeValueAsString(body);  // write the request body to the object mapper as a string
394
-            String header = request.getHeader(documentJwtHeader == null  // get the request header
395
-                    || documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
396
-
397
-            if (bodyString.isEmpty()) {  // if the request body is empty, an error occurs
398
-                throw new RuntimeException("{\"error\":1,\"message\":\"Request payload is empty\"}");
399
-            }
400
-
401
-            JSONObject bodyCheck = jwtManager.parseBody(bodyString, header);  // parse the request body
402
-            track = objectMapper.readValue(bodyCheck.toJSONString(), Track.class);  // read the request body
403
-        } catch (Exception e) {
404
-            e.printStackTrace();
405
-            return e.getMessage();
406
-        }
407
-
408
-        int error = callbackHandler.handle(track, fileName);
409
-
410
-        return "{\"error\":" + error + "}";
411
-    }
412
-
413
-    @PostMapping("/saveas")
414
-    @ResponseBody
415
-    public String saveAs(@RequestBody final JSONObject body, @CookieValue("uid") final String uid) {
416
-        String title = (String) body.get("title");
417
-        String saveAsFileUrl = (String) body.get("url");
418
-
419
-        try {
420
-            String fileName = documentManager.getCorrectName(title);
421
-            String curExt = fileUtility.getFileExtension(fileName);
422
-
423
-            if (!fileUtility.getFileExts().contains(curExt)) {
424
-                return "{\"error\":\"File type is not supported\"}";
425
-            }
426
-
427
-            URL url = new URL(saveAsFileUrl);
428
-            java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
429
-            InputStream stream = connection.getInputStream();
430
-
431
-            if (Integer.parseInt(filesizeMax) < stream.available() || stream.available() <= 0) {
432
-                return "{\"error\":\"File size is incorrect\"}";
433
-            }
434
-            storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(fileName)), stream);
435
-            createUserMetadata(uid, fileName);
436
-
437
-            return "{\"file\":  \"" + fileName + "\"}";
438
-        } catch (IOException e) {
439
-            e.printStackTrace();
440
-            return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
441
-        }
442
-    }
443
-
444
-    @PostMapping("/rename")
445
-    @ResponseBody
446
-    public String rename(@RequestBody final JSONObject body) {
447
-        String newfilename = (String) body.get("newfilename");
448
-        String dockey = (String) body.get("dockey");
449
-        String origExt = "." + (String) body.get("ext");
450
-        String curExt = newfilename;
451
-
452
-        if (newfilename.indexOf(".") != -1) {
453
-            curExt = (String) fileUtility.getFileExtension(newfilename);
454
-        }
455
-
456
-        if (origExt.compareTo(curExt) != 0) {
457
-            newfilename += origExt;
458
-        }
459
-
460
-        HashMap<String, String> meta = new HashMap<>();
461
-        meta.put("title", newfilename);
462
-
463
-        try {
464
-            callbackManager.commandRequest("meta", dockey, meta);
465
-            return "result ok";
466
-        } catch (Exception e) {
467
-            e.printStackTrace();
468
-            return e.getMessage();
469
-        }
470
-    }
471
-
472
-    @PostMapping("/reference")
473
-    @ResponseBody
474
-    public String reference(@RequestBody final JSONObject body) {
475
-        try {
476
-            JSONParser parser = new JSONParser();
477
-            Gson gson = new GsonBuilder().disableHtmlEscaping().create();
478
-
479
-            String userAddress = "";
480
-            String fileName = "";
481
-
482
-            if (body.containsKey("referenceData")) {
483
-                LinkedHashMap referenceDataObj = (LinkedHashMap) body.get("referenceData");
484
-                String instanceId = (String) referenceDataObj.get("instanceId");
485
-
486
-                if (instanceId.equals(storagePathBuilder.getServerUrl(false))) {
487
-                    JSONObject fileKey = (JSONObject) parser.parse((String) referenceDataObj.get("fileKey"));
488
-                    userAddress = (String) fileKey.get("userAddress");
489
-                    if (userAddress.equals(InetAddress.getLocalHost().getHostAddress())) {
490
-                        fileName = (String) fileKey.get("fileName");
491
-                    }
492
-                }
493
-            }
494
-
495
-
496
-            if (fileName.equals("")) {
497
-                try {
498
-                    String path = (String) body.get("path");
499
-                    path = fileUtility.getFileName(path);
500
-                    File f = new File(storagePathBuilder.getFileLocation(path));
501
-                    if (f.exists()) {
502
-                        fileName = path;
503
-                    }
504
-                } catch (Exception e) {
505
-                    return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
506
-                }
507
-            }
508
-
509
-            if (fileName.equals("")) {
510
-                return "{ \"error\": \"File not found\"}";
511
-            }
512
-
513
-            boolean directUrl = (boolean) body.get("directUrl");
514
-
515
-            HashMap<String, Object> fileKey = new HashMap<>();
516
-            fileKey.put("fileName", fileName);
517
-            fileKey.put("userAddress", InetAddress.getLocalHost().getHostAddress());
518
-
519
-            HashMap<String, Object> referenceData = new HashMap<>();
520
-            referenceData.put("instanceId", storagePathBuilder.getServerUrl(true));
521
-            referenceData.put("fileKey", gson.toJson(fileKey));
522
-
523
-            HashMap<String, Object> data = new HashMap<>();
524
-            data.put("fileType", fileUtility.getFileExtension(fileName).replace(".", ""));
525
-            data.put("url", documentManager.getDownloadUrl(fileName, true));
526
-            data.put("directUrl", directUrl ? documentManager.getDownloadUrl(fileName, false) : null);
527
-            data.put("referenceData", referenceData);
528
-            data.put("path", fileName);
529
-
530
-            if (jwtManager.tokenEnabled()) {
531
-                String token = jwtManager.createToken(data);
532
-                data.put("token", token);
533
-            }
534
-            return gson.toJson(data);
535
-        } catch (Exception e) {
536
-            e.printStackTrace();
537
-            return "{ \"error\" : 1, \"message\" : \"" + e.getMessage() + "\"}";
538
-        }
539
-    }
540
-
541
-    @PutMapping("/restore")
542
-    @ResponseBody
543
-    public String restore(@RequestBody final JSONObject body) {
544
-        try {
545
-            String sourceBasename = (String) body.get("fileName");
546
-            Integer version = (Integer) body.get("version");
547
-            String userID = (String) body.get("userId");
548
-
549
-            String sourceStringFile = storagePathBuilder.getFileLocation(sourceBasename);
550
-            File sourceFile = new File(sourceStringFile);
551
-            Path sourcePathFile = sourceFile.toPath();
552
-            String historyDirectory = storagePathBuilder.getHistoryDir(sourcePathFile.toString());
553
-
554
-            Integer bumpedVersion = storagePathBuilder.getFileVersion(historyDirectory, false);
555
-            String bumpedVersionStringDirectory = documentManager.versionDir(historyDirectory, bumpedVersion, true);
556
-            File bumpedVersionDirectory = new File(bumpedVersionStringDirectory);
557
-            if (!bumpedVersionDirectory.exists()) {
558
-                bumpedVersionDirectory.mkdir();
559
-            }
560
-
561
-            Path bumpedKeyPathFile = Paths.get(bumpedVersionStringDirectory, "key.txt");
562
-            String bumpedKeyStringFile = bumpedKeyPathFile.toString();
563
-            File bumpedKeyFile = new File(bumpedKeyStringFile);
564
-            String bumpedKey = serviceConverter.generateRevisionId(
565
-                storagePathBuilder.getStorageLocation()
566
-                + "/"
567
-                + sourceBasename
568
-                + "/"
569
-                + Long.toString(sourceFile.lastModified())
570
-            );
571
-            FileWriter bumpedKeyFileWriter = new FileWriter(bumpedKeyFile);
572
-            bumpedKeyFileWriter.write(bumpedKey);
573
-            bumpedKeyFileWriter.close();
574
-
575
-            Integer userInnerID = Integer.parseInt(userID.replace("uid-", ""));
576
-            User user = userService.findUserById(userInnerID).get();
577
-
578
-            Path bumpedChangesPathFile = Paths.get(bumpedVersionStringDirectory, "changes.json");
579
-            String bumpedChangesStringFile = bumpedChangesPathFile.toString();
580
-            File bumpedChangesFile = new File(bumpedChangesStringFile);
581
-            JSONObject bumpedChangesUser = new JSONObject();
582
-            // Don't add the `uid-` prefix.
583
-            // https://github.com/ONLYOFFICE/document-server-integration/issues/437#issuecomment-1663526562
584
-            bumpedChangesUser.put("id", user.getId());
585
-            bumpedChangesUser.put("name", user.getName());
586
-            JSONObject bumpedChangesChangesItem = new JSONObject();
587
-            bumpedChangesChangesItem.put("created", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
588
-            bumpedChangesChangesItem.put("user", bumpedChangesUser);
589
-            JSONArray bumpedChangesChanges = new JSONArray();
590
-            bumpedChangesChanges.add(bumpedChangesChangesItem);
591
-            JSONObject bumpedChanges = new JSONObject();
592
-            bumpedChanges.put("serverVersion", null);
593
-            bumpedChanges.put("changes", bumpedChangesChanges);
594
-            String bumpedChangesContent = bumpedChanges.toJSONString();
595
-            FileWriter bumpedChangesFileWriter = new FileWriter(bumpedChangesFile);
596
-            bumpedChangesFileWriter.write(bumpedChangesContent);
597
-            bumpedChangesFileWriter.close();
598
-
599
-            String sourceExtension = fileUtility.getFileExtension(sourceBasename);
600
-            String previousBasename = "prev" + sourceExtension;
601
-
602
-            Path bumpedFile = Paths.get(bumpedVersionStringDirectory, previousBasename);
603
-            Files.move(sourcePathFile, bumpedFile);
604
-
605
-            String recoveryVersionStringDirectory = documentManager.versionDir(historyDirectory, version, true);
606
-            Path recoveryPathFile = Paths.get(recoveryVersionStringDirectory, previousBasename);
607
-            String recoveryStringFile = recoveryPathFile.toString();
608
-            FileInputStream recoveryStream = new FileInputStream(recoveryStringFile);
609
-            storageMutator.createFile(sourcePathFile, recoveryStream);
610
-            recoveryStream.close();
611
-
612
-            JSONObject responseBody = new JSONObject();
613
-            responseBody.put("error", null);
614
-            responseBody.put("success", true);
615
-            return responseBody.toJSONString();
616
-        } catch (Exception error) {
617
-            error.printStackTrace();
618
-            JSONObject responseBody = new JSONObject();
619
-            responseBody.put("error", error.getMessage());
620
-            responseBody.put("success", false);
621
-            return responseBody.toJSONString();
622
-        }
623
-    }
624
-}

+ 0
- 147
src/main/java/com/onlyoffice/integration/controllers/IndexController.java Просмотреть файл

@@ -1,147 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.controllers;
20
-
21
-import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
22
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
23
-import com.onlyoffice.integration.documentserver.util.Misc;
24
-import com.onlyoffice.integration.documentserver.util.file.FileUtility;
25
-import com.onlyoffice.integration.entities.User;
26
-import com.onlyoffice.integration.services.UserServices;
27
-import org.springframework.beans.factory.annotation.Autowired;
28
-import org.springframework.beans.factory.annotation.Value;
29
-import org.springframework.stereotype.Controller;
30
-import org.springframework.ui.Model;
31
-import org.springframework.web.bind.annotation.CrossOrigin;
32
-import org.springframework.web.bind.annotation.GetMapping;
33
-import org.springframework.web.bind.annotation.PostMapping;
34
-import org.springframework.web.bind.annotation.RequestParam;
35
-import org.springframework.web.bind.annotation.ResponseBody;
36
-
37
-import java.util.ArrayList;
38
-import java.util.Arrays;
39
-import java.util.HashMap;
40
-import java.util.LinkedHashMap;
41
-import java.util.List;
42
-import java.util.Map;
43
-import java.util.stream.Collectors;
44
-
45
-@CrossOrigin("*")
46
-@Controller
47
-public class IndexController {
48
-
49
-    @Autowired
50
-    private FileStorageMutator storageMutator;
51
-
52
-    @Autowired
53
-    private FileStoragePathBuilder storagePathBuilder;
54
-
55
-    @Autowired
56
-    private FileUtility fileUtility;
57
-
58
-    @Autowired
59
-    private Misc mistUtility;
60
-
61
-    @Autowired
62
-    private UserServices userService;
63
-
64
-    @Value("${files.docservice.url.site}")
65
-    private String docserviceSite;
66
-
67
-    @Value("${files.docservice.url.preloader}")
68
-    private String docservicePreloader;
69
-
70
-    @Value("${url.converter}")
71
-    private String urlConverter;
72
-
73
-    @Value("${url.editor}")
74
-    private String urlEditor;
75
-
76
-    @Value("${files.docservice.languages}")
77
-    private String langs;
78
-
79
-    @GetMapping("${url.index}")
80
-    public String index(@RequestParam(value = "directUrl", required = false) final Boolean directUrl,
81
-                        final Model model) {
82
-        java.io.File[] files = storageMutator.getStoredFiles();  // get all the stored files from the storage
83
-        List<String> docTypes = new ArrayList<>();
84
-        List<Boolean> filesEditable = new ArrayList<>();
85
-        List<String> versions = new ArrayList<>();
86
-        List<Boolean> isFillFormDoc = new ArrayList<>();
87
-        List<String> langsAndKeys = Arrays.asList(langs.split("\\|"));
88
-
89
-        Map<String, String> languages = new LinkedHashMap<>();
90
-
91
-        langsAndKeys.forEach((str) -> {
92
-            String[] couple = str.split(":");
93
-            languages.put(couple[0], couple[1]);
94
-        });
95
-
96
-        List<User> users = userService.findAll();  // get a list of all the users
97
-
98
-        String tooltip = users.stream()  // get the tooltip with the user descriptions
99
-                .map(user -> mistUtility.convertUserDescriptions(user.getName(),
100
-                        user.getDescriptions()))  // convert user descriptions to the specified format
101
-                .collect(Collectors.joining());
102
-
103
-        for (java.io.File file:files) {  // run through all the files
104
-            String fileName = file.getName();  // get file name
105
-            docTypes.add(fileUtility
106
-                    .getDocumentType(fileName)
107
-                    .toString()
108
-                    .toLowerCase());  // add a document type of each file to the list
109
-            filesEditable.add(fileUtility.getEditedExts()
110
-                    .contains(fileUtility.getFileExtension(fileName)));  // specify if a file is editable or not
111
-            versions.add(" [" + storagePathBuilder.
112
-                    getFileVersion(fileName, true) + "]");  // add a file version to the list
113
-            isFillFormDoc.add(fileUtility.getFillExts().contains(fileUtility.getFileExtension(fileName)));
114
-        }
115
-
116
-        // add all the parameters to the model
117
-        model.addAttribute("isFillFormDoc", isFillFormDoc);
118
-        model.addAttribute("versions", versions);
119
-        model.addAttribute("files", files);
120
-        model.addAttribute("docTypes", docTypes);
121
-        model.addAttribute("filesEditable", filesEditable);
122
-        model.addAttribute("datadocs", docserviceSite + docservicePreloader);
123
-        model.addAttribute("tooltip", tooltip);
124
-        model.addAttribute("users", users);
125
-        model.addAttribute("languages", languages);
126
-        model.addAttribute("directUrl", directUrl);
127
-
128
-        return "index.html";
129
-    }
130
-
131
-    @PostMapping("/config")
132
-    @ResponseBody
133
-    public HashMap<String, String> configParameters() {  // get configuration parameters
134
-        HashMap<String, String> configuration = new HashMap<>();
135
-
136
-        configuration.put("FillExtList", String.join(",", fileUtility
137
-                .getFillExts()));  // put a list of the extensions that can be filled to config
138
-        configuration.put("ConverExtList", String.join(",", fileUtility
139
-                .getConvertExts()));  // put a list of the extensions that can be converted to config
140
-        configuration.put("EditedExtList", String.join(",", fileUtility
141
-                .getEditedExts()));  // put a list of the extensions that can be edited to config
142
-        configuration.put("UrlConverter", urlConverter);
143
-        configuration.put("UrlEditor", urlEditor);
144
-
145
-        return configuration;
146
-    }
147
-}

+ 0
- 32
src/main/java/com/onlyoffice/integration/documentserver/callbacks/Callback.java Просмотреть файл

@@ -1,32 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.callbacks;
20
-
21
-import com.onlyoffice.integration.dto.Track;
22
-import org.springframework.beans.factory.annotation.Autowired;
23
-
24
-// specify the callback handler functions
25
-public interface Callback {
26
-    int handle(Track body, String fileName);  // handle the callback
27
-    int getStatus();  // get document status
28
-    @Autowired
29
-    default void selfRegistration(CallbackHandler callbackHandler) {  // register a callback handler
30
-        callbackHandler.register(getStatus(), this);
31
-    }
32
-}

+ 0
- 50
src/main/java/com/onlyoffice/integration/documentserver/callbacks/CallbackHandler.java Просмотреть файл

@@ -1,50 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.callbacks;
20
-
21
-import com.onlyoffice.integration.dto.Track;
22
-import org.slf4j.Logger;
23
-import org.slf4j.LoggerFactory;
24
-import org.springframework.stereotype.Service;
25
-
26
-import java.util.HashMap;
27
-import java.util.Map;
28
-
29
-@Service
30
-public class CallbackHandler {
31
-
32
-    private Logger logger = LoggerFactory.getLogger(CallbackHandler.class);
33
-
34
-    private Map<Integer, Callback> callbackHandlers = new HashMap<>();
35
-
36
-    public void register(final int code, final Callback callback) {  // register a callback handler
37
-        callbackHandlers.put(code, callback);
38
-    }
39
-
40
-    public int handle(final Track body, final String fileName) {  // handle a callback
41
-        Callback callback = callbackHandlers.get(body.getStatus());
42
-        if (callback == null) {
43
-            logger.warn("Callback status " + body.getStatus() + " is not supported yet");
44
-           return 0;
45
-        }
46
-
47
-        int result = callback.handle(body, fileName);
48
-        return result;
49
-    }
50
-}

+ 0
- 35
src/main/java/com/onlyoffice/integration/documentserver/callbacks/Status.java Просмотреть файл

@@ -1,35 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.callbacks;
20
-
21
-// document status
22
-public enum Status {
23
-    EDITING(1),  // 1 - document is being edited
24
-    SAVE(2),  // 2 - document is ready for saving
25
-    CORRUPTED(3),  // 3 - document saving error has occurred
26
-    MUST_FORCE_SAVE(6),  // 6 - document is being edited, but the current document state is saved
27
-    CORRUPTED_FORCE_SAVE(7);  // 7 - error has occurred while force saving the document
28
-    private int code;
29
-    Status(final int codeParam) {
30
-        this.code = codeParam;
31
-    }
32
-    public int getCode() {  // get document status
33
-        return this.code;
34
-    }
35
-}

+ 0
- 59
src/main/java/com/onlyoffice/integration/documentserver/callbacks/implementations/EditCallback.java Просмотреть файл

@@ -1,59 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.callbacks.implementations;
20
-
21
-import com.onlyoffice.integration.documentserver.callbacks.Callback;
22
-import com.onlyoffice.integration.documentserver.callbacks.Status;
23
-import com.onlyoffice.integration.documentserver.managers.callback.CallbackManager;
24
-import com.onlyoffice.integration.dto.Action;
25
-import com.onlyoffice.integration.dto.Track;
26
-import org.springframework.beans.factory.annotation.Autowired;
27
-import org.springframework.stereotype.Component;
28
-
29
-@Component
30
-public class EditCallback implements Callback {
31
-    @Autowired
32
-    private CallbackManager callbackManager;
33
-    @Override
34
-    public int handle(final Track body,
35
-                      final String fileName) {  // handle the callback when the document is being edited
36
-        int result = 0;
37
-        Action action =  body.getActions().get(0);  // get the user ID who is editing the document
38
-        if (action.getType().equals(com.onlyoffice.integration.documentserver.models.enums
39
-                .Action.edit)) {  // if this value is not equal to the user ID
40
-            String user =  action.getUserid();  // get user ID
41
-            if (!body.getUsers().contains(user)) {  // if this user is not specified in the body
42
-                String key = body.getKey();  // get document key
43
-                try {
44
-                    // create a command request to forcibly save the document being edited without closing it
45
-                    callbackManager.commandRequest("forcesave", key, null);
46
-                } catch (Exception e) {
47
-                    e.printStackTrace();
48
-                    result = 1;
49
-                }
50
-            }
51
-        }
52
-        return result;
53
-    }
54
-
55
-    @Override
56
-    public int getStatus() {  // get document status
57
-        return Status.EDITING.getCode();  // return status 1 - document is being edited
58
-    }
59
-}

+ 0
- 50
src/main/java/com/onlyoffice/integration/documentserver/callbacks/implementations/ForcesaveCallback.java Просмотреть файл

@@ -1,50 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.callbacks.implementations;
20
-
21
-import com.onlyoffice.integration.documentserver.callbacks.Callback;
22
-import com.onlyoffice.integration.documentserver.callbacks.Status;
23
-import com.onlyoffice.integration.documentserver.managers.callback.CallbackManager;
24
-import com.onlyoffice.integration.dto.Track;
25
-import org.springframework.beans.factory.annotation.Autowired;
26
-import org.springframework.stereotype.Component;
27
-
28
-@Component
29
-public class ForcesaveCallback implements Callback {
30
-    @Autowired
31
-    private CallbackManager callbackManager;
32
-    @Override
33
-    public int handle(final Track body,
34
-                      final String fileName) {  // handle the callback when the force saving request is performed
35
-        int result = 0;
36
-        try {
37
-            callbackManager.processForceSave(body, fileName);  // file force saving process
38
-        } catch (Exception ex) {
39
-            ex.printStackTrace();
40
-            result = 1;
41
-        }
42
-        return result;
43
-    }
44
-
45
-    @Override
46
-    public int getStatus() {  // get document status
47
-        // return status 6 - document is being edited, but the current document state is saved
48
-        return Status.MUST_FORCE_SAVE.getCode();
49
-    }
50
-}

+ 0
- 50
src/main/java/com/onlyoffice/integration/documentserver/callbacks/implementations/SaveCallback.java Просмотреть файл

@@ -1,50 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.callbacks.implementations;
20
-
21
-import com.onlyoffice.integration.documentserver.callbacks.Callback;
22
-import com.onlyoffice.integration.documentserver.callbacks.Status;
23
-import com.onlyoffice.integration.documentserver.managers.callback.CallbackManager;
24
-import com.onlyoffice.integration.dto.Track;
25
-import org.springframework.beans.factory.annotation.Autowired;
26
-import org.springframework.stereotype.Component;
27
-
28
-@Component
29
-public class SaveCallback implements Callback {
30
-    @Autowired
31
-    private CallbackManager callbackManager;
32
-    @Override
33
-    public int handle(final Track body,
34
-                      final String fileName) {  // handle the callback when the saving request is performed
35
-        int result = 0;
36
-        try {
37
-            callbackManager.processSave(body, fileName);  // file saving process
38
-        } catch (Exception ex) {
39
-            ex.printStackTrace();
40
-            result = 1;
41
-        }
42
-
43
-        return result;
44
-    }
45
-
46
-    @Override
47
-    public int getStatus() {  // get document status
48
-        return Status.SAVE.getCode();  // return status 2 - document is ready for saving
49
-    }
50
-}

+ 0
- 28
src/main/java/com/onlyoffice/integration/documentserver/managers/callback/CallbackManager.java Просмотреть файл

@@ -1,28 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.callback;
20
-
21
-import com.onlyoffice.integration.dto.Track;
22
-import java.util.HashMap;
23
-
24
-public interface CallbackManager {  // specify the callback manager functions
25
-    void processSave(Track body, String fileName);  // file saving process
26
-    void commandRequest(String method, String key, HashMap meta);  // create a command request
27
-    void processForceSave(Track body, String fileName);  // file force saving process
28
-}

+ 0
- 333
src/main/java/com/onlyoffice/integration/documentserver/managers/callback/DefaultCallbackManager.java Просмотреть файл

@@ -1,333 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.callback;
20
-
21
-import com.fasterxml.jackson.databind.ObjectMapper;
22
-import com.onlyoffice.integration.documentserver.managers.document.DocumentManager;
23
-import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
24
-import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
25
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
26
-import com.onlyoffice.integration.documentserver.util.file.FileUtility;
27
-import com.onlyoffice.integration.dto.Action;
28
-import com.onlyoffice.integration.documentserver.util.service.ServiceConverter;
29
-import com.onlyoffice.integration.dto.Track;
30
-import lombok.SneakyThrows;
31
-import org.json.simple.JSONObject;
32
-import org.springframework.beans.factory.annotation.Autowired;
33
-import org.springframework.beans.factory.annotation.Value;
34
-import org.springframework.context.annotation.Primary;
35
-import org.springframework.http.HttpStatus;
36
-import org.springframework.stereotype.Component;
37
-
38
-import java.io.ByteArrayInputStream;
39
-import java.io.File;
40
-import java.io.InputStream;
41
-import java.io.OutputStream;
42
-import java.net.URL;
43
-import java.nio.charset.StandardCharsets;
44
-import java.nio.file.Path;
45
-import java.nio.file.Paths;
46
-import java.util.HashMap;
47
-import java.util.List;
48
-import java.util.Map;
49
-
50
-import static com.onlyoffice.integration.documentserver.util.Constants.FILE_SAVE_TIMEOUT;
51
-
52
-// todo: Refactoring
53
-@Component
54
-@Primary
55
-public class DefaultCallbackManager implements CallbackManager {
56
-
57
-    @Value("${files.docservice.url.site}")
58
-    private String docserviceUrlSite;
59
-    @Value("${files.docservice.url.command}")
60
-    private String docserviceUrlCommand;
61
-    @Value("${files.docservice.header}")
62
-    private String documentJwtHeader;
63
-
64
-    @Autowired
65
-    private DocumentManager documentManager;
66
-    @Autowired
67
-    private JwtManager jwtManager;
68
-    @Autowired
69
-    private FileUtility fileUtility;
70
-    @Autowired
71
-    private FileStorageMutator storageMutator;
72
-    @Autowired
73
-    private FileStoragePathBuilder storagePathBuilder;
74
-    @Autowired
75
-    private ObjectMapper objectMapper;
76
-    @Autowired
77
-    private ServiceConverter serviceConverter;
78
-
79
-    // download file from url
80
-    @SneakyThrows
81
-    private byte[] getDownloadFile(final String url) {
82
-        if (url == null || url.isEmpty()) {
83
-            throw new RuntimeException("Url argument is not specified");  // URL isn't specified
84
-        }
85
-
86
-        URL uri = new URL(url);
87
-        java.net.HttpURLConnection connection = (java.net.HttpURLConnection) uri.openConnection();
88
-        connection.setConnectTimeout(FILE_SAVE_TIMEOUT);
89
-        InputStream stream = connection.getInputStream();  // get input stream of the file information from the URL
90
-
91
-        int statusCode = connection.getResponseCode();
92
-        if (statusCode != HttpStatus.OK.value()) {  // checking status code
93
-            connection.disconnect();
94
-            throw new RuntimeException("Document editing service returned status: " + statusCode);
95
-        }
96
-
97
-        if (stream == null) {
98
-            connection.disconnect();
99
-            throw new RuntimeException("Input stream is null");
100
-        }
101
-
102
-        return stream.readAllBytes();
103
-    }
104
-
105
-    // file saving
106
-    @SneakyThrows
107
-    private void saveFile(final byte[] byteArray, final Path path) {
108
-        if (path == null) {
109
-            throw new RuntimeException("Path argument is not specified");  // file isn't specified
110
-        }
111
-        // update a file or create a new one
112
-        storageMutator.createOrUpdateFile(path, new ByteArrayInputStream(byteArray));
113
-    }
114
-
115
-    @Override
116
-    @SneakyThrows
117
-    public void processSave(final Track body, final String fileName) {  // file saving process
118
-        String downloadUri = body.getUrl();
119
-        String changesUri = body.getChangesurl();
120
-        String key = body.getKey();
121
-        String newFileName = fileName;
122
-
123
-        String curExt = fileUtility.getFileExtension(fileName);  // get current file extension
124
-        String downloadExt = "." + body.getFiletype(); // get an extension of the downloaded file
125
-
126
-        // todo: Refactoring
127
-        // convert downloaded file to the file with the current extension if these extensions aren't equal
128
-        if (!curExt.equals(downloadExt)) {
129
-            try {
130
-                String newFileUri = serviceConverter
131
-                        .getConvertedData(downloadUri, downloadExt, curExt,
132
-                                serviceConverter.generateRevisionId(downloadUri), null, false,
133
-                                null).getUri();  // convert a file and get URL to a new file
134
-                if (newFileUri.isEmpty()) {
135
-                    newFileName = documentManager
136
-                            .getCorrectName(fileUtility.getFileNameWithoutExtension(fileName)
137
-                                    + downloadExt);  // get the correct file name if it already exists
138
-                } else {
139
-                    downloadUri = newFileUri;
140
-                }
141
-            } catch (Exception e) {
142
-                newFileName = documentManager
143
-                        .getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt);
144
-            }
145
-        }
146
-
147
-        byte[] byteArrayFile = getDownloadFile(downloadUri);  // download document file
148
-
149
-        String storagePath = storagePathBuilder.getFileLocation(newFileName);  // get the path to a new file
150
-        Path lastVersion = Paths.get(storagePathBuilder
151
-                .getFileLocation(fileName));  // get the path to the last file version
152
-
153
-        if (lastVersion.toFile().exists()) {  // if the last file version exists
154
-            Path histDir = Paths.get(storagePathBuilder.getHistoryDir(storagePath));  // get the history directory
155
-            storageMutator.createDirectory(histDir);  // and create it
156
-
157
-            String versionDir = documentManager
158
-                    .versionDir(histDir.toAbsolutePath().toString(),  // get the file version directory
159
-                    storagePathBuilder
160
-                            .getFileVersion(histDir.toAbsolutePath().toString(), false), true);
161
-
162
-            Path ver = Paths.get(versionDir);
163
-            Path toSave = Paths.get(storagePath);
164
-
165
-            storageMutator.createDirectory(ver);  // create the file version directory
166
-
167
-            lastVersion.toFile().renameTo(new File(versionDir + File.separator + "prev" + curExt));
168
-
169
-            saveFile(byteArrayFile, toSave); // save document file
170
-
171
-            byte[] byteArrayChanges = getDownloadFile(changesUri); // download file changes
172
-            saveFile(byteArrayChanges, Path
173
-                    .of(versionDir + File.separator + "diff.zip")); // save file changes to the diff.zip archive
174
-
175
-            JSONObject jsonChanges = new JSONObject();  // create a json object for document changes
176
-            jsonChanges.put("changes", body.getHistory().getChanges());  // put the changes to the json object
177
-            jsonChanges.put("serverVersion", body.getHistory()
178
-                    .getServerVersion());  // put the server version to the json object
179
-            String history = objectMapper.writeValueAsString(jsonChanges);
180
-
181
-            if (history == null && body.getHistory() != null) {
182
-                history = objectMapper.writeValueAsString(body.getHistory());
183
-            }
184
-
185
-            if (history != null && !history.isEmpty()) {
186
-                // write the history changes to the changes.json file
187
-                storageMutator.writeToFile(versionDir + File.separator + "changes.json", history);
188
-            }
189
-
190
-            // write the key value to the key.txt file
191
-            storageMutator.writeToFile(versionDir + File.separator + "key.txt", key);
192
-
193
-            // get the path to the forcesaved file version and remove it
194
-            storageMutator.deleteFile(storagePathBuilder.getForcesavePath(newFileName, false));
195
-        }
196
-    }
197
-
198
-    // todo: Replace (String method) with (Enum method)
199
-    @SneakyThrows
200
-    public void commandRequest(final String method,
201
-                               final String key,
202
-                               final HashMap meta) {  // create a command request
203
-        String documentCommandUrl = docserviceUrlSite + docserviceUrlCommand;
204
-
205
-        URL url = new URL(documentCommandUrl);
206
-        java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
207
-
208
-        HashMap<String, Object> params = new HashMap<String, Object>();
209
-        params.put("c", method);
210
-        params.put("key", key);
211
-
212
-        if (meta != null) {
213
-            params.put("meta", meta);
214
-        }
215
-
216
-        String headerToken;
217
-        // check if a secret key to generate token exists or not
218
-        if (jwtManager.tokenEnabled() && jwtManager.tokenUseForRequest()) {
219
-            Map<String, Object> payloadMap = new HashMap<>();
220
-            payloadMap.put("payload", params);
221
-            headerToken = jwtManager.createToken(payloadMap);  // encode a payload object into a header token
222
-
223
-            // add a header Authorization with a header token and Authorization prefix in it
224
-            connection.setRequestProperty(documentJwtHeader.equals("")
225
-                    ? "Authorization" : documentJwtHeader, "Bearer " + headerToken);
226
-
227
-            String token = jwtManager.createToken(params);  // encode a payload object into a body token
228
-            params.put("token", token);
229
-        }
230
-
231
-        String bodyString = objectMapper.writeValueAsString(params);
232
-
233
-        byte[] bodyByte = bodyString.getBytes(StandardCharsets.UTF_8);
234
-
235
-        connection.setRequestMethod("POST");  // set the request method
236
-        connection
237
-                .setRequestProperty("Content-Type", "application/json; charset=UTF-8");  // set the Content-Type header
238
-        connection.setDoOutput(true);  // set the doOutput field to true
239
-        connection.connect();
240
-
241
-        try (OutputStream os = connection.getOutputStream()) {
242
-            os.write(bodyByte);  // write bytes to the output stream
243
-        }
244
-
245
-        InputStream stream = connection.getInputStream();  // get input stream
246
-
247
-        if (stream == null) {
248
-            throw new RuntimeException("Could not get an answer");
249
-        }
250
-
251
-        String jsonString = serviceConverter.convertStreamToString(stream);  // convert stream to json string
252
-        connection.disconnect();
253
-
254
-        JSONObject response = serviceConverter.convertStringToJSON(jsonString);  // convert json string to json object
255
-        // todo: Add errors ENUM
256
-        String responseCode = response.get("error").toString();
257
-        switch (responseCode) {
258
-            case "0":
259
-            case "4":
260
-                break;
261
-            default:
262
-                throw new RuntimeException(response.toJSONString());
263
-            }
264
-        }
265
-
266
-    @SneakyThrows
267
-    public void processForceSave(final Track body, final String fileNameParam) {  // file force saving process
268
-
269
-        String downloadUri = body.getUrl();
270
-        String fileName = fileNameParam;
271
-
272
-        String curExt = fileUtility.getFileExtension(fileName);  // get current file extension
273
-        String downloadExt = "." + body.getFiletype();  // get an extension of the downloaded file
274
-
275
-        Boolean newFileName = false;
276
-
277
-        // convert downloaded file to the file with the current extension if these extensions aren't equal
278
-        // todo: Extract function
279
-        if (!curExt.equals(downloadExt)) {
280
-            try {
281
-                // convert file and get URL to a new file
282
-                String newFileUri = serviceConverter
283
-                        .getConvertedData(downloadUri, downloadExt, curExt, serviceConverter
284
-                                .generateRevisionId(downloadUri), null, false, null).getUri();
285
-                if (newFileUri.isEmpty()) {
286
-                    newFileName = true;
287
-                } else {
288
-                    downloadUri = newFileUri;
289
-                }
290
-            } catch (Exception e) {
291
-                newFileName = true;
292
-            }
293
-        }
294
-
295
-        byte[] byteArrayFile = getDownloadFile(downloadUri);  // download document file
296
-        String forcesavePath = "";
297
-
298
-        // todo: Use ENUMS
299
-        // todo: Pointless toString conversion
300
-        boolean isSubmitForm = body.getForcesavetype().toString().equals("3");
301
-
302
-        // todo: Extract function
303
-        if (isSubmitForm) {  // if the form is submitted
304
-            if (newFileName) {
305
-                // get the correct file name if it already exists
306
-                fileName = documentManager
307
-                        .getCorrectName(fileUtility
308
-                                .getFileNameWithoutExtension(fileName) + "-form" + downloadExt);
309
-            } else {
310
-                fileName = documentManager
311
-                        .getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form" + curExt);
312
-            }
313
-            forcesavePath = storagePathBuilder.getFileLocation(fileName);  // create forcesave path if it doesn't exist
314
-            List<Action> actions =  body.getActions();
315
-            Action action = actions.get(0);
316
-            String user = action.getUserid();  // get the user ID
317
-            // create meta data for the forcesaved file
318
-            storageMutator.createMeta(fileName, user, "Filling Form");
319
-        } else {
320
-            if (newFileName) {
321
-                fileName = documentManager
322
-                        .getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt);
323
-            }
324
-
325
-            forcesavePath = storagePathBuilder.getForcesavePath(fileName, false);
326
-            if (forcesavePath.isEmpty()) {
327
-                forcesavePath = storagePathBuilder.getForcesavePath(fileName, true);
328
-            }
329
-        }
330
-
331
-        saveFile(byteArrayFile, Path.of(forcesavePath));
332
-    }
333
-}

+ 0
- 246
src/main/java/com/onlyoffice/integration/documentserver/managers/document/DefaultDocumentManager.java Просмотреть файл

@@ -1,246 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.document;
20
-
21
-import com.onlyoffice.integration.documentserver.storage.FileStorageMutator;
22
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
23
-import com.onlyoffice.integration.documentserver.util.file.FileUtility;
24
-import com.onlyoffice.integration.documentserver.util.service.ServiceConverter;
25
-import org.springframework.beans.factory.annotation.Autowired;
26
-import org.springframework.beans.factory.annotation.Value;
27
-import org.springframework.context.annotation.Primary;
28
-import org.springframework.stereotype.Component;
29
-
30
-import java.io.File;
31
-import java.io.InputStream;
32
-import java.io.UnsupportedEncodingException;
33
-import java.math.BigDecimal;
34
-import java.math.RoundingMode;
35
-import java.net.InetAddress;
36
-import java.net.URLEncoder;
37
-import java.net.UnknownHostException;
38
-import java.nio.file.Files;
39
-import java.nio.file.Path;
40
-import java.nio.file.Paths;
41
-import java.util.ArrayList;
42
-import java.util.Date;
43
-import java.util.LinkedHashMap;
44
-import java.util.Map;
45
-
46
-import static com.onlyoffice.integration.documentserver.util.Constants.KILOBYTE_SIZE;
47
-
48
-@Component
49
-@Primary
50
-public class DefaultDocumentManager implements DocumentManager {
51
-
52
-    @Value("${files.storage.folder}")
53
-    private String storageFolder;
54
-    @Value("${files.storage}")
55
-    private String filesStorage;
56
-    @Value("${url.track}")
57
-    private String trackUrl;
58
-    @Value("${url.download}")
59
-    private String downloadUrl;
60
-
61
-    @Autowired
62
-    private FileStorageMutator storageMutator;
63
-    @Autowired
64
-    private FileStoragePathBuilder storagePathBuilder;
65
-    @Autowired
66
-    private FileUtility fileUtility;
67
-    @Autowired
68
-    private ServiceConverter serviceConverter;
69
-
70
-    // get URL to the created file
71
-    public String getCreateUrl(final String fileName, final Boolean sample) {
72
-        String fileExt = fileUtility.getFileExtension(fileName).replace(".", "");
73
-        String url = storagePathBuilder.getServerUrl(true)
74
-                + "/create?fileExt=" + fileExt + "&sample=" + sample;
75
-        return url;
76
-    }
77
-
78
-    // get a file name with an index if the file with such a name already exists
79
-    public String getCorrectName(final String fileName) {
80
-        String baseName = fileUtility.getFileNameWithoutExtension(fileName);  // get file name without extension
81
-        String ext = fileUtility.getFileExtension(fileName);  // get file extension
82
-        String name = baseName + ext;  // create a full file name
83
-
84
-        Path path = Paths.get(storagePathBuilder.getFileLocation(name));
85
-
86
-        // run through all the files with such a name in the storage directory
87
-        for (int i = 1; Files.exists(path); i++) {
88
-            name = baseName + " (" + i + ")" + ext;  // and add an index to the base name
89
-            path = Paths.get(storagePathBuilder.getFileLocation(name));
90
-        }
91
-
92
-        return name;
93
-    }
94
-
95
-    // get file URL
96
-    public String getFileUri(final String fileName, final Boolean forDocumentServer) {
97
-        try {
98
-            String serverPath = storagePathBuilder.getServerUrl(forDocumentServer);  // get server URL
99
-            String hostAddress = storagePathBuilder.getStorageLocation();  // get the storage directory
100
-            String filePathDownload = !fileName.contains(InetAddress.getLocalHost().getHostAddress()) ? fileName
101
-                    : fileName.substring(fileName.indexOf(InetAddress.getLocalHost()
102
-                    .getHostAddress()) + InetAddress.getLocalHost().getHostAddress().length() + 1);
103
-            if (!filesStorage.isEmpty() && filePathDownload.contains(filesStorage)) {
104
-                filePathDownload = filePathDownload.substring(filesStorage.length() + 1);
105
-            }
106
-
107
-            String filePath = serverPath + "/download?fileName=" + URLEncoder
108
-                    .encode(filePathDownload, java.nio.charset.StandardCharsets.UTF_8.toString()) + "&userAddress"
109
-                    + URLEncoder.encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString());
110
-            return filePath;
111
-        } catch (UnsupportedEncodingException | UnknownHostException e) {
112
-            return "";
113
-        }
114
-    }
115
-
116
-    // get file URL
117
-    public String getHistoryFileUrl(final String fileName, final Integer version, final String file,
118
-                                    final Boolean forDocumentServer) {
119
-        try {
120
-            String serverPath = storagePathBuilder.getServerUrl(forDocumentServer);  // get server URL
121
-            String hostAddress = storagePathBuilder.getStorageLocation();  // get the storage directory
122
-            String filePathDownload = !fileName.contains(InetAddress.getLocalHost().getHostAddress()) ? fileName
123
-                    : fileName.substring(fileName.indexOf(InetAddress.getLocalHost().getHostAddress())
124
-                    + InetAddress.getLocalHost().getHostAddress().length() + 1);
125
-            String userAddress = forDocumentServer ? "&userAddress" + URLEncoder
126
-                    .encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString()) : "";
127
-            String filePath = serverPath + "/downloadhistory?fileName=" + URLEncoder
128
-                    .encode(filePathDownload, java.nio.charset.StandardCharsets.UTF_8.toString())
129
-                + "&ver=" + version + "&file=" + file
130
-                + userAddress;
131
-            return filePath;
132
-        } catch (UnsupportedEncodingException | UnknownHostException e) {
133
-            return "";
134
-        }
135
-    }
136
-
137
-    // get the callback URL
138
-    public String getCallback(final String fileName) {
139
-        String serverPath = storagePathBuilder.getServerUrl(true);
140
-        String storageAddress = storagePathBuilder.getStorageLocation();
141
-        try {
142
-            String query = trackUrl + "?fileName="
143
-                    + URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString())
144
-                    + "&userAddress=" + URLEncoder
145
-                    .encode(storageAddress, java.nio.charset.StandardCharsets.UTF_8.toString());
146
-            return serverPath + query;
147
-        } catch (UnsupportedEncodingException e) {
148
-            return "";
149
-        }
150
-    }
151
-
152
-    // get URL to download a file
153
-    public String getDownloadUrl(final String fileName, final Boolean isServer) {
154
-        String serverPath = storagePathBuilder.getServerUrl(isServer);
155
-        String storageAddress = storagePathBuilder.getStorageLocation();
156
-        try {
157
-            String userAddress = isServer ? "&userAddress=" + URLEncoder
158
-                    .encode(storageAddress, java.nio.charset.StandardCharsets.UTF_8.toString()) : "";
159
-            String query = downloadUrl + "?fileName="
160
-                    + URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString())
161
-                    + userAddress;
162
-
163
-            return serverPath + query;
164
-        } catch (UnsupportedEncodingException e) {
165
-            return "";
166
-        }
167
-    }
168
-
169
-    // get file information
170
-    public ArrayList<Map<String, Object>> getFilesInfo() {
171
-        ArrayList<Map<String, Object>> files = new ArrayList<>();
172
-
173
-        // run through all the stored files
174
-        for (File file : storageMutator.getStoredFiles()) {
175
-            Map<String, Object> map = new LinkedHashMap<>();  // write all the parameters to the map
176
-            map.put("version", storagePathBuilder.getFileVersion(file.getName(), false));
177
-            map.put("id", serviceConverter
178
-                    .generateRevisionId(storagePathBuilder.getStorageLocation()
179
-                            + "/" + file.getName() + "/"
180
-                            + Paths.get(storagePathBuilder.getFileLocation(file.getName()))
181
-                            .toFile()
182
-                            .lastModified()));
183
-            map.put("contentLength", new BigDecimal(String.valueOf((file.length() / Double.valueOf(KILOBYTE_SIZE))))
184
-                    .setScale(2, RoundingMode.HALF_UP) + " KB");
185
-            map.put("pureContentLength", file.length());
186
-            map.put("title", file.getName());
187
-            map.put("updated", String.valueOf(new Date(file.lastModified())));
188
-            files.add(map);
189
-        }
190
-
191
-        return files;
192
-    }
193
-
194
-    // get file information by its ID
195
-    public ArrayList<Map<String, Object>> getFilesInfo(final String fileId) {
196
-        ArrayList<Map<String, Object>> file = new ArrayList<>();
197
-
198
-        for (Map<String, Object> map : getFilesInfo()) {
199
-            if (map.get("id").equals(fileId)) {
200
-                file.add(map);
201
-                break;
202
-            }
203
-        }
204
-
205
-        return file;
206
-    }
207
-
208
-    // get the path to the file version by the history path and file version
209
-    public String versionDir(final String path, final Integer version, final boolean historyPath) {
210
-        if (!historyPath) {
211
-            return storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(path)) + version;
212
-        }
213
-        return path + File.separator + version;
214
-    }
215
-
216
-    // create demo document
217
-    public String createDemo(final String fileExt, final Boolean sample, final String uid, final String uname) {
218
-        String demoName = (sample ? "sample." : "new.")
219
-                + fileExt;  // create sample or new template file with the necessary extension
220
-        String demoPath =
221
-            "assets"
222
-            + File.separator
223
-            + "document-templates"
224
-            + File.separator
225
-            + (sample ? "sample" : "new")
226
-            + File.separator
227
-            + demoName;
228
-
229
-        // get a file name with an index if the file with such a name already exists
230
-        String fileName = getCorrectName(demoName);
231
-
232
-        InputStream stream = Thread.currentThread()
233
-                                    .getContextClassLoader()
234
-                                    .getResourceAsStream(demoPath);  // get the input file stream
235
-
236
-        if (stream == null) {
237
-            return null;
238
-        }
239
-
240
-        storageMutator.createFile(Path.of(storagePathBuilder
241
-                .getFileLocation(fileName)), stream);  // create a file in the specified directory
242
-        storageMutator.createMeta(fileName, uid, uname);  // create meta information of the demo file
243
-
244
-        return fileName;
245
-    }
246
-}

+ 0
- 42
src/main/java/com/onlyoffice/integration/documentserver/managers/document/DocumentManager.java Просмотреть файл

@@ -1,42 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.document;
20
-
21
-import java.util.ArrayList;
22
-import java.util.Map;
23
-
24
-// specify the document manager functions
25
-public interface DocumentManager {
26
-
27
-    // get a file name with an index if the file with such a name already exists
28
-    String getCorrectName(String fileName);
29
-    String getFileUri(String fileName, Boolean forDocumentServer);  // get file URL
30
-    String getHistoryFileUrl(String fileName, Integer version, String file, Boolean forDocumentServer);  // get file URL
31
-    String getCallback(String fileName);  // get the callback URL
32
-    String getDownloadUrl(String fileName, Boolean forDocumentServer);  // get URL to download a file
33
-    ArrayList<Map<String, Object>> getFilesInfo();  // get file information
34
-    ArrayList<Map<String, Object>> getFilesInfo(String fileId);  // get file information by its ID
35
-
36
-    //  get the path to the file version by the history path and file version
37
-    String versionDir(String path, Integer version, boolean historyPath);
38
-
39
-    // create demo document
40
-    String createDemo(String fileExt, Boolean sample, String uid, String uname) throws Exception;
41
-    String getCreateUrl(String fileName, Boolean sample);  // get URL to the created file
42
-}

+ 0
- 183
src/main/java/com/onlyoffice/integration/documentserver/managers/history/DefaultHistoryManager.java Просмотреть файл

@@ -1,183 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.history;
20
-
21
-import com.fasterxml.jackson.core.JsonProcessingException;
22
-import com.fasterxml.jackson.databind.ObjectMapper;
23
-import com.onlyoffice.integration.documentserver.managers.document.DocumentManager;
24
-import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
25
-import com.onlyoffice.integration.documentserver.models.filemodel.Document;
26
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
27
-import com.onlyoffice.integration.documentserver.util.file.FileUtility;
28
-import lombok.SneakyThrows;
29
-import org.json.simple.JSONArray;
30
-import org.json.simple.JSONObject;
31
-import org.json.simple.parser.JSONParser;
32
-import org.springframework.beans.factory.annotation.Autowired;
33
-import org.springframework.stereotype.Component;
34
-
35
-import java.io.File;
36
-import java.io.FileInputStream;
37
-import java.util.ArrayList;
38
-import java.util.HashMap;
39
-import java.util.List;
40
-import java.util.Map;
41
-import java.util.Scanner;
42
-
43
-// todo: Rebuild completely
44
-@Component
45
-public class DefaultHistoryManager implements HistoryManager {
46
-
47
-    @Autowired
48
-    private FileStoragePathBuilder storagePathBuilder;
49
-
50
-    @Autowired
51
-    private DocumentManager documentManager;
52
-
53
-    @Autowired
54
-    private JwtManager jwtManager;
55
-
56
-    @Autowired
57
-    private FileUtility fileUtility;
58
-
59
-    @Autowired
60
-    private JSONParser parser;
61
-
62
-    @Autowired
63
-    private ObjectMapper objectMapper;
64
-
65
-    // todo: Refactoring
66
-    @SneakyThrows
67
-    public String[] getHistory(final Document document) {  // get document history
68
-
69
-        // get history directory
70
-        String histDir = storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(document.getTitle()));
71
-        Integer curVer = storagePathBuilder.getFileVersion(histDir, false);  // get current file version
72
-
73
-        if (curVer > 0) {  // check if the current file version is greater than 0
74
-            List<Object> hist = new ArrayList<>();
75
-            Map<String, Object> histData = new HashMap<>();
76
-
77
-            for (Integer i = 1; i <= curVer; i++) {  // run through all the file versions
78
-                Map<String, Object> obj = new HashMap<String, Object>();
79
-                Map<String, Object> dataObj = new HashMap<String, Object>();
80
-                String verDir = documentManager
81
-                        .versionDir(histDir, i, true);  // get the path to the given file version
82
-
83
-                String key = i == curVer ? document.getKey() : readFileToEnd(new File(verDir
84
-                        + File.separator + "key.txt"));  // get document key
85
-                obj.put("key", key);
86
-                obj.put("version", i);
87
-
88
-                if (i == 1) {  // check if the version number is equal to 1
89
-                    String createdInfo = readFileToEnd(new File(histDir
90
-                            + File.separator + "createdInfo.json"));  // get file with meta data
91
-                    JSONObject json = (JSONObject) parser.parse(createdInfo);  // and turn it into json object
92
-
93
-                    // write meta information to the object (user information and creation date)
94
-                    obj.put("created", json.get("created"));
95
-                    Map<String, Object> user = new HashMap<String, Object>();
96
-                    user.put("id", json.get("id"));
97
-                    user.put("name", json.get("name"));
98
-                    obj.put("user", user);
99
-                }
100
-
101
-                dataObj.put("fileType", fileUtility
102
-                        .getFileExtension(document.getTitle()).replace(".", ""));
103
-                dataObj.put("key", key);
104
-                dataObj.put("url", i == curVer ? document.getUrl()
105
-                        : documentManager.getHistoryFileUrl(document.getTitle(), i, "prev" + fileUtility
106
-                        .getFileExtension(document.getTitle()), true));
107
-                if (!document.getDirectUrl().equals("")) {
108
-                    dataObj.put("directUrl", i == curVer ? document.getDirectUrl()
109
-                            : documentManager.getHistoryFileUrl(document.getTitle(), i, "prev" + fileUtility
110
-                            .getFileExtension(document.getTitle()), false));
111
-                }
112
-                dataObj.put("version", i);
113
-
114
-                if (i > 1) {  //check if the version number is greater than 1
115
-                    // if so, get the path to the changes.json file
116
-                    JSONObject changes = (JSONObject) parser.parse(readFileToEnd(new File(documentManager
117
-                            .versionDir(histDir, i - 1, true) + File.separator + "changes.json")));
118
-                    JSONObject change = (JSONObject) ((JSONArray) changes.get("changes")).get(0);
119
-
120
-                    // write information about changes to the object
121
-                    obj.put("changes", changes.get("changes"));
122
-                    obj.put("serverVersion", changes.get("serverVersion"));
123
-                    obj.put("created", change.get("created"));
124
-                    obj.put("user", change.get("user"));
125
-
126
-                    // get the history data from the previous file version
127
-                    Map<String, Object> prev = (Map<String, Object>) histData.get(Integer.toString(i - 2));
128
-                    Map<String, Object> prevInfo = new HashMap<String, Object>();
129
-                    prevInfo.put("fileType", prev.get("fileType"));
130
-                    prevInfo.put("key", prev.get("key"));  // write key and URL information about previous file version
131
-                    prevInfo.put("url", prev.get("url"));
132
-                    if (!document.getDirectUrl().equals("")) {
133
-                        prevInfo.put("directUrl", prev.get("directUrl"));
134
-                    }
135
-
136
-                    // write information about previous file version to the data object
137
-                    dataObj.put("previous", prevInfo);
138
-                    // write the path to the diff.zip archive with differences in this file version
139
-                    Integer verdiff = i - 1;
140
-                    dataObj.put("changesUrl", documentManager
141
-                            .getHistoryFileUrl(document.getTitle(), verdiff, "diff.zip", true));
142
-                }
143
-
144
-                if (jwtManager.tokenEnabled()) {
145
-                    dataObj.put("token", jwtManager.createToken(dataObj));
146
-                }
147
-
148
-                hist.add(obj);
149
-                histData.put(Integer.toString(i - 1), dataObj);
150
-            }
151
-
152
-            // write history information about the current file version to the history object
153
-            Map<String, Object> histObj = new HashMap<String, Object>();
154
-            histObj.put("currentVersion", curVer);
155
-            histObj.put("history", hist);
156
-
157
-            try {
158
-                return new String[]{objectMapper.writeValueAsString(histObj),
159
-                        objectMapper.writeValueAsString(histData)};
160
-            } catch (JsonProcessingException e) {
161
-                e.printStackTrace();
162
-            }
163
-        }
164
-        return new String[]{"", ""};
165
-    }
166
-
167
-    // read a file
168
-    private String readFileToEnd(final File file) {
169
-        String output = "";
170
-        try {
171
-            try (FileInputStream is = new FileInputStream(file)) {
172
-                Scanner scanner = new Scanner(is);  // read data from the source
173
-                scanner.useDelimiter("\\A");
174
-                while (scanner.hasNext()) {
175
-                    output += scanner.next();
176
-                }
177
-                scanner.close();
178
-            }
179
-        } catch (Exception e) {
180
-        }
181
-        return output;
182
-    }
183
-}

+ 0
- 26
src/main/java/com/onlyoffice/integration/documentserver/managers/history/HistoryManager.java Просмотреть файл

@@ -1,26 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.history;
20
-
21
-import com.onlyoffice.integration.documentserver.models.filemodel.Document;
22
-
23
-// specify the history manager functions
24
-public interface HistoryManager {
25
-    String[] getHistory(Document document);  // get document history
26
-}

+ 0
- 135
src/main/java/com/onlyoffice/integration/documentserver/managers/jwt/DefaultJwtManager.java Просмотреть файл

@@ -1,135 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.jwt;
20
-
21
-import com.fasterxml.jackson.databind.ObjectMapper;
22
-import org.json.simple.JSONObject;
23
-import org.json.simple.parser.JSONParser;
24
-import org.primeframework.jwt.Signer;
25
-import org.primeframework.jwt.Verifier;
26
-import org.primeframework.jwt.domain.JWT;
27
-import org.primeframework.jwt.hmac.HMACSigner;
28
-import org.primeframework.jwt.hmac.HMACVerifier;
29
-import org.springframework.beans.factory.annotation.Autowired;
30
-import org.springframework.beans.factory.annotation.Value;
31
-import org.springframework.stereotype.Component;
32
-
33
-import java.util.LinkedHashMap;
34
-import java.util.Map;
35
-
36
-@Component
37
-public class DefaultJwtManager implements JwtManager {
38
-    @Value("${files.docservice.secret}")
39
-    private String tokenSecret;
40
-    @Value("${files.docservice.token-use-for-request}")
41
-    private String tokenUseForRequest;
42
-    @Autowired
43
-    private ObjectMapper objectMapper;
44
-    @Autowired
45
-    private JSONParser parser;
46
-
47
-    // create document token
48
-    @Override
49
-    public String createToken(final Map<String, Object> payloadClaims) {
50
-        try {
51
-            // build a HMAC signer using a SHA-256 hash
52
-            Signer signer = HMACSigner.newSHA256Signer(tokenSecret);
53
-            JWT jwt = new JWT();
54
-            for (String key : payloadClaims.keySet()) {  // run through all the keys from the payload
55
-                jwt.addClaim(key, payloadClaims.get(key));  // and write each claim to the jwt
56
-            }
57
-            return JWT.getEncoder().encode(jwt, signer);  // sign and encode the JWT to a JSON string representation
58
-        } catch (Exception e) {
59
-            return "";
60
-        }
61
-    }
62
-
63
-    // check if the token is enabled
64
-    @Override
65
-    public boolean tokenEnabled() {
66
-        return tokenSecret != null && !tokenSecret.isEmpty();
67
-    }
68
-
69
-    @Override
70
-    public boolean tokenUseForRequest() {
71
-        return Boolean.parseBoolean(tokenUseForRequest) && !tokenUseForRequest.isEmpty();
72
-    }
73
-
74
-    // read document token
75
-    @Override
76
-    public JWT readToken(final String token) {
77
-        try {
78
-            // build a HMAC verifier using the token secret
79
-            Verifier verifier = HMACVerifier.newVerifier(tokenSecret);
80
-
81
-            // verify and decode the encoded string JWT to a rich object
82
-            return JWT.getDecoder().decode(token, verifier);
83
-        } catch (Exception exception) {
84
-            return null;
85
-        }
86
-    }
87
-
88
-    // parse the body
89
-    @Override
90
-    public JSONObject parseBody(final String payload, final String header) {
91
-        JSONObject body;
92
-        try {
93
-            Object obj = parser.parse(payload);  // get body parameters by parsing the payload
94
-            body = (JSONObject) obj;
95
-        } catch (Exception ex) {
96
-            throw new RuntimeException("{\"error\":1,\"message\":\"JSON Parsing error\"}");
97
-        }
98
-        if (tokenEnabled() && tokenUseForRequest()) {  // check if the token is enabled
99
-            String token = (String) body.get("token");  // get token from the body
100
-            if (token == null) {  // if token is empty
101
-                if (header != null && header.trim()!="") {  // and the header is defined
102
-
103
-                    // get token from the header (it is placed after the Bearer prefix if it exists)
104
-                    token = header.startsWith("Bearer ") ? header.substring("Bearer ".length()) : header;
105
-                }
106
-            }
107
-            if (token == null || token.trim()=="") {
108
-                throw new RuntimeException("{\"error\":1,\"message\":\"JWT expected\"}");
109
-            }
110
-
111
-            JWT jwt = readToken(token);  // read token
112
-            if (jwt == null) {
113
-                throw new RuntimeException("{\"error\":1,\"message\":\"JWT validation failed\"}");
114
-            }
115
-            if (jwt.getObject("payload") != null) {  // get payload from the token and check if it is not empty
116
-                try {
117
-                    @SuppressWarnings("unchecked") LinkedHashMap<String, Object> jwtPayload =
118
-                            (LinkedHashMap<String, Object>) jwt.getObject("payload");
119
-
120
-                    jwt.claims = jwtPayload;
121
-                } catch (Exception ex) {
122
-                    throw new RuntimeException("{\"error\":1,\"message\":\"Wrong payload\"}");
123
-                }
124
-            }
125
-            try {
126
-                Object obj = parser.parse(objectMapper.writeValueAsString(jwt.claims));
127
-                body = (JSONObject) obj;
128
-            } catch (Exception ex) {
129
-                throw new RuntimeException("{\"error\":1,\"message\":\"Parsing error\"}");
130
-            }
131
-        }
132
-
133
-        return body;
134
-    }
135
-}

+ 0
- 33
src/main/java/com/onlyoffice/integration/documentserver/managers/jwt/JwtManager.java Просмотреть файл

@@ -1,33 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.jwt;
20
-
21
-import org.json.simple.JSONObject;
22
-import org.primeframework.jwt.domain.JWT;
23
-
24
-import java.util.Map;
25
-
26
-// specify the jwt manager functions
27
-public interface JwtManager {
28
-    boolean tokenEnabled();  // check if the token is enabled
29
-    boolean tokenUseForRequest();  // check if the token is enabled
30
-    String createToken(Map<String, Object> payloadClaims);  // create document token
31
-    JWT readToken(String token);  // read document token
32
-    JSONObject parseBody(String payload, String header);  // parse the body
33
-}

+ 0
- 70
src/main/java/com/onlyoffice/integration/documentserver/managers/template/SampleTemplateManager.java Просмотреть файл

@@ -1,70 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.template;
20
-
21
-import com.onlyoffice.integration.documentserver.models.enums.DocumentType;
22
-import com.onlyoffice.integration.documentserver.models.filemodel.Template;
23
-import com.onlyoffice.integration.documentserver.managers.document.DocumentManager;
24
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
25
-import com.onlyoffice.integration.documentserver.util.file.FileUtility;
26
-import org.springframework.beans.factory.annotation.Autowired;
27
-import org.springframework.beans.factory.annotation.Qualifier;
28
-import org.springframework.stereotype.Component;
29
-
30
-import java.util.List;
31
-
32
-@Component
33
-@Qualifier("sample")
34
-public class SampleTemplateManager implements TemplateManager {
35
-    @Autowired
36
-    private DocumentManager documentManager;
37
-
38
-    @Autowired
39
-    private FileStoragePathBuilder storagePathBuilder;
40
-
41
-    @Autowired
42
-    private FileUtility fileUtility;
43
-
44
-    // create a template document with the specified name
45
-    public List<Template> createTemplates(final String fileName) {
46
-        List<Template> templates = List.of(
47
-                new Template("", "Blank", documentManager
48
-                        .getCreateUrl(fileName, false)),  // create a blank template
49
-                new Template(getTemplateImageUrl(fileName), "With sample content", documentManager
50
-                        .getCreateUrl(fileName,
51
-                                true))  // create a template with sample content using the template image
52
-        );
53
-
54
-        return templates;
55
-    }
56
-
57
-    // get the template image URL for the specified file
58
-    public String getTemplateImageUrl(final String fileName) {
59
-        DocumentType fileType = fileUtility.getDocumentType(fileName);  // get the file type
60
-        String path = storagePathBuilder.getServerUrl(true);  // get server URL
61
-        if (fileType.equals(DocumentType.word)) {  // get URL to the template image for the word document type
62
-            return path + "/css/img/file_docx.svg";
63
-        } else if (fileType.equals(DocumentType.slide)) {  // get URL to the template image for the slide document type
64
-            return path + "/css/img/file_pptx.svg";
65
-        } else if (fileType.equals(DocumentType.cell)) {  // get URL to the template image for the cell document type
66
-            return path + "/css/img/file_xlsx.svg";
67
-        }
68
-        return path + "/css/img/file_docx.svg";  // get URL to the template image for the default document type (word)
69
-    }
70
-}

+ 0
- 28
src/main/java/com/onlyoffice/integration/documentserver/managers/template/TemplateManager.java Просмотреть файл

@@ -1,28 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.managers.template;
20
-
21
-import com.onlyoffice.integration.documentserver.models.filemodel.Template;
22
-import java.util.List;
23
-
24
-// specify the template manager functions
25
-public interface TemplateManager {
26
-    List<Template> createTemplates(String fileName);  // create a template document with the specified name
27
-    String getTemplateImageUrl(String fileName);  // get the template image URL for the specified file
28
-}

+ 0
- 24
src/main/java/com/onlyoffice/integration/documentserver/models/AbstractModel.java Просмотреть файл

@@ -1,24 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models;
20
-
21
-import java.io.Serializable;
22
-
23
-public abstract class AbstractModel implements Serializable {
24
-}

+ 0
- 53
src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Customization.java Просмотреть файл

@@ -1,53 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.configurations;
20
-
21
-import lombok.Getter;
22
-import lombok.Setter;
23
-import org.springframework.beans.factory.annotation.Autowired;
24
-import org.springframework.context.annotation.Scope;
25
-import org.springframework.stereotype.Component;
26
-
27
-@Component
28
-@Scope("prototype")
29
-@Getter
30
-@Setter
31
-/* The parameters which allow to customize the editor interface so that it looked like your
32
- other products (if there are any) and change the presence or absence of the additional buttons,
33
-  links, change logos and editor owner details. */
34
-public class Customization {
35
-    @Autowired
36
-    private Logo logo;  // the image file at the top left corner of the Editor header
37
-    @Autowired
38
-    private Goback goback;  // the settings for the Open file location menu button and upper right corner button
39
-    private Boolean autosave = true;  // if the Autosave menu option is enabled or disabled
40
-    private Boolean comments = true;  // if the Comments menu button is displayed or hidden
41
-    private Boolean compactHeader = false;  /* if the additional action buttons are displayed
42
-    in the upper part of the editor window header next to the logo (false) or in the toolbar (true) */
43
-    private Boolean compactToolbar = false;  // if the top toolbar type displayed is full (false) or compact (true)
44
-    private Boolean compatibleFeatures = false;  // the use of functionality only compatible with the OOXML format
45
-    private Boolean forcesave = false;  /* add the request for the forced file saving to the callback handler
46
-     when saving the document within the document editing service */
47
-    private Boolean help = true;  //  if the Help menu button is displayed or hidden
48
-    private Boolean hideRightMenu = false;  // if the right menu is displayed or hidden on first loading
49
-    private Boolean hideRulers = false;  // if the editor rulers are displayed or hidden
50
-    private Boolean submitForm = false;  // if the Submit form button is displayed or hidden
51
-    private Boolean about = true;
52
-    private Boolean feedback = true;
53
-}

+ 0
- 40
src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Embedded.java Просмотреть файл

@@ -1,40 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.configurations;
20
-
21
-import com.onlyoffice.integration.documentserver.models.enums.ToolbarDocked;
22
-import lombok.Getter;
23
-import lombok.Setter;
24
-import org.springframework.context.annotation.Scope;
25
-import org.springframework.stereotype.Component;
26
-
27
-@Component
28
-@Scope("prototype")
29
-@Getter
30
-@Setter
31
-/* The parameters which allow to change the settings
32
- which define the behavior of the buttons in the embedded mode */
33
-public class Embedded {
34
-    private String embedUrl;  /* the absolute URL to the document serving as a source file for the document embedded
35
-     into the web page */
36
-    private String saveUrl;  /* the absolute URL that will allow the document to be saved
37
-     onto the user personal computer */
38
-    private String shareUrl;  // the absolute URL that will allow other users to share this document
39
-    private ToolbarDocked toolbarDocked;  // the place for the embedded viewer toolbar, can be either top or bottom
40
-}

+ 0
- 48
src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Goback.java Просмотреть файл

@@ -1,48 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.configurations;
20
-
21
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
22
-import lombok.Getter;
23
-import org.springframework.beans.factory.annotation.Autowired;
24
-import org.springframework.beans.factory.annotation.Value;
25
-import org.springframework.context.annotation.Scope;
26
-import org.springframework.stereotype.Component;
27
-
28
-import javax.annotation.PostConstruct;
29
-
30
-@Component
31
-@Scope("prototype")
32
-public class Goback {  // the settings for the Open file location menu button and upper right corner button
33
-
34
-    @Autowired
35
-    private FileStoragePathBuilder storagePathBuilder;
36
-
37
-    @Value("${url.index}")
38
-    private String indexMapping;
39
-
40
-    @Getter
41
-    private String url;  /* the absolute URL to the website address which will be opened
42
-    when clicking the Open file location menu button */
43
-
44
-    @PostConstruct
45
-    private void init() {
46
-        this.url = storagePathBuilder.getServerUrl(false) + indexMapping;
47
-    }
48
-}

+ 0
- 45
src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Info.java Просмотреть файл

@@ -1,45 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.configurations;
20
-
21
-import lombok.Getter;
22
-import lombok.Setter;
23
-import org.springframework.context.annotation.Scope;
24
-import org.springframework.stereotype.Component;
25
-
26
-import java.text.SimpleDateFormat;
27
-import java.util.Date;
28
-import java.util.Locale;
29
-
30
-@Component
31
-@Scope("prototype")
32
-@Getter
33
-@Setter
34
-/* The additional parameters for the document (document owner, folder where the document is stored,
35
- uploading date, sharing settings) */
36
-public class Info {
37
-    private String owner = "Me";  // the name of the document owner/creator
38
-    private Boolean favorite = null;  // the highlighting state of the Favorite icon
39
-    private String uploaded = getDate();  // the document uploading date
40
-
41
-    private String getDate() {
42
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd yyyy", Locale.US);
43
-        return simpleDateFormat.format(new Date());
44
-    }
45
-}

+ 0
- 38
src/main/java/com/onlyoffice/integration/documentserver/models/configurations/Logo.java Просмотреть файл

@@ -1,38 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.configurations;
20
-
21
-import lombok.Getter;
22
-import lombok.Setter;
23
-import org.springframework.beans.factory.annotation.Value;
24
-import org.springframework.context.annotation.Scope;
25
-import org.springframework.stereotype.Component;
26
-
27
-@Component
28
-@Scope("prototype")
29
-@Getter
30
-@Setter
31
-public class Logo {  // the image file at the top left corner of the Editor header
32
-    @Value("${logo.image}")
33
-    private String image;  // the path to the image file used to show in common work mode
34
-    @Value("${logo.imageEmbedded}")
35
-    private String imageEmbedded;  // the path to the image file used to show in the embedded mode
36
-    @Value("${logo.url}")
37
-    private String url;  // the absolute URL which will be used when someone clicks the logo image
38
-}

+ 0
- 32
src/main/java/com/onlyoffice/integration/documentserver/models/enums/Action.java Просмотреть файл

@@ -1,32 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.enums;
20
-
21
-public enum Action {
22
-    edit,
23
-    review,
24
-    view,
25
-    embedded,
26
-    filter,
27
-    comment,
28
-    chat,
29
-    fillForms,
30
-    blockcontent,
31
-    protect
32
-}

+ 0
- 48
src/main/java/com/onlyoffice/integration/documentserver/models/enums/ConvertErrorType.java Просмотреть файл

@@ -1,48 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.enums;
20
-
21
-public enum ConvertErrorType {
22
-    EMPTY_ERROR(0, ""),
23
-    CONVERTATION_UNKNOWN(-1, "Error convertation unknown"),
24
-    CONVERTATION_TIMEOUT(-2, "Error convertation timeout"),
25
-    CONVERTATION_ERROR(-3, "Error convertation error"),
26
-    DOWNLOAD_ERROR(-4, "Error download error"),
27
-    UNEXPECTED_GUID_ERROR(-5, "Error unexpected guid"),
28
-    DATABASE_ERROR(-6, "Error database"),
29
-    DOCUMENT_REQUEST_ERROR(-7, "Error document request"),
30
-    DOCUMENT_VKEY_ERROR(-8, "Error document VKey");
31
-
32
-    private final int code;
33
-    private final String label;
34
-
35
-    ConvertErrorType(final int codeParam, final String labelParam) {
36
-        this.code = codeParam;
37
-        this.label = labelParam;
38
-    }
39
-
40
-    public static String labelOfCode(final int code) {
41
-        for (ConvertErrorType convertErrorType : values()) {
42
-            if (convertErrorType.code == code) {
43
-                return convertErrorType.label;
44
-            }
45
-        }
46
-        return "ErrorCode = " + code;
47
-    }
48
-}

+ 0
- 25
src/main/java/com/onlyoffice/integration/documentserver/models/enums/DocumentType.java Просмотреть файл

@@ -1,25 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.enums;
20
-
21
-public enum DocumentType {
22
-    word,
23
-    cell,
24
-    slide
25
-}

+ 0
- 24
src/main/java/com/onlyoffice/integration/documentserver/models/enums/Mode.java Просмотреть файл

@@ -1,24 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.enums;
20
-
21
-public enum Mode {
22
-    edit,
23
-    view
24
-}

+ 0
- 24
src/main/java/com/onlyoffice/integration/documentserver/models/enums/ToolbarDocked.java Просмотреть файл

@@ -1,24 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.enums;
20
-
21
-public enum ToolbarDocked {
22
-    top,
23
-    bottom
24
-}

+ 0
- 25
src/main/java/com/onlyoffice/integration/documentserver/models/enums/Type.java Просмотреть файл

@@ -1,25 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.enums;
20
-
21
-public enum Type {
22
-    desktop,
23
-    mobile,
24
-    embedded
25
-}

+ 0
- 41
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/CommentGroup.java Просмотреть файл

@@ -1,41 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import com.fasterxml.jackson.annotation.JsonInclude;
22
-import com.onlyoffice.integration.documentserver.serializers.SerializerFilter;
23
-import lombok.AllArgsConstructor;
24
-import lombok.Data;
25
-import lombok.NoArgsConstructor;
26
-import org.springframework.stereotype.Component;
27
-
28
-import java.util.List;
29
-
30
-@Component
31
-@Data
32
-@NoArgsConstructor
33
-@AllArgsConstructor
34
-public class CommentGroup {
35
-    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
36
-    private List<String> view;  // define a list of groups whose comments the user can view
37
-    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
38
-    private List<String> edit;  // define a list of groups whose comments the user can edit
39
-    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
40
-    private List<String> remove;  // define a list of groups whose comments the user can remove
41
-}

+ 0
- 49
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/Document.java Просмотреть файл

@@ -1,49 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import com.onlyoffice.integration.documentserver.models.configurations.Info;
22
-import lombok.Getter;
23
-import lombok.Setter;
24
-import org.springframework.beans.factory.annotation.Autowired;
25
-import org.springframework.context.annotation.Scope;
26
-import org.springframework.stereotype.Component;
27
-
28
-import java.util.HashMap;
29
-
30
-@Component
31
-@Scope("prototype")
32
-@Getter
33
-@Setter
34
-public class Document {  // the parameters pertaining to the document (title, url, file type, etc.)
35
-    @Autowired
36
-    private Info info;  /* additional parameters for the document (document owner, folder where the document is stored,
37
-     uploading date, sharing settings) */
38
-    @Autowired
39
-    private Permission permissions;  // the permission for the document to be edited and downloaded or not
40
-    private String fileType;  //  the file type for the source viewed or edited document
41
-    private String key;  // the unique document identifier used by the service to recognize the document
42
-    private String urlUser;  /* the absolute URL that will allow the document to be saved
43
-    onto the user personal computer */
44
-    private String title;  /* the desired file name for the viewed or edited document which will also be used
45
-    as file name when the document is downloaded */
46
-    private String url;  // the absolute URL where the source viewed or edited document is stored
47
-    private String directUrl;
48
-    private HashMap<String, Object> referenceData;
49
-}

+ 0
- 59
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/EditorConfig.java Просмотреть файл

@@ -1,59 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import com.onlyoffice.integration.documentserver.models.configurations.Customization;
22
-import com.onlyoffice.integration.documentserver.models.configurations.Embedded;
23
-import com.onlyoffice.integration.documentserver.models.enums.Mode;
24
-import lombok.AllArgsConstructor;
25
-import lombok.Data;
26
-import lombok.NoArgsConstructor;
27
-import org.springframework.beans.factory.annotation.Autowired;
28
-import org.springframework.context.annotation.Scope;
29
-import org.springframework.stereotype.Component;
30
-
31
-import java.util.HashMap;
32
-import java.util.List;
33
-
34
-@Component
35
-@Scope("prototype")
36
-@Data
37
-@NoArgsConstructor
38
-@AllArgsConstructor
39
-public class EditorConfig {  /* the parameters pertaining to the editor interface: opening mode (viewer or editor),
40
- interface language, additional buttons, etc. */
41
-    private HashMap<String, Object> actionLink = null;  /* the data which contains the information about the
42
-    action in the document that will be scrolled to */
43
-    private String callbackUrl;  // the absolute URL to the document storage service
44
-    private HashMap<String, Object> coEditing = null;
45
-    private String createUrl;  // the absolute URL of the document where it will be created and available after creation
46
-    @Autowired
47
-    private Customization customization;  /* the parameters which allow to customize the editor interface
48
-     so that it looked like your other products (if there are any) and change the presence or absence
49
-      of the additional buttons, links, change logos and editor owner details */
50
-    @Autowired
51
-    private Embedded embedded;  /* the parameters which allow to change the settings which define
52
-     the behavior of the buttons in the embedded mode */
53
-    private String lang;  // the editor interface language
54
-    private Mode mode;  // the editor opening mode
55
-    @Autowired
56
-    private User user;  // the user currently viewing or editing the document
57
-    private List<Template> templates;  /* the presence or absence
58
-     of the templates in the <b>Create New...</b> menu option */
59
-}

+ 0
- 44
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/FileModel.java Просмотреть файл

@@ -1,44 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import com.onlyoffice.integration.documentserver.models.enums.DocumentType;
22
-import com.onlyoffice.integration.documentserver.models.enums.Type;
23
-import lombok.Getter;
24
-import lombok.Setter;
25
-import org.springframework.beans.factory.annotation.Autowired;
26
-import org.springframework.context.annotation.Scope;
27
-import org.springframework.stereotype.Component;
28
-
29
-@Component
30
-@Scope("prototype")
31
-@Getter
32
-@Setter
33
-/* the file base parameters which include the platform type used,
34
- document display size (width and height) and type of the document opened */
35
-public class FileModel {
36
-    @Autowired
37
-    private Document document;  // the parameters pertaining to the document (title, url, file type, etc.)
38
-    private DocumentType documentType;  // the document type to be opened
39
-    @Autowired
40
-    private EditorConfig editorConfig;  /*  the parameters pertaining to the
41
-     editor interface: opening mode (viewer or editor), interface language, additional buttons, etc. */
42
-    private String token;  // the encrypted signature added to the Document Server config
43
-    private Type type;  // the platform type used to access the document
44
-}

+ 0
- 55
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/Permission.java Просмотреть файл

@@ -1,55 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import com.fasterxml.jackson.annotation.JsonInclude;
22
-import com.onlyoffice.integration.documentserver.models.AbstractModel;
23
-import com.onlyoffice.integration.documentserver.serializers.SerializerFilter;
24
-import lombok.Getter;
25
-import lombok.Setter;
26
-import org.springframework.beans.factory.annotation.Autowired;
27
-import org.springframework.context.annotation.Scope;
28
-import org.springframework.stereotype.Component;
29
-
30
-import java.util.List;
31
-
32
-@Component
33
-@Scope("prototype")
34
-@Getter
35
-@Setter
36
-public class Permission extends AbstractModel {  // the permission for the document to be edited and downloaded or not
37
-    private Boolean comment = true;  // if the document can be commented or not
38
-    private Boolean copy = true;  // if the content can be copied to the clipboard or not
39
-    private Boolean download = true;  // if the document can be downloaded or only viewed or edited online
40
-    private Boolean edit = true;  // if the document can be edited or only viewed
41
-    private Boolean print = true;  // if the document can be printed or not
42
-    private Boolean fillForms = true;  // if the forms can be filled
43
-    private Boolean modifyFilter = true;  /* if the filter can applied globally (true) affecting all the
44
-     other users, or locally (false) */
45
-    private Boolean modifyContentControl = true;  // if the content control settings can be changed
46
-    private Boolean review = true;  // if the document can be reviewed or not
47
-    private Boolean chat = true;  // if a chat can be used
48
-    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
49
-    private List<String> reviewGroups;  // the groups whose changes the user can accept/reject
50
-    @Autowired
51
-    private CommentGroup commentGroups;  //  the groups whose comments the user can edit, remove and/or view
52
-    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
53
-    private List<String> userInfoGroups;
54
-    private Boolean protect = true;
55
-}

+ 0
- 42
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/ReferenceData.java Просмотреть файл

@@ -1,42 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import java.util.HashMap;
22
-import java.util.Map;
23
-import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
24
-import org.springframework.beans.factory.annotation.Autowired;
25
-
26
-public class ReferenceData {
27
-    @Autowired
28
-    private FileStoragePathBuilder storagePathBuilder;
29
-    private final String instanceId;
30
-    private final Map<String, String> fileKey;
31
-    public ReferenceData(final String fileName, final String curUserHostAddress, final User user) {
32
-        instanceId = storagePathBuilder.getServerUrl(true);
33
-        Map<String, String> fileKeyList = new HashMap<>();
34
-        if (!user.getId().equals("uid-0")) {
35
-            fileKeyList.put("fileName", fileName);
36
-            fileKeyList.put("userAddress", curUserHostAddress);
37
-        } else {
38
-            fileKeyList = null;
39
-        }
40
-        fileKey = fileKeyList;
41
-    }
42
-}

+ 0
- 32
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/Template.java Просмотреть файл

@@ -1,32 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import lombok.AllArgsConstructor;
22
-import lombok.Getter;
23
-import lombok.Setter;
24
-
25
-@Getter
26
-@Setter
27
-@AllArgsConstructor
28
-public class Template {  // the document template parameters
29
-    private String image;  // the absolute URL to the image for template
30
-    private String title;  // the template title that will be displayed in the <b>Create New...</b> menu option
31
-    private String url;  // the absolute URL to the document where it will be created and available after creation
32
-}

+ 0
- 42
src/main/java/com/onlyoffice/integration/documentserver/models/filemodel/User.java Просмотреть файл

@@ -1,42 +0,0 @@
1
-/**
2
- *
3
- * (c) Copyright Ascensio System SIA 2023
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- *     http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
-package com.onlyoffice.integration.documentserver.models.filemodel;
20
-
21
-import com.onlyoffice.integration.documentserver.models.AbstractModel;
22
-import lombok.Getter;
23
-import lombok.Setter;
24
-import org.springframework.context.annotation.Scope;
25
-import org.springframework.stereotype.Component;
26
-
27
-@Component
28
-@Scope("prototype")
29
-@Getter
30
-@Setter
31
-public class User extends AbstractModel {
32
-    private String id;
33
-    private String name;
34
-    private String group;
35
-
36
-    // the user configuration parameters
37
-    public void configure(final int idParam, final String nameParam, final String groupParam) {
38
-        this.id = "uid-" + idParam;  // the user id
39
-        this.name = nameParam;  // the user name
40
-        this.group = groupParam;  // the group the user belongs to
41
-    }
42
-}

+ 0
- 0
src/main/java/com/onlyoffice/integration/documentserver/serializers/FilterState.java Просмотреть файл


Некоторые файлы не были показаны из-за большого количества измененных файлов