Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tidy up

  • Loading branch information...
commit ee29392ca08e3013d5642d6b3e87a3b424cbb2f4 1 parent c0f0055
@jamescookie authored
View
6 addRemote.bat
@@ -1,3 +1,3 @@
-git remote add %0 https://github.com/%0/quartz-monitor.git
-git remote -v
-git fetch %0
+call git remote add %1 https://github.com/%1/quartz-monitor.git
+call git remote -v
+call git fetch %1
View
7 grails-app/controllers/org/grails/plugins/quartz/QuartzController.groovy
@@ -4,7 +4,6 @@ import org.quartz.Scheduler
import org.quartz.Trigger
import org.quartz.impl.matchers.GroupMatcher
import org.quartz.TriggerKey
-import org.quartz.CronExpression
import org.quartz.CronTrigger
import static org.quartz.impl.matchers.GroupMatcher.jobGroupEquals
@@ -139,7 +138,7 @@ class QuartzController {
return
}
- CronTrigger trigger = quartzScheduler.getTrigger(new TriggerKey(params.triggerName, params.triggerGroup))
+ CronTrigger trigger = quartzScheduler.getTrigger(new TriggerKey(params.triggerName, params.triggerGroup)) as CronTrigger
if (!trigger) {
flash.message = "No such trigger"
redirect(action: "list")
@@ -149,8 +148,8 @@ class QuartzController {
try {
trigger.setCronExpression(params.cronexpression)
quartzScheduler.rescheduleJob(new TriggerKey(params.triggerName, params.triggerGroup), trigger);
- } catch(Exception ex) {
- flash.message = "cron expression (${params.cronexpression}) was not correct"
+ } catch (Exception ex) {
+ flash.message = "cron expression (${params.cronexpression}) was not correct: $ex"
render(view: "editCronTrigger", model: [trigger: trigger])
return
}
View
62 grails-app/views/quartz/editCronTrigger.gsp
@@ -1,40 +1,38 @@
<%@ page import="org.quartz.Trigger" %>
<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <g:set var="layoutName" value="${grailsApplication.config.quartz?.monitor?.layout}" />
- <meta name="layout" content="${layoutName ?: 'main'}" />
- <title>Quartz Jobs - Reschedule</title>
- <link rel="stylesheet" href="${resource(dir: 'css', file: 'quartz-monitor.css', plugin: 'quartz-monitor')}"/>
- <link rel="stylesheet" href="${resource(dir: 'css', file: 'jquery.countdown.css', plugin: 'quartz-monitor')}"/>
- <link rel="stylesheet" href="${resource(dir: 'css', file: 'jquery.clock.css', plugin: 'quartz-monitor')}"/>
- </head>
- <body>
- <div class="content">
- <div class="nav">
- <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
- </div>
- <div class="body">
- <g:if test="${flash.message}">
- <div class="message">${flash.message}</div>
- </g:if>
- <h1 id="quartz-title">Reschedule [${trigger.name}]</h1>
- <g:form action="saveCronTrigger">
- <g:hiddenField name="triggerName" value="${trigger.name}"/>
- <g:hiddenField name="triggerGroup" value="${trigger.group}"/>
- <fieldset class="form">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <g:set var="layoutName" value="${grailsApplication.config.quartz?.monitor?.layout}"/>
+ <meta name="layout" content="${layoutName ?: 'main'}"/>
+ <title>Quartz Jobs - Reschedule</title>
+</head>
+<body>
+<div class="content">
+ <div class="nav">
+ <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
+ </div>
+
+ <div class="body">
+ <g:if test="${flash.message}">
+ <div class="message">${flash.message}</div>
+ </g:if>
+ <h1 id="quartz-title">Reschedule [${trigger.name}]</h1>
+ <g:form action="saveCronTrigger">
+ <g:hiddenField name="triggerName" value="${trigger.name}"/>
+ <g:hiddenField name="triggerGroup" value="${trigger.group}"/>
+ <fieldset class="form">
<div>
<label>Cron Expression</label>
<span class="required-indicator">*</span>
<g:textField name="cronexpression" value="${trigger.getCronExpression()}"/>
</div>
- </fieldset>
- <fieldset class="buttons">
- <g:submitButton name="save" value="Reschedule"/>
- <g:actionSubmit action="list" name="cancel" value="Cancel"/>
- </fieldset>
- </g:form>
- </div>
- </div>
- </body>
+ </fieldset>
+ <fieldset class="buttons">
+ <g:submitButton name="save" value="Reschedule"/>
+ <g:actionSubmit action="list" name="cancel" value="Cancel"/>
+ </fieldset>
+ </g:form>
+ </div>
+</div>
+</body>
</html>
View
12 test/projects/test-harness/grails-app/jobs/test/harness/CronJob.groovy
@@ -0,0 +1,12 @@
+package test.harness
+
+
+class CronJob {
+ static triggers = {
+ cron startDelay:2000, cronExpression: '0 * * * * ?'
+ }
+
+ def execute() {
+ println "running CronJob"
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.