Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jean-Noel Colin
Best way to develop JSF/Icefaces portlets
June 3, 2008 6:58 AM
Answer

Jean-Noel Colin

Rank: New Member

Posts: 17

Join Date: February 11, 2008

Recent Posts

Because we are experienced with JSF & IceFaces, we want to build our portlets using those technologies.

My question is: how should we proceed? For development, i see two options:
  1. service builder in the ext environment
  2. independent war for each portlets using the SDK


My concern is that if I use the ext environment, it mean I have one single faces-config.xml file for all my porlets. Or how should I organize the code?
On the other hand, if I use the independent war approach, will I still be able to access Liferay internal functions (like get UserId or stuff like that) from the code?

Would there be a third approach where I would generate my datalayer using the service builder and code the presentation layer in independent war?

Thanks a lot for your help

Jean-Noel Colin
Luis Colorado
RE: Best way to develop JSF/Icefaces portlets
June 4, 2008 9:39 AM
Answer

Luis Colorado

Rank: Regular Member

Posts: 110

Join Date: July 2, 2006

Recent Posts

I'm a newbie to JSF and Icefaces, but I would say that, in general, you want to deploy your applications as independent WAR files, and not use the extension environment. The extension environment is useful if you want to extend or modify Liferay behavior, but it's unnecessarily too cumbersome and slow to extend Liferay if you just want to develop applications running on portlets.

Be aware that a lot of functionality (like getting the user id) is JSR-168 standard, so you don't need to use any Liferay API to use that information. Take a look to the JSR-168 specification (http://developers.sun.com/portalserver/reference/techart/jsr168/pb_whitepaper.pdf) to see what goodies are included with the plain standard.

You can also retrieve data from the database if you need more detailed information, although, of course, it should be easier to use the API.

Good luck!

Luis
Lari Tuominen
RE: Best way to develop JSF/Icefaces portlets
June 19, 2008 7:09 AM
Answer

Lari Tuominen

Rank: Expert

Posts: 283

Join Date: November 7, 2007

Recent Posts

Hi, Jean-Noel

We have developed few JSF + ICEfaces portlets and I would prefer independent war using SDK. One way to get started is to check out samples that Neil Griffin has written (can be found from the repository).

You are able to get current userID, for instance by

FacesContext fc = FacesContext.getCurrentInstance();
ExternalContext ec = fc.getExternalContext();
String userID = ec.getRemoteUser();

Also UserLocalServiceUtil, etc. gives access to various user related attributes