document-server-integration icon indicating copy to clipboard operation
document-server-integration copied to clipboard

Failure to rename the "Java Spring Example" project file

Open wangliuliu1115 opened this issue 1 year ago • 3 comments

This issue is unique.

  • [X] I have used the search tool and did not find an issue describing my bug.

Operating System of DocumentServer

Linux (RPM package)

Version information

8.1

Expected Behavior

The file is renamed normally or an exception occurs

Actual Behavior

In the official "Java Spring Example" project, the "/rename" interface is called when the file is renamed. Unfortunately, the interface returns "result ok" and the file is not renamed. My documentserver is onlyoffice-documentserver:8.1

Reproduction Steps

Connect to the document server, start the "Java Spring Example" project, create a new file, open it and rename it. At this time, it is found that the interface returns success, and the file name does not change

Additional information

No response

wangliuliu1115 avatar Aug 01 '24 01:08 wangliuliu1115

I am a beginner of Onlyoffice and hope to get your help

wangliuliu1115 avatar Aug 01 '24 01:08 wangliuliu1115

A more detailed description of the problem is that the editor, including collaborators, shows the changed editor, but unfortunately the file name on the disk has not changed. I tried to manually modify the name of the file, and found that the new content of the file disappeared after the modification and refresh. The content is saved only when the observation triggers the event, and I cannot manually trigger the saved event.

wangliuliu1115 avatar Aug 23 '24 00:08 wangliuliu1115

Hi, In this case, the goal of the integration example is not to rename the physical file in storage but to demonstrate how the editor and the system it's integrated with communicate. Renaming the document in the editor calls a command to rename it for all the users who are co-editing it, but the name of the actual file is left unchanged. Here's the part of the code where this is implemented: https://github.com/ONLYOFFICE/document-server-integration/blob/develop/web/documentserver-example/java-spring/src/main/java/com/onlyoffice/integration/controllers/FileController.java#L480-L499

SergeyKorneyev avatar Aug 29 '24 15:08 SergeyKorneyev