AW: [opencms-dev] Scheduled task
Andreas Zahner
A.Zahner at alkacon.com
Tue Mar 4 13:26:49 CET 2003
Samuel,
you can use "Scheduled tasks" to run special tasks in OpenCms, e.g. send
a Newsletter every month, check something every 30 minutes etc.
In the OpenCms backoffice, you have to enter the following information
(separated by a space):
Minute, hour, day, month, day of week, user, group, java class,
parameter.
An example for the backoffice entry:
"6 12 * * * Admin Administrators your.package.ClassName aParam" runs
your class every day at 12.06 am as user Admin in the Administrators
group.
Further examples for adjusting the time:
"5 12 * * 0" runs your class every Monday at 12.05,
"30 11 24 12 *" runs your class every year on December, 24th at 11.30
Your Java class has to implement the class I_CmsCronJob (package
com.opencms.core) and provide a method "launch" which will be executed.
Example:
/**
* This method is called by the scheduler.<p>
*
* @param CmsObject the Cms object
* @param parameter the parameters entered in the backoffice
* @return String String that is written to the opencms log
*/
public String launch(CmsObject cms, String parameter) throws
IOException, CmsException {
// enter your code here!!
return "Scheduler launched successfully!";
}
Now you should be able to create your own scheduled tasks.
Regards,
Andreas Zahner
Alkacon Software - The OpenCms Experts
http://www.alkacon.com
-----Ursprüngliche Nachricht-----
Von: owner-opencms-dev at www.opencms.org
[mailto:owner-opencms-dev at www.opencms.org] Im Auftrag von Samuel Shum
Hiu Yeung (FS)
Gesendet: Dienstag, 4. März 2003 11:09
An: opencms-dev at www.opencms.org
Betreff: [opencms-dev] Scheduled task
Hi,
I think Scheduled Task is a new feature in opencms 5.0.
Can anyone provide me an example or some kind of writeup on how to use
it? Or please direct me to a place that I can get the information on
using it?
Thanks so much,
Samuel
More information about the opencms-dev
mailing list