掲示板

Hook and Ext Plugin per portal instance

thumbnail
13年前 に Philipp Michael によって更新されました。

Hook and Ext Plugin per portal instance

New Member 投稿: 22 参加年月日: 11/01/19 最新の投稿
Hey everybody,

I'm wondering if it is possible to install a hook or an ext plugin only on a portal instance instead of the entire server. I have made some changes on a Liferay portlet and this should only effect a specific instance. Is there a way to setup this within the control panel? Or do I have to make some changes via plugins sdk?

Please help.

Regards
Philipp
thumbnail
13年前 に Hitoshi Ozawa によって更新されました。

RE: Hook and Ext Plugin per portal instance

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
ext plugin is actually changing Liferay itself so it will be effective on all instances on a server. I think it depends on what kind of hook you're creating.

What is the reason for not just setting up Liferay on another vm?
thumbnail
13年前 に Philipp Michael によって更新されました。

RE: Hook and Ext Plugin per portal instance

New Member 投稿: 22 参加年月日: 11/01/19 最新の投稿
Thanks for your quick reply. The reason why we are not setting up Liferay on another VM is, that we only have one port available.

Changes I have made via hooks:

- language properties (added some values)
- custom jsps (modified the markup e.g. of asset publisher or journal content search -> those changes are mostly only necessary and volitional for one portal instance)
- portlet properties (bugfixing e.g. for rss portlet javascript bug)

Especially custom jsps should only take affect on a specific instance.
thumbnail
13年前 に Baptiste Grenier によって更新されました。

RE: Hook and Ext Plugin per portal instance

Regular Member 投稿: 100 参加年月日: 09/06/30 最新の投稿
I don't think that it's possible, but in you customs jsps you could test the companyId/organizationId/...Id in order to apply or not the custom changes (either inline or either by having a jsp calling the original jsp or a customized one).
thumbnail
13年前 に Hitoshi Ozawa によって更新されました。

RE: Hook and Ext Plugin per portal instance

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
- language properties (added some values)


Do you want to show different messages per instance? If not, this shouldn't be a problem.

- custom jsps (modified the markup e.g. of asset publisher or journal content search -> those changes are mostly only necessary and volitional for one portal instance)


Why don't you just create a new jsp files for each instance? It's difficult to have different model for each instance, but if it's just a jsp file in a portlet, it seems it possible to create a jsp file or a portlet for each instance.

- portlet properties (bugfixing e.g. for rss portlet javascript bug)

If this is just a bug fix, you probably want the bug fix for all instances so this shouldn't be a problem.
thumbnail
13年前 に Philipp Michael によって更新されました。

RE: Hook and Ext Plugin per portal instance

New Member 投稿: 22 参加年月日: 11/01/19 最新の投稿
Thank you Baptiste and Hitoshi for your suggestions. Now I'm using a switch to solve this. For example, the abstracts.jsp of the asset publihser portlet looks like this:

<c:choose>
	<c:when test="<%= company.getWebId().equals(instanceOneWebId) %>">
		<liferay-util:include page="/html/portlet/asset_publisher/display/abstracts_one.jsp" />
	</c:when>
	<c:when test="<%= company.getWebId().equals(instanceTwoWebId) %>">
		<liferay-util:include page="/html/portlet/asset_publisher/display/abstracts_two.jsp" />
	</c:when>
	<c:otherwise>
		<liferay-util:include page="/html/portlet/asset_publisher/display/abstracts_default.jsp" />
	</c:otherwise>
</c:choose>


I want to set those webids in the portal properties. How I can access this new custom properties in my jsp files?
thumbnail
11年前 に Brian Scott Schupbach によって更新されました。

RE: Hook and Ext Plugin per portal instance

Expert 投稿: 329 参加年月日: 08/10/23 最新の投稿
It would be a nice feature to be able to apply hooks on a per portal instance basis. You can disable certain portlets and themes per instance but you can't for hooks. There should be a section in "Portlet Configuration" that would allow you to disable hooks on a per instance basis.

What is the reason for not just setting up Liferay on another vm?


The reason why you would try to avoid this is the reason why portal instances were created to begin with. Increased time involved in Maintenance, updates, resources, etc.. Also if you are an enterprise customer this sort of setup won't support certain enterprise licenses.
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Hook and Ext Plugin per portal instance

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
The reason why you would try to avoid this is the reason why portal instances were created to begin with. Increased time involved in Maintenance, updates, resources, etc..


Making hook per instance seems to increate maintenance, update, resource, etc time. It seems better to just one hook with a switch to logic based on instance id inside it. It may be nice to be able to setup a hook contain multiple logics for each instance and have liferay portal do the selection on which logic to use based on a property file.

How about posting a suggestion to the "Suggestion forum"?
thumbnail
11年前 に Brian Scott Schupbach によって更新されました。

RE: Hook and Ext Plugin per portal instance

Expert 投稿: 329 参加年月日: 08/10/23 最新の投稿
I don't think making a hook per instance would increase maintenance and resources...maybe I wasn't being clear enough.

For example one my first portal instance uses active directory to login. The 2nd portal instance does not use active directory and is open for public users to sign up. I actually want to write a login hook in the 2nd instance so I can grab roles and authenticate with another system we have. If I write the hook it will be applied to both instances..which will be bad because the 1st instance uses active directory and isn't connected at all with the system I am trying to grab roles from. To make the hook work I'll have to write logic to test for each instance.

My suggestion is that hooks should work the same way themes and portlets work. You can disable them on a per instance basis. If that were the case I could write a login hook, deploy it, and have it enabled in one instance and disabled in another. Then I wouldn't have to write in logic in the hook or create a separate vm with a separate database and code base.

That's a good idea. I'll submit it as a suggestion. Thanks!
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Hook and Ext Plugin per portal instance

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
You can disable them on a per instance basis.


That's the point I'm making. It's available for use, but you're disabling it on a per portal instance. This is different from having to write a different hook (war file) for each portal instance if several portal instances needs to use them.