Fórum

Complete Service builder working example portlet

Prasanna Raj, modificado 11 Anos atrás.

Complete Service builder working example portlet

Junior Member Postagens: 68 Data de Entrada: 30/01/12 Postagens Recentes
Hello All,
I'm trying to work with the service builder of Liferay for the first time. I'm looking for a working example of a portlet displaying records in the front end fetched from DB using service builder. I looked at the following url:

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/service-build-5

This helped me get started with Service builders. How can I fetch the values from the util classes generated and use it in my JSP to display values in the front?

Note: All my North-East friends in US, Be careful! Be Safe! Take care!!

Thanks.
PR
thumbnail
Samuel Kong, modificado 11 Anos atrás.

RE: Complete Service builder working example portlet

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
Prasanna Raj, modificado 11 Anos atrás.

RE: Complete Service builder working example portlet

Junior Member Postagens: 68 Data de Entrada: 30/01/12 Postagens Recentes
Hey Samuel,

Thanks for the response, The example shows service.xml creating a new table in LR DB.
Is there a way I can use any existing table of LR like users or roles and just display the first say 5 rows or 10 rows in the UI?

Thanks.
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Complete Service builder working example portlet

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Sure, check out the UserLocalServiceImpl class and the methods it exposes.
thumbnail
Samuel Kong, modificado 11 Anos atrás.

RE: Complete Service builder working example portlet

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
There's probably no need to use service builder. Just call UserLocalServiceUtil.getCompanyUsers(companyId, start, end)
thumbnail
Hitoshi Ozawa, modificado 11 Anos atrás.

RE: Complete Service builder working example portlet

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
How can I fetch the values from the util classes generated and use it in my JSP to display values in the front?


You just have to call one of the impl method in the jsp. I think there was an example in the online Developer service builder manual you've read.
Service Builder just generates some classes and methods which you can customize. Just call these methods as you'll call any other java methods from jsp.

example:
<%= UserLocalServiceImpl.getFullName(userId) %>