Li Yuan 1 год назад
Родитель
Сommit
d6382d1ca0

+ 0 - 4
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/BusinessApplication.java

@@ -2,11 +2,8 @@ package com.lc.ibps;
 
 import java.io.IOException;
 
-import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
 import org.mybatis.spring.annotation.MapperScan;
 import org.slf4j.Logger;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.FactoryBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -18,7 +15,6 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.netflix.hystrix.EnableHystrix;
 import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.annotation.ImportResource;
 import org.springframework.core.env.Environment;
 

+ 5 - 3
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/IntegrationConfiguration.java → ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/config/IntegrationConfiguration.java

@@ -16,7 +16,7 @@
  *
  */
 
-package com.onlyoffice.integration;
+package com.lc.ibps.config;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
@@ -28,11 +28,13 @@ import org.modelmapper.convention.MatchingStrategies;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 
 import javax.annotation.PostConstruct;
 
 @Configuration
+@ComponentScan(basePackages = {"com.onlyoffice.integration"})
 public class IntegrationConfiguration {
 
     @Value("${files.storage}")
@@ -41,10 +43,10 @@ public class IntegrationConfiguration {
     @Value("${files.docservice.verify-peer-off}")
     private String verifyPerrOff;
 
-//    @Autowired
+    @Autowired
     private FileStoragePathBuilder storagePathBuilder;
 
-//    @Autowired
+    @Autowired
     private SSLUtils ssl;
 
     @Bean

+ 122 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/ExampleData.java

@@ -0,0 +1,122 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2024
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.onlyoffice.integration;
+
+import com.onlyoffice.integration.documentserver.serializers.FilterState;
+import com.onlyoffice.integration.services.UserServices;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@Component
+public class ExampleData {
+    @Autowired
+    private UserServices userService;
+    @PostConstruct
+    public void init() {
+        // the description for user 0
+        List<String> descriptionUserZero = Arrays.asList(
+                "The name is requested when the editor is opened",
+                "Doesn’t belong to any group",
+                "Can review all the changes",
+                "Can perform all actions with comments",
+                "The file favorite state is undefined",
+                "Can't mention others in comments",
+                "Can't create new files from the editor",
+                "Can’t see anyone’s information",
+                "Can't rename files from the editor",
+                "Can't view chat",
+                "Can't protect file",
+                "View file without collaboration",
+                "Can’t submit forms"
+        );
+
+        // the description for user 1
+        List<String> descriptionUserFirst = Arrays.asList(
+                "File author by default",
+                "He doesn’t belong to any of the groups",
+                "He can review all the changes",
+                "He can do everything with the comments",
+                "The file favorite state is undefined",
+                "Can create a file from a template with data from the editor",
+                "Can see the information about all users",
+                "Can view chat",
+                "Has an avatar",
+                "Can submit forms"
+        );
+
+        // the description for user 2
+        List<String> descriptionUserSecond = Arrays.asList(
+                "He belongs to Group2",
+                "He can review only his own changes or the changes made by the users who don’t belong"
+                        + " to any of the groups",
+                "He can view every comment, edit his comments and the comments left by the users "
+                        + "who don't belong to any of the groups and remove only his comments",
+                "This file is favorite",
+                "Can create a file from an editor",
+                "Can see the information about users from Group2 and users who don’t belong to any group",
+                "Can view chat",
+                "Has an avatar",
+                "Can’t submit forms"
+        );
+
+        // the description for user 3
+        List<String> descriptionUserThird = Arrays.asList(
+                "He belongs to Group3",
+                "He can review only the changes made by the users from Group2",
+                "He can view the comments left by the users from Group2 and Group3 and edit the comments left by "
+                        + "the users from Group2",
+                "This file isn’t favorite",
+                "He can’t copy data from the file into the clipboard",
+                "He can’t download the file",
+                "He can’t print the file",
+                "Can create a file from an editor",
+                "Can see the information about Group2 users",
+                "Can view chat",
+                "Can’t submit forms"
+        );
+
+        // create user 1 with the specified parameters
+        userService.createUser("John Smith", "smith@example.com", descriptionUserFirst,
+                "", Arrays.asList(FilterState.NULL.toString()), Arrays.asList(FilterState.NULL.toString()),
+                Arrays.asList(FilterState.NULL.toString()), Arrays.asList(FilterState.NULL.toString()),
+                Arrays.asList(FilterState.NULL.toString()), null, true, true, true);
+
+        // create user 2 with the specified parameters
+        userService.createUser("Mark Pottato", "pottato@example.com", descriptionUserSecond,
+                "group-2", Arrays.asList("", "group-2"), Arrays.asList(FilterState.NULL.toString()),
+                Arrays.asList("group-2", ""), Arrays.asList("group-2"), Arrays.asList("group-2", ""), true, true,
+                true, true);
+
+        // create user 3 with the specified parameters
+        userService.createUser("Hamish Mitchell", null, descriptionUserThird,
+                "group-3", Arrays.asList("group-2"), Arrays.asList("group-2", "group-3"), Arrays.asList("group-2"),
+                new ArrayList<>(), Arrays.asList("group-2"), false, true, true, false);
+
+        // create user 0 with the specified parameters
+        userService.createUser("Anonymous", null, descriptionUserZero, "",
+                Arrays.asList(FilterState.NULL.toString()), Arrays.asList(FilterState.NULL.toString()),
+                Arrays.asList(FilterState.NULL.toString()), Arrays.asList(FilterState.NULL.toString()),
+                new ArrayList<>(), null, false, false, false);
+    }
+}

+ 0 - 32
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/IntegrationApplication.java

@@ -1,32 +0,0 @@
-/**
- *
- * (c) Copyright Ascensio System SIA 2024
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package com.onlyoffice.integration;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class IntegrationApplication {
-
-    // run the SpringApplication from the IntagrationApplication with the specified parameters
-    public static void main(final String[] args) {
-        SpringApplication.run(IntegrationApplication.class, args);
-    }
-
-}

+ 22 - 30
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/controllers/EditorController.java

@@ -21,6 +21,7 @@ package com.onlyoffice.integration.controllers;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.onlyoffice.integration.documentserver.managers.jwt.JwtManager;
+import com.onlyoffice.integration.documentserver.models.EditModel;
 import com.onlyoffice.integration.documentserver.models.enums.Action;
 import com.onlyoffice.integration.documentserver.models.enums.Type;
 import com.onlyoffice.integration.documentserver.models.filemodel.FileModel;
@@ -74,18 +75,16 @@ public class EditorController {
 
     @GetMapping(path = "${url.editor}")
     // process request to open the editor page
-    public String index(@RequestParam("fileName") final String fileName,
+    public EditModel index(@RequestParam("fileName") final String fileName,
                         @RequestParam(value = "action", required = false) final String actionParam,
                         @RequestParam(value = "type", required = false) final String typeParam,
                         @RequestParam(value = "actionLink", required = false) final String actionLink,
                         @RequestParam(value = "directUrl", required = false,
                                 defaultValue = "false") final Boolean directUrl,
-                        @CookieValue(value = "uid") final String uid,
-                        @CookieValue(value = "ulang") final String lang,
-                        final Model model) throws JsonProcessingException {
+                        @RequestParam(value = "uid") final String uid) throws JsonProcessingException {
         Action action = Action.edit;
         Type type = Type.desktop;
-        Locale locale = new Locale("en");
+        Locale locale = Locale.CHINA;
 
         if (actionParam != null) {
             action = Action.valueOf(actionParam);
@@ -94,22 +93,8 @@ public class EditorController {
             type = Type.valueOf(typeParam);
         }
 
-        List<String> langsAndKeys = Arrays.asList(langs.split("\\|"));
-        for (String langAndKey : langsAndKeys) {
-            String[] couple = langAndKey.split(":");
-            if (couple[0].equals(lang)) {
-                String[] langAndCountry = couple[0].split("-");
-                locale = new Locale(langAndCountry[0], langAndCountry.length > 1 ? langAndCountry[1] : "");
-            }
-        }
-
         Optional<User> optionalUser = userService.findUserById(Integer.parseInt(uid));
 
-        // if the user is not present, return the ONLYOFFICE start page
-        if (!optionalUser.isPresent()) {
-            return "index.html";
-        }
-
         User user = optionalUser.get();
         user.setImage(user.getAvatar() ? storagePathBuilder.getServerUrl(true) + "/css/img/uid-"
                 + user.getId() + ".png" : null);
@@ -127,32 +112,39 @@ public class EditorController {
                         .isEnableDirectUrl(directUrl)
                         .build()
         );
+        EditModel model = new EditModel();
 
         // add attributes to the specified model
         // add file model with the default parameters to the original model
-        model.addAttribute("model", fileModel);
-
+//        model.addAttribute("model", fileModel);
+        model.setModel(fileModel);
         // create the document service api URL and add it to the model
-        model.addAttribute("docserviceApiUrl", docserviceSite + docserviceApiUrl);
-
+//        model.addAttribute("docserviceApiUrl", docserviceSite + docserviceApiUrl);
+        model.setDocserviceApiUrl(docserviceSite + docserviceApiUrl);
         // get an image and add it to the model
-        model.addAttribute("dataInsertImage",  getInsertImage(directUrl));
+//        model.addAttribute("dataInsertImage",  getInsertImage(directUrl));
+        model.setDataInsertImage(getInsertImage(directUrl));
 
         // get a document for comparison and add it to the model
-        model.addAttribute("dataDocument",  getCompareFile(directUrl));
+//        model.addAttribute("dataDocument",  getCompareFile(directUrl));
+        model.setDataDocument(getCompareFile(directUrl));
 
         // get recipients data for mail merging and add it to the model
-        model.addAttribute("dataSpreadsheet", getSpreadsheet(directUrl));
+//        model.addAttribute("dataSpreadsheet", getSpreadsheet(directUrl));
+        model.setDataSpreadsheet(getSpreadsheet(directUrl));
 
         // get user data for mentions and add it to the model
-        model.addAttribute("usersForMentions", getUserMentions(uid));
+//        model.addAttribute("usersForMentions", getUserMentions(uid));
+        model.setUsersForMentions(getUserMentions(uid));
 
-        model.addAttribute("usersInfo", getUsersInfo(uid));
+//        model.addAttribute("usersInfo", getUsersInfo(uid));
+        model.setUsersInfo(getUsersInfo(uid));
 
         // get user data for protect and add it to the model
-        model.addAttribute("usersForProtect", getUserProtect(uid));
+//        model.addAttribute("usersForProtect", getUserProtect(uid));
+        model.setUsersForProtect(getUserProtect(uid));
 
-        return "editor.html";
+        return model;
     }
 
     private List<Mentions> getUserMentions(final String uid) {  // get user data for mentions

+ 1 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/controllers/FileController.java

@@ -68,7 +68,7 @@ import java.util.*;
 
 @CrossOrigin("*")
 @RequestMapping("/onlyOffice")
-@RestController
+@Controller
 public class FileController {
 
     @Value("${files.docservice.header}")

+ 31 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/documentserver/models/EditModel.java

@@ -0,0 +1,31 @@
+package com.onlyoffice.integration.documentserver.models;
+
+import com.onlyoffice.integration.documentserver.models.filemodel.FileModel;
+import com.onlyoffice.integration.dto.Mentions;
+import com.onlyoffice.integration.dto.Protect;
+import com.onlyoffice.integration.dto.UserInfo;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Component
+@Scope("prototype")
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class EditModel implements Serializable {
+
+    private FileModel model;
+    private String docserviceApiUrl;
+    private String dataInsertImage;
+    private String dataDocument;
+    private String dataSpreadsheet;
+    private List<Mentions> usersForMentions;
+    private List<UserInfo> usersInfo;
+    private List<Protect> usersForProtect;
+}

+ 5 - 5
ibps-provider-root/modules/provider-business/src/main/java/com/onlyoffice/integration/services/UserServices.java

@@ -24,9 +24,7 @@ import com.onlyoffice.integration.entities.User;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
+import java.util.*;
 
 @Service
 public class UserServices {
@@ -37,6 +35,8 @@ public class UserServices {
     @Autowired
     private PermissionServices permissionService;
 
+    private List<User> data = new ArrayList<>();
+
     // get a list of all users
     public List<User> findAll() {
         return new ArrayList<>();
@@ -44,7 +44,7 @@ public class UserServices {
 
     // get a user by their ID
     public Optional<User> findUserById(final Integer id) {
-        return Optional.of(new User());
+        return Optional.of(data.get(id));
     }
 
     // create a user with the specified parameters
@@ -87,7 +87,7 @@ public class UserServices {
         newUser.setPermissions(permission);
 
 //        userRepository.save(newUser); // save a new user
-
+        data.add(newUser);
         return newUser;
     }
 }

+ 436 - 0
ibps-provider-root/modules/provider-business/src/main/resources/assets/document-formats/onlyoffice-docs-formats.json

@@ -0,0 +1,436 @@
+[
+    {
+        "name": "djvu",
+        "type": "word",
+        "actions": ["view"],
+        "convert": ["bmp", "gif", "jpg", "pdf", "pdfa", "png"],
+        "mime": ["image/vnd.djvu"]
+    },
+    {
+        "name": "doc",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/msword"]
+    },
+    {
+        "name": "docm",
+        "type": "word",
+        "actions": ["view", "edit"],
+        "convert": ["docx", "docxf", "bmp", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.ms-word.document.macroenabled.12"]
+    },
+    {
+        "name": "docx",
+        "type": "word",
+        "actions": ["view", "edit"],
+        "convert": ["docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]
+    },
+    {
+        "name": "docxf",
+        "type": "word",
+        "actions": ["view", "edit"],
+        "convert": ["docx", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "oform", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf"]
+    },
+    {
+        "name": "dot",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/msword"]
+    },
+    {
+        "name": "dotm",
+        "type": "word",
+        "actions": ["view", "edit"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.ms-word.template.macroenabled.12"]
+    },
+    {
+        "name": "dotx",
+        "type": "word",
+        "actions": ["view", "edit"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.openxmlformats-officedocument.wordprocessingml.template"]
+    },
+    {
+        "name": "epub",
+        "type": "word",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert":["docx", "docxf", "bmp", "docm", "dotm", "dotx", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/epub+zip"]
+    },
+    {
+        "name": "fb2",
+        "type": "word",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["text/fb2+xml"]
+    },
+    {
+        "name": "fodt",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.oasis.opendocument.text-flat-xml"]
+    },
+    {
+        "name": "htm",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["text/html"]
+    },
+    {
+        "name": "html",
+        "type": "word",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["text/html"]
+    },
+    {
+        "name": "mht",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["message/rfc822"]
+    },
+    {
+        "name": "mhtml",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["message/rfc822"]
+    },
+    {
+        "name": "odt",
+        "type": "word",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.oasis.opendocument.text"]
+    },
+    {
+        "name": "oform",
+        "type": "word",
+        "actions": ["view"],
+        "convert": ["pdf"],
+        "mime": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform"]
+    },
+    {
+        "name": "ott",
+        "type": "word",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.oasis.opendocument.text-template"]
+    },
+    {
+        "name": "oxps",
+        "type": "word",
+        "actions": ["view"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/oxps"]
+    },
+    {
+        "name": "pdf",
+        "type": "word",
+        "actions": ["view", "fill"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/pdf", "application/acrobat", "application/nappdf", "application/x-pdf", "image/pdf"]
+    },
+    {
+        "name": "rtf",
+        "type": "word",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "txt"],
+        "mime": ["application/rtf", "text/rtf"]
+    },
+    {
+        "name": "stw",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.sun.xml.writer.template"]
+    },
+    {
+        "name": "sxw",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.sun.xml.writer"]
+    },
+    {
+        "name": "txt",
+        "type": "word",
+        "actions": ["view", "lossy-edit"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf"],
+        "mime": ["text/plain"]
+    },
+    {
+        "name": "wps",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.ms-works"]
+    },
+    {
+        "name": "wpt",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": []
+    },
+    {
+        "name": "xml",
+        "type": "word",
+        "actions": ["view", "auto-convert"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/xml", "text/xml"]
+    },
+    {
+        "name": "xps",
+        "type": "word",
+        "actions": ["view"],
+        "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"],
+        "mime": ["application/vnd.ms-xpsdocument", "application/xps"]
+    },
+    {
+        "name": "csv",
+        "type": "cell",
+        "actions": ["view", "lossy-edit"],
+        "convert": ["xlsx", "bmp", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["text/csv", "application/csv", "text/x-comma-separated-values", "text/x-csv"]
+    },
+    {
+        "name": "et",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": []
+    },
+    {
+        "name": "ett",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": []
+    },
+    {
+        "name": "fods",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.oasis.opendocument.spreadsheet-flat-xml"]
+    },
+    {
+        "name": "ods",
+        "type": "cell",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.oasis.opendocument.spreadsheet"]
+    },
+    {
+        "name": "ots",
+        "type": "cell",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.oasis.opendocument.spreadsheet-template"]
+    },
+    {
+        "name": "sxc",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.sun.xml.calc"]
+    },
+    {
+        "name": "xls",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.ms-excel"]
+    },
+    {
+        "name": "xlsb",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.ms-excel.sheet.binary.macroenabled.12"]
+    },
+    {
+        "name": "xlsm",
+        "type": "cell",
+        "actions": ["view", "edit"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xltm", "xltx"],
+        "mime": ["application/vnd.ms-excel.sheet.macroenabled.12"]
+    },
+    {
+        "name": "xlsx",
+        "type": "cell",
+        "actions": ["view", "edit"],
+        "convert": ["bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]
+    },
+    {
+        "name": "xlt",
+        "type": "cell",
+        "actions": ["view", "auto-convert"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm", "xltx"],
+        "mime": ["application/vnd.ms-excel"]
+    },
+    {
+        "name": "xltm",
+        "type": "cell",
+        "actions": ["view", "edit"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltx"],
+        "mime": ["application/vnd.ms-excel.template.macroenabled.12"]
+    },
+    {
+        "name": "xltx",
+        "type": "cell",
+        "actions": ["view", "edit"],
+        "convert": ["xlsx", "bmp", "csv", "gif", "jpg", "ods", "ots", "pdf", "pdfa", "png", "xlsm", "xltm"],
+        "mime": ["application/vnd.openxmlformats-officedocument.spreadsheetml.template"]
+    },
+    {
+        "name": "dps",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": []
+    },
+    {
+        "name": "dpt",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": []
+    },
+    {
+        "name": "fodp",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.oasis.opendocument.presentation-flat-xml"]
+    },
+    {
+        "name": "odp",
+        "type": "slide",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.oasis.opendocument.presentation"]
+    },
+    {
+        "name": "otp",
+        "type": "slide",
+        "actions": ["view", "lossy-edit", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.oasis.opendocument.presentation-template"]
+    },
+    {
+        "name": "pot",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.ms-powerpoint"]
+    },
+    {
+        "name": "potm",
+        "type": "slide",
+        "actions": ["view", "edit"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.ms-powerpoint.template.macroenabled.12"]
+    },
+    {
+        "name": "potx",
+        "type": "slide",
+        "actions": ["view", "edit"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.openxmlformats-officedocument.presentationml.template"]
+    },
+    {
+        "name": "pps",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.ms-powerpoint"]
+    },
+    {
+        "name": "ppsm",
+        "type": "slide",
+        "actions": ["view", "edit"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsx", "pptm"],
+        "mime": ["application/vnd.ms-powerpoint.slideshow.macroenabled.12"]
+    },
+    {
+        "name": "ppsx",
+        "type": "slide",
+        "actions": ["view", "edit"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "pptm"],
+        "mime": ["application/vnd.openxmlformats-officedocument.presentationml.slideshow"]
+    },
+    {
+        "name": "ppt",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.ms-powerpoint"]
+    },
+    {
+        "name": "pptm",
+        "type": "slide",
+        "actions": ["view", "edit"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx"],
+        "mime": ["application/vnd.ms-powerpoint.presentation.macroenabled.12"]
+    },
+    {
+        "name": "pptx",
+        "type": "slide",
+        "actions": ["view", "edit"],
+        "convert": ["bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.openxmlformats-officedocument.presentationml.presentation"]
+    },
+    {
+        "name": "sxi",
+        "type": "slide",
+        "actions": ["view", "auto-convert"],
+        "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"],
+        "mime": ["application/vnd.sun.xml.impress"]
+    },
+    {
+        "name": "bmp",
+        "type": "",
+        "actions": [],
+        "convert": [],
+        "mime": ["image/bmp"]
+    },
+    {
+        "name": "gif",
+        "type": "",
+        "actions": [],
+        "convert": [],
+        "mime": ["image/gif"]
+    },
+    {
+        "name": "jpg",
+        "type": "",
+        "actions": [],
+        "convert": [],
+        "mime": ["image/jpeg"]
+    },
+    {
+        "name": "pdfa",
+        "type": "",
+        "actions": [],
+        "convert": [],
+        "mime": ["application/pdf", "application/acrobat", "application/nappdf", "application/x-pdf", "image/pdf"]
+    },
+    {
+        "name": "png",
+        "type": "",
+        "actions": [],
+        "convert": [],
+        "mime": ["image/png"]
+    }
+]

+ 36 - 0
ibps-provider-root/modules/provider-business/src/main/resources/config/application-office.yml

@@ -0,0 +1,36 @@
+filename-max: 50
+files:
+  docservice:
+    header: Authorization
+    history:
+      postfix: -hist
+    languages: zh:Chinese (Simplified)|en:English
+    secret: ''
+    timeout: 120000
+    token-use-for-request: true
+    url:
+      api: web-apps/apps/api/documents/api.js
+      command: coauthoring/CommandService.ashx
+      converter: ConvertService.ashx
+      example: ''
+      preloader: web-apps/apps/api/documents/cache-scripts.html
+      site: http://192.168.56.164:9999/
+    verify-peer-off: true
+  storage: C:\Users\rex\opt\onlyoffice
+  storage.folder: documents
+filesize-max: 5242880
+server:
+  address: ''
+  port: 4000
+  version: 1.9.0
+spring:
+  servlet:
+    multipart:
+      max-file-size: 5MB
+      max-request-size: 5MB
+url:
+  converter: /converter
+  download: /download
+  editor: /editor
+  index: /dontuserthis
+  track: /track

+ 1 - 1
ibps-provider-root/modules/provider-business/src/main/resources/config/application.yml

@@ -3,7 +3,7 @@ spring:
     name: ibps-business-provider
   profiles:
     active: ${SPRING_PROFILES_ACTIVE:dev}
-    include: common,app,provider-base
+    include: common,app,provider-base,office
 swagger:
   title: 深圳市金源信通
   description: 金源信通接口文档说明