Foros de discusión

Creating User on Liferay but also create user on other database

thumbnail
Danial Habibi, modificado hace 12 años.

Creating User on Liferay but also create user on other database

Regular Member Mensajes: 141 Fecha de incorporación: 1/11/11 Mensajes recientes
Hi All.. I need Help,how do I resolve this problem...I want to create user in liferay but whenever I create User on liferay user it also create the user on other database?
for example: liferay using lportal as database and my database is test so whenever we create user on liferay it create new data at user table on lportal,The thing I want is it also insert new user to my table user on test database....how do i resolve this???
Thank's

any help would be appreciated...sorry for bad english
thumbnail
Mayur Patel, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
If you want to connect to different schema you need to make entry in portal.ext.properties files which resides in following path

{liferay-home}\{tomcat}\webapps\ROOT\WEB-INF\classes\portal.ext.properties

// connect to test schema
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/[b]test[/b]?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root


Regards,
Mayur
thumbnail
Danial Habibi, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Regular Member Mensajes: 141 Fecha de incorporación: 1/11/11 Mensajes recientes
Mayur Patel:
If you want to connect to different schema you need to make entry in portal.ext.properties files which resides in following path

{liferay-home}\{tomcat}\webapps\ROOT\WEB-INF\classes\portal.ext.properties

// connect to test schema
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/[b]test[/b]?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root


Regards,
Mayur


I've Tried that solution still can't resolve my problem.
thumbnail
Milen Dyankov, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Regular Member Mensajes: 171 Fecha de incorporación: 23/09/09 Mensajes recientes
If both databases are the same (Oracle, MySQL, ...), check the database documentation of how can you link/share tables or replicate data.
For example one possible way of doing this in Oracle would be to have a database link to your table in Liferay's database and then add a trigger to users table to update yours accordingly.

If you are dealing with different databases, then you'll need to implement this in Liferay by hooking/extending the User service.
thumbnail
Danial Habibi, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Regular Member Mensajes: 141 Fecha de incorporación: 1/11/11 Mensajes recientes
Milen Dyankov:
If both databases are the same (Oracle, MySQL, ...), check the database documentation of how can you link/share tables or replicate data.
For example one possible way of doing this in Oracle would be to have a database link to your table in Liferay's database and then add a trigger to users table to update yours accordingly.

If you are dealing with different databases, then you'll need to implement this in Liferay by hooking/extending the User service.



I'm Using IBM DB2

can u provide example for hooking/extending user service??I'm still confuse about hook plugin in liferay
thumbnail
Milen Dyankov, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Regular Member Mensajes: 171 Fecha de incorporación: 23/09/09 Mensajes recientes
Danial Habibi:
I'm Using IBM DB2


you mean both databases are IBM DB2? If so then check database documentation about replication and/or about triggers and linking tables in different schemas .

Danial Habibi:
can u provide example for hooking/extending user service??I'm still confuse about hook plugin in liferay


Not sure what exactly needs to be changed in your case but to get a general idea of overwriting Liferay services see here
thumbnail
Danial Habibi, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Regular Member Mensajes: 141 Fecha de incorporación: 1/11/11 Mensajes recientes
Milen Dyankov:
Danial Habibi:
I'm Using IBM DB2


you mean both databases are IBM DB2? If so then check database documentation about replication and/or about triggers and linking tables in different schemas .

Danial Habibi:
can u provide example for hooking/extending user service??I'm still confuse about hook plugin in liferay


Not sure what exactly needs to be changed in your case but to get a general idea of overwriting Liferay services see here


Yes both Database are Db2...
I see Thank's...I'l Try emoticon

Anyone know can give me example for hooking user service??
thumbnail
Mayur Patel, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
thumbnail
Danial Habibi, modificado hace 12 años.

RE: Creating User on Liferay but also create user on other database

Regular Member Mensajes: 141 Fecha de incorporación: 1/11/11 Mensajes recientes
Mayur Patel:
Refer this link,

http://www.liferay.com/community/forums/-/message_boards/message/7923306


ok Thank's
Uhm Where i can find source code in liferay src for creating user process?
thank's