I have built two web applications lets call them App1 and App2.
App1 has multiple pages (Page1.jsp and Page2.jsp). App1 is a standalone application which has a menu which links to the two pages.
App2 has multiple pages (Page3.jsp and Page4.jsp). App2 is also a standalone application which has a menu which links to the two pages.
Now I would like to combine App1 and App2 into a super-application without modifying App1 or App2. This super-application should have a menu which links to App1/Page1.jsp, App1/Page2.jsp, App2/Page3.jsp, and App2/Page4.jsp.
I think of a couple of approaches to doing this:
Solution 1: Frames
I can create a menu frame which has a menu which links to the pages of App1 and App2.
I can have a seperate frame which is used to display the content for App1 and App2.
However, I am not keen to use frames (http://www.html-faq.com/htmlframes/?framesareevil).
Solution 2: Dynamically build the menu based on URL parameter
Super application can have a div-based menu which links to App1 and App2. It can pass a parameter on the URL, e.g. App1/Page1.jsp?parent=SuperApp.
App1 and App2 can dynamically build a menu based on the parent parameter.
For example, if the parent parameter is not present then App1 will use its normal menu which links to Page1.jsp and Page2.jsp.
However, if the parent parameter is present then App1 will use the SuperApp menu (SuperApp/header.html) - it will dynamically include this HTML in the JSP page. This SuperApp menu will link to all the pages provided in App1 and App2.
This second solution will work without using frames, but I wanted to explore if there are other solutions I haven't considered?
How about having a third web application responsible for menus:
Configure a very small JavaScript component in each page that makes an AJAX call to the menu application to populate it. Typically this would be implemented with an empty <div> with a special class or ID. You also have a script (downloaded from MenuApp) that locates the <div> and adds the menu.
Some ideas:
Simplest implementation is that the MenuApp uses servlet config to configure menu options. A more flexible approach could use a SQL or NoSQL DB
Parameterized call, where the calling page could call in with a menu context (eg LoggedIn, AdvancedUser, Configuration) and the MenuApp returns an appropriate subset of menu items
Even more advanced: The user can configure their own favorites
The main disadvantage with this is the additional callback, although if you are already using AJAX this might be a very low overhead.
BTW, this is similar to how FaceBook, Google+, Twitter, Pinterest, etc implement their Like, PlusOne, etc, buttons, while being minimally invasive in the third-party web application. Eg see: https://developers.google.com/+/plugins/+1button/
One possible solution is to use portlets when you want to use two applications together. Deployment will be the same, you don't need to make any changes in App1 and App2. Depending on which portlet container you would like to use, configuration is different, but finally you will have one portlet for each application and configure menu of that portal to target urls of each application.
Two possible solutions are Liferay and Jetspeed. With thous two I worked. Also there is JBoss GateIn portlet container.
Related
I have a web app that displays a list of ID's (among other things) to the user. The back end is Java EE, and the front end is built with GWT.
When the user clicks one of the ID's a callback is executed that queries additional parameters from an API using the ID. When the API returns the parameters, I want to open another web app, passing one of the parameters to it so it opens displaying information relating to that parameter. How would this normally be done?
Can I use something like LinkElement for this?
Edit: I got this working using GWT's Window.open("my.url.com");
But I'm wondering if there's a better way?
You need to use GWT's Window class to handle this.
We plan to write a Vaadin front-end which contains a couple of hundred Vaadin portlets which are associated to a menu, which in turn will dynamically select the functions that need to be presented to the user. The UI will feature a set of menu options for the user to select, and based upon user's command, it will load the appropriate portlet to an adjacent Vaadin panel. Even though the intention is to have something like this, the question is whether this application will pre-load all the functions during initialization and take a long time to load? Should we follow a particular design pattern to avoid such undesirable delay in loading the front-end?
I have one Spring MVC Application and I want to split it in to multiple applications (each one deployed separetely) but having one main application that manage the security and the header, lateral menu and footer of the classic layout.
What I really want is that whenever the user clicks a button on the side menu, the main application calls the appropriate application to fill the body. The main application has to be able to call the application server that contains the appropriate WAR, but instead to give it the control to draw the entire page only allow him drawing the body.
Sorry for my horrible english.
I am using liferay 6.2 for migrating my existing web application to liferay.I have done below things:
-->created my own theme extending the _styled theme
-->customized the navigation to have fixed sidebar on the left and content area on the right.
-->Added 3 web content display portlets dynamically and added the content into each of them.
I have all the portlets residing on the same page,these are traversed by using navigation bar on the left side. Now I have new requirement to show content depending on the client.
For e.g. I have 3 client's data right now mixed all together across all portlets ,I have requirement to segregate all the content.For e.g. If user logging in work for X client ,he/she should only see the relevant content . If there is some content which is common to all it should be displayed as it is.
There should also be a way to add/remove client at runtime.Is liferay multi-site capability something I can make use of?
How can I go ahead and achieve this? Any inputs will be highly appreciated.
I have an EJB 2.1 Project (Actually, it must be migrated into EJB 3.1 :-)) Currently it supports only one window. it means the user should work on a window. It is because of the variables, used as session variables. (Last Search Criteria, last used id, etc...).
I want to make it possible to open two or more tabs in for example Firefox and work parallel. If the user is on the same tab, the variables should be kept only for that tab. Only global variables can be valid for all tabs.
How can i approach to this problem.??
Any documentation to understand multiwindow will be also helpful.
Or any other idea or experiences about multiwindow web project is also welcome.
There isn't any built-in way to deal with this in either browsers or any EJB that I am aware of. Other web app frameworks have the concept of Web Flows that are series of connected actions that can handle multiple flows in different tabs of the same browsers, so you may wish to start looking there.
In a nutshell, they create their own "cookies" that the application controls, not the browser itself. These "application cookies" are then used to stash chunks of information related to the current set of operations, much like a session.
These sorts of things are often kicked off by the user clicking a link that opens in a "new window" (or tab) that notifies the application (via a page hit or an ajax call) that a new "work session" is being opened and gets the inner-session set up.