Fóruns

Início » Liferay Portal » English » 6. Portal Framework

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Prasanna Raj
Complete Service builder working example portlet
31 de Outubro de 2012 10:50
Resposta

Prasanna Raj

Ranking: Junior Member

Mensagens: 69

Data de entrada: 30 de Janeiro de 2012

Mensagens 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
Samuel Kong
RE: Complete Service builder working example portlet
31 de Outubro de 2012 20:49
Resposta

Samuel Kong

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1030

Data de entrada: 10 de Março de 2008

Mensagens recentes

Hitoshi Ozawa
RE: Complete Service builder working example portlet
31 de Outubro de 2012 21:05
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7952

Data de entrada: 23 de Março de 2010

Mensagens 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) %>
Prasanna Raj
RE: Complete Service builder working example portlet
7 de Novembro de 2012 19:38
Resposta

Prasanna Raj

Ranking: Junior Member

Mensagens: 69

Data de entrada: 30 de Janeiro de 2012

Mensagens 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.
David H Nebinger
RE: Complete Service builder working example portlet
7 de Novembro de 2012 20:56
Resposta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensagens: 8166

Data de entrada: 1 de Setembro de 2006

Mensagens recentes

Sure, check out the UserLocalServiceImpl class and the methods it exposes.
Samuel Kong
RE: Complete Service builder working example portlet
8 de Novembro de 2012 00:49
Resposta

Samuel Kong

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1030

Data de entrada: 10 de Março de 2008

Mensagens recentes

There's probably no need to use service builder. Just call UserLocalServiceUtil.getCompanyUsers(companyId, start, end)