留言板

Multi Tenant Liferay Details

Sourabh Lonikar,修改在7 年前。

Multi Tenant Liferay Details

Junior Member 帖子: 42 加入日期: 16-11-14 最近的帖子
Hey everyone,
I am looking into multi-tenant liferay deployments. We are planning to use this feature to cohabit multiple portals in same server. But would like to have different portlets and configurations for each company/portals.

From Multi-tenancy and portal-ext.properties thread, portal properties can be overridden for each company through 'portal-${easyconf:companyId}.properties' file. Also

David H Nebinger:
In order to get customization of JSPs in a multi-tenancy setup, you're going to have to hook the JSP pages and put the code in to handle differences.


How do we ensure that below components of instance are applicable only for particular company ?

hooks
portlets
ext plugins

Do we need to check for company id programatically for each portlets or is there a way to configure the same from control panel ?

Regards,
Sourabh
thumbnail
David H Nebinger,修改在7 年前。

RE: Multi Tenant Liferay Details (答复)

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Sourabh Lonikar:
David H Nebinger:
In order to get customization of JSPs in a multi-tenancy setup, you're going to have to hook the JSP pages and put the code in to handle differences.


How do we ensure that below components of instance are applicable only for particular company ?


The Liferay portlets do not expect to have different behavior based upon company id. As you have different pages per site, you can have different configs for each portlet.

But that's the important part - config is at the page level, not the site level. If there were pages shared between the multihome companies, you cannot make the portlets on the page do one thing for one company and another thing for others. Here you'd have to basically alter the portlet code to be influenced by company id.

The Liferay plugins that you create, well they are not "company specific". Any portlet you deploy is available to a portal admin to drop on any page whether they apply to the company or not. EXT is definitely global too. Hooks also apply globally.

But what you can do is add code which uses the theme display to check the current company id and then it can go off and do different things. If I only wanted a portlet to be visible for one company, for example, you could add a <c:if /> tag to the portlet JSP that wraps the full content and is only visible then when a company id matches. It doesn't remove the portlet from placement on another company's page, but it does make it pointless for the other company to drop it somewhere because they wouldn't see anything.

Same way with the hooks; if you're adding a button to a form and it should only apply to one company, wrap it using a similar check.