Using CubaPlatform app from other app maked whit other framework

I have a web application in production. Let’s call it AppA, developed with another framework.
I have another application developed with CubaPlatform using Dashboard, maps, charts. Let’s call it AppB.
Both with the same database.
Is it possible from AppA to call AppB to show the Dashboard, maps, charts?

In what way should I make the call?
Thank for your comments

Hi,

In a simple case, you can embed a CUBA app in <iframe>.

Also, take a look at this topic: Problem loading cuba application in <iframe> - #3 от пользователя minaev - CUBA.Platform in case you’ll have cookies disabled issue.

Regards,
Gleb

Thanks for answering.
But from AppA can I send parameters to AppB to show the Dashboard, maps and charts?
For example, date range, customer code, etc?
The two App are on the same server and have access to the same database.
Regards,
Gregorio

Hi, I think by what you wrote that you actually want to share data between the 2 apps. In that case an iframe is not a solution I fear. I mean, not a complete solution…

With an iframe you can embed some site (whatever) in another site, maybe sending some initial parameters via query strings, but that’s it for the collaboration between the two.
Luckily for us an iframe is completely isolated from the hosting page (barring bugs in the browser), so you cannot exchange data between the two sites using client side javascript.

You could, however, extend both apps to be able to exchange messages via server, for example using websockets.
It’s doable yes, but not trivial though.

P.

Hi,

If you want to view parameterized data in the Cuba app, you can use the URL in the iFrame to request some specific data like sending a particular customer type to filter the dashboard accordingly. Inside the CUBA app you can use the UrlParamChangedEvent to find the parameter.

There is also an eventing mechanism in Javascript to send messages from and to the iFrame. Here you find more information about it: Exchange data between HTML iframes — Den's Website (@pfurini FYI)

Cheers
Mario

Sure, this is a good way to customize the iframe content on first load, or if reloading the entire iframe is fine when parameters change.

Admittedly, I never used that, mainly because I’ve always avoided iframes, if possible. I see them only as a workaround for putting third-party widgets (like crappy ads) in web sites. Never had positive experiences with them…
Anyway if the OP doesn’t find a better solution than using iframes, I’d avoid client side messaging and search for a proper server side messaging solution to exchange data.

P.