Try the fastest and simplest way to install ONLYOFFICE

How to pass data from doceditor to plugin

Integration questions/issues

How to pass data from doceditor to plugin

Postby shippeli » Fri Feb 17, 2017 2:30 pm

Hi,
i am devolping a plugin that enables users to insert content (images, text snippets, ...) from a repository into a document.
The user needs a token to access the repository which i would like to pass in from document editor.
Is it possible?
I've tried a workaround to pass the token as url query parameter (some apache rewrite and other magic;) ) but the document server seems to cut off all query parameters when calling plugin's config.
Thanks for any help!

Supplement: The editor script and the plugin script are on different servers. So due to cross origin policy i cannot set/get a variable in the doceditor (parent) frame.
shippeli
 
Posts: 12
Joined: Fri Apr 08, 2016 8:27 am

Re: How to pass data from doceditor to plugin

Postby Maxim » Mon Feb 20, 2017 11:34 am

Hello!
Developing a plugin you should remember that plugin can interact with the editor using APi only. You cannot tranafer tokens (from other services) through Document Server. If you need token authorization you will have to put token into plugin. There is no another way how to do that.
Maxim
 
Posts: 1082
Joined: Tue Oct 11, 2016 2:34 pm

Re: How to pass data from doceditor to plugin

Postby shippeli » Mon Feb 20, 2017 11:53 am

Yes, that's clear, i do the call to the external API from the plugin. But i need to inject the token into the plugin somehow.
The workaround now works, but it is not a nice solution.
shippeli
 
Posts: 12
Joined: Fri Apr 08, 2016 8:27 am


Return to Plugins

Who is online

Users browsing this forum: No registered users and 1 guest