Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Miles Huang
Enhance hook plugin to enable scheduler-entry config like portlet plugin
August 31, 2013 10:15 AM
Answer

Miles Huang

Rank: Junior Member

Posts: 29

Join Date: August 30, 2005

Recent Posts

Since Liferay 6 the liferay-portlet.xml is enhanced for scheduler-entry definition. It is really great and convenient for the portlet developer to register a scheduled job.emoticon

But the scheduled job needn't be bundled with a portlet. There is use case that I need a background job without any UI. So a portlet plugin in this case is overkill.

Is there any reason that prevent this mechanism to be applied to other kind of plugins, like hooks and webs? I would like to see this secheduler-entry also applicable in the liferay-hook.xml configuration.

Thoughts?
David H Nebinger
RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi
August 31, 2013 4:56 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7252

Join Date: September 1, 2006

Recent Posts

hooks do not have their own context, they apply to the Liferay context. I don't know that I'd want a hook doing this sort of thing.

Personally I don't mind having it bound to a portlet. You can use the basic 'hello world' portlet, add the scheduled task to it and deploy it. You don't have to place it on any page, just deploying it will be enough for the scheduled task...
Miles Huang
RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi
September 5, 2013 6:19 AM
Answer

Miles Huang

Rank: Junior Member

Posts: 29

Join Date: August 30, 2005

Recent Posts

A hook or web plugin do resides in it's own webapp, thus have it's separated classloader which is different from PortalClassLoader. Although it might be called as ContextClassLoader instead of PortletClassLoader, the concept is same.
Such requirement is not rare in Enterprise Applications. An example of such use case is demoed in the kaleo-web plugin: It do have requirements to setup a scheduled task for Timer, and accomplished by complex spring bean configurations.
David H Nebinger
RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi
September 5, 2013 6:31 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7252

Join Date: September 1, 2006

Recent Posts

liferay-portlet.xml is the descriptor for a portlet. Hooks and webs do not have a corresponding descriptor, and I'm still not sure that there are enough use cases to warrant adding support for it, but it's just my opinion...