Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Miles Huang
Enhance hook plugin to enable scheduler-entry config like portlet plugin
31 août 2013 10:15
Réponse

Miles Huang

Rang: Junior Member

Publications: 29

Date d'inscription: 30 août 2005

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?
David H Nebinger
RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi
31 août 2013 16:56
Réponse

David H Nebinger

Rang: Liferay Legend

Publications: 7227

Date d'inscription: 1 septembre 2006

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...
Miles Huang
RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi
5 septembre 2013 06:19
Réponse

Miles Huang

Rang: Junior Member

Publications: 29

Date d'inscription: 30 août 2005

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.
David H Nebinger
RE: Enhance hook plugin to enable scheduler-entry config like portlet plugi
5 septembre 2013 06:31
Réponse

David H Nebinger

Rang: Liferay Legend

Publications: 7227

Date d'inscription: 1 septembre 2006

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...