package compbio.controllers;
-import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Controller;
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;
/**
@RequestMapping("/features")
public class SSFeaturesController extends BasicController {
- @RequestMapping(value = "query", method = RequestMethod.GET)
- public String formCounterQuery(Map<String, Object> model) {
- model.put("username", getPrincipalName());
- model.put("type", 'E');
- model.put("value", 80);
+ @RequestMapping(value = "query", method = RequestMethod.GET)
+ public String formCounterQuery(Map<String, Object> 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<String, Object> 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<String, Object> 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<String, String> 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<String, String> 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";
+ }
}
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ 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"%>
<html>
<jsp:include page="../fragments/header.jsp" />
<body>
<div class="container">
- <c:choose>
- <c:when test="${permissions == 'user_role'}">
- <jsp:include page="../fragments/mainmenu.jsp" />
- </c:when>
- <c:otherwise>
- <jsp:include page="../fragments/publicmenu.jsp" />
- </c:otherwise>
- </c:choose>
+ <sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_USER')">
+ <jsp:include page="../fragments/mainmenu.jsp" />
+ </sec:authorize>
+ <sec:authorize access="!hasAnyRole('ROLE_ADMIN','ROLE_USER')">
+ <jsp:include page="../fragments/publicmenu.jsp" />
+ </sec:authorize>
<div class="panel panel-default">
<div class="panel-heading">
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ 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"%>
<html>
<jsp:include page="../fragments/header.jsp" />
<body>
<div class="container">
- <c:choose>
- <c:when test="${permissions == 'user_role'}">
- <jsp:include page="../fragments/mainmenu.jsp" />
- </c:when>
- <c:otherwise>
- <jsp:include page="../fragments/publicmenu.jsp" />
- </c:otherwise>
- </c:choose>
+ <sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_USER')">
+ <jsp:include page="../fragments/mainmenu.jsp" />
+ </sec:authorize>
+ <sec:authorize access="!hasAnyRole('ROLE_ADMIN','ROLE_USER')">
+ <jsp:include page="../fragments/publicmenu.jsp" />
+ </sec:authorize>
<div class="panel panel-default">
<div class="panel-heading">
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ 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"%>
<html>
<jsp:include page="../fragments/header.jsp" />
<body>
<div class="container">
- <c:choose>
- <c:when test="${permissions == 'user_role'}">
- <jsp:include page="../fragments/mainmenu.jsp" />
- </c:when>
- <c:otherwise>
- <jsp:include page="../fragments/publicmenu.jsp" />
- </c:otherwise>
- </c:choose>
+ <sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_USER')">
+ <jsp:include page="../fragments/mainmenu.jsp" />
+ </sec:authorize>
+ <sec:authorize access="!hasAnyRole('ROLE_ADMIN','ROLE_USER')">
+ <jsp:include page="../fragments/publicmenu.jsp" />
+ </sec:authorize>
<div class="panel panel-default">
<div class="panel-heading">