CallCommand function not executed for Presentation(ppt) files

Hi Team,

callCommand function is not executed for Presentation files. It is executing for Doc and Excel files. But not for Presentation files. Please check our code below.

(function (window, undefined) {
    window.Asc.plugin.init = function () {
        window.Asc.plugin.event_onDocumentContentReady = function () {
         
            window.Asc.scope.editorType = this.info.editorType;

            setInterval(function () {
                window.Asc.plugin.callCommand(
                    function () {
                        console.log('call command IN');    // Not executed for Presenatation files alone
                        var currentPage = Asc.scope.editorType === 'cell'
                            ? Api.GetActiveSheet().GetIndex()
                            : Api.GetCurrentVisiblePage();
                        return currentPage;
                    });
                window.Asc.plugin.onCommandCallback = function (currentPage) {
                    console.log('Received onCommandCallback audit result:', currentPage);
                };
            }, 1000);
        };
    }
})(window, undefined);

Hello @Jagan

Thanks for separating the topics. Have you updated Document Server as I asked in previous post?

UPD: Here is a screenshot:

As you can see, it is operating successfully.

Hi @Constantine ,

Today we upgraded to 8.2.2.22, still we are facing the same issue. callCommand is executing for Doc and Excel files. But not for Presentation files.

Did you add the presentation editor to the list of EditorsSupport parameter in config.json?

"EditorsSupport"      : ["word", "cell", "slide"],

Can you share an archive with all plugin files for test? Don’t see any other option as code above works for me.

Hi @Constantine,

We already have same “EditorsSupport” in config file.
I am unable to upload zip package here. So we have consolidated all the code in the attached document. Please do let us know if you need more info

onlyoffice.docx (14.3 KB)

Plugin did not start for me and I spotted incorrect definition of code.js file in index.html:

<script type="text/javascript" src="code.js"></script>

You did not specify correct path, it should be:

<script type="text/javascript" src="scripts/code.js"></script>

After that it runs without any issues.

Please fix this and try restarting Document Server after the change with:

  • systemctl restart ds-* for package installation;
  • supervisorctl restart all from inside the container with Document Server for Docker installation;
  • restarting all Document Server services in Windows Services for Windows installation.

Let me know if it helps.

We have index, config and code.js in the same folder. Is it mandatory to have “scripts” folder?

No, not all. It’s just a common practice.

As I mentioned, please try restarting the service. Also, let know how your plugin was added to Document Server.

Hi @Constantine ,

We are restarting the service daily. We followed the steps in the below link for adding plugins.

Are you running Community Edition of Document Server in Kubernetes environment? Do you have any errors in the browser console when running the plugin?

We are using Developer edition of Document server, we are not getting any errors in console.

Have you tried accessing the editor with your plugin from Incognito mode? It is possible that some intermediate version of plugin was cached.

By the way, I was informed that you submitted a ticket via Help Desk platform. Please do not post similar topic in different channels. I recommend sticking to the communication in the ticket.

Yes, tried in incognito mode too, it didnt work.

Hereafter, will respond in the ticket created.

Thanks

1 Like

Thanks. Feel free to share the solution the you would find with support team here so that anyone who faces the same problem could use it.

1 Like