Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Gus Heck
Hook requires a portlet? Why?
February 17, 2012 12:39 PM
Answer

Gus Heck

Rank: Junior Member

Posts: 40

Join Date: November 16, 2011

Recent Posts

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?
David H Nebinger
RE: Hook requires a portlet? Why?
February 17, 2012 1:55 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8385

Join Date: September 1, 2006

Recent Posts

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...
Hitoshi Ozawa
RE: Hook requires a portlet? Why?
February 17, 2012 8:06 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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.
Arcko Duan
RE: Hook requires a portlet? Why?
February 18, 2012 12:38 AM
Answer

Arcko Duan

Rank: Regular Member

Posts: 202

Join Date: October 15, 2007

Recent Posts

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.
Mika Koivisto
RE: Hook requires a portlet? Why?
February 22, 2012 5:45 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1505

Join Date: August 7, 2006

Recent Posts

Hook plugins have never required a portlet plugin so the statement is wrong.
Hitoshi Ozawa
RE: Hook requires a portlet? Why?
February 22, 2012 6:39 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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.
Jonas Yuan
RE: Hook requires a portlet? Why?
May 9, 2012 1:05 PM
Answer

Jonas Yuan

Rank: Liferay Master

Posts: 993

Join Date: April 26, 2007

Recent Posts

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