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