Try the fastest and simplest way to install ONLYOFFICE

Custom server side saving with the callback option

Integration questions/issues

Custom server side saving with the callback option

Postby noldor » Wed Oct 21, 2015 10:06 am

Hello,
-- I installed OnlyOffice Document Server v3 and put the editor in my own web application using the API. Everything seems to be working so far.
-- But now I want to save the modified word document to my own application server from the editor.
-- To achieve this, first I tried setting the "callbackUrl" parameter pointing a dummy url of my application server. I was hoping an http request would be triggered when I use the "Save" menu item in the editor. But nothing happened.
-- I thought it could be because of some cross-domain limitations, so i set the "callbackUrl" to a dummy address with the onlyoffice document server address. Still nothing happens.

1 - When does "callbackUrl" get triggered? Or is there anything else that i should do to make it work?
2 - What does "Save" menu item do? It seems it has no function at this point..
3 - Or what is the correct approach to be able to access the modified document from my own application.

Thank you.

EDİT:
With making some more tests, I've noticed that callbackUrl is triggered by the document server itself, not by the editor in the browser. And it's only triggered only after user closes the editor. And the "Save" menu item sends a saving request via a WebSocket message to the document server. But, my requirement is still a callback option with a custom button which i will add in my application, not only when the editor is closed. I will put my own "Save" button in my application, and I want to be able to fetch the modified document at that moment when users clicks that custom button. Any help??


---
---
noldor
 
Posts: 4
Joined: Mon Oct 19, 2015 8:30 am

Re: Custom server side saving with the callback option

Postby AnaMih » Fri Oct 23, 2015 1:48 pm

1) The link as it is shown here should be pointed for collbackUrl parameter.
For example http://api.onlyoffice.com/editors/basic
2) There is no any cross-domain limitations.
3) Please specify the language of Example you've downloaded
and send us the changed fragment of the code.
User avatar
AnaMih
 
Posts: 264
Joined: Mon Aug 25, 2014 10:15 am

Re: Custom server side saving with the callback option

Postby noldor » Mon Oct 26, 2015 6:22 am

AnaMih wrote:1) 1) The link as it is shown here should be pointed for collbackUrl parameter.
For example http://api.onlyoffice.com/editors/basic
2) There is no any cross-domain limitations.
3) Please specify the language of Example you've downloaded
and send us the changed fragment of the code.


Thank you for the reply.
But as i mentioned in the last edited section on my post, what I actually need is to trigger callback process manually. It seems right now; if the websocket connection between the document server and the editor is gone, document server automatically triggers the callback. I need this process to be made manually by myself after user clicks a save button of my own. The only solution i can imagine at the moment is that i will disturb the connection by injecting some extra javascript code inside the editor myself. But if there is already an implementation i could do via API or webserver cofig, that would be more inconvenient.
noldor
 
Posts: 4
Joined: Mon Oct 19, 2015 8:30 am

Re: Custom server side saving with the callback option

Postby AnaMih » Mon Oct 26, 2015 3:48 pm

The request is sent from document service to CallBackurl after ten seconds.
"Save" button saves the current document state inside the document service.
User avatar
AnaMih
 
Posts: 264
Joined: Mon Aug 25, 2014 10:15 am

Re: Custom server side saving with the callback option

Postby noldor » Tue Oct 27, 2015 5:40 am

AnaMih wrote:The request is sent from document service to CallBackurl after ten seconds.
"Save" button saves the current document state inside the document service.


You guys just don't bother to read anything, do you? =)
Okay thanks...
noldor
 
Posts: 4
Joined: Mon Oct 19, 2015 8:30 am

Re: Custom server side saving with the callback option

Postby AnaMih » Tue Oct 27, 2015 3:53 pm

3 - Or what is the correct approach to be able to access the modified document from my own application.

Unfortunatly, there is no such opportunity.

...my requirement is still a callback option with a custom button which i will add in my application, not only when the editor is closed. I will put my own "Save" button in my application, and I want to be able to fetch the modified document at that moment when users clicks that custom button...

The request is sent from document service to CallBackurl in ten seconds after closing the changed document.
It is impossible to get the changed document in real time (without closing it).

We can assure you that we read all requests and do our best to answer the questions or request any additional information (if necessary).
User avatar
AnaMih
 
Posts: 264
Joined: Mon Aug 25, 2014 10:15 am

Re: Custom server side saving with the callback option

Postby talk2thiyagu » Tue Apr 11, 2017 1:46 pm

What if user wants to cancel the document after he types something in it.

Scenario;
-User opens the document(Onlyoffice verifies the call back url with storage server).
-User typing something on it.
-After some two lines of typing, user wants to close the document without saving it(User do not want that document to be created for now).
-As per the OnlyOffice doc., storage server will get a request from OnlyOffice server after 10 secs.
-Storage server also stores the file and it will show to the user .

How to handle this scenario?Please help me.

Thanks.
talk2thiyagu
 
Posts: 3
Joined: Mon Mar 21, 2016 6:33 am

Re: Custom server side saving with the callback option

Postby Maxim » Wed Apr 12, 2017 6:33 am

Hello talk2thiyagu!
You can disable autosave.
Maxim
 
Posts: 653
Joined: Tue Oct 11, 2016 2:34 pm

Re: Custom server side saving with the callback option

Postby talk2thiyagu » Wed Apr 12, 2017 6:53 am

How to do that?Could you please explain?
talk2thiyagu
 
Posts: 3
Joined: Mon Mar 21, 2016 6:33 am

Re: Custom server side saving with the callback option

Postby Maxim » Wed Apr 12, 2017 9:06 am

Hello talk2thiyagu!
In Editor Advanced Settings
autosave.png
autosave.png (17.05 KiB) Viewed 223 times
Maxim
 
Posts: 653
Joined: Tue Oct 11, 2016 2:34 pm

Next

Return to API

Who is online

Users browsing this forum: No registered users and 1 guest