Foren

Liferay Portal as the UI layer?

miguel juteau, geändert vor 11 Jahren.

Liferay Portal as the UI layer?

New Member Beiträge: 2 Beitrittsdatum: 20.02.13 Neueste Beiträge
We were tasked with developing a new business app for our client, using a JQuery/CXF/Spring/POJO/Hibernate stack. Our client now wishes us to "use Liferay for the UI layer" to reuse all its built-in UI widgets (complex data grids, etc) and features (role-based UI personalization, etc) to speed up development. Is it correct to assume that Liferay can act as the presentation layer of our JEE web app, communicating with our app's services through REST calls? Our first impression upon reading the documentation is that we'd have to build our app as a portlet, incuding a UI layer, then integrate it into a Liferay Portal instance. Is this really a viable option for developing a custom business app? Any guidance or advice would be greatly appreciated.
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Liferay Portal as the UI layer?

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Yes, you would need to rework from a servlet to a portlet (or multiple portlets) concept.

This transition can be a challenge, but is not necessarily difficult. Really depends upon how your project is currently structured (i.e. do you use MVC pattern, do you have separate layers, etc.) and what presentation framework you're currently using (JSP, struts, JSF, etc.), as these will determine how difficult the effort will be.

There are some short cuts that may be an option. You can use an IFrame portlet to expose an existing web application, for example, but this sometimes proves challenging with respect to passing info from the portal to the servlet (i.e. user credentials, etc.). Again this depends upon the complexity and expectations of your web app.
miguel juteau, geändert vor 11 Jahren.

RE: Liferay Portal as the UI layer?

New Member Beiträge: 2 Beitrittsdatum: 20.02.13 Neueste Beiträge
Hi David,
I really appreciate your prompt feedback. We are still in design phase, so we can still adapt our architecture for a best fit with Liferay. The web UI of our app will be a rich client with excel-like functionality. Our layers were going to be 1) UI-JQUery-Ajax 2) CXF json rest services-servlet 3) POJO BOs 4) JPA-Hibernate. We were thinking of avoiding server-side UI generation, and instead have the browser make AJAX calls for both layout and data, using HTML templates.
We could publish our app as a UI-less web app (a war file), or more specifically a portlet, exposing all services (layout and data) through a REST JSON interface. Could we plug that into an instance of Liferay Portal (probably a separate war file?), which would act as the client of our portlet? What type of interface would you recommend between our app and Liferay Portal as the best option, in terms of ease of development? Thank you.
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Liferay Portal as the UI layer?

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Well, a couple of things to keep in mind since you're still in design phase.

1. Jquery was phased out of Liferay in the 6.x line. You can add jquery support back in, but it's an extra step you need to take.

2. Creating a servlet using CXF to expose the web services backed by JPA/Hibernate works. I've got a current project that uses that pattern in the Liferay platform.

3. Handling the UI on the client side using AJAX is possible. Of course we all know the difficulty here is determined by the framework you use for the implementation. You'll still need to define a basic portlet plugin so your UI will be rendered within a portlet frame, but it's still doable.

Personally here I would recommend Vaadin though. You implement your code in java for a server-side plugin, but Vaadin uses GWT so you get a rich client-side based upon AJAX. But that's just my opinion, and you are typically better off sticking with what you know.
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: Liferay Portal as the UI layer?

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
If you UI layer is mostly just javascript (including jquery), it's just possible to use Web Content portlet and paste the code as a "Source".
It's also possbile to just paste the code in the view.jsp generated by the Liferay IDE wizard. Just wrote an article on how to do this (in Japanese). It's scheduled to come next week.