Index: scheduler/GroovyJob.java =================================================================== --- scheduler/GroovyJob.java (revision 0) +++ scheduler/GroovyJob.java (revision 0) @@ -0,0 +1,102 @@ +/* + * Copyright 2005-2007, XpertNet SARL, and individual contributors as indicated + * by the contributors.txt. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package com.xpn.xwiki.plugin.scheduler; + +import groovy.lang.Binding; +import groovy.lang.GroovyShell; +import org.codehaus.groovy.control.CompilationFailedException; +import org.quartz.Job; +import org.quartz.JobDataMap; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import com.xpn.xwiki.objects.BaseObject; +import com.xpn.xwiki.api.Context; + +/** + * The task that will get executed by the Scheduler when the Job is triggered. This task in + * turn calls a Groovy script to perform the execution. + * + *
Important:: Note that the script will execute in the XWiki Context that was set at
+ * the time the Job was scheduled for execution. For example calling context.getDoc()
+ * will return the current document that was set at that time and not the current document that is
+ * set when the Groovy script executes...
+ *
+ * @version $Id: $
+ */
+public class GroovyJob implements Job
+{
+ /**
+ * Executes the Groovy script passed in the script
property of the
+ * {@link com.xpn.xwiki.plugin.scheduler.SchedulerPlugin#XWIKI_JOB_CLASS} object extracted from the
+ * XWiki context passed in the Quartz's Job execution context. The XWiki Task object is
+ * looked for in the current document that was set in the context at the time the Job was
+ * scheduled.
+ *
+ * @param context the Quartz execution context containing the XWiki context from which the
+ * script to execute is retrieved
+ * @exception JobExecutionException if the script fails to execute or if the user didn't have
+ * programming rights when the Job was scheduled
+ * @see Job#execute(org.quartz.JobExecutionContext)
+ */
+ public void execute(JobExecutionContext context) throws JobExecutionException
+ {
+ try {
+ JobDataMap data = context.getJobDetail().getJobDataMap();
+
+ // The XWiki context was saved in the Job execution data map. Get it as we'll retrieve
+ // the script to execute from it.
+ Context xcontext = (Context) data.get("context");
+
+ if (xcontext.hasProgrammingRights()) {
+
+ // The current task id. This is needed to find the correct XWiki Task object that
+ // was stored in the current document as there can be several tasks stored in that
+ // document.
+ int task = data.getInt("xjob");
+
+ // Get the correct task object from the current doc set when the Job was
+ // scheduled.
+ // TODO: I think it would be much cleaner to store the XWiki Task object directly
+ // in the Job execution context rather than having to assume it's in the current
+ // document that was set at that time... Fix this!
+ BaseObject object = xcontext.getDoc().getObject(SchedulerPlugin.XWIKI_JOB_CLASS, task);
+
+ // Make the Job execution data available to the Groovy script
+ Binding binding = new Binding(data.getWrappedMap());
+
+ // Execute the Groovy script
+ GroovyShell shell = new GroovyShell(binding);
+ shell.evaluate(object.getLargeStringValue("script"));
+
+ } else {
+ throw new JobExecutionException("The user [" + xcontext.getUser() + "] didn't have "
+ + "programming rights when the job [" + context.getJobDetail().getName()
+ + "] was scheduled.");
+ }
+ } catch (CompilationFailedException e) {
+ throw new JobExecutionException("Failed to execute script for job ["
+ + context.getJobDetail().getName() + "]", e, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Index: scheduler/SchedulerPluginApi.java
===================================================================
--- scheduler/SchedulerPluginApi.java (revision 4003)
+++ scheduler/SchedulerPluginApi.java (working copy)
@@ -51,23 +51,23 @@
setPlugin(plugin);
}
- public boolean pauseTask(String number)
+ public boolean pauseJob(String number)
{
- return pauseTask(context.getDoc().getObject(SchedulerPlugin.TASK_CLASS,
+ return pauseJob(context.getDoc().getObject(SchedulerPlugin.XWIKI_JOB_CLASS,
Integer.valueOf(number).intValue()));
}
- public boolean pauseTask(Object object)
+ public boolean pauseJob(Object object)
{
- return pauseTask(object.getXWikiObject());
+ return pauseJob(object.getXWikiObject());
}
- public boolean pauseTask(BaseObject object)
+ public boolean pauseJob(BaseObject object)
{
try {
- plugin.pauseTask(String.valueOf(object.getNumber()));
+ plugin.pauseJob(String.valueOf(object.getNumber()));
saveStatus("Paused", object);
- LOG.debug("Pause Task : " + object.getStringValue("taskName"));
+ LOG.debug("Pause Job : " + object.getStringValue("jobName"));
return true;
} catch (XWikiException e) {
context.put("error", e.getMessage());
@@ -77,22 +77,22 @@
/**
* Schedule the given XObject to be executed according to its parameters. Errors are returned in
- * the context map. Scheduling can be called for example: #if($xwiki.scheduler.scheduleTask($task)!=true)
- * #error($context.get("error") #else #info("Task scheduled") #end
Where $task is an
- * XObject, instance of the XWiki.Task XClass
+ * the context map. Scheduling can be called for example: #if($xwiki.scheduler.scheduleJob($job)!=true)
+ * #error($context.get("error") #else #info("Job scheduled") #end
Where $job is an
+ * XObject, instance of the XWiki.SchedulerJobClass XClass
*
- * @param object the XObject to be scheduled, an instance of the XClass XWiki.Task
+ * @param object the XObject to be scheduled, an instance of the XClass XWiki.SchedulerJobClass
* @return true on success, false on failure
*/
- public boolean scheduleTask(Object object)
+ public boolean scheduleJob(Object object)
{
- return scheduleTask(object.getXWikiObject());
+ return scheduleJob(object.getXWikiObject());
}
- public boolean scheduleTask(BaseObject object)
+ public boolean scheduleJob(BaseObject object)
{
try {
- plugin.scheduleTask(object, context);
+ plugin.scheduleJob(object, context);
saveStatus("Scheduled", object);
return true;
} catch (Exception e) {
@@ -102,15 +102,15 @@
}
/**
- * Schedule for execution all XWiki Tasks found in the passed Document object.
+ * Schedule for execution all XWiki SchedulerJob objects found in the passed Document.
*/
- public boolean scheduleTasks(Document document)
+ public boolean scheduleJobs(Document document)
{
try {
- Vector objects = document.getObjects(SchedulerPlugin.TASK_CLASS);
+ Vector objects = document.getObjects(SchedulerPlugin.XWIKI_JOB_CLASS);
for (Iterator iterator = objects.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
- scheduleTask(object.getXWikiObject());
+ scheduleJob(object.getXWikiObject());
}
saveDocument(document.getDocument());
return true;
@@ -120,23 +120,23 @@
}
}
- public boolean resumeTask(String number)
+ public boolean resumeJob(String number)
{
- return resumeTask(context.getDoc().getObject(SchedulerPlugin.TASK_CLASS,
+ return resumeJob(context.getDoc().getObject(SchedulerPlugin.XWIKI_JOB_CLASS,
Integer.valueOf(number).intValue()));
}
- public boolean resumeTask(Object object)
+ public boolean resumeJob(Object object)
{
- return resumeTask(object.getXWikiObject());
+ return resumeJob(object.getXWikiObject());
}
- public boolean resumeTask(BaseObject object)
+ public boolean resumeJob(BaseObject object)
{
try {
- plugin.resumeTask(String.valueOf(object.getNumber()));
+ plugin.resumeJob(String.valueOf(object.getNumber()));
saveStatus("Scheduled", object);
- LOG.debug("Resume Task : " + object.getStringValue("taskName"));
+ LOG.debug("Resume Job : " + object.getStringValue("jobName"));
return true;
} catch (XWikiException e) {
context.put("error", e.getMessage());
@@ -144,23 +144,23 @@
}
}
- public boolean unscheduleTask(String number)
+ public boolean unscheduleJob(String number)
{
- return unscheduleTask(context.getDoc().getObject(SchedulerPlugin.TASK_CLASS,
+ return unscheduleJob(context.getDoc().getObject(SchedulerPlugin.XWIKI_JOB_CLASS,
Integer.valueOf(number).intValue()));
}
- public boolean unscheduleTask(Object object)
+ public boolean unscheduleJob(Object object)
{
- return unscheduleTask(object.getXWikiObject());
+ return unscheduleJob(object.getXWikiObject());
}
- public boolean unscheduleTask(BaseObject object)
+ public boolean unscheduleJob(BaseObject object)
{
try {
saveStatus("Unscheduled", object);
- plugin.unscheduleTask(String.valueOf(object.getNumber()));
- LOG.debug("Delete Task : " + object.getStringValue("taskName"));
+ plugin.unscheduleJob(String.valueOf(object.getNumber()));
+ LOG.debug("Delete Job : " + object.getStringValue("jobName"));
return true;
} catch (XWikiException e) {
context.put("error", e.getMessage());
@@ -168,6 +168,17 @@
}
}
+ public Date getNextFireTime(String objectNumber)
+ {
+ try{
+ return plugin.getNextFireTime(objectNumber);
+ }
+ catch (SchedulerPluginException e){
+ context.put("error",e.getMessage());
+ return null;
+ }
+ }
+
public Date getNextFireTime(Object object)
{
try {
@@ -186,7 +197,7 @@
private void saveStatus(String status, BaseObject object)
throws XWikiException
{
- context.getDoc().getObject(SchedulerPlugin.TASK_CLASS,
+ context.getDoc().getObject(SchedulerPlugin.XWIKI_JOB_CLASS,
object.getNumber()).setStringValue("status", status);
saveDocument(context.getDoc());
}
Index: scheduler/SchedulerPluginException.java
===================================================================
--- scheduler/SchedulerPluginException.java (revision 4003)
+++ scheduler/SchedulerPluginException.java (working copy)
@@ -23,21 +23,21 @@
public class SchedulerPluginException extends PluginException
{
- protected static final int ERROR_SCHEDULERPLUGIN_SAVE_TASK_CLASS = 90000;
+ protected static final int ERROR_SCHEDULERPLUGIN_SAVE_JOB_CLASS = 90000;
protected static final int ERROR_SCHEDULERPLUGIN_INITIALIZE_STATUS_LISTENER = 90001;
- protected static final int ERROR_SCHEDULERPLUGIN_PAUSE_TASK = 90002;
+ protected static final int ERROR_SCHEDULERPLUGIN_PAUSE_JOB = 90002;
- protected static final int ERROR_SCHEDULERPLUGIN_RESUME_TASK = 90003;
+ protected static final int ERROR_SCHEDULERPLUGIN_RESUME_JOB = 90003;
- protected static final int ERROR_SCHEDULERPLUGIN_SCHEDULE_TASK = 90004;
+ protected static final int ERROR_SCHEDULERPLUGIN_SCHEDULE_JOB = 90004;
protected static final int ERROR_SCHEDULERPLUGIN_BAD_CRON_EXPRESSION = 90005;
- protected static final int ERROR_SCHEDULERPLUGIN_TASK_CLASS_NOT_FOUND = 90006;
+ protected static final int ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND = 90006;
- protected static final int ERROR_SCHEDULERPLUGIN_TASK_DOES_NOT_EXITS = 90007;
+ protected static final int ERROR_SCHEDULERPLUGIN_JOB_DOES_NOT_EXITS = 90007;
protected static final int ERROR_SCHEDULERPLUGIN_GET_SCHEDULER = 90007;
Index: scheduler/SchedulerPlugin.java
===================================================================
--- scheduler/SchedulerPlugin.java (revision 4003)
+++ scheduler/SchedulerPlugin.java (working copy)
@@ -56,9 +56,9 @@
private static final Log LOG = LogFactory.getLog(SchedulerPlugin.class);
/**
- * Fullname of the XWiki Task Class representing a task that can be scheduled by this plugin.
+ * Fullname of the XWiki Scheduler Job Class representing a job that can be scheduled by this plugin.
*/
- public static final String TASK_CLASS = "XWiki.Task";
+ public static final String XWIKI_JOB_CLASS = "XWiki.SchedulerJobClass";
/**
* Default Quartz scheduler instance.
@@ -66,11 +66,6 @@
private Scheduler scheduler;
/**
- * Map that holds Job execution data.
- */
- private JobDataMap data = new JobDataMap();
-
- /**
* {@inheritDoc}
*
* @see XWikiDefaultPlugin#XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)
@@ -89,7 +84,7 @@
{
super.init(context);
try {
- updateTaskClass(context);
+ updateSchedulerJobClass(context);
setScheduler(getDefaultSchedulerInstance());
setStatusListener();
getScheduler().start();
@@ -111,24 +106,26 @@
}
/**
- * Schedule the given task by creating a job and associating a cron trigger with it
+ * Schedule the given job by creating a job and associating a cron trigger with it
*
- * @param object the XWiki Task object
+ * @param object the XWiki ShedulerJob object
* @param context the XWiki context
*/
- public boolean scheduleTask(BaseObject object, XWikiContext context)
+ public boolean scheduleJob(BaseObject object, XWikiContext context)
throws SchedulerPluginException
{
boolean scheduled = true;
try {
- String task = String.valueOf(object.getNumber());
+ JobDataMap data = new JobDataMap();
- JobDetail job = new JobDetail(task, Scheduler.DEFAULT_GROUP,
- Class.forName(object.getStringValue("taskClass")), true, false, true);
- Trigger trigger = new CronTrigger(task, Scheduler.DEFAULT_GROUP, task,
+ String xjob = String.valueOf(object.getNumber());
+
+ JobDetail job = new JobDetail(xjob, Scheduler.DEFAULT_GROUP,
+ Class.forName(object.getStringValue("jobClass")), true, false, true);
+ Trigger trigger = new CronTrigger(xjob, Scheduler.DEFAULT_GROUP, xjob,
Scheduler.DEFAULT_GROUP, object.getStringValue("cron"));
- data.put("task", object.getNumber());
+ data.put("xjob", new Integer(xjob));
// We offer the Job a wrapped copy of the request context and of the XWiki API
Context copy = new Context((XWikiContext) context.clone());
@@ -138,135 +135,135 @@
job.setJobDataMap(data);
getScheduler().addJob(job, true);
- int state = getScheduler().getTriggerState(task, Scheduler.DEFAULT_GROUP);
+ int state = getScheduler().getTriggerState(xjob, Scheduler.DEFAULT_GROUP);
switch (state) {
case Trigger.STATE_PAUSED:
object.setStringValue("status", "Paused");
break;
case Trigger.STATE_NORMAL:
- if (getTrigger(task).compareTo(trigger) != 0) {
- LOG.debug("Reschedule Task : " + object.getStringValue("taskName"));
+ if (getTrigger(xjob).compareTo(trigger) != 0) {
+ LOG.debug("Reschedule Job : " + object.getStringValue("jobName"));
}
getScheduler().rescheduleJob(trigger.getName(), trigger.getGroup(), trigger);
object.setStringValue("status", "Scheduled");
break;
case Trigger.STATE_NONE:
- LOG.debug("Schedule Task : " + object.getStringValue("taskName"));
+ LOG.debug("Schedule Job : " + object.getStringValue("jobName"));
getScheduler().scheduleJob(trigger);
- LOG.info("XWiki Task Status :" + object.getStringValue("status"));
+ LOG.info("XWiki Job Status :" + object.getStringValue("status"));
if (object.getStringValue("status").equals("Paused")) {
- getScheduler().pauseJob(task, Scheduler.DEFAULT_GROUP);
+ getScheduler().pauseJob(xjob, Scheduler.DEFAULT_GROUP);
object.setStringValue("status", "Paused");
} else {
object.setStringValue("status", "Scheduled");
}
break;
default:
- LOG.debug("Schedule Task : " + object.getStringValue("taskName"));
+ LOG.debug("Schedule Job : " + object.getStringValue("jobName"));
getScheduler().scheduleJob(trigger);
object.setStringValue("status", "Scheduled");
break;
}
} catch (SchedulerException e) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_SCHEDULE_TASK,
- "Error while scheduling task " + object.getStringValue("taskName"), e);
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_SCHEDULE_JOB,
+ "Error while scheduling job " + object.getStringValue("jobName"), e);
} catch (ParseException e) {
throw new SchedulerPluginException(
SchedulerPluginException.ERROR_SCHEDULERPLUGIN_BAD_CRON_EXPRESSION,
- "Error while parsing cron expression for task " + object.getStringValue("taskName"),
+ "Error while parsing cron expression for job " + object.getStringValue("jobName"),
e);
} catch (ClassNotFoundException e) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_TASK_CLASS_NOT_FOUND,
- "Error while loading task class for task : " + object.getStringValue("taskName"),
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND,
+ "Error while loading job class for job : " + object.getStringValue("jobName"),
e);
}
return scheduled;
}
/**
- * Pause the task with the given name by pausing all of its current triggers.
+ * Pause the job with the given name by pausing all of its current triggers.
*
- * @param taskName the name of the task to be paused
+ * @param jobName the name of the job to be paused
*/
- public void pauseTask(String taskName) throws SchedulerPluginException
+ public void pauseJob(String jobName) throws SchedulerPluginException
{
try {
- getScheduler().pauseJob(taskName, Scheduler.DEFAULT_GROUP);
+ getScheduler().pauseJob(jobName, Scheduler.DEFAULT_GROUP);
} catch (SchedulerException e) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_PAUSE_TASK,
- "Error occured while trying to pause task " + taskName, e);
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_PAUSE_JOB,
+ "Error occured while trying to pause job " + jobName, e);
}
}
/**
- * Resume the task with the given name (un-pause)
+ * Resume the job with the given name (un-pause)
*
- * @param taskName the name of the task to be paused
+ * @param jobName the name of the job to be paused
*/
- public void resumeTask(String taskName) throws PluginException
+ public void resumeJob(String jobName) throws PluginException
{
try {
- getScheduler().resumeJob(taskName, Scheduler.DEFAULT_GROUP);
+ getScheduler().resumeJob(jobName, Scheduler.DEFAULT_GROUP);
} catch (SchedulerException e) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_RESUME_TASK,
- "Error occured while trying to resume task " + taskName, e);
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_RESUME_JOB,
+ "Error occured while trying to resume job " + jobName, e);
}
}
/**
- * Unschedule the given task
+ * Unschedule the given job
*
- * @param taskName the task name for the task to be unscheduled
+ * @param jobName the job name for the job to be unscheduled
*/
- public void unscheduleTask(String taskName) throws SchedulerPluginException
+ public void unscheduleJob(String jobName) throws SchedulerPluginException
{
try {
- getScheduler().deleteJob(taskName, Scheduler.DEFAULT_GROUP);
+ getScheduler().deleteJob(jobName, Scheduler.DEFAULT_GROUP);
} catch (SchedulerException e) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_TASK_CLASS_NOT_FOUND,
- "Error while unscheduling task " + taskName, e);
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND,
+ "Error while unscheduling job " + jobName, e);
}
}
/**
- * Get Trigger object of the given task
+ * Get Trigger object of the given job
*
- * @param task the task name for which the trigger will be given
- * @return the trigger object of the given task
+ * @param job the job name for which the trigger will be given
+ * @return the trigger object of the given job
*/
- private Trigger getTrigger(String task) throws SchedulerPluginException
+ private Trigger getTrigger(String job) throws SchedulerPluginException
{
Trigger trigger;
try {
- trigger = getScheduler().getTrigger(task, Scheduler.DEFAULT_GROUP);
+ trigger = getScheduler().getTrigger(job, Scheduler.DEFAULT_GROUP);
} catch (SchedulerException e) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_TASK_CLASS_NOT_FOUND,
- "Error while getting trigger for task " + task, e);
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND,
+ "Error while getting trigger for job " + job, e);
}
if (trigger == null) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_TASK_DOES_NOT_EXITS,
- "Task does not exists");
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_DOES_NOT_EXITS,
+ "Job does not exists");
}
return trigger;
}
/**
- * Get the next fire time for the given task name Task
+ * Get the next fire time for the given job name SchedulerJob
*
- * @param task the task name for which the next fire time will be given
- * @return the next Date the task will be fired at
+ * @param job the job name for which the next fire time will be given
+ * @return the next Date the job will be fired at
*/
- public Date getNextFireTime(String task) throws SchedulerPluginException
+ public Date getNextFireTime(String job) throws SchedulerPluginException
{
- return getTrigger(task).getNextFireTime();
+ return getTrigger(job).getNextFireTime();
}
/**
@@ -339,42 +336,42 @@
}
/**
- * Creates the XWiki Task Class if it does not exist in the wiki. Update it if it exists but
+ * Creates the XWiki SchedulerJob XClass if it does not exist in the wiki. Update it if it exists but
* is missing some properties.
*
* @param context the XWiki context
- * @exception SchedulerPluginException if the updated Task Class failed to be saved
+ * @exception SchedulerPluginException if the updated SchedulerJob XClass failed to be saved
*/
- private void updateTaskClass(XWikiContext context) throws SchedulerPluginException
+ private void updateSchedulerJobClass(XWikiContext context) throws SchedulerPluginException
{
XWiki xwiki = context.getWiki();
boolean needsUpdate = false;
XWikiDocument doc;
try {
- doc = xwiki.getDocument(SchedulerPlugin.TASK_CLASS, context);
+ doc = xwiki.getDocument(SchedulerPlugin.XWIKI_JOB_CLASS, context);
} catch (Exception e) {
doc = new XWikiDocument();
- doc.setFullName(SchedulerPlugin.TASK_CLASS);
+ doc.setFullName(SchedulerPlugin.XWIKI_JOB_CLASS);
needsUpdate = true;
}
BaseClass bclass = doc.getxWikiClass();
- bclass.setName(SchedulerPlugin.TASK_CLASS);
- needsUpdate |= bclass.addTextField("taskName", "Task Name", 30);
- needsUpdate |= bclass.addTextField("taskClass", "Task Class", 30);
+ bclass.setName(SchedulerPlugin.XWIKI_JOB_CLASS);
+ needsUpdate |= bclass.addTextField("jobName", "Job Name", 60);
+ needsUpdate |= bclass.addTextField("jobClass", "Job Class", 60);
needsUpdate |= bclass.addTextField("status", "Status", 30);
needsUpdate |= bclass.addTextField("cron", "Cron Expression", 30);
- needsUpdate |= bclass.addTextAreaField("script", "Groovy Script", 45, 10);
+ needsUpdate |= bclass.addTextAreaField("script", "Job Script", 45, 10);
if (needsUpdate) {
try {
xwiki.saveDocument(doc, context);
} catch (XWikiException ex) {
throw new SchedulerPluginException(
- SchedulerPluginException.ERROR_SCHEDULERPLUGIN_SAVE_TASK_CLASS,
- "Error while saving " + SchedulerPlugin.TASK_CLASS
- + " class document in XWiki", ex);
+ SchedulerPluginException.ERROR_SCHEDULERPLUGIN_SAVE_JOB_CLASS,
+ "Error while saving " + SchedulerPlugin.XWIKI_JOB_CLASS
+ + " class document in XWiki", ex);
}
}
}