Changes for page Job Scheduler

Last modified by Mark Kohlmann on 2024/07/26 08:06

From version 3.1
edited by Mark Kohlmann
on 2024/07/26 08:06
Change comment: Install extension [org.xwiki.platform:xwiki-platform-scheduler-ui/16.5.0]
To version 2.1
edited by Mark Kohlmann
on 2020/04/03 03:54
Change comment: Install extension [org.xwiki.platform:xwiki-platform-scheduler-ui/12.2]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.mark\.kohlmann@chiefintegrations\.com
1 +XWiki.MarkKohlmann
Content
... ... @@ -13,13 +13,7 @@
13 13   #set ($tJobHolder = $request.which)
14 14   #set ($jobDoc = $xwiki.getDocument($tJobHolder))
15 15   #set ($jobObj = $jobDoc.getObject('XWiki.SchedulerJobClass'))
16 - #if (!$services.csrf.isTokenValid($request.form_token))
17 - ##
18 - ## Check that the CSRF token matches the user before any operation
19 - ##
20 - {{error}}$services.localization.render('xe.scheduler.invalidToken'){{/error}}
21 -
22 - #elseif ($request.do == 'schedule')
16 + #if ($request.do == 'schedule')
23 23   ##
24 24   ## Schedule a job
25 25   ##
... ... @@ -111,6 +111,7 @@
111 111  ##
112 112  |=(%scope="col"%)$services.localization.render('xe.scheduler.jobs.name')|=(%scope="col"%)$services.localization.render('xe.scheduler.jobs.status')|=(%scope="col"%)$services.localization.render('xe.scheduler.jobs.next')|=(%scope="col"%)$services.localization.render('xe.scheduler.jobs.actions')
113 113  #foreach ($docName in $services.query.xwql('from doc.object(XWiki.SchedulerJobClass) as jobs where doc.fullName <> ''XWiki.SchedulerJobTemplate''').execute())
108 + #set ($actions = {})
114 114   #set ($jobHolder = $xwiki.getDocument($docName))
115 115   #set ($job = $jobHolder.getObject('XWiki.SchedulerJobClass'))
116 116   #set ($status = $scheduler.getJobStatus($job).value)
... ... @@ -123,16 +123,18 @@
123 123   #else
124 124   #set ($firetime = $services.localization.render('xe.scheduler.jobs.next.undefined'))
125 125   #end
126 - #set ($actions = ['trigger'])
121 + #set ($ok = $!actions.put('trigger', $doc.getURL('view', "do=trigger&which=${jobHolder.fullName}")))
127 127   #if ($status == 'None')
128 - #set ($ok = $actions.add('schedule'))
123 + #set ($ok = $!actions.put('schedule', $doc.getURL('view', "do=schedule&which=${jobHolder.fullName}")))
129 129   #elseif($status == 'Normal')
130 - #set ($ok = $actions.addAll(['pause', 'unschedule']))
125 + #set ($ok = $!actions.put('pause', $doc.getURL('view', "do=pause&which=${jobHolder.fullName}")))
126 + #set ($ok = $!actions.put('unschedule', $doc.getURL('view', "do=unschedule&which=${jobHolder.fullName}")))
131 131   #elseif ($status == 'Paused')
132 - #set ($ok = $actions.addAll(['resume', 'unschedule']))
128 + #set ($ok = $!actions.put('resume', $doc.getURL('view', "do=resume&which=${jobHolder.fullName}")))
129 + #set ($ok = $!actions.put('unschedule', $doc.getURL('view', "do=unschedule&which=${jobHolder.fullName}")))
133 133   #end
134 - #set ($ok = $actions.add('delete'))
135 -|$job.get('jobName')|$status|$firetime|**$services.localization.render('xe.scheduler.jobs.actions.access')** [[$services.localization.render('xe.scheduler.jobs.actions.view')>>$services.rendering.escape($jobHolder.fullName, 'xwiki/2.1')]]#if($jobHolder.hasAccessLevel('programming')) [[$services.localization.render('xe.scheduler.jobs.actions.edit')>>path:${jobHolder.getURL('edit')}]]#end **$services.localization.render('xe.scheduler.jobs.actions.manage')**#foreach($action in $actions) [[$services.localization.render("xe.scheduler.jobs.actions.$action")>>path:$doc.getURL('view', $escapetool.url({'do': $action, 'which': $jobHolder.fullName, 'form_token': $services.csrf.token}))]]#end
131 + #set ($ok = $!actions.put('delete', $doc.getURL('view', "do=delete&which=${jobHolder.fullName}")))
132 +|$job.get('jobName')|$status|$firetime|**$services.localization.render('xe.scheduler.jobs.actions.access')** [[$services.localization.render('xe.scheduler.jobs.actions.view')>>$jobHolder.fullName]]#if($jobHolder.hasAccessLevel('programming')) [[$services.localization.render('xe.scheduler.jobs.actions.edit')>>path:${jobHolder.getURL('edit')}]]#end **$services.localization.render('xe.scheduler.jobs.actions.manage')**#foreach($action in $actions.entrySet()) [[$services.localization.render("xe.scheduler.jobs.actions.${action.key}")>>path:${action.value}]]#end
136 136  
137 137  #end
138 138  #if ($doc.hasAccessLevel('programming'))
... ... @@ -157,9 +157,9 @@
157 157   <input type="hidden" name="template" value="XWiki.SchedulerJobTemplate" />
158 158   <input type="hidden" name="sheet" value="1" />
159 159   <input type="hidden" name="space" value="Scheduler"/>
160 - <label class="sr-only" for="page">$services.localization.render('xe.scheduler.jobs.create.nameTip')</label>
157 + <label class="hidden" for="page">$services.localization.render('xe.scheduler.jobs.create.nameTip')</label>
161 161   <input id="page" name="page" size="30" type="text"
162 - placeholder="$escapetool.xml($services.localization.render('xe.scheduler.jobs.create.nameTip'))" />
159 + value="$escapetool.xml($services.localization.render('xe.scheduler.jobs.create.nameTip'))" />
163 163   <span class="buttonwrapper">
164 164   <input type="submit" class="btn btn-success"
165 165   value="$escapetool.xml($services.localization.render('xe.scheduler.jobs.create.submit'))"/>