The scheduler is a portlet that can be added. It is located under CMS Administration in the personalize pages. It can be used to write Java classes that can be scheduled to run. These Java classes are Quartz classes and need to implement org.quartz.Job interface. Once you have your Job class you can upload it and schedule it.
To add a job you click on add new user jobs
You may use any name and description you like but the class needs to be the fully qualified name of the job. You need to have your job on dotCMS classpath first. You can jar it up and place it in common/lib/ext of place your class under dotCMS/WEB-INF/classes.
Select your times to execute and save.
The Job Scheduler tool allows you to both view scheduled Quartz jobs (including system jobs) and to create and manage scheduled Quartz jobs to run Java classes integrated into your dotCMS system as static or dynamic (OSGI) plugins.
The Job Scheduler tool is not included in any Tool Groups by default (and is thus not enabled for any users by default); to use the Job Scheduler tool you must add it to a Tool Group.
To create a User Job, click the New button.
Creating a New Job
|Name||Name used to identify the job; this will display in the job list.|
|Execute||You may specify a start date and time and/or end date and time to run the job.|
If values are entered for this field, the Cron Expression will only be evaluated during the appropriate times.
|Class to be Executed||Select the class to be executed from the displayed list of Quartz classes.|
|Cron Expression||A cron expression specifying the specific times to run the job.|
Note: The job will only be run when the times specified in both the Execute and Cron Expression fields enable the job to run.
The System Jobs tab shows information about all quartz jobs scheduled automatically by the dotCMS system. System jobs are automatically scheduled and managed by dotCMS; you can view information on the jobs in the Scheduler tool, but you may not make any changes to these jobs.
Creating the Java Class
To create a Java class to run in the Job Scheduler:
- Implement the org.quartz.Job interface in your class.
- Create a jar containing the class.
- Place the class jar in the WEB-INF/classes folder of your dotCMS installation (/dotserver/tomcat-X.x.xx/webapps/ROOT/WEB-INF/classes).
- Add the class to your CLASSPATH.