Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
master slave
Extending liferay users in an other database
21 de abril de 2013 14:17
Respuesta

master slave

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 8 de abril de 2013

Mensajes recientes

Hi community ,

Please i realy need your help because i spent a lot of time trying to solve this problem .

I would like to develop several portlets that add students and teachers,main informations of student should be in table users_ of liferay, and add more fields in a custom Students table.
I followed this tutorial Herebut I do not understand how liferay is doing the joint between the users_ table and extension table (column :email)
1Now that we have added addUser to our new class, when our class is called it will add a user to the liferay user table as well as our extra fields to our new table, and they will be linked via the e-mail address.
.
Can someone help me to do this task.

I will be very grateful.
Sunil Kulkarni
RE: Extending liferay users in an other database
22 de abril de 2013 0:02
Respuesta

Sunil Kulkarni

Ranking: Junior Member

Mensajes: 94

Fecha de incorporación: 24 de junio de 2011

Mensajes recientes

Hello,

LR does not support one-to-one mapping between 2 tables (joins) directly with Service Builder.

In one of my earlier assignment, I did the following. In my case I have used use id to map the data between 2 tables.

User_ table - LR table (userid - unique id)
UserExt table - Create by Me (userId -PK for my table).

1. Written a addUser method in my class.
2. Get the parameter required for adding user in LR and more parameters for populating the data in my table (UserExt).
3. Add a user in LR table usinf UserServiceUtil.addUser() method. Return type of this method is User model.
4. User User.userId from LR and also populate the data in UserExt table with User.userId as PK. So that when I get userId, I am able to get the information from both the tables with one unique key.
master slave
RE: Extending liferay users in an other database
22 de abril de 2013 14:39
Respuesta

master slave

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 8 de abril de 2013

Mensajes recientes

Thank you emoticon
Do you know how to get the current userId that is inserted into database?because i need to add it in the UserExta Table
Manish Yadav
RE: Extending liferay users in an other database
22 de abril de 2013 23:55
Respuesta

Manish Yadav

Ranking: Expert

Mensajes: 385

Fecha de incorporación: 26 de mayo de 2012

Mensajes recientes

did you create any custom portlet for adding user in portal or you are using OTB portlet..
If OTB then you can create EXT ..
from com.liferay.portlet.login.action.CreateAccountAction.java you can get

long userId=User.getUserid();
master slave
RE: Extending liferay users in an other database
23 de abril de 2013 2:52
Respuesta

master slave

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 8 de abril de 2013

Mensajes recientes

I have created a custom portlet that add user in user_ table and other fields in an other table userExtra.Any solution for this issue ?
master slave
RE: Extending liferay users in an other database
23 de abril de 2013 16:49
Respuesta

master slave

Ranking: Junior Member

Mensajes: 31

Fecha de incorporación: 8 de abril de 2013

Mensajes recientes

SOLVED: UserLocalServiceUtil.addUser(...) return a User Object and from this object i got the last userId inserted in user_ table.

Thanks for your reply