Forums de discussion

Enhance hook plugin to enable scheduler-entry config like portlet plugin

thumbnail
Miles Huang, modifié il y a 10 années.

Enhance hook plugin to enable scheduler-entry config like portlet plugin

Junior Member Publications: 29 Date d'inscription: 31/08/05 Publications récentes
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?
thumbnail
David H Nebinger, modifié il y a 10 années.

RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi

Liferay Legend Publications: 14914 Date d'inscription: 02/09/06 Publications récentes
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...
thumbnail
Miles Huang, modifié il y a 10 années.

RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi

Junior Member Publications: 29 Date d'inscription: 31/08/05 Publications récentes
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.
thumbnail
David H Nebinger, modifié il y a 10 années.

RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi

Liferay Legend Publications: 14914 Date d'inscription: 02/09/06 Publications récentes
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...