* @author Natasha Sherstneva
*/
@Controller
-public class HelpController {
+public class DocumentationController {
@RequestMapping(value = "/help/overview", method = RequestMethod.GET)
public String formOverviewPage(Map<String, Object> model, Principal principal) {
model.put("username", getPrincipleName(principal));
return "support/Notimplemented";
}
-
- private String getPrincipleName (Principal principal) {
+
+ private String getPrincipleName(Principal principal) {
if (null != principal.getName()) {
return principal.getName();
}
model.put("value", "127.0.0.1");
return "queryIP";
}
-
+
@RequestMapping(value = "/admin/ip/counts/results", method = RequestMethod.GET)
public String findIPwithCounter(@RequestParam("JobCounter") String counter, Map<String, Object> model, Principal principal) {
model.put("username", principal.getName());
model.put("value", counter);
return "queryIPStatistics";
}
-
+
int realcounter;
try {
realcounter = Integer.parseInt(counter.trim());
final long startTime = System.currentTimeMillis();
CassandraRequester cr = new CassandraRequester();
List<TotalByCounterBean> r = cr.readIpByCounter(realcounter);
- model.put("results", r);
+ model.put("results", r);
model.put("njobs", 0);
if (null != r) {
model.put("njobs", r.size());
}
- final long endTime = System.currentTimeMillis();
+ final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
model.put("counter", realcounter);
return "reportIPstatistics";
final long startTime = System.currentTimeMillis();
CassandraRequester cr = new CassandraRequester();
UserBean r = cr.readIp(ip);
- model.put("results", r);
+ model.put("results", r);
model.put("njobs", 0);
if (null != r) {
model.put("njobs", r.getMainInfo().size());
}
- final long endTime = System.currentTimeMillis();
+ final long endTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
model.put("ip", ip);
return "reportIP";
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-
import compbio.statistic.CassandraRequester;
import compbio.cassandra.DataBase;
import compbio.statistic.StatisticsProt;
* @author Natasha Sherstneva
*/
@Controller
-public class JobExecutionTimeController {
+public class JobController {
@RequestMapping(value = "/stat/exectime/query", method = RequestMethod.GET)
- public String initFindForm(Map<String, Object> model, Principal principal) {
+ public String initFormExecTime(Map<String, Object> model, Principal principal) {
model.put("username", principal.getName());
Calendar cal = Calendar.getInstance();
String date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DATE);
return "queryTimeExecution";
}
+ @RequestMapping(value = "/job/query", method = RequestMethod.GET)
+ public String initFindForm(Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
+ model.put("value", "jp_NzBOJKo");
+ return "queryJobLog";
+ }
+
@RequestMapping(value = "/stat/exectime/results", method = RequestMethod.GET)
- public String findSequence(@RequestParam("date1") String date1, @RequestParam("date2") String date2,
- @RequestParam(value="option", required=false) String option, Map<String, Object> model, Principal principal) {
+ public String findExecTimeData(@RequestParam("date1") String date1, @RequestParam("date2") String date2,
+ @RequestParam(value = "option", required = false) String option, Map<String, Object> model, Principal principal) {
model.put("username", principal.getName());
final long startTime = System.currentTimeMillis();
model.put("timeExecution", (endTime - startTime));
return "/reportTimeExecution";
}
+
+ @RequestMapping(value = "/job/results", method = RequestMethod.GET)
+ public String findJob(@RequestParam("IdJob") String jobid, Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
+ final long startTime = System.currentTimeMillis();
+ CassandraRequester cr = new CassandraRequester();
+ model.put("result", cr.readJobLog(jobid));
+ final long endTime = System.currentTimeMillis();
+ model.put("timeExecution", (endTime - startTime));
+ model.put("IdJob", jobid);
+ return "reportJobLog";
+ }
+
}
+++ /dev/null
-package compbio.controllers;
-
-import java.security.Principal;
-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.statistic.CassandraRequester;
-
-/**
- * @author Alexander Sherstnev
- * @author Natasha Sherstneva
- */
-@Controller
-public class JobLogController {
-
- @RequestMapping(value = "/job/query", method = RequestMethod.GET)
- public String initFindForm(Map<String, Object> model, Principal principal) {
- model.put("username", principal.getName());
- model.put("value", "jp_NzBOJKo");
- return "queryJobLog";
- }
-
- @RequestMapping(value = "/job/results", method = RequestMethod.GET)
- public String findJob(@RequestParam("IdJob") String jobid, Map<String, Object> model, Principal principal) {
- model.put("username", principal.getName());
- final long startTime = System.currentTimeMillis();
- CassandraRequester cr = new CassandraRequester();
- model.put("result", cr.readJobLog(jobid));
- final long endTime = System.currentTimeMillis();
- model.put("timeExecution", (endTime - startTime));
- model.put("IdJob", jobid);
- return "reportJobLog";
- }
-}
}
@RequestMapping(value = "sequence/results", method = RequestMethod.GET)
- public String findSequence(@RequestParam("sequence") String sequence, @RequestParam("protein") String flag, Map<String, Object> model, Principal principal) {
+ public String findSequence(@RequestParam("sequence") String sequence, @RequestParam("protein") String flag, Map<String, Object> model,
+ Principal principal) {
model.put("username", principal.getName());
final long startTime = System.currentTimeMillis();
@Controller
public class UserController {
- //@Inject
- //JavaMailSender mailSender;
+ // @Inject
+ // JavaMailSender mailSender;
private final Pattern EMAIL = Pattern.compile("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}");
@RequestMapping(value = "/register/query", method = RequestMethod.GET)
}
user.setRegistrationDate(new Date());
- UserManager cm = new CassandraUserManager();
+ UserManager cm = new CassandraUserManager();
try {
cm.addUser(user);
} catch (DataIntegrityViolationException e) {
subscribeToList(user.getEmail());
}
/*
- Account.autoLogin(user, request, authenticationManager);
- */
+ * Account.autoLogin(user, request, authenticationManager);
+ */
return "redirect:/index";
}
if (bindingResult.hasErrors()) {
return "Register";
}
-
+
user.setRegistrationDate(new Date());
- UserManager cm = new CassandraUserManager();
+ UserManager cm = new CassandraUserManager();
try {
cm.addUser(user);
} catch (DataIntegrityViolationException e) {
message.setTo("proteocache-discuss-subscribe@compbio.dundee.ac.uk");
message.setSubject("ProteoCache mailing list subscription");
message.setText("testing " + email);
- //mailSender.send(message);
+ // mailSender.send(message);
}
}