Web Applications Integration
Integrating standalone web applications into a Portal is not an easy task. There is no magic recipe for a good integration in a very short time without having to make compromises. However, Liferay makes it possible to achieve a near-native integration with minimal effort.
The Web Application Integrator (WAI) will automatically deploy any standard Java servlet application as a portlet within Liferay. To use the WAI, simply copy an application WAR file into the autodeploy directory, and then add the portlet to your page. Liferay transparently handles the rest.
Behind the scenes, your application will be embedded in an iframe inside the portlet. While this would normally result in annoying artifacts such as scrollbars, the WAI will automatically resize the iframe to fit its contents, and provides a bookmarkable link to the current page.
Deploying a real world application #
To see an example of how simple it is to deploy an application using the WAI, follow the instructions below to install JAMWiki. It is distributed as a single WAR file, and is perfect for demonstration purposes.
- Download JAMWiki
- Start Liferay
- Copy the jamwiki.war file in the "deploy" directory, located in the root directory of your Liferay bundle
- Wait for the the portlet to be auto-deployed
- Create a new page
- Add the jamwiki portlet to the page; it will be located in the "Undefined" category
- Follow the normal jamwiki installation process
- Jamwiki is setup!
You can now use it just like any other portlet: maximize it, minimize it, or move it around the page. If you want to send someone a link to the current page or bookmark it, just click on "Permanent Link" at the bottom of the portlet.
- Refreshing your browser without clicking on "Permanent Link" will return you to the application's home page.
- Login credentials cannot be shared with the embedded application.
- If the user navigates away from your site within the iframe, the automatic resizing and permanent link functionality will cease to function.
The deployment process performed by WAI can be customized by creating a liferay-plugin-package.xml file in the WEB-INF directory of the web application.
- wai.connector.iframe.height.default: The default height of the iframe to be used on pages where the actual height cannot be determined.