Foren

[ask] Dynamically use Datasource based on groupid Liferay 6.0

thumbnail
Danial Mustofa Habibi, geändert vor 10 Jahren.

[ask] Dynamically use Datasource based on groupid Liferay 6.0

Regular Member Beiträge: 141 Beitrittsdatum: 01.11.11 Neueste Beiträge
Hi all...how to dynamically used different database based on groupid from logging user? For example is the group name XL I want to use database XLPortlet ,and if user iwth groupname Carto using Database CartoPortlet... how to achieve this in liferay??can we use service builder to achieve this??I've try using ext-spring to connect other database than lportal,but It doesnt dynamic ;( any idea how to achieve this?? Thank's


Regards


Danial
thumbnail
Bart Simpson, geändert vor 10 Jahren.

RE: [ask] Dynamically use Datasource based on groupid Liferay 6.0

Liferay Master Beiträge: 522 Beitrittsdatum: 29.08.11 Neueste Beiträge
You can use data-source attribute of service builder for the custom services to use a different database setting, check http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd for more details.
However this won't work without some customization in your XLPortlet, you can check for the groupId and on the basis of it call different variants of your portlet.
Just an idea there can be better approaches.
thumbnail
Danial Mustofa Habibi, geändert vor 10 Jahren.

RE: [ask] Dynamically use Datasource based on groupid Liferay 6.0

Regular Member Beiträge: 141 Beitrittsdatum: 01.11.11 Neueste Beiträge
Bart Simpson:
You can use data-source attribute of service builder for the custom services to use a different database setting, check http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd for more details.
However this won't work without some customization in your XLPortlet, you can check for the groupId and on the basis of it call different variants of your portlet.
Just an idea there can be better approaches.


hi bart...wew..It's weird to call you bart ..hahaha...well anyway...I've tried that....but it can't dynamic,,,and it can only use one database for one entity, what i want is ...one entity ..can access different database based on logged user who access that entity, ..what i want is one entity can use many database but still using service-builder....any idea how to solve it??

thank's


Regards

Danial
Kiran Kulkarni, geändert vor 8 Jahren.

RE: [ask] Dynamically use Datasource based on groupid Liferay 6.0

New Member Beiträge: 12 Beitrittsdatum: 03.12.13 Neueste Beiträge
Daniel.
Did you make any progress on this.
I am looking for a similar implementation.