1. Move query jsps into a separate directory
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Mon, 9 Dec 2013 08:40:28 +0000 (08:40 +0000)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Mon, 9 Dec 2013 08:40:28 +0000 (08:40 +0000)
2. Re-design getting Principal in controllers

22 files changed:
server/compbio/controllers/BasicController.java [new file with mode: 0644]
server/compbio/controllers/DailyStatisticsController.java
server/compbio/controllers/DatabaseController.java [moved from server/compbio/controllers/DBUpdateController.java with 90% similarity]
server/compbio/controllers/DocumentationController.java
server/compbio/controllers/IPDataController.java
server/compbio/controllers/JobController.java
server/compbio/controllers/MainController.java
server/compbio/controllers/SequenceController.java
server/compbio/controllers/UserController.java
server/compbio/statistic/CassandraRequester.java
webapp/view/fragments/mainmenu.jsp
webapp/view/query/IP.jsp [moved from webapp/view/queryIP.jsp with 84% similarity]
webapp/view/query/IPStatistics.jsp [moved from webapp/view/queryIPStatistics.jsp with 91% similarity]
webapp/view/query/JobLog.jsp [moved from webapp/view/queryJobLog.jsp with 84% similarity]
webapp/view/query/JobStatistics.jsp [moved from webapp/view/queryJobStatistics.jsp with 88% similarity]
webapp/view/query/JobTimeExecution.jsp [moved from webapp/view/queryTimeExecution.jsp with 89% similarity]
webapp/view/query/RemoveJobs.jsp [moved from webapp/view/queryRemoveJobs.jsp with 92% similarity]
webapp/view/query/Sequence.jsp [moved from webapp/view/queryProteinSequence.jsp with 80% similarity]
webapp/view/query/SequenceCounts.jsp [moved from webapp/view/queryProteinSequenceCounter.jsp with 91% similarity]
webapp/view/reportJobLog.jsp
webapp/view/reportProteinSequences.jsp
webapp/view/reportProteinSequencesCounter.jsp

diff --git a/server/compbio/controllers/BasicController.java b/server/compbio/controllers/BasicController.java
new file mode 100644 (file)
index 0000000..d4be834
--- /dev/null
@@ -0,0 +1,21 @@
+package compbio.controllers;
+
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.userdetails.UserDetails;
+/*
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+*/
+
+public class BasicController {
+
+       protected String getPrincipalName() {
+               Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
+               if (principal instanceof UserDetails) {
+                       return ((UserDetails) principal).getUsername();
+               } 
+               return principal.toString();
+       }
+}
index d508c82..d6a0c1e 100644 (file)
@@ -1,6 +1,5 @@
 package compbio.controllers;
 
-import java.security.Principal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -23,11 +22,11 @@ import compbio.statistic.StatisticsProt;
  * @author Natasha Sherstneva
  */
 @Controller
-public class DailyStatisticsController {
+public class DailyStatisticsController extends BasicController {
 
        @RequestMapping(value = "/stat/jobs/query", method = RequestMethod.GET)
-       public String initFindForm(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String initFindForm(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                Calendar cal = Calendar.getInstance();
                String date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DATE);
                cal.add(Calendar.DATE, -3);
@@ -36,13 +35,13 @@ public class DailyStatisticsController {
                model.put("date1", date1);
                model.put("date2", date2);
 
-               return "queryJobStatistics";
+               return "query/JobStatistics";
        }
 
        @RequestMapping(value = "/stat/jobsdaily/results", method = RequestMethod.GET)
        public String findJobsInPeriod(@RequestParam("date1") String date1, @RequestParam("date2") String date2,
-                       @RequestParam("option") String option, Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+                       @RequestParam("option") String option, Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
 
                CassandraRequester cr = new CassandraRequester();
@@ -63,9 +62,9 @@ public class DailyStatisticsController {
        }
 
        @RequestMapping(value = "/stat/jobsoneday/results", method = RequestMethod.GET)
-       public String findJobsInOneDay(@RequestParam("date") String date, @RequestParam("status") String status, Map<String, Object> model,
-                       Principal principal) throws ParseException {
-               model.put("username", principal.getName());
+       public String findJobsInOneDay(@RequestParam("date") String date, @RequestParam("status") String status, Map<String, Object> model)
+                       throws ParseException {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
 
                String realdate;
@@ -15,10 +15,11 @@ import compbio.cassandra.CassandraRemover;
  * @author Natasha Sherstneva
  */
 @Controller
-public class DBUpdateController {
+public class DatabaseController extends BasicController {
 
        @RequestMapping(value = "/database/remove", method = RequestMethod.GET)
        public String initRemoveForm(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                Calendar cal = Calendar.getInstance();
                String date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DATE);
                cal.add(Calendar.DATE, -3);
@@ -30,13 +31,14 @@ public class DBUpdateController {
                model.put("date2", date2);
                model.put("sampleip", "127.0.0.1");
                model.put("sampleseq", "ATA");
-               return "queryRemoveJobs";
+               return "query/RemoveJobs";
        }
 
        @RequestMapping(value = "/database/state", method = RequestMethod.GET)
        public String initDBStatRequest(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                // return "queryDBState";
-               return "support/Notpermitted";
+               return "support/Denied";
        }
 
        @RequestMapping(value = "/database/remove/goreal", method = RequestMethod.GET)
@@ -44,7 +46,7 @@ public class DBUpdateController {
                        @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) {
-
+               model.put("username", getPrincipalName());
                CassandraRemover cr = new CassandraRemover();
                int numberRemover = 0;
                if (flagId != null)
@@ -62,7 +64,7 @@ public class DBUpdateController {
        @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) {
-
+               model.put("username", getPrincipalName());
                /*
                 * CassandraRemover cr = new CassandraRemover(); int numberRemover = 0;
                 * if (flagId != null) numberRemover = cr.RemoveJobById(jobId); if
index 9e7de42..07c72b9 100644 (file)
@@ -1,6 +1,5 @@
 package compbio.controllers;
 
-import java.security.Principal;
 import java.util.Map;
 
 import org.springframework.stereotype.Controller;
@@ -14,36 +13,30 @@ import org.springframework.web.bind.annotation.RequestMethod;
  * @author Natasha Sherstneva
  */
 @Controller
-public class DocumentationController {
+public class DocumentationController extends BasicController {
 
        @RequestMapping(value = "/help/overview", method = RequestMethod.GET)
-       public String formOverviewPage(Map<String, Object> model, Principal principal) {
-               model.put("username", getPrincipleName(principal));
+       public String formOverviewPage(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                return "help/Overview";
        }
 
        @RequestMapping(value = "/help/howto", method = RequestMethod.GET)
-       public String formHowtoPage(Map<String, Object> model, Principal principal) {
-               model.put("username", getPrincipleName(principal));
+       public String formHowtoPage(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                return "support/Notimplemented";
        }
 
        @RequestMapping(value = "/help/doc", method = RequestMethod.GET)
-       public String formDocPage(Map<String, Object> model, Principal principal) {
-               model.put("username", getPrincipleName(principal));
+       public String formDocPage(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                return "support/Notimplemented";
        }
 
        @RequestMapping(value = "/help/javadoc", method = RequestMethod.GET)
-       public String formJavadoc(Map<String, Object> model, Principal principal) {
-               model.put("username", getPrincipleName(principal));
+       public String formJavadoc(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                return "support/Notimplemented";
        }
 
-       private String getPrincipleName(Principal principal) {
-               if (null != principal.getName()) {
-                       return principal.getName();
-               }
-               return "unknown";
-       }
 }
index a7cd7f0..7c17a7f 100644 (file)
@@ -1,6 +1,5 @@
 package compbio.controllers;
 
-import java.security.Principal;
 import java.util.List;
 import java.util.Map;
 
@@ -18,29 +17,29 @@ import compbio.statistic.CassandraRequester;
  * @author Natasha Sherstneva
  */
 @Controller
-public class IPDataController {
+public class IPDataController extends BasicController {
 
        @RequestMapping(value = "/admin/ip/counts/query", method = RequestMethod.GET)
-       public String initStatisticsForm(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String initStatisticsForm(Map<String, Object> model) {
+               model.put("username", "name:" + getPrincipalName());
                model.put("value", 5);
-               return "queryIPStatistics";
+               return "query/IPStatistics";
        }
 
        @RequestMapping(value = "/admin/ip/query", method = RequestMethod.GET)
-       public String initOneIPForm(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String initOneIPForm(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                model.put("value", "127.0.0.1");
-               return "queryIP";
+               return "query/IP";
        }
 
        @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());
+       public String findIPwithCounter(@RequestParam("JobCounter") String counter, Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                if (counter.equals("")) {
                        model.put("error", "The value must not be empty");
                        model.put("value", counter);
-                       return "queryIPStatistics";
+                       return "query/IPStatistics";
                }
 
                int realcounter;
@@ -49,13 +48,13 @@ public class IPDataController {
                } catch (NumberFormatException e) {
                        model.put("error", "The value must be an integer number");
                        model.put("value", counter);
-                       return "queryIPStatistics";
+                       return "query/IPStatistics";
                }
 
                if (realcounter < 1) {
                        model.put("error", "The value must be greater than 0");
                        model.put("value", counter);
-                       return "queryIPStatistics";
+                       return "query/IPStatistics";
                }
 
                final long startTime = System.currentTimeMillis();
@@ -73,8 +72,8 @@ public class IPDataController {
        }
 
        @RequestMapping(value = "/admin/ip/results", method = RequestMethod.GET)
-       public String findIP(@RequestParam("ip") String ip, Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String findIP(@RequestParam("ip") String ip, Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
                CassandraRequester cr = new CassandraRequester();
                UserBean r = cr.readIp(ip);
index 6bfe4ee..94045f9 100644 (file)
@@ -19,11 +19,11 @@ import compbio.statistic.StatisticsProt;
  * @author Natasha Sherstneva
  */
 @Controller
-public class JobController {
+public class JobController extends BasicController {
 
        @RequestMapping(value = "/stat/exectime/query", method = RequestMethod.GET)
-       public String initFormExecTime(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String initFormExecTime(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                Calendar cal = Calendar.getInstance();
                String date2 = cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DATE);
                cal.add(Calendar.DATE, -3);
@@ -31,20 +31,20 @@ public class JobController {
 
                model.put("date1", date1);
                model.put("date2", date2);
-               return "queryTimeExecution";
+               return "query/JobTimeExecution";
        }
 
        @RequestMapping(value = "/job/query", method = RequestMethod.GET)
-       public String initFindForm(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String initFindForm(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                model.put("value", "jp_NzBOJKo");
-               return "queryJobLog";
+               return "query/JobLog";
        }
 
        @RequestMapping(value = "/stat/exectime/results", method = RequestMethod.GET)
        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());
+                       @RequestParam(value = "option", required = false) String option, Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
 
                CassandraRequester sp = new CassandraRequester();
@@ -65,8 +65,8 @@ public class JobController {
        }
 
        @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());
+       public String findJob(@RequestParam("IdJob") String jobid, Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
                CassandraRequester cr = new CassandraRequester();
                model.put("result", cr.readJobLog(jobid));
index f918c24..4aeb1cd 100644 (file)
@@ -1,21 +1,15 @@
 package compbio.controllers;
 
-import java.security.Principal;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
 @Controller
-public class MainController {
+public class MainController extends BasicController {
 
        @RequestMapping(value = "/index", method = RequestMethod.GET)
-       public String printPublicHome(ModelMap model, Principal principal) {
-               String name = "";
-               // if (null != name ) {
-               // name = principal.getName();
-               // }
-               model.addAttribute("username", name);
+       public String printPublicHome(ModelMap model) {
                model.addAttribute("message", "Spring Security Custom Form example");
                return "public";
        }
@@ -37,21 +31,14 @@ public class MainController {
        }
 
        @RequestMapping(value = "/denied", method = RequestMethod.GET)
-       public String denied(ModelMap model, Principal principal) {
-               String name = "unknown";
-               if (null != principal.getName())
-                       name = principal.getName();
-               model.put("username", name);
+       public String denied(ModelMap model) {
+               model.put("username", getPrincipalName());
                return "support/Denied";
        }
 
        @RequestMapping(value = "/home", method = RequestMethod.GET)
-       public String printHome(ModelMap model, Principal principal) {
-               String name = "unknown";
-               if (null != name) {
-                       name = principal.getName();
-               }
-               model.addAttribute("username", name);
+       public String printHome(ModelMap model ) {
+               model.addAttribute("username", getPrincipalName());
                model.addAttribute("message", "Spring Security Custom Form example");
                return "home";
        }
index 6440d74..df4c987 100644 (file)
@@ -1,6 +1,5 @@
 package compbio.controllers;
 
-import java.security.Principal;
 import java.util.List;
 import java.util.Map;
 import java.util.regex.Pattern;
@@ -26,7 +25,7 @@ import compbio.statistic.CassandraRequester;
  */
 @Controller
 @RequestMapping("/sequence")
-public class SequenceController {
+public class SequenceController extends BasicController {
 
        /**
         * pattern for NON-protein alphabet symbols
@@ -34,23 +33,23 @@ public class SequenceController {
        private final Pattern NONPROTEIN = Pattern.compile("[^ARNDCQEGHILKMFPSTWYV]+", Pattern.CASE_INSENSITIVE);
 
        @RequestMapping(value = "query", method = RequestMethod.GET)
-       public String formSequenceQuery(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String formSequenceQuery(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                model.put("value", "AAAAA");
-               return "queryProteinSequence";
+               return "query/Sequence";
        }
 
        @RequestMapping(value = "counts/query", method = RequestMethod.GET)
-       public String formCounterQuery(Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String formCounterQuery(Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                model.put("value", 5);
-               return "queryProteinSequenceCounter";
+               return "query/SequenceCounts";
        }
 
        @RequestMapping(value = "sequence/results", method = RequestMethod.GET)
-       public String findSequence(@RequestParam("sequence") String sequence, @RequestParam("protein") String flag, Map<String, Object> model,
-                       Principal principal) {
-               model.put("username", principal.getName());
+       public String findSequence(@RequestParam("sequence") String sequence, @RequestParam("searchtype") String searchtype,
+                       Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
 
                // input checks
@@ -58,24 +57,24 @@ public class SequenceController {
                if (trimmedsequence.equalsIgnoreCase("")) {
                        model.put("error", "The sequence cann't be empty");
                        model.put("value", sequence);
-                       return "queryProteinSequence";
+                       return "query/Sequence";
                }
                if (NONPROTEIN.matcher(trimmedsequence).find()) {
                        model.put("error", "The sequence contains symbols not from the standard protein alphabet");
                        model.put("value", sequence);
-                       return "queryProteinSequence";
+                       return "query/Sequence";
                }
 
                model.put("njobs", 0);
                model.put("prot", trimmedsequence);
-               model.put("flag", flag);
+               model.put("searchtype", searchtype);
 
                if (0 < trimmedsequence.length()) {
                        CassandraRequester cr = new CassandraRequester();
-                       List<ProteinBean> r = cr.readProteins(trimmedsequence, flag);
+                       List<ProteinBean> r = cr.readProteins(trimmedsequence, searchtype);
                        model.put("results", r);
                        if (null != r) {
-                               if (flag.equals("whole"))
+                               if (searchtype.equals("whole"))
                                        model.put("njobs", r.get(0).getJobid().size());
                                else
                                        model.put("njobs", r.size());
@@ -87,14 +86,14 @@ public class SequenceController {
        }
 
        @RequestMapping(value = "counts/results", method = RequestMethod.GET)
-       public String countSequences(@RequestParam("counterJob") String counter, Map<String, Object> model, Principal principal) {
-               model.put("username", principal.getName());
+       public String countSequences(@RequestParam("counterJob") String counter, Map<String, Object> model) {
+               model.put("username", getPrincipalName());
                final long startTime = System.currentTimeMillis();
 
                if (counter.equals("")) {
                        model.put("error", "The value must not be empty");
                        model.put("value", counter);
-                       return "queryIPStatistics";
+                       return "query/SequenceCounts";
                }
 
                int realcounter;
@@ -103,13 +102,13 @@ public class SequenceController {
                } catch (NumberFormatException e) {
                        model.put("error", "The value must be an integer number");
                        model.put("value", counter);
-                       return "queryIPStatistics";
+                       return "query/SequenceCounts";
                }
 
                if (realcounter < 1) {
                        model.put("error", "The value must be greater than 0");
                        model.put("value", counter);
-                       return "queryIPStatistics";
+                       return "query/SequenceCounts";
                }
 
                CassandraRequester cr = new CassandraRequester();
index 513f5bb..7dbfdf4 100644 (file)
@@ -1,6 +1,5 @@
 package compbio.controllers;
 
-import java.security.Principal;
 import java.util.Date;
 import java.util.regex.Pattern;
 
@@ -28,13 +27,25 @@ public class UserController {
        // 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)
-       public String printPublicHome(ModelMap model) {
+       @RequestMapping(value = "/register/query", method = RequestMethod.POST)
+       public String RegisterForm(ModelMap model) {
                User user = new User();
                model.addAttribute(user);
                return "Register";
        }
 
+       @RequestMapping(value = "/register/edit/query", method = RequestMethod.GET)
+       public String AccountForm(ModelMap model) {
+               User user = new User();
+               user.setFullName("Sasha Sherstnev");
+               user.setEmail("admin@admin.com");
+               user.setOrganisation("UoD");
+               user.setPosition("cleaner");
+               user.setUpdateByEmail(true);
+               model.addAttribute("u", user);
+               return "Edit";
+       }
+
        @RequestMapping(value = "/register/do", method = RequestMethod.POST)
        public String addUser(Model model, @ModelAttribute("user") User user, BindingResult bindingResult) {
 
index e95291a..1bb0050 100755 (executable)
@@ -184,16 +184,16 @@ public class CassandraRequester {
        /*
         * query: protein sequence
         */
-       public List<ProteinBean> readProteins(String protIn, String flag) {
+       public List<ProteinBean> readProteins(String protIn, String searchtype) {
                List<ProteinBean> result;
-               if (flag.equals("whole"))
+               if (searchtype.equals("whole"))
                        result = db.ReadWholeSequence(protIn);
                else
                        result = db.ReadPartOfSequence(protIn);
                if (result == null)
                        return null;
 
-               if (flag.equals("part")) {
+               if (searchtype.equals("partial")) {
                        for (ProteinBean entry : result) {
                                entry.setSubProt(CreateSubprot(entry.getSequence(), protIn));
                        }
index 1379729..9b3316c 100644 (file)
@@ -39,7 +39,7 @@
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> ${username}<b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                        <li><a href="<spring:url value="/logout" htmlEscape="true" />">Logout</a></li>
-                                       <li><a href="<spring:url value="/user/account" htmlEscape="true" />">User account</a></li>
+                                       <li><a href="<spring:url value="/register/edit/query" htmlEscape="true" />">User account</a></li>
                                </ul>
                        </li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-question-sign"></span> Help<b class="caret"></b></a>
similarity index 84%
rename from webapp/view/queryIP.jsp
rename to webapp/view/query/IP.jsp
index ca6540f..492eb86 100644 (file)
@@ -6,10 +6,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header.jsp" />
+<jsp:include page="../fragments/header.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/admin/ip/results" var="query"/>
 
        <div class="panel panel-default">
@@ -23,7 +23,7 @@
                        </form>
                </div>
        </div>
-       <jsp:include page="fragments/footer.jsp"/>
+       <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
\ No newline at end of file
similarity index 91%
rename from webapp/view/queryIPStatistics.jsp
rename to webapp/view/query/IPStatistics.jsp
index bbd6840..7213b4f 100644 (file)
@@ -7,10 +7,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header.jsp" />
+<jsp:include page="../fragments/header.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/admin/ip/counts/results" var="query"/>
 
        <div class="panel panel-default">
@@ -41,7 +41,7 @@
                </div>
        </div>
 
-       <jsp:include page="fragments/footer.jsp"/>
+       <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
similarity index 84%
rename from webapp/view/queryJobLog.jsp
rename to webapp/view/query/JobLog.jsp
index d101fc4..7cf966c 100644 (file)
@@ -6,10 +6,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header.jsp" />
+<jsp:include page="../fragments/header.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/job/query" var="query"/>
 
        <div class="panel panel-default">
@@ -24,7 +24,7 @@
                </div>
        </div>
 
-       <jsp:include page="fragments/footer.jsp"/>
+       <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
\ No newline at end of file
similarity index 88%
rename from webapp/view/queryJobStatistics.jsp
rename to webapp/view/query/JobStatistics.jsp
index 4160843..5636b95 100644 (file)
@@ -6,10 +6,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
 
 <html>
-<jsp:include page="fragments/header_database.jsp" />
+<jsp:include page="../fragments/header_database.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/stat/jobsdaily/results" var="query" />
 
        <div class="panel panel-default">
@@ -32,7 +32,7 @@
                </div>
        </div>
 
-       <jsp:include page="fragments/footer.jsp" />
+       <jsp:include page="../fragments/footer.jsp" />
        </div>
 </body>
 </html>
\ No newline at end of file
similarity index 89%
rename from webapp/view/queryTimeExecution.jsp
rename to webapp/view/query/JobTimeExecution.jsp
index 3d7f7f2..b1f3331 100644 (file)
@@ -6,10 +6,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header_database.jsp" />
+<jsp:include page="../fragments/header_database.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/stat/exectime/results" var="query"/>
 
        <div class="panel panel-default">
@@ -33,7 +33,7 @@
                </div>
        </div>
        
-               <jsp:include page="fragments/footer.jsp"/>
+               <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
similarity index 92%
rename from webapp/view/queryRemoveJobs.jsp
rename to webapp/view/query/RemoveJobs.jsp
index 53f0d4d..cf3459f 100644 (file)
@@ -6,10 +6,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header_database.jsp" />
+<jsp:include page="../fragments/header_database.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/database/remove/go" var="formurl"/>
 
        <div class="panel panel-default">
@@ -49,7 +49,7 @@
                </div>
        </div>
 
-       <jsp:include page="fragments/footer.jsp"/>
+       <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
\ No newline at end of file
similarity index 80%
rename from webapp/view/queryProteinSequence.jsp
rename to webapp/view/query/Sequence.jsp
index 1312265..be14705 100644 (file)
@@ -7,10 +7,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header.jsp" />
+<jsp:include page="../fragments/header.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/sequence/sequence/results" var="query"/>
 
        <div class="panel panel-default">
@@ -24,7 +24,7 @@
                                <div class="form-group">
                                        <p><textarea class="form-control" rows="3" name="sequence">${value}</textarea></p>
                                        <p><input type="radio" name="protein" value="whole">search for the whole sequence<br/>
-                                       <input type="radio" name="protein" value="part" Checked>search for partial sequence matching</p>
+                                       <input type="radio" name="searchtype" value="partial" Checked>search for partial sequence matching</p>
                                        <input type="submit" name="Search" value="Search"/>
                                </div>
                        </c:when>
@@ -33,7 +33,7 @@
                                        <p><textarea class="form-control" rows="3" name="sequence">${value}</textarea></p>
                                        <p class="help-block">${error}</p>
                                        <p><input type="radio" name="protein" value="whole">search for the whole sequence<br/>
-                                       <input type="radio" name="protein" value="part" Checked>search for partial sequence matching</p>
+                                       <input type="radio" name="searchtype" value="partial" Checked>search for partial sequence matching</p>
                                        <input type="submit" name="Search" value="Search"/>
                                </div>
                        </c:otherwise>
@@ -41,7 +41,7 @@
                        </form>
                </div>
        </div>
-       <jsp:include page="fragments/footer.jsp"/>
+       <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
similarity index 91%
rename from webapp/view/queryProteinSequenceCounter.jsp
rename to webapp/view/query/SequenceCounts.jsp
index 6b864c5..57a03e0 100644 (file)
@@ -7,10 +7,10 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
 
 <html>
-<jsp:include page="fragments/header.jsp" />
+<jsp:include page="../fragments/header.jsp" />
 <body>
        <div class="container">
-       <jsp:include page="fragments/mainmenu.jsp" />
+       <jsp:include page="../fragments/mainmenu.jsp" />
        <spring:url value="/sequence/counts/results" var="query"/>
 
        <div class="panel panel-default">
@@ -40,7 +40,7 @@
                        </form>
                </div>
        </div>
-       <jsp:include page="fragments/footer.jsp"/>
+       <jsp:include page="../fragments/footer.jsp"/>
        </div>
 </body>
 </html>
index f82ed25..846cde9 100644 (file)
                <div class="panel-body">
                        <p>Start timestamp : ${result.dateStart}</p>
                        <p>End timestamp : ${result.dateEnd}</p>
-                       <p>IP: <a title="Click to view other jobs" href="${ip_query}?ip=${result.ip}&Search=Search">${result.ip}</a></p>
+                       <p>IP: <a title="Click to view other jobs" href="${ip_query}?ip=${result.ip}">${result.ip}</a></p>
 
                        <table class="table table-striped table-hover table-bordered">
                        <tbody>
                                <tr>
                                        <td>Sequence</td>
                                        <td style="text-align: left; border-buttom: dotted; font-family: monospace">
-                                               <a title="Click to view other jobs" href="${sequence_query}?sequence=${result.sequence}&protein=whole&Search=Search">${result.sequence}</a>
+                                               <a title="Click to view other jobs" href="${sequence_query}?sequence=${result.sequence}&searchtype=whole">${result.sequence}</a>
                                        </td>
                                </tr>
                                <c:forEach items="${result.prediction}" var="pred">
index 45bd1e9..668d653 100644 (file)
@@ -16,7 +16,7 @@
        <div class="panel panel-default">
        <div class="panel-heading">
                <c:choose>
-                       <c:when test="${flag == 'whole'}">
+                       <c:when test="${searchtype == 'whole'}">
                                <p style="font-weight:bold;">Jobs for the protein sequence: ${prot}</p>
                        </c:when>
                        <c:otherwise>
                                                                        <td
                                                                                style="text-align: center; font-weight: bold; font-family: monospace">Protein
                                                                                Sequence</td>
-                                                                       <c:if test="${flag == 'whole'}">
+                                                                       <c:if test="${searchtype == 'whole'}">
                                                                                <td
                                                                                        style="text-align: left; border-buttom: dotted; font-family: monospace"><c:out
                                                                                                value="${res.sequence}" /></td>
                                                                        </c:if>
-                                                                       <c:if test="${flag == 'part'}">
+                                                                       <c:if test="${searchtype == 'partial'}">
                                                                                <td
                                                                                        style="text-align: left; border-buttom: dotted; font-family: monospace">
                                                                                        <c:forEach items="${res.subProt}" var="seq">
index e11db1e..93af680 100644 (file)
@@ -40,7 +40,7 @@
                                        <tr>
                                                <td>${res.totaljobs}</td>
                                                <td style="text-align: left; border-buttom: dotted; font-family: monospace">
-                                                       <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.name}&protein=whole&Search=Search">${res.name}</a>
+                                                       <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.name}&searchtype=whole">${res.name}</a>
                                                </td>
                                        </tr>
                                </c:forEach>