留言板

Is Dynamic data source switching possible in Liferay ?

Vijay Peddareddy,修改在12 年前。

Is Dynamic data source switching possible in Liferay ?

New Member 帖子: 10 加入日期: 12-3-14 最近的帖子
Hello,

I've a Portlet deployed on 3 different pages on 3 different Organizations as shown below:

Cust1 Org > Page 1 > GetMyNamePortlet
Cust2 Org > Page 1 > GetMyNamePortlet
Cust3 Org > Page 1 > GetMyNamePortlet

On click of "Get My Name" button available in the portlet, it should dynamically connect to the Schema it is mapped to and retrieve the name from that Schema. I'm trying to achieve this using Dynamic Data source routing concept.

Environment is: Liferay 6.1 + Tomcat 7 Bundle

Please help me out if any one already did this or please share any information whether it is possible or not.

Thanks a lot in advance.

Regards
Vijay Peddareddy.
Vijay Peddareddy,修改在12 年前。

RE: Is Dynamic data source switching possible in Liferay ?

New Member 帖子: 10 加入日期: 12-3-14 最近的帖子
Hello,

Could someone please help me whether this is possible in Liferay ? If it is, please share your thoughts.

Thanks a lot in advance.

Regards
Vijay Peddareddy.
Vijay Peddareddy,修改在11 年前。

RE: Is Dynamic data source switching possible in Liferay ?

New Member 帖子: 10 加入日期: 12-3-14 最近的帖子
Hello,

Could someone please help me whether dynamic data source switching is possible in Liferay ? If it is, please share your thoughts.

Thanks a lot in advance.

Regards
Vijay Peddareddy.
thumbnail
David H Nebinger,修改在11 年前。

RE: Is Dynamic data source switching possible in Liferay ?

Liferay Legend 帖子: 14915 加入日期: 06-9-2 最近的帖子
'dynamic datasource routing' is not necessary for this implementation.

Add an organization id column to whatever table you're defining in service builder.

Portlet would pass the org id for the current user/page/whatever to the SB call and you return the appropriate data.
Vijay Peddareddy,修改在11 年前。

RE: Is Dynamic data source switching possible in Liferay ?

New Member 帖子: 10 加入日期: 12-3-14 最近的帖子
David H Nebinger:
'dynamic datasource routing' is not necessary for this implementation.

Add an organization id column to whatever table you're defining in service builder.

Portlet would pass the org id for the current user/page/whatever to the SB call and you return the appropriate data.



Thanks for your reply David.

As per the requirement I'm not supposed to add "organization" id column.

Finally, I'm able to achieve this functionality using Service Builder. I'll post the solution asap.

Regards
Vijay Peddareddy.
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: Is Dynamic data source switching possible in Liferay ?

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Just create a method in your impl to dynamically choose where to get the data based on organizationId send from the portlet.