mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
java: added postfix -form isSubmitForm
This commit is contained in:
@ -177,18 +177,18 @@ public class TrackManager {
|
||||
|
||||
String curExt = FileUtility.GetFileExtension(fileName);
|
||||
String downloadExt = FileUtility.GetFileExtension(downloadUri);
|
||||
String newFileName = fileName;
|
||||
Boolean newFileName = false;
|
||||
|
||||
if (!curExt.equals(downloadExt)) {
|
||||
try {
|
||||
String newFileUri = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false);
|
||||
if (newFileUri.isEmpty()) {
|
||||
newFileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
newFileName = true;
|
||||
} else {
|
||||
downloadUri = newFileUri;
|
||||
}
|
||||
} catch (Exception e){
|
||||
newFileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
newFileName = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,14 +197,20 @@ public class TrackManager {
|
||||
|
||||
if (isSubmitForm) {
|
||||
//new file
|
||||
if (newFileName.equals(fileName)){
|
||||
newFileName = DocumentManager.GetCorrectName(fileName, userAddress);
|
||||
if (newFileName){
|
||||
fileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + "-form" + downloadExt, userAddress);
|
||||
} else {
|
||||
fileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + "-form" + curExt, userAddress);
|
||||
}
|
||||
forcesavePath = DocumentManager.StoragePath(newFileName, userAddress);
|
||||
forcesavePath = DocumentManager.StoragePath(fileName, userAddress);
|
||||
} else {
|
||||
forcesavePath = DocumentManager.ForcesavePath(newFileName, userAddress, false);
|
||||
if (newFileName){
|
||||
fileName = DocumentManager.GetCorrectName(FileUtility.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
|
||||
forcesavePath = DocumentManager.ForcesavePath(fileName, userAddress, false);
|
||||
if (forcesavePath == "") {
|
||||
forcesavePath = DocumentManager.ForcesavePath(newFileName, userAddress, true);
|
||||
forcesavePath = DocumentManager.ForcesavePath(fileName, userAddress, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +221,7 @@ public class TrackManager {
|
||||
JSONArray actions = (JSONArray) body.get("actions");
|
||||
JSONObject action = (JSONObject) actions.get(0);
|
||||
String user = (String) action.get("userid");
|
||||
DocumentManager.CreateMeta(newFileName, user, "Filling Form", userAddress);
|
||||
DocumentManager.CreateMeta(fileName, user, "Filling Form", userAddress);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user