Correction d'un bug dans evaluation
+ Modif diverses
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
<%@ include file="/WEB-INF/decorators/include.jsp"%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title><fmt:message key="detail.title"/></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="article cb">
|
||||
<h4 class="title">Article's details</h4>
|
||||
|
||||
<div class="article cbb">
|
||||
<h2>${article.title}</h2>
|
||||
<p class="author">Author: <b>${article.mainAuthor.firstName} ${article.mainAuthor.lastName}</b></p>
|
||||
<p class="author">Author: <b>${article.mainAuthor.firstName}
|
||||
${article.mainAuthor.lastName}</b></p>
|
||||
<c:if test="${article.secondaryAuthors!=null}">
|
||||
<p class="secondaryAuthors">
|
||||
Secondary Authors:
|
||||
<p class="secondaryAuthors">Secondary Authors:
|
||||
<ul>
|
||||
<c:forEach items="${article.secondaryAuthors}" var="sAuthor">
|
||||
<li>${sAuthor}</li>
|
||||
@@ -21,11 +22,11 @@
|
||||
|
||||
<p class="topic">Topic: <b>${article.topic}</b></p>
|
||||
<p class="topic">State of article: <b>${article.state}</b></p>
|
||||
<p class="article_url"><a href="
|
||||
<p class="article_url"><a
|
||||
href="
|
||||
<c:url value="/download.htm">
|
||||
<c:param name="articleId" value="${article.id}"/>
|
||||
</c:url>">Download the article</a>
|
||||
</p>
|
||||
</c:url>">Download</a></p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -237,7 +237,7 @@ public class EvaluationController extends SimpleFormController {
|
||||
for(SimpleCriterion sc : liste) {
|
||||
Rating rt = new Rating();
|
||||
for (Rating r : ratings) {
|
||||
if (r.getCriterion().getId() == sc.getId()) {
|
||||
if (r.getCriterion().getId().intValue() == sc.getId().intValue()) {
|
||||
rt = r;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.ModelAndViewDefiningException;
|
||||
import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||
import org.yacos.core.article.Article;
|
||||
import org.yacos.core.article.IArticleManager;
|
||||
@@ -21,14 +22,24 @@ public class DetailArticleController extends SimpleFormController {
|
||||
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
logger.info("Returning main view");
|
||||
String id=request.getParameter("id");
|
||||
System.out.println("article's id is "+id);
|
||||
Integer idd=new Integer(Integer.parseInt(id));
|
||||
Article article=articleManager.getArticle(idd);
|
||||
//FIXME
|
||||
logger.info("Returning details view");
|
||||
|
||||
String articleId = request.getParameter("id");
|
||||
|
||||
try {
|
||||
Integer id = new Integer(articleId);
|
||||
|
||||
Article article = articleManager.getArticle(id);
|
||||
|
||||
if (article == null)
|
||||
throw new ModelAndViewDefiningException(new ModelAndView("404error"));
|
||||
|
||||
return new ModelAndView("detailArticle", "article", article);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
throw new ModelAndViewDefiningException(new ModelAndView("404error"));
|
||||
}
|
||||
}
|
||||
|
||||
public IArticleManager getArticleManager() {
|
||||
return articleManager;
|
||||
|
||||
@@ -20,7 +20,6 @@ public class MainController extends SimpleFormController {
|
||||
|
||||
logger.info("Returning main view");
|
||||
|
||||
//FIXME
|
||||
return new ModelAndView("main");
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.ModelAndViewDefiningException;
|
||||
import org.springframework.web.servlet.mvc.Controller;
|
||||
import org.springframework.web.servlet.view.RedirectView;
|
||||
import org.yacos.core.article.Article;
|
||||
@@ -87,8 +88,7 @@ public class ArticleDownloadController implements Controller {
|
||||
response.getOutputStream().close();
|
||||
|
||||
} catch(NumberFormatException e){
|
||||
// TODO : display something
|
||||
return null;
|
||||
throw new ModelAndViewDefiningException(new ModelAndView("404error"));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -68,7 +68,6 @@ public class SessionService {
|
||||
//request.setAttribute("nbUserConferences",getNbUserConferences());
|
||||
|
||||
} catch (NamingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user