stateArticle pour visualiser l'etat des articles pour roles differents

Policy failures:   
Code warning
- failed on resource stateArticle.jsp. Reason: No end tag (</div>)., line 16
- failed on resource StateArticleController.java. Reason: The import java.util.Hashtable is never used, line 
Override reason:
This commit is contained in:
Jialin Wang
2008-02-18 01:00:15 +00:00
parent 3941b6ec1b
commit 11e388b15a
4 changed files with 118 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
<head></head>
<body>
<br />
<b>${ currentUser.firstName } ${ currentUser.lastName }</b><br />
<a href="tableBord.htm"><b>${ currentUser.firstName } ${ currentUser.lastName }</b></a><br />
<a href="listConference.htm" >
<fmt:message key="user.information.followconference" >

View File

@@ -0,0 +1,26 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
<h4 class="title">list state of Articles</h4>
<table>
<c:forEach items="${articles}" var="article">
<tr>
<td>
<div class=""><h2>${article.title}</h2>
</td>
<td>
<h2>${article.state}</h2>
</td>
</tr>
</c:forEach>
</table>
</body>
</html>

View File

@@ -34,7 +34,7 @@
<li><a href="<c:url value="choosePreference.htm"/>"><fmt:message key="menu.pcmember.article.preference" /></a></li>
<li><a href="<c:url value="#"/>"><fmt:message key="menu.pcmember.article.delegate" /></a></li>
<li><a href="<c:url value="listEvaluation.htm"/>"><fmt:message key="menu.pcmember.article.evaluation" /></a></li>
<li><a href="<c:url value="stateArticle.htm?role=2"/>"><fmt:message key="tableBord.state" /></a></li>
<li><a href="<c:url value="stateArticle.htm?role=referee"/>"><fmt:message key="tableBord.state" /></a></li>
<li><a href="<c:url value="#"/>"><fmt:message key="menu.pcmember.article.evaluation.modify" /></a></li>
<li><a href="<c:url value="#"/>"><fmt:message key="menu.pcmember.article.discussion" /></a></li>
</ul>
@@ -48,7 +48,7 @@
<h4><fmt:message key="menu.referee.title" /></h4>
<ul>
<li><a href="<c:url value="listEvaluation.htm"/>"><fmt:message key="menu.referee.article.evaluation" /></a></li>
<li><a href="<c:url value="stateArticle.htm?role=2"/>"><fmt:message key="tableBord.state" /></a></li>
<li><a href="<c:url value="stateArticle.htm?role=referee"/>"><fmt:message key="tableBord.state" /></a></li>
<li><a href="<c:url value="#"/>"><fmt:message key="menu.referee.article.evaluation.modify" /></a></li>
</ul>
<div id="footer"></div>
@@ -62,7 +62,7 @@
<ul>
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.author.article.submission" /></a></li>
<li><a href="<c:url value="manageArticle.htm"/>"><fmt:message key="tableBord.manage" /></a></li>
<li><a href="<c:url value="stateArticle.htm?role=1"/>"><fmt:message key="tableBord.etat" /></a></li>
<li><a href="<c:url value="stateArticle.htm?role=author"/>"><fmt:message key="tableBord.state" /></a></li>
</ul>
<div id="footer"></div>

View File

@@ -0,0 +1,88 @@
package org.yacos.web.system.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
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 org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.yacos.core.article.Article;
import org.yacos.core.article.IArticleManager;
import org.yacos.web.system.controller.NoConferenceSelectedException;
import org.yacos.web.system.session.SessionService;
public class StateArticleController 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 stateArticle view");
String role=request.getParameter("role");
Integer confId=SessionService.getInstance().getCurrentConferenceId();
String authorId=SessionService.getInstance().getCurrentUserLogin();
// Hashtable<String,Object> ht=new Hashtable<String, Object>();
List<Article> articles=new ArrayList<Article>();
if(role.equals("author"))
{
articles=articleManager.getArticleOfAuthor(confId, authorId);
if (articles==null|articles.isEmpty())
{
System.out.println("Liste est Null");
}
else
{
return new ModelAndView("stateArticle","articles",articles);
}
}
else if (role.equals("referee"))
{
articles=articleManager.getArticlesOfMember(confId, authorId);
if (articles==null|articles.isEmpty())
{
System.out.println("Liste est Null");
}
else
{
return new ModelAndView("stateArticle","articles",articles);}
}
return null;
}
public IArticleManager getArticleManager() {
return articleManager;
}
public void setArticleManager(IArticleManager articleManager) {
this.articleManager = articleManager;
}
}