<classpathentry kind="lib" path="WEB-INF/lib/spring-jms-3.2.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-orm-3.2.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-oxm-3.2.3.RELEASE.jar"/>
- <classpathentry kind="lib" path="WEB-INF/lib/spring-tx-3.2.3.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WEB-INF/lib/spring-tx-3.2.3.RELEASE.jar" sourcepath="/home/asherstnev/.m2/repository/org/springframework/spring-tx/3.2.3.RELEASE/spring-tx-3.2.3.RELEASE-sources.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-web-3.2.3.RELEASE.jar" sourcepath="/home/asherstnev/.m2/repository/org/springframework/spring-web/3.2.3.RELEASE/spring-web-3.2.3.RELEASE-sources.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-webmvc-3.2.3.RELEASE.jar" sourcepath="/home/asherstnev/.m2/repository/org/springframework/spring-webmvc/3.2.3.RELEASE/spring-webmvc-3.2.3.RELEASE-sources.jar"/>
- <classpathentry kind="lib" path="WEB-INF/lib/spring-context-3.2.3.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WEB-INF/lib/spring-context-3.2.3.RELEASE.jar" sourcepath="/home/asherstnev/.m2/repository/org/springframework/spring-context/3.2.3.RELEASE/spring-context-3.2.3.RELEASE-sources.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-context-support-3.2.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-security-acl-3.1.4.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-security-config-3.1.4.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-security-core-3.1.4.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-security-taglibs-3.1.4.RELEASE.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/spring-security-web-3.1.4.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WEB-INF/lib/aopalliance-1.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_45"/>
<classpathentry kind="output" path="WEB-INF/classes"/>
-<beans:beans xmlns="http://www.springframework.org/schema/security"
+<beans:beans
+ xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
- <http auto-config="true">
- <intercept-url pattern="/home/*" access="ROLE_USER" />
- <form-login login-page="/login" default-target-url="/welcome"
- authentication-failure-url="/loginfailed" />
+ <http auto-config="true" use-expressions="true" access-denied-page="/denied">
+ <intercept-url pattern="/stat/**" access="hasRole('ROLE_USER')" />
+ <intercept-url pattern="/sequence/**" access="hasRole('ROLE_USER')" />
+ <intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" />
+ <intercept-url pattern="/database/**" access="hasRole('ROLE_ADMIN')" />
+ <intercept-url pattern="/public*" access="permitAll"/>
+ <intercept-url pattern="/login*" access="permitAll"/>
+ <intercept-url pattern="/index*" access="permitAll"/>
+ <intercept-url pattern="/register*" access="permitAll"/>
+ <form-login
+ login-page="/login"
+ default-target-url="/home"
+ authentication-failure-url="/loginfailed"
+ />
<logout logout-success-url="/logout" />
</http>
+ <global-method-security secured-annotations="enabled">
+ </global-method-security>
+
+<!--
+ <http access-denied-page="/denied.xhtml" auto-config="true" use-expressions="false" >
+ <form-login
+ login-page="/login.xhtml"
+ default-target-url="/"
+ authentication-failure-url="/denied.xhtml"
+ login-processing-url="/static/j_spring_security_check"
+ />
+ <intercept-url pattern="/PANEL/**" access="ROLE_GENERALT"></intercept-url>
+ <logout invalidate-session="true" logout-url="/index.xhtml"/>
+ </http>
+
+ <global-method-security secured-annotations="enabled" jsr250-annotations="enabled"></global-method-security>
+-->
+
<authentication-manager>
<authentication-provider>
<user-service>
- <user name="sherstnev" password="sasha12345" authorities="ROLE_USER" />
+ <user name="sherstnev" password="sasha" authorities="ROLE_USER" />
+ <user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
</user-service>
</authentication-provider>
</authentication-manager>
<welcome-file>index.jsp</welcome-file>\r
</welcome-file-list>\r
\r
+ <!-- ############################################################################################################ -->\r
+ <!-- Spring Security -->\r
+\r
+ <listener>\r
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\r
+ </listener>\r
+\r
+ <context-param>\r
+ <param-name>contextConfigLocation</param-name>\r
+ <param-value>\r
+ /WEB-INF/spring-security.xml\r
+ </param-value>\r
+ </context-param>\r
+\r
+ <filter>\r
+ <filter-name>springSecurityFilterChain</filter-name>\r
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>\r
+ </filter>\r
+\r
+ <filter-mapping>\r
+ <filter-name>springSecurityFilterChain</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+ </filter-mapping>\r
+\r
+ <!-- Main Spring Servlet: annotation based configuration -->\r
<servlet>\r
<servlet-name>proteocache</servlet-name>\r
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>\r
#################################################################################
# Cassandra host or IP
# test server is 10.0.115.190
-#cassandra.host=localhost
-cassandra.host=gjb-www-1.cluster.lifesci.dundee.ac.uk
+cassandra.host=localhost
+#cassandra.host=gjb-www-1.cluster.lifesci.dundee.ac.uk
cassandra.newtables.update=false
import java.util.Calendar;
import org.apache.log4j.Logger;
+import org.springframework.dao.DataIntegrityViolationException;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Configuration;
import com.datastax.driver.core.SocketOptions;
import com.datastax.driver.core.Session;
+import com.datastax.driver.core.exceptions.QueryExecutionException;
+import com.datastax.driver.core.exceptions.QueryValidationException;
import com.datastax.driver.core.policies.Policies;
import compbio.engine.ProteoCachePropertyHelperManager;
session.execute("CREATE TABLE IF NOT EXISTS JpredArchive "
+ "(JobID ascii, Protein varchar, IP ascii, StartTime bigint, ExecTime int, FinalStatus ascii, ExecutionStatus ascii, alignment map<ascii,ascii>, "
+ "predictions map<ascii,ascii>, ArchiveLink varchar, LOG varchar, PRIMARY KEY(JobID));");
-
+
session.execute("CREATE TABLE IF NOT EXISTS JobDateInfo "
+ "(jobday bigint, Total bigint, TotalOK bigint, TotalStopped bigint, TotalError bigint, TotalTimeOut bigint, Program varchar, Version varchar, PRIMARY KEY(jobday));");
+ String com = "CREATE TABLE IF NOT EXISTS Users "
+ + "(name varchar, id bigint, email varchar, password varchar, organisation varchar, position varchar, signedtolist boolean, registrationdate bigint, PRIMARY KEY(id));";
+
+
+ try {
+ session.execute(com);
+ } catch (QueryExecutionException e) {
+ String mess = "CassandraNativeConnector.CreateMainTables: query execution exception...";
+ System.out.println(mess);
+ log.error(mess);
+ log.error(e.getLocalizedMessage(), e.getCause());
+ } catch (QueryValidationException e) {
+ String mess = "CassandraNativeConnector.CreateMainTables: query validation exception... Command: " + com;
+ System.out.println(mess);
+ log.error(mess);
+ log.error(e.getLocalizedMessage(), e.getCause());
+ }
+
session.execute("CREATE INDEX IF NOT EXISTS ProteinSeq ON ProteinRow (protein);");
session.execute("CREATE INDEX IF NOT EXISTS ProteinIp ON ProteinLog (ip);");
session.execute("CREATE INDEX IF NOT EXISTS ON ProteinLog (ExecutionStatus);");
session.execute("CREATE INDEX IF NOT EXISTS ON FailLog (FinalStatus);");
+ session.execute("CREATE INDEX IF NOT EXISTS ON Users (email);");
// session.execute("CREATE INDEX IF NOT EXISTS JobDateStamp ON ProteinData (jobtime);");
}
package compbio.controllers;
+import java.security.Principal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@Controller
public class DailyStatisticsController {
- @RequestMapping(value = "/stat", method = RequestMethod.GET)
- public String initFindForm(Map<String, Object> model) {
+ @RequestMapping(value = "/stat/jobs/query", method = RequestMethod.GET)
+ public String initFindForm(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);
cal.add(Calendar.DATE, -3);
return "queryJobStatistics";
}
- @RequestMapping(value = "/stat/query", method = RequestMethod.GET)
+ @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) {
+ @RequestParam("option") String option, Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
final long startTime = System.currentTimeMillis();
CassandraRequester cr = new CassandraRequester();
return "/reportJobStatistics";
}
- @RequestMapping(value = "/stat/oneday", method = RequestMethod.GET)
- public String findJobsInOneDay(@RequestParam("date") String date, @RequestParam("status") String status, Map<String, Object> model) throws ParseException {
-
+ @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());
final long startTime = System.currentTimeMillis();
String realdate;
package compbio.controllers;
+import java.security.Principal;
import java.util.Map;
import org.springframework.stereotype.Controller;
public class HelpController {
@RequestMapping(value = "/help/overview", method = RequestMethod.GET)
- public String formOverviewPage(Map<String, Object> model) {
+ public String formOverviewPage(Map<String, Object> model, Principal principal) {
+ model.put("username", getPrincipleName(principal));
return "help/Overview";
}
@RequestMapping(value = "/help/howto", method = RequestMethod.GET)
- public String formHowtoPage(Map<String, Object> model) {
+ public String formHowtoPage(Map<String, Object> model, Principal principal) {
+ model.put("username", getPrincipleName(principal));
return "support/Notimplemented";
}
@RequestMapping(value = "/help/doc", method = RequestMethod.GET)
- public String formDocPage(Map<String, Object> model) {
+ public String formDocPage(Map<String, Object> model, Principal principal) {
+ model.put("username", getPrincipleName(principal));
return "support/Notimplemented";
}
@RequestMapping(value = "/help/javadoc", method = RequestMethod.GET)
- public String formJavadoc(Map<String, Object> model) {
+ public String formJavadoc(Map<String, Object> model, Principal principal) {
+ model.put("username", getPrincipleName(principal));
return "support/Notimplemented";
}
+
+ private String getPrincipleName (Principal principal) {
+ if (null != principal.getName()) {
+ return principal.getName();
+ }
+ return "unknown";
+ }
}
package compbio.controllers;
+import java.security.Principal;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import compbio.cassandra.DataBase;
import compbio.cassandra.TotalByCounterBean;
import compbio.cassandra.UserBean;
import compbio.statistic.CassandraRequester;
@Controller
public class IPDataController {
- @RequestMapping(value = "/ip/stat", method = RequestMethod.GET)
- public String initStatisticsForm(Map<String, Object> model) {
+ @RequestMapping(value = "/admin/ip/counts/query", method = RequestMethod.GET)
+ public String initStatisticsForm(Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
model.put("value", 5);
return "queryIPStatistics";
}
- @RequestMapping(value = "/ip", method = RequestMethod.GET)
- public String initOneIPForm(Map<String, Object> model) {
+ @RequestMapping(value = "/admin/ip/query", method = RequestMethod.GET)
+ public String initOneIPForm(Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
model.put("value", "127.0.0.1");
return "queryIP";
}
- @RequestMapping(value = "/ip/stat/querycounter", method = RequestMethod.GET)
- public String findIPwithCounter(@RequestParam("JobCounter") String counter, Map<String, Object> model) {
-
+ @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());
if (counter.equals("")) {
model.put("error", "The value must not be empty");
model.put("value", counter);
return "reportIPstatistics";
}
- @RequestMapping(value = "/ip/query", method = RequestMethod.GET)
- public String findIP(@RequestParam("ip") String ip, Map<String, Object> model) {
+ @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());
final long startTime = System.currentTimeMillis();
CassandraRequester cr = new CassandraRequester();
UserBean r = cr.readIp(ip);
package compbio.controllers;
+import java.security.Principal;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Controller
public class JobExecutionTimeController {
- @RequestMapping(value = "/exectime", method = RequestMethod.GET)
- public String initFindForm(Map<String, Object> model) {
+ @RequestMapping(value = "/stat/exectime/query", method = RequestMethod.GET)
+ public String initFindForm(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);
cal.add(Calendar.DATE, -3);
return "queryTimeExecution";
}
- @RequestMapping(value = "/exectime/query", method = RequestMethod.GET)
+ @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) {
+ @RequestParam(value="option", required=false) String option, Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
final long startTime = System.currentTimeMillis();
CassandraRequester sp = new CassandraRequester();
package compbio.controllers;
+import java.security.Principal;
import java.util.Map;
import org.springframework.stereotype.Controller;
@Controller
public class JobLogController {
- @RequestMapping(value = "/joblog", method = RequestMethod.GET)
- public String initFindForm(Map<String, Object> model) {
+ @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 = "/joblog/query", method = RequestMethod.GET)
- public String findJob(@RequestParam("IdJob") String jobid, Map<String, Object> model) {
+ @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));
package compbio.controllers;
+import java.security.Principal;
import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
+import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class MainController {
- @RequestMapping("home")
- public String loadHomePage(Model m) {
- m.addAttribute("name", "Proteocache");
+ @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);
+ model.addAttribute("message", "Spring Security Custom Form example");
+ return "public";
+ }
+
+ @RequestMapping(value = "/login", method = RequestMethod.GET)
+ public String login(ModelMap model) {
+ return "login";
+ }
+
+ @RequestMapping(value = "/loginfailed", method = RequestMethod.GET)
+ public String loginerror(ModelMap model) {
+ model.addAttribute("error", "Wrong user name or password");
+ return "login";
+ }
+
+ @RequestMapping(value = "/logout", method = RequestMethod.GET)
+ public String logout(ModelMap model) {
+ return "public";
+ }
+
+ @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);
+ 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);
+ model.addAttribute("message", "Spring Security Custom Form example");
return "home";
}
-}
\ No newline at end of file
+
+}
package compbio.controllers;
+import java.security.Principal;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.springframework.web.bind.annotation.RequestParam;
import compbio.cassandra.ProteinBean;
-import compbio.cassandra.DataBase;
-import compbio.data.sequence.SequenceUtil;
import compbio.cassandra.TotalByCounterBean;
import compbio.statistic.CassandraRequester;
/**
- * Spring controller for sequence search. This version works in the servlet
+ * Spring controller for sequence queries. This version works in the servlet
* style.
*
* @author Alexander Sherstnev
* @version 1.0 December 2013
*/
@Controller
+@RequestMapping("/sequence")
public class SequenceController {
/**
*/
private final Pattern NONPROTEIN = Pattern.compile("[^ARNDCQEGHILKMFPSTWYV]+", Pattern.CASE_INSENSITIVE);
- @RequestMapping(value = "/sequence/query1", method = RequestMethod.GET)
- public String formSequenceQuery(Map<String, Object> model) {
+ @RequestMapping(value = "query", method = RequestMethod.GET)
+ public String formSequenceQuery(Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
model.put("value", "AAAAA");
return "queryProteinSequence";
}
- @RequestMapping(value = "/sequence/query2", method = RequestMethod.GET)
- public String formCounterQuery(Map<String, Object> model) {
+ @RequestMapping(value = "counts/query", method = RequestMethod.GET)
+ public String formCounterQuery(Map<String, Object> model, Principal principal) {
+ model.put("username", principal.getName());
model.put("value", 5);
return "queryProteinSequenceCounter";
}
- @RequestMapping(value = "/sequence/querysequence", method = RequestMethod.GET)
- public String findSequence(@RequestParam("sequence") String sequence, @RequestParam("protein") String flag, Map<String, Object> model) {
+ @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());
final long startTime = System.currentTimeMillis();
// input checks
return "reportProteinSequences";
}
- @RequestMapping(value = "/sequence/querycounter", method = RequestMethod.GET)
- public String countSequences(@RequestParam("counterJob") String counter, Map<String, Object> model) {
+ @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());
final long startTime = System.currentTimeMillis();
if (counter.equals("")) {
import org.apache.log4j.Logger;
-import com.datastax.driver.core.Session;
-
import compbio.cassandra.CassandraNativeConnector;
import compbio.cassandra.CassandraNewTableWriter;
import compbio.cassandra.JpredParserHTTP;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.ImportResource;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
@EnableWebMvc
+@ImportResource("WEB-INF/spring-security.xml")
@ComponentScan(basePackages = "compbio.controllers")
public class WebConfig extends WebMvcConfigurerAdapter {
<html>
<head>
<title></title>
- <script type="text/javascript">window.location.href='<%=request.getContextPath()%>/home'</script>
+ <script type="text/javascript">window.location.href='<%=request.getContextPath()%>/index'</script>
</head>
<body>
- If you are not redirected automatically, click
- <a href="<%=request.getContextPath()%>/home">here</a>.
+ If you are not redirected automatically, click <a href="<%=request.getContextPath()%>/index">here</a>.
</body>
</html>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<jsp:include page="logos.jsp" />
-<nav class="navbar navbar-default" role="navigation">
+<nav class="navbar navbar-default">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-search"></span> Search Servlets <b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a href="<spring:url value="/sequence/query1" htmlEscape="true" />">Protein Sequence</a></li>
- <li><a href="<spring:url value="/joblog" htmlEscape="true" />">Job</a></li>
- <li><a href="<spring:url value="/ip" htmlEscape="true" />">IP</a></li>
+ <li><a href="<spring:url value="/sequence/query" htmlEscape="true" />">Protein Sequence</a></li>
+ <li><a href="<spring:url value="/job/query" htmlEscape="true" />">Job</a></li>
+ <li><a href="<spring:url value="/admin/ip/query" htmlEscape="true" />">IP</a></li>
</ul>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-stats"></span> Statistics Servlets<b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a href="<spring:url value="/stat" htmlEscape="true" />">Daily Job Statistics</a></li>
+ <li><a href="<spring:url value="/stat/jobs/query" htmlEscape="true" />">Daily Job Statistics</a></li>
<li class="divider"></li>
- <li><a href="<spring:url value="/exectime" htmlEscape="true" />">Job Time Execution</a></li>
- <li><a href="<spring:url value="/ip/stat" htmlEscape="true" />">IPs by Job count</a></li>
- <li><a href="<spring:url value="/sequence/query2" htmlEscape="true" />">Proteins by Job count</a></li>
+ <li><a href="<spring:url value="/stat/exectime/query" htmlEscape="true" />">Job Time Execution</a></li>
+ <li><a href="<spring:url value="/admin/ip/counts/query" htmlEscape="true" />">IPs by Job count</a></li>
+ <li><a href="<spring:url value="/sequence/counts/query" htmlEscape="true" />">Proteins by Job count</a></li>
</ul>
</li>
+<sec:authorize access="hasRole('ROLE_ADMIN')">
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-edit"></span> Database Servlets<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="<spring:url value="/database/state" htmlEscape="true" />">DB state</a></li>
<li><a href="<spring:url value="/database/remove" htmlEscape="true" />">Remove records</a></li>
</ul>
</li>
+</sec:authorize>
</ul>
<ul class="nav navbar-nav navbar-right">
+ <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>
+ </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>
<ul class="dropdown-menu">
<li><a href="<spring:url value="/help/overview" htmlEscape="true" />">Overview</a></li>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/ip/query" var="query"/>
+ <spring:url value="/admin/ip/results" var="query"/>
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/ip/stat/querycounter" var="query"/>
+ <spring:url value="/admin/ip/counts/results" var="query"/>
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
+ <spring:url value="/job/query" var="query"/>
<div class="panel panel-default">
<div class="panel-heading">
<div style="font-weight:bold;">Enter Job Id</div>
</div>
<div class="panel-body">
- <spring:url value="/joblog/query" var="formurl"/>
- <form method="get" action="${fn:escapeXml(formurl)}">
+ <form method="get" action="${query}">
<p><input type="text" name="IdJob" value="${value}"></p>
<input type="submit" name="Search" value="Search"/>
</form>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
+ <spring:url value="/stat/jobsdaily/results" var="query" />
<div class="panel panel-default">
<div class="panel-heading">
<div style="font-weight:bold;">Enter time period for daily job statistics</div>
</div>
<div class="panel-body">
- <spring:url value="/stat/query" var="formurl" />
- <form method="get" action="${fn:escapeXml(formurl)}">
+ <form method="get" action="${query}">
<p><input type="checkbox" name="option" value="AllDates" checked="checked" onclick="hide(this, 'date');"> Query for all dates<br>
<div id='date' style="visibility:hidden;">
<p>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/sequence/querysequence" var="query"/>
+ <spring:url value="/sequence/sequence/results" var="query"/>
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/sequence/querycounter" var="query"/>
+ <spring:url value="/sequence/counts/results" var="query"/>
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/exectime/query" var="query"/>
+ <spring:url value="/stat/exectime/results" var="query"/>
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/joblog/query" var="jobqueryservlet" />
+ <spring:url value="/job/results" var="jobqueryservlet" />
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/ip/query" var="ipquery" />
+ <spring:url value="/admin/ip/results" var="ipquery" />
<div class="panel panel-default">
<div class="panel-heading">
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/sequence/querysequence" var="searchquery" />
- <spring:url value="/ip/query" var="ipquery" />
+ <spring:url value="/sequence/sequence/results" var="sequence_query" />
+ <spring:url value="/admin/ip/results" var="ip_query" />
<div class="panel panel-default">
<div class="panel-heading">
<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="${ipquery}?ip=${result.ip}&Search=Search">${result.ip}</a></p>
+ <p>IP: <a title="Click to view other jobs" href="${ip_query}?ip=${result.ip}&Search=Search">${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="${searchquery}?sequence=${result.sequence}&protein=whole&Search=Search">${result.sequence}</a>
+ <a title="Click to view other jobs" href="${sequence_query}?sequence=${result.sequence}&protein=whole&Search=Search">${result.sequence}</a>
</td>
</tr>
<c:forEach items="${result.prediction}" var="pred">
<tr>
<td>${pred.key}</td>
- <td
- style="text-align: left; border-buttom: dotted; font-family: monospace">
- ${pred.value}</td>
+ <td style="text-align: left; border-buttom: dotted; font-family: monospace">${pred.value}</td>
</tr>
</c:forEach>
</tbody>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/stat/oneday" var="onedayquery" />
- <spring:url value="/stat/query?date1=${date1}&date2=${date2}&option=${option}" var="thequery" />
+ <spring:url value="/stat/jobsoneday/results" var="oneday_query" />
+ <spring:url value="/stat/jobsdaily/results?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="${thequery}" class="btn btn-default active">Reload</a>
+ <a href="${the_query}" class="btn btn-default active">Reload</a>
</li>
</ul>
<td style="text-align: center">${res.key}</td>
<c:set var="value" value="${res.value}"/>
<td style="text-align: right">${value.total}</td>
- <td style="text-align: right"><a href="${onedayquery}?date=${res.key}&status=OK">${value.totalOK}</a></td>
+ <td style="text-align: right"><a href="${oneday_query}?date=${res.key}&status=OK">${value.totalOK}</a></td>
<td style="text-align: right">
<c:choose>
<c:when test="${value.totalStopped == 0}">0</c:when>
- <c:otherwise><a href="${onedayquery}?date=${res.key}&status=Stopped">${value.totalStopped}</a></c:otherwise>
+ <c:otherwise><a href="${oneday_query}?date=${res.key}&status=Stopped">${value.totalStopped}</a></c:otherwise>
</c:choose>
</td>
<td style="text-align: right">
<c:choose>
<c:when test="${value.totalError == 0}">0</c:when>
- <c:otherwise><a href="${onedayquery}?date=${res.key}&status=JpredError">${value.totalError}</a></c:otherwise>
+ <c:otherwise><a href="${oneday_query}?date=${res.key}&status=JpredError">${value.totalError}</a></c:otherwise>
</c:choose>
</td>
<td style="text-align: right">
<c:choose>
<c:when test="${value.totalTimeOut == 0}">0</c:when>
- <c:otherwise><a href="${onedayquery}?date=${res.key}&status=TimedOut">${value.totalTimeOut}</a></c:otherwise>
+ <c:otherwise><a href="${oneday_query}?date=${res.key}&status=TimedOut">${value.totalTimeOut}</a></c:otherwise>
</c:choose>
</td>
</tr>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/joblog/query" var="jobquery" />
- <spring:url value="/stat/oneday?date=${date}&status=${status}" var="thequery" />
+ <spring:url value="/job/results" var="job_query" />
+ <spring:url value="/stat/onedaystat?date=${date}&status=${status}" var="the_query" />
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="${thequery}" class="btn btn-default active">Reload</a>
+ <a href="${the_query}" class="btn btn-default active">Reload</a>
</li>
</ul>
<tbody>
<c:forEach items="${results.jobidAndSeq}" var="res" varStatus="status">
<tr>
- <td><a href="${jobquery}?IdJob=${res.key}">${res.key}</a></td>
+ <td><a href="${job_query}?IdJob=${res.key}">${res.key}</a></td>
<c:choose>
<c:when test="${res.value == ''}">
<td>Job with alignment</td>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/sequence/query" var="searchquery" />
- <spring:url value="/joblog/query" var="jobquery" />
+ <spring:url value="/job/results" var="job_query" />
<div class="panel panel-default">
<div class="panel-heading">
<tr>
<th rowspan="${res.size + 2}"><a
title="Click to view the job log"
- href="${jobquery}?IdJob=${id}">${id}</a></th>
+ href="${job_query}?IdJob=${id}">${id}</a></th>
</tr>
<tr>
<td
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/sequence/querysequence" var="searchquery" />
- <spring:url value="/joblog/query" var="jobquery" />
+ <spring:url value="/sequence/sequence/results" var="sequence_query" />
<div class="panel panel-default">
<div class="panel-heading">
<tr>
<td>${res.totaljobs}</td>
<td style="text-align: left; border-buttom: dotted; font-family: monospace">
- <a title="Click to view all jobs" href="${searchquery}?sequence=${res.name}&protein=whole&Search=Search">${res.name}</a>
+ <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.name}&protein=whole&Search=Search">${res.name}</a>
</td>
</tr>
</c:forEach>
<body>
<div class="container">
<jsp:include page="fragments/mainmenu.jsp" />
- <spring:url value="/exectime/query?date1=${date1}&date2=${date2}&option=${option}" var="thequery" />
+ <spring:url value="/stat/exectime/query?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
<!-- reload button -->
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="${thequery}" class="btn btn-default active">Reload</a>
+ <a href="${the_query}" class="btn btn-default active">Reload</a>
</li>
</ul>
+++ /dev/null
-<%@ 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"%>
-
-<html>
-<jsp:include page="../fragments/header.jsp" />
-<body>
- <div class="container">
- <jsp:include page="../fragments/mainmenu.jsp" />
-
- <div class="panel panel-default">
- <div class="panel-heading">
- <div style="font-weight:bold;">The page is not available...</div>
- </div>
- <div class="panel-body">
- <p>You do not have unough permissions to view the page</p>
- </div>
- </div>
-
- <jsp:include page="../fragments/footer.jsp" />
- </div>
-</body>
-</html>
\ No newline at end of file