论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Gus Heck
Hook requires a portlet? Why?
2012年2月17日 下午12:39
答复

Gus Heck

等级: Junior Member

帖子: 40

加入日期: 2011年11月16日

最近的帖子

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?
2012年2月17日 下午1:55
答复

David H Nebinger

Community Moderator

等级: Liferay Legend

帖子: 11108

加入日期: 2006年9月1日

最近的帖子

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?
2012年2月17日 下午8:06
答复

Hitoshi Ozawa

等级: Liferay Legend

帖子: 7949

加入日期: 2010年3月23日

最近的帖子

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?
2012年2月18日 上午12:38
答复

Arcko Duan

等级: Regular Member

帖子: 208

加入日期: 2007年10月15日

最近的帖子

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?
2012年2月22日 下午5:45
答复

Mika Koivisto

LIFERAY STAFF

等级: Liferay Legend

帖子: 1513

加入日期: 2006年8月7日

最近的帖子

Hook plugins have never required a portlet plugin so the statement is wrong.
Hitoshi Ozawa
RE: Hook requires a portlet? Why?
2012年2月22日 下午6:39
答复

Hitoshi Ozawa

等级: Liferay Legend

帖子: 7949

加入日期: 2010年3月23日

最近的帖子

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?
2012年5月9日 下午1:05
答复

Jonas Yuan

等级: Liferay Master

帖子: 993

加入日期: 2007年4月26日

最近的帖子

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