modif ds evaluation

Policy failures:   
Code warning
- failed on resource EvaluationController.java. Reason: ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized, line 100
- failed on resource EvaluationController.java. Reason: The local variable idd is never read, line 124
- failed on resource EvaluationController.java. Reason: Type safety: The expression of type ArrayList needs unchecked conversion to conform to List<Rating>, line 10
Override reason:   
o(∩_∩)o
This commit is contained in:
Jialin Wang
2008-02-04 23:10:55 +00:00
parent bf7cbab71a
commit d922edeaef
5 changed files with 88 additions and 11 deletions

View File

@@ -124,6 +124,8 @@ evaluation.commentAuthor=Comment of author
evaluation.headPage=Here is a report of the evaluation
evaluation.titleArticle=The title of article is
evaluation.note=The note for the criterion
evaluation.thisArticle=evaluate this article
evaluation.choose=Choose an title to evaluation from the list
#Validation messages for errors
submissionArticle.title=The title should not be null
@@ -138,3 +140,4 @@ validate.download=download the article
validate.report=consulter the result of the evaluation
validate.validate=validate
validate.reject=reject

View File

@@ -16,7 +16,7 @@
<li><a href="<c:url value="addConference.htm"/>"><fmt:message key="menu.chairman.conference.create" /></a></li>
<li><a href="<c:url value="dispatchArticle.htm"/>"><fmt:message key="menu.chairman.article.dispatch" /></a></li>
<li><a href="<c:url value="choosePreference.htm"/>"><fmt:message key="menu.pcmember.article.preference" /></a></li>
<li><a href="<c:url value="evaluation.htm"/>"><fmt:message key="menu.referee.article.evaluation" /></a></li>
<li><a href="<c:url value="listEvaluation.htm"/>"><fmt:message key="menu.referee.article.evaluation" /></a></li>
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.author.article.submission" /></a></li>
<li><a href="<c:url value="validateArticle.htm"/>"><fmt:message key="menu.pcmember.article.validation" /></a></li>
</ul>

View File

@@ -0,0 +1,21 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
<h2><fmt:message key="evaluation.choose"/></h2>
<c:forEach items="${listArticle}" var="article">
<ul class="article">
<li class="title">Title: <a href="<c:url value="${article.URL_article}"/>">${article.title}</a></li>
<li class="author">Author: <b>${article.mainAuthor.firstName} ${article.mainAuthor.lastName}</b></li>
<li class="topic">Topic: <b>${article.topic}</b></li>
<li class="article_url"><a href="<c:url value="evaluation.htm?id=${article.id}"/>"><fmt:message key="evaluation.thisArticle"/></a></li>
</ul>
<br />
<hr />
<br />
</c:forEach>
</body>
</html>

View File

@@ -25,6 +25,7 @@ import org.yacos.core.users.User;
import org.yacos.web.PCmember.form.FormEvaluation;
import org.yacos.web.PCmember.form.SimpleCriterion;
import org.yacos.web.system.session.SessionService;
public class EvaluationController extends SimpleFormController {
@@ -87,13 +88,16 @@ public class EvaluationController extends SimpleFormController {
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
String id=request.getParameter("id");
logger.info("my article's id is "+id);
FormEvaluation fe=(FormEvaluation)command;
List<SimpleCriterion> liste=fe.getSimpleRatings();
String commentAuthor=fe.getCommentAuthor();
String commentPCMember=fe.getCommentPCMember();
ArrayList<Rating> listeRating=new ArrayList();
List<Rating> listeRating=new ArrayList();
for(SimpleCriterion sc : liste){
@@ -109,16 +113,17 @@ public class EvaluationController extends SimpleFormController {
// Article article=articleManager.getArticle(new Integer(1));
Article article = new Article();
article.setTitle("myTitle");
Article article =articleManager.getArticle(Integer.parseInt(id));
System.out.println("le title est: "+article.getTitle());
User toto = userManager.getUser("toto");
if(toto == null){
toto = userManager.addUser("toto",User.hashPassword("toto"), "Toto", "Toto", "Toto corp.", "toto@totocorp.com");
User current = SessionService.getInstance().getCurrentUser();
if(current == null){
current = userManager.addUser("toto",User.hashPassword("toto"), "Toto", "Toto", "Toto corp.", "toto@totocorp.com");
}
Report rpt =new Report(commentPCMember,commentAuthor,listeRating,toto,article);
//evaluationManager.addReport(article, commentPCMember, commentAuthor, listeRating, toto);
int idd=Integer.parseInt(id);
Report rpt =new Report(commentPCMember,commentAuthor,listeRating,current,article);
//evaluationManager.addReport(idd, commentPCMember, commentAuthor, listeRating, current.getLogin());
request.getSession().setAttribute("report", rpt);
//Map<String, Report> model1 = new HashMap<String, Report>();
//model1.put("report", rpt);

View File

@@ -0,0 +1,48 @@
package org.yacos.web.PCmember.controller;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.IOException;
import java.util.List;
import org.yacos.web.system.controller.NoConferenceSelectedException;
import org.yacos.web.system.session.SessionService;
import org.yacos.core.article.Article;
import org.yacos.core.article.IArticleManager;
import org.yacos.core.exceptions.ConferenceDoesntExistException;
public class ListEvaluationController extends SimpleFormController {
protected final Log logger = LogFactory.getLog(getClass());
private IArticleManager articleManager;
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, NoConferenceSelectedException {
logger.info("Returning listArticle view");
List<Article> listArticle;
try {
listArticle = articleManager.getArticles(SessionService.getInstance().getCurrentConferenceId());
getServletContext().setAttribute("listArticle", listArticle);
} catch (ConferenceDoesntExistException e) {
logger.error(e.getMessage());
}
return new ModelAndView("listEvaluation");
}
public IArticleManager getArticleManager() {
return articleManager;
}
public void setArticleManager(IArticleManager articleManager) {
this.articleManager = articleManager;
}
}