From 01ac2f6460fd19994ccf4264c26b610986926fd8 Mon Sep 17 00:00:00 2001 From: Sasha Sherstnev Date: Mon, 16 Dec 2013 12:30:11 +0000 Subject: [PATCH] Fix problem with access permissions and make better wording for the new servlet --- .../compbio/controllers/SSFeaturesController.java | 100 ++++++++++---------- webapp/view/query/SSFeatures.jsp | 12 +-- webapp/view/reportSSFeatures.jsp | 6 +- webapp/view/support/Blocked.jsp | 19 ++-- webapp/view/support/Denied.jsp | 19 ++-- webapp/view/support/Notimplemented.jsp | 19 ++-- 6 files changed, 81 insertions(+), 94 deletions(-) diff --git a/server/compbio/controllers/SSFeaturesController.java b/server/compbio/controllers/SSFeaturesController.java index 27015bb..f8e5d66 100644 --- a/server/compbio/controllers/SSFeaturesController.java +++ b/server/compbio/controllers/SSFeaturesController.java @@ -1,6 +1,5 @@ package compbio.controllers; -import java.util.List; import java.util.Map; import org.springframework.stereotype.Controller; @@ -8,8 +7,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; -import compbio.cassandra.ProteinBean; -import compbio.cassandra.TotalByCounterBean; import compbio.statistic.CassandraRequester; /** @@ -26,61 +23,60 @@ import compbio.statistic.CassandraRequester; @RequestMapping("/features") public class SSFeaturesController extends BasicController { - @RequestMapping(value = "query", method = RequestMethod.GET) - public String formCounterQuery(Map model) { - model.put("username", getPrincipalName()); - model.put("type", 'E'); - model.put("value", 80); + @RequestMapping(value = "query", method = RequestMethod.GET) + public String formCounterQuery(Map model) { + model.put("username", getPrincipalName()); + model.put("type", 'E'); + model.put("value", 50); + return "query/SSFeatures"; + } + + @RequestMapping(value = "features/results", method = RequestMethod.GET) + public String countSequences(@RequestParam("TypeFeatures") String typeFeature, @RequestParam("Percent") String percent, + Map model) { + model.put("username", getPrincipalName()); + final long startTime = System.currentTimeMillis(); + + if (percent.equals("")) { + model.put("error", "The value must not be empty"); + model.put("type", typeFeature); + model.put("value", percent); return "query/SSFeatures"; } - - @RequestMapping(value = "features/results", method = RequestMethod.GET) - public String countSequences(@RequestParam("TypeFeatures") String typeFeature, @RequestParam("Percent") String percent,Map model) { - model.put("username", getPrincipalName()); - final long startTime = System.currentTimeMillis(); - - if (percent.equals("")) { - model.put("error", "The value must not be empty"); - model.put("type", typeFeature); - model.put("value", percent); - return "query/SSFeatures"; - } - int realpercent; - try { - realpercent = Integer.parseInt(percent.trim()); - } catch (NumberFormatException e) { - model.put("error", "The value must be an integer number"); - model.put("value", percent); - return "query/SSFeatures"; - } + int realpercent; + try { + realpercent = Integer.parseInt(percent.trim()); + } catch (NumberFormatException e) { + model.put("error", "The value must be an integer number"); + model.put("value", percent); + return "query/SSFeatures"; + } - if (realpercent < 1) { - model.put("error", "The value must be greater than 0"); - model.put("value", percent); - return "query/SSFeatures"; - } - - if (realpercent > 100) { - model.put("error", "The value must be less than 100"); - model.put("value", percent); - return "query/SSFeatures"; - } + if (realpercent < 1) { + model.put("error", "The value must be greater than 0"); + model.put("value", percent); + return "query/SSFeatures"; + } - CassandraRequester cr = new CassandraRequester(); - Map r = cr.readProteinsPrediction(typeFeature, realpercent); - model.put("results", r); - model.put("njobs", 0); - if (null != r) { - model.put("njobs", r.size()); - } - final long endTime = System.currentTimeMillis(); - model.put("timeExecution", (endTime - startTime)); - model.put("feature", typeFeature); - model.put("percent", realpercent); - return "reportSSFeatures"; + if (realpercent > 100) { + model.put("error", "The value must be less than 100"); + model.put("value", percent); + return "query/SSFeatures"; } - + CassandraRequester cr = new CassandraRequester(); + Map r = cr.readProteinsPrediction(typeFeature, realpercent); + model.put("results", r); + model.put("njobs", 0); + if (null != r) { + model.put("njobs", r.size()); + } + final long endTime = System.currentTimeMillis(); + model.put("timeExecution", (endTime - startTime)); + model.put("feature", typeFeature); + model.put("percent", realpercent); + return "reportSSFeatures"; + } } diff --git a/webapp/view/query/SSFeatures.jsp b/webapp/view/query/SSFeatures.jsp index 59cdc1c..be793c8 100644 --- a/webapp/view/query/SSFeatures.jsp +++ b/webapp/view/query/SSFeatures.jsp @@ -15,20 +15,20 @@
-
Proteins with features
+
Protein Secondary Structure statistics
-
+
- + - +
diff --git a/webapp/view/reportSSFeatures.jsp b/webapp/view/reportSSFeatures.jsp index 2d885f7..7aae5d0 100644 --- a/webapp/view/reportSSFeatures.jsp +++ b/webapp/view/reportSSFeatures.jsp @@ -17,16 +17,16 @@
-
Jobs Statistics
+
Protein Secondary Structure Feature Statistics
-

No proteins with features ${feature} more then ${percent} % found

+

No proteins with feature ${feature} more then ${percent}% of the protein sequence found

-

${njobs} proteins with features ${feature} more then ${percent} % found

+

${njobs} proteins with feature ${feature} more then ${percent}% of the protein sequence found

diff --git a/webapp/view/support/Blocked.jsp b/webapp/view/support/Blocked.jsp index 405c921..d017c09 100644 --- a/webapp/view/support/Blocked.jsp +++ b/webapp/view/support/Blocked.jsp @@ -1,25 +1,22 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> -<%@page import="java.util.ArrayList"%> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
- - - - - - - - + + + + + +
diff --git a/webapp/view/support/Denied.jsp b/webapp/view/support/Denied.jsp index bcb306c..0a27337 100644 --- a/webapp/view/support/Denied.jsp +++ b/webapp/view/support/Denied.jsp @@ -1,25 +1,22 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> -<%@page import="java.util.ArrayList"%> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
- - - - - - - - + + + + + +
diff --git a/webapp/view/support/Notimplemented.jsp b/webapp/view/support/Notimplemented.jsp index 1eb2bd0..2afcd43 100644 --- a/webapp/view/support/Notimplemented.jsp +++ b/webapp/view/support/Notimplemented.jsp @@ -1,25 +1,22 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> -<%@page import="java.util.ArrayList"%> +<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
- - - - - - - - + + + + + +
-- 1.7.10.2