|
|
@@ -81,29 +81,39 @@ public class OnlyServiceAPIImpl implements OnlyServiceAPI {
|
|
81
|
81
|
return documentEdit(map, collaborativeEditing, clientType);
|
|
82
|
82
|
}
|
|
83
|
83
|
if (VIEW.equals(mode)) {
|
|
84
|
|
- return documentView(map, clientType);
|
|
|
84
|
+ return documentView(map, collaborativeEditing, clientType);
|
|
85
|
85
|
}
|
|
|
86
|
+// if (VIEW.equals(mode)) {
|
|
|
87
|
+// return documentView(map, clientType);
|
|
|
88
|
+// }
|
|
86
|
89
|
return null;
|
|
87
|
90
|
}
|
|
88
|
91
|
|
|
89
|
92
|
private Map documentEdit(Map<String, Object> map, boolean collaborativeEditing, String clientType) {
|
|
90
|
|
- FileConfig fileConfigDTO = openEditConfig(map, "edit", collaborativeEditing,clientType);
|
|
|
93
|
+ FileConfig fileConfigDTO = openEditConfig(map, "edit", collaborativeEditing, clientType);
|
|
91
|
94
|
String json = JSON.toJSONString(fileConfigDTO);
|
|
92
|
95
|
Map<String, Object> config = JSON.parseObject(json, Map.class);
|
|
93
|
96
|
config.put("type", clientType);
|
|
94
|
97
|
return config;
|
|
95
|
98
|
}
|
|
96
|
99
|
|
|
|
100
|
+ private Map documentView(Map<String, Object> map, boolean collaborativeEditing, String clientType) {
|
|
|
101
|
+ FileConfig fileConfigDTO = openEditConfig(map, "view", collaborativeEditing, clientType);
|
|
|
102
|
+ String json = JSON.toJSONString(fileConfigDTO);
|
|
|
103
|
+ Map<String, Object> config = JSON.parseObject(json, Map.class);
|
|
|
104
|
+ config.put("type", clientType);
|
|
|
105
|
+ return config;
|
|
|
106
|
+ }
|
|
97
|
107
|
|
|
98
|
|
- private Map documentView(Map<String, Object> map,String clientType) {
|
|
99
|
|
- FileConfig fileConfigDTO = openEditConfig(map, "view", false,clientType);
|
|
|
108
|
+ private Map documentView(Map<String, Object> map, String clientType) {
|
|
|
109
|
+ FileConfig fileConfigDTO = openEditConfig(map, "view", false, clientType);
|
|
100
|
110
|
String json = JSON.toJSONString(fileConfigDTO);
|
|
101
|
111
|
Map<String, Object> config = JSON.parseObject(json, Map.class);
|
|
102
|
112
|
config.put("type", clientType);
|
|
103
|
113
|
return config;
|
|
104
|
114
|
}
|
|
105
|
115
|
|
|
106
|
|
- private FileConfig openEditConfig(Map<String, Object> map, String mode, boolean collaborativeEditing,String clientType) {
|
|
|
116
|
+ private FileConfig openEditConfig(Map<String, Object> map, String mode, boolean collaborativeEditing, String clientType) {
|
|
107
|
117
|
try {
|
|
108
|
118
|
map.put("mode", mode);
|
|
109
|
119
|
log.info("开始生成文件信息");
|
|
|
@@ -111,7 +121,7 @@ public class OnlyServiceAPIImpl implements OnlyServiceAPI {
|
|
111
|
121
|
FileMetadata tempFileInfo = fileHandler.handlerFile(map, collaborativeEditing);
|
|
112
|
122
|
//生成配置文件 TODO: 控制文件权限
|
|
113
|
123
|
log.info("开始生成编辑器配置信息");
|
|
114
|
|
- FileConfig fileConfigDTO = onlyOfficeConfigFactory.buildInitConfig(tempFileInfo.getUrl(), mode, tempFileInfo.getKey(), tempFileInfo.getOldName(),clientType);
|
|
|
124
|
+ FileConfig fileConfigDTO = onlyOfficeConfigFactory.buildInitConfig(tempFileInfo.getUrl(), mode, tempFileInfo.getKey(), tempFileInfo.getOldName(), clientType);
|
|
115
|
125
|
log.info("生成编辑器配置信息结束");
|
|
116
|
126
|
// TODO: 添加更多详细的自定义信息
|
|
117
|
127
|
return fileConfigDTO;
|