Try the fastest and simplest way to install ONLYOFFICE

Callback url does not work?

Integration questions/issues

Callback url does not work?

Postby dgallig » Mon Nov 21, 2016 4:05 pm

Hello all,
I have two servers, server A) Debian with apache2 running my app on php ( which I want to integrate with OnlyOffice)
and the other server B ) an ubuntu 14.04 with installed the document server as per instructions.

I can see a file .docx (example1.docx) and work on it .My index.php is located on A
and it's like that :

Code: Select all
<?php

    require_once( dirname(__FILE__) . '/config.php' );

    require_once( dirname(__FILE__) . '/common.php' );

    require_once( dirname(__FILE__) . '/functions.php' );

?>

<html lang="en">

<head>
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
    <title>Open Office Integration Example</title>
</head>

<body>

<div id="placeholder"></div>

<script type="text/javascript" src="http://10.0.0.248/web-apps/apps/api/documents/api.js"></script>




<script>
new DocsAPI.DocEditor("placeholder", {
    "documentType": "text",
    "document": {
        "fileType": "docx",
        "key": "Khidsadrz6zTPdfd7",
        "title": "example1.docx",
        "url": "http://10.0.0.248/web-apps/docs/example1.docx",
    },
    "editorConfig": {
    "callbackUrl": "http://10.0.0.248/callback.php",
    "createUrl": "http://10.0.0.248/web-apps/docs",
    "lang": "en-US",
    "mode": "edit",
    "recent": [
        {
            "folder": "Examples",
            "title": "exampledocument1.docx",
            "url": "http://10.0.0.248/web-apps/docs/exampledocument1.docx",
        },
       ]
   }
});
</script>
</body>


The file is in the directory /var/www/onlyoffice/documentserver/web-apps/docs
callback.php is served by the nginx server running on B.
I can see the files, change it and If i open the editor again changes are there. But If i open the original file it shows no changes at all.
The config has those values :

Code: Select all
$GLOBALS['DOC_SERV_STORAGE_URL'] = "http://10.0.0.248/web-apps/docs";[b] <<--IS THIS OK??[/b]
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://10.0.0.248/web-apps/docs"; [b]<<--AND THIS ??[/b]
$GLOBALS['DOC_SERV_API_URL'] = "http://10.0.0.248/web-apps/apps/api/documents/api.js";
$GLOBALS['DOC_SERV_PRELOADER_URL'] = "http://10.0.0.248/web-apps/apps/api/documents/cache-scripts.html";


What I'm missing ??? Please Help me, it's very important!

Thank you in advance

David
dgallig
 
Posts: 4
Joined: Mon Nov 21, 2016 11:00 am

Re: Callback url does not work?

Postby Maxim » Tue Nov 22, 2016 10:13 am

Hello!
1. Please specify ip addresses of your servers
2. DOC_SERV_STORAGE_URL and DOC_SERV_CONVERTER_URL are not OK
3. Note that ONLYOFFICE™ Document Server includes the document editor, document editing service, document command service and document conversion service.
The document manager and document storage service are either included to Community Server or must be implemented by the software integrators who use ONLYOFFICE™ Document Server on their own server.
4. please learn attentively API once again

Feel free to contact us!
Maxim
 
Posts: 374
Joined: Tue Oct 11, 2016 2:34 pm

Re: Callback url does not work?

Postby dgallig » Tue Nov 22, 2016 12:21 pm

Hello Maxim thank you for your reply,
So the problem it that we lack those two settings...
It's not very clear, because in the example there is
$GLOBALS['DOC_SERV_STORAGE_URL'] = "http://documentserver/FileUploader.ashx";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://documentserver/ConvertService.ashx";

and maybe the link should say communityserver, would be better, I think that's the mistake many people do reading the doc :)

The ip are internals so, 192.168.0.248 is the Document Server and 192.168.0.249 is the Community server.

On the last one I have :
/var/www/onlyoffice/WebStudio/Controls/FileUploader
/var/www/onlyoffice/WebStudio/Controls/FileUploader/HttpModule
/var/www/onlyoffice/WebStudio/Products/CRM/Controls/Common/FileUploader.ascx
/var/www/onlyoffice/WebStudio/Products/Community/Modules/Wiki/WikiUC/fckeditor/editor/plugins/FileUploader.aspx
/var/www/onlyoffice/WebStudio2/Controls/FileUploader
/var/www/onlyoffice/WebStudio2/Controls/FileUploader/HttpModule
/var/www/onlyoffice/WebStudio2/Products/CRM/Controls/Common/FileUploader.ascx
/var/www/onlyoffice/WebStudio2/Products/Community/Modules/Wiki/WikiUC/fckeditor/editor/plugins/FileUploader.aspx


Not
ashx but aspx,
However I have the following ashx files:

/var/www/onlyoffice/WebStudio/login.ashx
/var/www/onlyoffice/WebStudio/Products/CRM/HttpHandlers/filehandler.ashx
/var/www/onlyoffice/WebStudio/Products/CRM/HttpHandlers/webtoleadfromhandler.ashx
/var/www/onlyoffice/WebStudio/Products/Files/HttpHandlers/filehandler.ashx
/var/www/onlyoffice/WebStudio/Products/Files/HttpHandlers/thirdpartyapphandler.ashx
/var/www/onlyoffice/WebStudio/Services/WhatsNew/feed.ashx
/var/www/onlyoffice/WebStudio/addons/mail/HttpHandlers/ContactPhoto.ashx
/var/www/onlyoffice/WebStudio/addons/mail/HttpHandlers/Download.ashx
/var/www/onlyoffice/WebStudio/addons/mail/HttpHandlers/DownloadAll.ashx
/var/www/onlyoffice/WebStudio/addons/mail/HttpHandlers/EditDocument.ashx
/var/www/onlyoffice/WebStudio/addons/mail/HttpHandlers/ViewDocument.ashx
/var/www/onlyoffice/WebStudio/addons/talk/http-poll/httppoll.ashx
/var/www/onlyoffice/WebStudio2/login.ashx
/var/www/onlyoffice/WebStudio2/Products/CRM/HttpHandlers/filehandler.ashx
/var/www/onlyoffice/WebStudio2/Products/CRM/HttpHandlers/webtoleadfromhandler.ashx
/var/www/onlyoffice/WebStudio2/Products/Files/HttpHandlers/filehandler.ashx
/var/www/onlyoffice/WebStudio2/Products/Files/HttpHandlers/thirdpartyapphandler.ashx
/var/www/onlyoffice/WebStudio2/Services/WhatsNew/feed.ashx
/var/www/onlyoffice/WebStudio2/addons/mail/HttpHandlers/ContactPhoto.ashx
/var/www/onlyoffice/WebStudio2/addons/mail/HttpHandlers/Download.ashx
/var/www/onlyoffice/WebStudio2/addons/mail/HttpHandlers/DownloadAll.ashx
/var/www/onlyoffice/WebStudio2/addons/mail/HttpHandlers/EditDocument.ashx
/var/www/onlyoffice/WebStudio2/addons/mail/HttpHandlers/ViewDocument.ashx
/var/www/onlyoffice/WebStudio2/addons/talk/http-poll/httppoll.ashx


So, which one is which? :)

Many thanks!
dgallig
 
Posts: 4
Joined: Mon Nov 21, 2016 11:00 am

Re: Callback url does not work?

Postby dgallig » Wed Nov 23, 2016 3:32 pm

Hello again.
I'll try to explain better now I have
A) My app server
B) Doc server
C) Community Server

Files are hosted on A ( but I can export a NFS share )
I understand file are loaded from A to B, which permit me the edit, then passed from B to C which convert and save the file, is that right?
I just installed the community server which is the latest debian package available using your instructions

Code: Select all
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
wget http://download.onlyoffice.com/repo/onlyoffice.key
sudo apt-key add onlyoffice.key
sudo echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
sudo apt-get update
sudo apt-get install onlyoffice-communityserver



Anyway it's not clear where are those files as for the global vars :
$GLOBALS['DOC_SERV_STORAGE_URL'] = "http://documentserver/FileUploader.ashx";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://documentserver/ConvertService.ashx";

They should be on the Community Server? We must create them? Or What?

In the documentation regarding the APIs of the Community Server seems that every operation must be completed after authenticating with the server :

"Authentication in the ONLYOFFICE™ Community Server API is managed via the HTTP authentication, i.e. every request must include the Authorization HTTP header. For information and examples please visit the Authentication section. "

Anyway I cannot find the authentication.json file on the machine, nor the api/2.0 directory.

Could you please clarify the steps that are needed?

You told me "The document manager and document storage service are either included to Community Server " so where are they and how can I address them?
Seem that the callback must be on the community server? Where ? Anywhere?

"The document storage service must return the following response, otherwise the document editor will display an error message:"


Thanks in advance

David
dgallig
 
Posts: 4
Joined: Mon Nov 21, 2016 11:00 am

Re: Callback url does not work?

Postby Maxim » Thu Nov 24, 2016 12:32 pm

Hello!
dgallig wrote:A) My app server
B) Doc server
C) Community Server


What is ip of "A" server?
Why do you want to use "C" server? You don't have to because you have already "A" server. And this moment i don't understand what for you use "C" server. For our API you should have Document server "B" and your server (website for example).

dgallig wrote:Files are hosted on A ( but I can export a NFS share )
I understand file are loaded from A to B, which permit me the edit, then passed from B to C which convert and save the file, is that right?
I just installed the community server which is the latest debian package available using your instructions


Document Server is designed to edit files only. Files you can store anywhere. It depends on you.

So you need to connect the editors to your web site. For that specify the path to the editors installation in the config.php file (in your case it's 192.168.0.248):
$GLOBALS['DOC_SERV_STORAGE_URL'] = "http://192.168.0.248/FileUploader.ashx";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://192.168.0.248/ConvertService.ashx";
$GLOBALS['DOC_SERV_API_URL'] = "http://192.168.0.248/web-apps/apps/api/documents/api.js";
$GLOBALS['DOC_SERV_PRELOADER_URL'] = "http://192.168.0.248/web-apps/apps/api/documents/cache-scripts.html";


dgallig wrote:They should be on the Community Server? We must create them? Or What?


The document manager and document storage service must be implemented by the software integrators who use ONLYOFFICE™ Document Server on their own server.
Maxim
 
Posts: 374
Joined: Tue Oct 11, 2016 2:34 pm


Return to API

Who is online

Users browsing this forum: No registered users and 1 guest

cron