log.debug(
request.getServerName() + ":" + request.getServerPort() + request.getRequestURI());
log.debug("----------------------------------------------------------------");
log.debug("Request parameters:");
NamespaceMap schedulerParameters = getSchedulerParameters(request);
try {
String publicationId = (String) schedulerParameters.get(PARAMETER_PUBLICATION_ID);
log.debug("Scheduler invoked.");
log.debug("Scheduler Parameters:");
log.debug(" scheduler.publication-id: [" + publicationId + "]");
logSessionAttributes(request);
// check if the request wants to submit, modify or delete a job.
String action = (String) schedulerParameters.get(PARAMETER_ACTION);
log.debug(" scheduler.action: [" + action + "]");
if (action == null) {
} else if (action.equals(ADD)) {
Date startTime = TriggerHelper.getDate(schedulerParameters);
getScheduler().addJob(publicationId, startTime, request);
} else if (action.equals(MODIFY)) {
Date startTime = TriggerHelper.getDate(schedulerParameters);
String jobId = getJobId(schedulerParameters);
getScheduler().modifyJob(jobId, publicationId, startTime);
} else if (action.equals(DELETE)) {
String jobId = getJobId(schedulerParameters);
getScheduler().deleteJob(jobId, publicationId);
} else if (action.equals(DOCUMENT_DELETED)) {
Publication publication =
PublicationFactory.getPublication(
publicationId,
getServletContextDirectory().getAbsolutePath());
String documentUrl = (String) schedulerParameters.get(PARAMETER_DOCUMENT_URL);
org.apache.lenya.cms.publication.Document document =
publication.getDocumentBuilder().buildDocument(publication, documentUrl);
deleteDocumentJobs(document);
}