Message Boards

prevent jsp hook execution for all communities

avasek atok, modified 8 Years ago.

prevent jsp hook execution for all communities

Junior Member Posts: 41 Join Date: 1/9/15 Recent Posts
Hi, I have multiple communities in a single liferay instance. I have create a jsp-hook to override one of the core liferay portal jsp.
Out of 5 community sites which i have, this hook is needed by only one community. Hence I want to prevent the execution of this jsp hook for other communities. For event based hooks i can prevent based on the community url, since this is a jsp hook i haven't written any java classes.
Hence looking for any suggestions to overcome this.

Thanks,
thumbnail
Olaf Kock, modified 8 Years ago.

RE: prevent jsp hook execution for all communities

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
You can make a JSP hook an "application adapter", where it will only be active in those communities (or rather sites, I hope you're in the latest version because I can't remember when they were introduced). You'll do this by setting the custom-jsp-global flag to false. Caveat: Each site can only have one application adapter.

Also, some issues to be careful about here and here.
thumbnail
Punam Shah, modified 8 Years ago.

RE: prevent jsp hook execution for all communities

Regular Member Posts: 117 Join Date: 1/20/12 Recent Posts
Well, simple convert global hook to adapter hook ; by updating property <custom-jsp-global>false</custom-jsp-global> in liferay-hook.xml.

Please refer : https://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen06-customizing-sites-and-site-templates-with-application-adapt-0 for more information.
avasek atok, modified 8 Years ago.

RE: prevent jsp hook execution for all communities

Junior Member Posts: 41 Join Date: 1/9/15 Recent Posts
Thanks Kock and Shah. Would the same setting works for service hook, post login, auto login hooks or is there a separate mechanism.
I tried with the same setting for service hook, but in vain.
Please suggest.
thumbnail
Punam Shah, modified 8 Years ago.

RE: prevent jsp hook execution for all communities

Regular Member Posts: 117 Join Date: 1/20/12 Recent Posts
Yes. Application-Adapter will only work for JSP-Hook. Kindly brief about your current requirement, as which service you want to override.