Foros de discusión

Hook requires a portlet? Why?

Gus Heck, modificado hace 12 años.

Hook requires a portlet? Why?

Junior Member Mensajes: 39 Fecha de incorporación: 16/11/11 Mensajes recientes
I was looking at this blog post: http://www.liferay.com/web/jonas.yuan/blog/-/blogs/4639517

And it says "A hook plugin is always combined with a portlet plugin"

But why? I want to write a hook to replace the ldap authentication implementation to use TLS (since that doesn't seem to be supported by the existing code), but I want it to apply to the whole portal. Is that statement just an error, or am I going to run into some fundamental problem trying to effect the entire portal with my hook?
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Hook requires a portlet? Why?

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
It's just wrong. A hook does not always require a portlet, nor does a portlet require a hook...

Certain portlets that integrate and/or extend Liferay functions, such as the so-portlet he mentions, require a hook to make the functionality available not just to the portlet but to other portlets to leverage the functionality in the so-portlet.

But no, you can do hooks just as themselves. I have a number of hooks, mostly jsp overrides, for overriding portal/portlet JSPs, but they are not combined with a portlet.

Your hook should be fine on it's own...
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Hook requires a portlet? Why?

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
A hook plugin is always combined with a portlet plugin. For instance, the portlet so-portlet is a portlet plugin for Social Office with hooks. In general, hooks would be very helpful tools to customize the portal without touching the code part of the portal. In addition, you would use hooks to provide patches for the portal systems or social office products.


I think what Yuan is saying is that a hook is used to overwrite parts of portlet plugin (or in other words, codes in a hook is "combined" with codes in a portlet plugin).
I think he's trying to say that you can't overwrite Liferay's core functionalities with a hook.
thumbnail
Arcko Duan, modificado hace 12 años.

RE: Hook requires a portlet? Why?

Regular Member Mensajes: 213 Fecha de incorporación: 15/10/07 Mensajes recientes
The most possible reason Yuan said that should be at the time of the blog been written, hooks was just coming out and had fewer functions than now.
thumbnail
Mika Koivisto, modificado hace 12 años.

RE: Hook requires a portlet? Why?

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
Hook plugins have never required a portlet plugin so the statement is wrong.
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Hook requires a portlet? Why?

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Following definitions are confusing too, but I like to give Yuan a benefit of a doubt.

•Hooks: allow hooking into the portal core functionality;
•Webs: regular Java EE web modules designed to work with the portal, like ESB (Enterprise Service Bus), SSO (Single Sign-On), etc.
•Ext: ext environment as a plugin.
thumbnail
Jonas Yuan, modificado hace 11 años.

RE: Hook requires a portlet? Why?

Liferay Master Mensajes: 993 Fecha de incorporación: 27/04/07 Mensajes recientes
Thanks, all,

The statement is incorrect - it should be modified.

"A hook plugin could be standalone or go with other plugins like portlets, webs, themes."

Thanks

Jonas Yuan