Project

General

Profile

Revision 5044

Added by daigle about 11 years ago

change name of workflowjobid parameter to be workflowjobname which is more accurate

View differences:

lib/style/common/scheduledWorkflowResultset.xsl
79 79
							<xsl:choose>
80 80
							<xsl:when test="./status = 'scheduled'">
81 81
								<xsl:attribute name="class">underlined</xsl:attribute>
82
								<xsl:attribute name="href"><xsl:value-of select='$servletURL' />?action=unscheduleWorkflow&amp;workflowjobid=<xsl:value-of select='./name' />&amp;workflowname=<xsl:value-of select='./jobParam[@name=&apos;workflowname&apos;]/value' />&amp;workflowid=<xsl:value-of select='./jobParam[@name=&apos;workflowid&apos;]/value' />&amp;qformat=<xsl:value-of select='$qformat' />&amp;forwardto=scheduleWorkflowRun.jsp</xsl:attribute>
82
								<xsl:attribute name="href"><xsl:value-of select='$servletURL' />?action=unscheduleWorkflow&amp;workflowjobname=<xsl:value-of select='./name' />&amp;workflowname=<xsl:value-of select='./jobParam[@name=&apos;workflowname&apos;]/value' />&amp;workflowid=<xsl:value-of select='./jobParam[@name=&apos;workflowid&apos;]/value' />&amp;qformat=<xsl:value-of select='$qformat' />&amp;forwardto=scheduleWorkflowRun.jsp</xsl:attribute>
83 83
								Unschedule
84 84
							</xsl:when>
85 85
							<xsl:otherwise>
86 86
								<xsl:attribute name="class">underlined</xsl:attribute>
87
								<xsl:attribute name="href"><xsl:value-of select='$servletURL' />?action=rescheduleWorkflow&amp;workflowjobid=<xsl:value-of select='./name' />&amp;workflowname=<xsl:value-of select='./jobParam[@name=&apos;workflowname&apos;]/value' />&amp;workflowid=<xsl:value-of select='./jobParam[@name=&apos;workflowid&apos;]/value' />&amp;qformat=<xsl:value-of select='$qformat' />&amp;forwardto=scheduleWorkflowRun.jsp</xsl:attribute>
87
								<xsl:attribute name="href"><xsl:value-of select='$servletURL' />?action=rescheduleWorkflow&amp;workflowjobname=<xsl:value-of select='./name' />&amp;workflowname=<xsl:value-of select='./jobParam[@name=&apos;workflowname&apos;]/value' />&amp;workflowid=<xsl:value-of select='./jobParam[@name=&apos;workflowid&apos;]/value' />&amp;qformat=<xsl:value-of select='$qformat' />&amp;forwardto=scheduleWorkflowRun.jsp</xsl:attribute>
88 88
								Reschedule
89 89
							</xsl:otherwise>
90 90
							</xsl:choose>
......
93 93
						<xsl:when test="./status = 'unscheduled'">
94 94
							<a>
95 95
								<xsl:attribute name="class">underlined</xsl:attribute>
96
								<xsl:attribute name="href"><xsl:value-of select='$servletURL' />?action=deleteScheduledWorkflow&amp;workflowjobid=<xsl:value-of select='./name' />&amp;&amp;workflowname=<xsl:value-of select='./jobParam[@name=&apos;workflowname&apos;]/value' />&amp;workflowid=<xsl:value-of select='./jobParam[@name=&apos;workflowid&apos;]/value' />&amp;qformat=<xsl:value-of select='$qformat' />&amp;forwardto=scheduleWorkflowRun.jsp</xsl:attribute>
96
								<xsl:attribute name="href"><xsl:value-of select='$servletURL' />?action=deleteScheduledWorkflow&amp;workflowjobname=<xsl:value-of select='./name' />&amp;&amp;workflowname=<xsl:value-of select='./jobParam[@name=&apos;workflowname&apos;]/value' />&amp;workflowid=<xsl:value-of select='./jobParam[@name=&apos;workflowid&apos;]/value' />&amp;qformat=<xsl:value-of select='$qformat' />&amp;forwardto=scheduleWorkflowRun.jsp</xsl:attribute>
97 97
								Delete	
98 98
							</a>
99 99
						</xsl:when>
src/edu/ucsb/nceas/workflowscheduler/WorkflowScheduler.java
199 199
	 * @param groups
200 200
	 *            the user's group
201 201
	 */
202
	public void unScheduleJob(HttpServletRequest request, HttpServletResponse response,
202
	public void unscheduleJob(HttpServletRequest request, HttpServletResponse response,
203 203
			Hashtable<String, String[]> params, String username, String[] groups)
204 204
			throws MetacatSchedulerException {
205 205
		try {
206 206
			// workflow job id must exist
207
			String jobNames[] = params.get("workflowjobid");
207
			String jobNames[] = params.get("workflowjobname");
208 208
			if (jobNames == null || jobNames.length == 0) {
209
				throw new MetacatSchedulerException("SchedulerService.unScheduleJob - workflowjobid " 
209
				throw new MetacatSchedulerException("SchedulerService.unScheduleJob - workflowjobname " 
210 210
						+ "field must be populated in scheduler parameters when unscheduling job.");
211 211
			}
212 212
			String jobName = jobNames[0];
213 213

  
214 214
			// unschedule the job
215 215
			SchedulerService schedulerService = SchedulerService.getInstance();
216
			String xmlResult = schedulerService.unScheduleJob(jobName, username, groups);
216
			String xmlResult = schedulerService.unscheduleJob(jobName, username, groups);
217 217
			
218 218
			ResponseUtil.sendSuccessXML(response, xmlResult);
219 219

  
......
240 240
	 * @param groups
241 241
	 *            the user's group
242 242
	 */
243
	public void reScheduleJob(HttpServletRequest request, HttpServletResponse response, 
243
	public void rescheduleJob(HttpServletRequest request, HttpServletResponse response, 
244 244
			Hashtable<String, String[]> params, String username,
245 245
			String[] groups) throws MetacatSchedulerException {
246 246
		 		
247 247
		try {
248 248
			// workflow job id must exist
249
			String jobNames[] = params.get("workflowjobid");	
249
			String jobNames[] = params.get("workflowjobname");	
250 250
			if (jobNames == null || jobNames.length == 0) {
251
				throw new MetacatSchedulerException("WorkflowScheduler.reScheduleJob - workflowjobid field must be populated "
251
				throw new MetacatSchedulerException("WorkflowScheduler.reScheduleJob - workflowjobname field must be populated "
252 252
						+ "in scheduler parameters when rescheduling job.");
253 253
			}			
254 254
			String jobName = jobNames[0];
......
281 281
			Hashtable<String, String[]> params, String username, String[] groups) throws MetacatSchedulerException {
282 282
		 try {
283 283
			// workflow job id must exist
284
			String jobNames[] = params.get("workflowjobid");
284
			String jobNames[] = params.get("workflowjobname");
285 285
			if (jobNames == null || jobNames.length == 0) {
286 286
				throw new MetacatSchedulerException(
287 287
						"WorkflowScheduler.deleteJob - workflowname field must be populated "
src/edu/ucsb/nceas/workflowscheduler/WorkflowSchedulerServlet.java
87 87
 *                            removes it from the scheduling engine and changes the 
88 88
 *                            status in the scheduled_job table to " unscheduled.  Note 
89 89
 *                            that this may be extracted into a separate servlet.
90
 *     workflowjobid -- The job ID for the workflow run that we want to unschedule.  This
90
 *     workflowjobname -- The job ID for the workflow run that we want to unschedule.  This
91 91
 *                      is held in the database as scheduled_job.name
92 92
 *     forwardto -- If provided, forward to this page when processing is done.
93 93
 *     qformat -- If provided, render results using the stylesheets associated with
......
96 96
 *                            registers it with the scheduling engine and changes the 
97 97
 *                            status in the scheduled_job table to " scheduled.  Note 
98 98
 *                            that this may be extracted into a separate servlet.
99
 *     workflowjobid -- The job ID for the workflow run that we want to reschedule.  This
99
 *     workflowjobname -- The job ID for the workflow run that we want to reschedule.  This
100 100
 *                      is held in the database as scheduled_job.name
101 101
 *     forwardto -- If provided, forward to this page when processing is done.
102 102
 *     qformat -- If provided, render results using the stylesheets associated with
......
105 105
 *                            removes it from the scheduling engine and changes the 
106 106
 *                            status in the scheduled_job table to " deleted.  Note 
107 107
 *                            that this may be extracted into a separate servlet.
108
 *     workflowjobid -- The job ID for the workflow run that we want to delete.  This
108
 *     workflowjobname -- The job ID for the workflow run that we want to delete.  This
109 109
 *                      is held in the database as scheduled_job.name
110 110
 *     forwardto -- If provided, forward to this page when processing is done.
111 111
 *     qformat -- If provided, render results using the stylesheets associated with
......
332 332
				}
333 333
			} else if (action.equals("unscheduleWorkflow")) {
334 334
				try {
335
					WorkflowScheduler.getInstance().unScheduleJob(request, response,
335
					WorkflowScheduler.getInstance().unscheduleJob(request, response,
336 336
							params, userName, groupNames);
337 337
					return;
338 338
				} catch (BaseException be) {
......
344 344
				}
345 345
			} else if (action.equals("rescheduleWorkflow")) {
346 346
				try {
347
					WorkflowScheduler.getInstance().reScheduleJob(request, response,
347
					WorkflowScheduler.getInstance().rescheduleJob(request, response,
348 348
							params, userName, groupNames);
349 349
					return;
350 350
				} catch (BaseException be) {
src/edu/ucsb/nceas/metacat/scheduler/SchedulerService.java
123 123
	// Stop the scheduler
124 124
	public void stop() throws ServiceException {
125 125
		try {
126
			sched.shutdown(true);
126
			sched.shutdown();
127 127
			sched = null;
128 128
		} catch (SchedulerException se) {
129 129
			throw new ServiceException("SchedulerService.stop - Could not shut down scheduler: " + se.getMessage());
......
297 297
	 *            the user's group name
298 298
	 * @return a message saying the job was unscheduled
299 299
	 */
300
	public String unScheduleJob(String jobName, String username,
300
	public String unscheduleJob(String jobName, String username,
301 301
			String[] groups) throws ServiceException {
302 302
		
303 303
		ScheduledJobDAO jobDAO = null;
......
412 412
					+ "job : " + jobDAO.getName() + " due to a utility issue: " + ue.getMessage());
413 413
		}
414 414
        		
415
		return "Resheduled: " + jobDAO.getName();
415
		return "Rescheduled: " + jobDAO.getName();
416 416
	}
417 417

  
418 418
	/**

Also available in: Unified diff