Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Multiple Applications in one Session
I have a question regarding a project where we need to migrate different applications written in php to Vaadin.
In this context we will have to bring some of the applications together in one single application where we handle just one user session. That's because we need to handle different user roles that should get access to specific applications.
Example: User mmueller logs into the (wrapper) application with his ldap credentials. His roles are "app1-admin" and "app2-user". After logging in he gets displayed a panel at the left side where he can see a navigation menu with the applications he is allowed to see. When he clicks on the "app1" link, he will see the (dynamic) user menu for application 1 on top of the right content panel. Under the menu exists the content panel where the user can see the content chosen from the upper menu.
When the user wants to switch to application "app2" he just needs to select the application in the left navigation panel.
Here is an image showing the facts:
Maybe you have an idea how this can be done in Vaadin.
Thanks in advance guys, I wish you a good evening.
There are multiple ways to do this; one is to use the Navigator and implementing your apps as Views. You can the check the roles of your uses with a ViewChangeListener on navigation (of course you need to check the when building the view too).
Thomas Mattsson: There are multiple ways to do this; one is to use the Navigator and implementing your apps as Views. You can the check the roles of your uses with a ViewChangeListener on navigation (of course you need to check the when building the view too).
thanks for the fast reply and the proposal. The thing is that there needs to be a clean structure for each of the applications. But I think that can be faced by simply using different packages for each application. Also the application can become very large depending on the ressources needed for each of them. The rest that you mentioned is clear to me.
If you want to structure the apps as independent Vaadin applications, one way to do it would be to have a "manager" app that displays the selected application in a BrowserFrame component (ie. an iframe). If all the apps are bundled in the same "Web application" (same .war, for instance), they share the same HTTP session. Using an iframe would make correct browser navigation handling tricky, though.
You can also embed Vaadin apps in simple div elements on a web page, but I'm not sure if it's feasible to dynamically change what application is embedded there.
If it were me, I'd probably create my own lightweight navigation API so that Vaadin View == app, create a main project for the navigation framework, and create separate projects for each app. Those projects wouldn't contain an UI class, but would follow my navigation API instead.
thanks again for your comments. Generally that seems to be a tricky thing which cannot be realized in an easy way (at least if you want to have a clear application structure). It seems as we have already found a way to face the problem. I will speak (hopefully soon) to one of our developers who found that way and tell you what solution his developer team preferred. Hopefully it will help others, because I think it is a very common case.