import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import compbio.statistic.CassandraRequester;
import compbio.beans.DateBean;
import compbio.beans.ExecutionTimeBean;
+import compbio.beans.JobBean;
import compbio.beans.TotalExecutionTime;
import compbio.cassandra.DateFormatter;
import compbio.cassandra.readers.CassandraReader;
@RequestMapping(value = "/job/query", method = RequestMethod.GET)
public String initFindForm(Map<String, Object> model) {
model.put("username", getPrincipalName());
- CassandraRequester cr = new CassandraRequester();
+ CassandraReader cr = new CassandraReader();
model.put("value", cr.getExample("jobid"));
return "query/JobLog";
}
Calendar loccal = Calendar.getInstance();
ExecutionTimeReader reader = new ExecutionTimeReader();
if (alldates.equals("AllDates,off")) {
- date1 = theEaerlistDate;
- date2 = theCurrentDate;
+ date1 = getEarliestDate();
+ date2 = getCurrentDate();
}
// dates in string format
// dates in long format
long longDate1 = DateFormatter.DateParsing(date1, formaterYYMMDD);
long longDate2 = DateFormatter.DateParsing(date2, formaterYYMMDD);
- String error = DateChecking(trimmeddate1, trimmeddate2, longDate1, longDate2);
+ String error = checkDates(trimmeddate1, trimmeddate2, longDate1, longDate2);
if (error != null) {
model.put("error", error);
model.put("date1", date1);
model.put("username", getPrincipalName());
final long startTime = System.currentTimeMillis();
JobReader reader = new JobReader();
- model.put("result", reader.readJobLog(jobid));
+ JobBean job = reader.readJobLog(jobid);
+ if (null == job) {
+ model.put("jobnotfound", "yes");
+ } else {
+ model.put("result", job);
+ }
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
model.put("IdJob", jobid);
log.error("JobController.prepareJobArchiveToWeb: IO exception with job archive file");
log.error(e.getLocalizedMessage(), e.getCause());
}
+
// add a direct link to the job
String remotelink = "http://www.compbio.dundee.ac.uk/www-jpred/results/" + jobid + "/" + jobid + ".results.html";
URL remotelinkurl = new URL(remotelink);