--- /dev/null
+package compbio.controllers;
+
+import java.util.Map;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import compbio.cassandra.CassandraRemover;
+
+/**
+ * @author Alexander Sherstnev
+ * @author Natasha Sherstneva
+ */
+@Controller
+public class DBUpdateController {
+
+ @RequestMapping(value = "/database/remove", method = RequestMethod.GET)
+ public String initRemoveForm(Map<String, Object> model) {
+ return "queryRemoveJobs";
+ }
+
+ @RequestMapping(value = "/database/state", method = RequestMethod.GET)
+ public String initDBStatRequest(Map<String, Object> model) {
+ // return "queryDBState";
+ return "support/Notimplemented";
+ }
+
+ @RequestMapping(value = "/database/remove/goreal", method = RequestMethod.GET)
+ public String findIPwithCounter(@RequestParam("byId") String flagId, @RequestParam("id") String jobId,
+ @RequestParam("byDate") String flagDate, @RequestParam("date1") String date1, @RequestParam("date2") String date2,
+ @RequestParam("byIp") String flagIp, @RequestParam("ip") String ip, @RequestParam("bySequence") String flagSeq,
+ @RequestParam("seq") String seq, Map<String, Object> model) {
+
+ CassandraRemover cr = new CassandraRemover();
+ int numberRemover = 0;
+ if (flagId != null)
+ numberRemover = cr.RemoveJobById(jobId);
+ if (flagDate != null)
+ numberRemover = cr.RemoveJobByDate(date1, date2);
+ if (flagIp != null)
+ numberRemover = cr.RemoveJobByIp(ip);
+ if (flagSeq != null)
+ numberRemover = cr.RemoveJobBySequence(seq);
+ model.put("result", numberRemover);
+ return "reportRemoveData";
+ }
+
+ @RequestMapping(value = "/database/remove/go", method = RequestMethod.GET)
+ public String findIPwithCounter(@RequestParam("id") String jobId, @RequestParam("date1") String date1,
+ @RequestParam("date2") String date2, @RequestParam("ip") String ip, @RequestParam("seq") String seq, Map<String, Object> model) {
+
+ /*
+ * CassandraRemover cr = new CassandraRemover(); int numberRemover = 0;
+ * if (flagId != null) numberRemover = cr.RemoveJobById(jobId); if
+ * (flagDate != null) numberRemover = cr.RemoveJobByDate(date1, date2);
+ * if (flagIp != null) numberRemover = cr.RemoveJobByIp(ip); if (flagSeq
+ * != null) numberRemover = cr.RemoveJobBySequence(seq);
+ * model.put("result", numberRemover); return "reportRemoveData";
+ */
+ return "support/Blocked";
+ }
+
+}
import java.util.List;
import java.util.Map;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@RequestMapping(value = "/stat", method = RequestMethod.GET)
public String initFindForm(Map<String, Object> model) {
- return "QueryJobsByDate";
+ return "queryJobStatistics";
}
@RequestMapping(value = "/stat/query", method = RequestMethod.GET)
- public String findJobsInPeriod(@RequestParam("data1") String date1, @RequestParam("data2") String date2,
+ public String findJobsInPeriod(@RequestParam("date1") String date1, @RequestParam("date2") String date2,
@RequestParam("option") String option, Map<String, Object> model) {
final long startTime = System.currentTimeMillis();
CassandraRequester cr = new CassandraRequester();
- if (option.equals("AllDates")) {
+ if (option.equals("AllDates,off")) {
Calendar cal = Calendar.getInstance();
date1 = StatisticsProt.DateFormatYYMMDD(cr.earliestDate());
date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH);
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
model.put("flag", option);
- return "/ReportJobsByDate";
+ return "/reportJobStatistics";
}
@RequestMapping(value = "/stat/oneday", method = RequestMethod.GET)
String date1 = formaterYYMMDD.format(new Date(formaterDDMMYY.parse(date).getTime()));
CassandraRequester cr = new CassandraRequester();
- List<DataBase> r1 = cr.countJobs(date1, date1);
+ //List<DataBase> r1 = cr.countJobs(date1, date1);
List<DataBase> r = cr.readJobByDay(date);
model.put("results", r);
model.put("njobs", r.size());
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
System.out.println("Request for date = " + date1 + ": " + r.size() + " jobs found");
- return "/ReportJobsOfOneDay";
+ return "/reportJobStatisticsOneDay";
}
}
--- /dev/null
+package compbio.controllers;
+
+import java.util.Map;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+//import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author Alexander Sherstnev
+ * @author Natasha Sherstneva
+ */
+@Controller
+public class HelpController {
+
+ @RequestMapping(value = "/help/overview", method = RequestMethod.GET)
+ public String formOverviewPage(Map<String, Object> model) {
+ return "help/Overview";
+ }
+
+ @RequestMapping(value = "/help/howto", method = RequestMethod.GET)
+ public String formHowtoPage(Map<String, Object> model) {
+ return "support/Notimplemented";
+ }
+
+
+ @RequestMapping(value = "/help/doc", method = RequestMethod.GET)
+ public String formDocPage(Map<String, Object> model) {
+ return "support/Notimplemented";
+ }
+
+
+ @RequestMapping(value = "/help/javadoc", method = RequestMethod.GET)
+ public String formJavadoc(Map<String, Object> model) {
+ return "support/Notimplemented";
+ }
+}
import java.util.Calendar;
import java.util.Map;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-
-import compbio.cassandra.DataBase;
import compbio.statistic.CassandraRequester;
import compbio.statistic.StatisticsProt;
@RequestMapping(value = "/exectime", method = RequestMethod.GET)
public String initFindForm(Map<String, Object> model) {
- return "QueryTimeExecution";
+ return "queryTimeExecution";
}
@RequestMapping(value = "/exectime/query", method = RequestMethod.GET)
model.put("flag", option);
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
- return "/ReportTimeExecution";
+ return "/reportTimeExecution";
}
}
@RequestMapping(value = "/joblog", method = RequestMethod.GET)
public String initFindForm(Map<String, Object> model) {
- return "QueryJobLog";
+ return "queryJobLog";
}
@RequestMapping(value = "/joblog/query", method = RequestMethod.GET)
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
model.put("IdJob", jobid);
- return "ReportJobLog";
+ return "reportJobLog";
}
}
-
package compbio.controllers;
-
import java.util.List;
import java.util.Map;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class SequenceSearchController {
- @RequestMapping(value = "/sequence", method = RequestMethod.GET)
- public String initFindForm(Map<String, Object> model) {
- return "QuerySequenceProtein";
+ @RequestMapping(value = "/sequence/query1", method = RequestMethod.GET)
+ public String formSequenceQuery(Map<String, Object> model) {
+ return "queryProteinSequence";
}
- @RequestMapping(value = "/sequence/query", method = RequestMethod.GET)
- public String findSequence(@RequestParam("prot") String prot, @RequestParam("protein") String flag,
- @RequestParam("Search") String search, @RequestParam("counterJob") int counter, Map<String, Object> model) {
+ @RequestMapping(value = "/sequence/query2", method = RequestMethod.GET)
+ public String formCounterQuery(Map<String, Object> model) {
+ return "queryProteinSequenceCounter";
+ }
+
+ @RequestMapping(value = "/sequence/querysequence", method = RequestMethod.GET)
+ public String findSequence(@RequestParam("sequence") String sequence, @RequestParam("protein") String flag, Map<String, Object> model) {
final long startTime = System.currentTimeMillis();
- CassandraRequester cr = new CassandraRequester();
- if (search.equals("SearchCounter")) {
- List<DataBase> r = cr.readProteinByCounter(counter);
- model.put("results", r);
- model.put("njobs", r.size());
- System.out.println("Search counter = " + counter + ": " + r.size() + " proteins found");
- } else {
- List<DataBase> r = cr.readProteins(prot, flag);
+
+ String trimmedsequence = sequence.replaceAll("\\s", "");
+ model.put("njobs", 0);
+ model.put("prot", trimmedsequence);
+ model.put("flag", flag);
+
+ if (0 < trimmedsequence.length()) {
+ CassandraRequester cr = new CassandraRequester();
+ List<DataBase> r = cr.readProteins(trimmedsequence, flag);
model.put("results", r);
+ if (null != r) {
+ System.out.println("result size = " + r.size());
+ model.put("njobs", r.size());
+ }
+ }
+ final long endTime = System.currentTimeMillis();
+ model.put("timeExecution", (endTime - startTime));
+ return "reportProteinSequences";
+ }
+
+ @RequestMapping(value = "/sequence/querycounter", method = RequestMethod.GET)
+ public String countSequences(@RequestParam("counterJob") int counter, Map<String, Object> model) {
+ final long startTime = System.currentTimeMillis();
+
+ CassandraRequester cr = new CassandraRequester();
+ List<DataBase> r = cr.readProteinByCounter(counter);
+ model.put("results", r);
+ model.put("njobs", 0);
+ if (null != r) {
model.put("njobs", r.size());
- //System.out.println("Search sequence: " + r.size() + " proteins found");
}
final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
- model.put("prot", prot);
- model.put("flag", flag);
- model.put("search", search);
model.put("counter", counter);
- return "ReportSequenceProtein";
+ return "reportProteinSequencesCounter";
}
}