Picture of Silvio 2739
Registered 9 years 85 days
Silvio 2739 Tuesday, 10 March 2020, 03:17 PM
1 of 1 users consider this post helpful
How to debug admin part of an app?
When creating an app in Visual Studio you usually "Start debugging" to run the server part of an app. To run the user part you now have to start the app in the app client. But apart from the user part there is also an admin part. E.g. for a company named foo and an app named bar the user part is foo-bar.htm and the admin part is foo-baradmin.htm. How can you start the admin part while the server part still runs in debug mode?
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Tuesday, 10 March 2020, 03:30 PM
2 of 2 users consider this post helpful
Re: How to debug admin part of an app?
Hi Silvio,

the user and admin parts are just two htm files which are embedded inside the binary which you start when you debug the app. Both parts are always available and the access is controled by the PBX user objects.

The visual studio plugin just creates a PBX App object for the user part, not for the admin part.
You need to create another PBX App object where you configure the admin URL, e.g. ending with foo-baradmin.htm

Then you modify the Config Admin template and assign this new PBX App object and if you then login with a PBX user who has this Config Admin template, you can open the newly created Admin App.

Greetings,
Daniel
Picture of Emanuel 4974
Registered 5 years 35 days
Emanuel 4974 Tuesday, 12 May 2020, 11:50 AM
Re: How to debug admin part of an app?
Hello.

Could you please cover the PBX App object creation? Is it done in C++ or in myApps webpage?

I have one App service with one App instance (user and admin interfaces).

I am able to put the user app shortcut in myApps (using templates and selecting the App) but I don't know how to create a PBX App object for admin interface.

Kindly please advise.


Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Thursday, 14 May 2020, 12:51 PM
1 of 1 users consider this post helpful
Re: How to debug admin part of an app?
Hi Emanuel,

your apps folder inside your app project contains a javascript file which ends with ...manager.js
This file contains code to create PBX App objects inside a PBX.

Therefore you need to have installed the App already and created an instance inside the AP Manager (which is normally already done by the visual studio plugin itself) and then open the PBX Manager to see your own app and be able to create non admin and admin PBX App objects.

Sadly I discovered just now that the template app contains issues, that you need to manually fix to run the PBX Manager Plugin of your app.

Let's assume, you named your app appname and your company company:

appname.cpp:
- lowercase "admin" in function AppServiceApps
appList->push_back(new AppServiceApp("company-appnameadmin"));
- lowercase strings in function AppInstancePlugins:
pluginList->push_back(new AppInstancePlugin("company.appnamemanager", "company-appname.png", "company.appnamemanagertexts"));

apps/company.appnamemanager.js:
- plugin.company.appnamemanager must be lowercase in the whole file
- company.appnamemanagertexts must be lowercase in the whole file
- "/company-appnameadmin" must be lowercase too
- remove the lines which just contain "var appname = [];" and "appname=[];", as these break the code too

apps/company.appnamemanagertexts.js:
- company.appnamemanagertexts must be lowercase in the whole file

Recompile your app and it should now show up inside the PBX Manager ...

This will be fixed of course in an upcoming release for newly created apps but can't be fixed automatically inside already created applications.

Greetings,
Daniel


Picture of Emanuel 4974
Registered 5 years 35 days
Emanuel 4974 Thursday, 14 May 2020, 12:32 PM
Re: How to debug admin part of an app?
Good morning,

It is showing in PBX Manager now, but won't put admin shortcut on myApps. User shortcut works as before.

I don't have a line similar to "innopvaphone.plugins.appnamemanager" but I have this (in company.appnamemanager.js):


var plugin = plugin || {};
plugin.makenai = plugin.makenai || {};
plugin.makenai.dataexchangemanager = makenai.dataexchangemanager || function (start, item, app) {
this.createNode("div", null, null, "item-node");
innovaphone.lib1.loadCss(item.uri + ".css");

................................................................................


plugin.makenai.dataexchangemanager.prototype = innovaphone.ui1.nodePrototype;



It would be wonderful to have a template of project that is configured as expected. Couldn't find a project of App nowhere.

Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Thursday, 14 May 2020, 01:50 PM
Re: How to debug admin part of an app?
Maybe I don't really get what exactly doesn't work.

I attached a screenshot how it looks like if both an admin and a user object have been created with the PBX Manager plugin of an app.

If you click the "+ Add an app" you can add a new PBX App object either for the user or the admin app inside the PBX.

But this App is not yet visible inside your app list in myApps. You still have to configure this inside the Config User/Config Admin templates inside the PBX or directly on specific users.
There is a way to directly configure this on user templates, if you do want to do something like this?

Btw. here is the link to an updated version of the visual studio plugin which now correctly generates sources which directly work with the PBX Manager Plugin (if you create a new app):
http://build-dfs.innovaphone.com/13r1/windows/innovaphonesdk/132380/innovaphoneSDK.vsix

Greetings,
Daniel
admin.png

Picture of Emanuel 4974
Registered 5 years 35 days
Emanuel 4974 Thursday, 14 May 2020, 05:04 PM
Re: How to debug admin part of an app?
Thank you very much for your help. Is been a headache and sometimes buggy code make us lose a lot of time.

Much appreciate.
← You can define your color theme preference here