Try the fastest and simplest way to install ONLYOFFICE

Using Events & JWT

Any issues about docs (uploading, editing and etc.)

Using Events & JWT

Postby vmckillop » Wed Sep 13, 2017 4:05 am

Hi Maxim,

Is there a way to add an event such as onDocumentStateChange after the DocsAPI.DocEditor is implemented instead of part of the config? As far as I can tell there is no way javascript function to the config as well as using the config to generate the JWT token as JWT doesn't have a concept of a javascript function.

Thanks,
Vaughan
vmckillop
 
Posts: 7
Joined: Tue Aug 01, 2017 12:49 am

Re: Using Events & JWT

Postby Maxim » Wed Sep 13, 2017 1:44 pm

Hello vmckillop!
Please specify what an event do you mean, what it is supposed to do, when would you call this event....any using scenario would be great.
Maxim
 
Posts: 1162
Joined: Tue Oct 11, 2016 2:34 pm

Re: Using Events & JWT

Postby vmckillop » Thu Sep 14, 2017 5:31 am

Hi Maxim,

Any of the events available here: https://api.onlyoffice.com/editors/config/events normally configured in the config object such as

events: {
'onReady': onReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
}

I am currently calling the CommandService.ashx asking for a force save of a file, however I always receive it to my callbackhandler at a minimum of 4.5 seconds later which is generally to slow for our customers. So I was thinking of using onDocumentStateChange, to call a force save each time a change is made to the document, therefore reducing the delay.

Thanks!
vmckillop
 
Posts: 7
Joined: Tue Aug 01, 2017 12:49 am

Re: Using Events & JWT

Postby vmckillop » Thu Sep 14, 2017 6:48 am

As a follow up to this. What is the reason why a user can 'download as' in the editor and the docx file will download within 600ms however calling forcesave through command service takes > 4.5seconds to receive file. Is there a way in the config files to change this?

Thanks,
Vaughan
vmckillop
 
Posts: 7
Joined: Tue Aug 01, 2017 12:49 am

Re: Using Events & JWT

Postby vmckillop » Fri Sep 15, 2017 7:13 am

Further followup to this, To speed things up I've temporarily turned off JWT for the editor, and am utilising the onDownloadAs event. This is responding back with a URL to the file in 250ms - exactly what we are hoping for! I just can't use it with JWT enabled. Still also confused why forcesave through API takes so much longer.

Any advice on where to go from here would be appreciated.
vmckillop
 
Posts: 7
Joined: Tue Aug 01, 2017 12:49 am


Return to Documents

Who is online

Users browsing this forum: No registered users and 1 guest