From 11e388b15a0ba4802014d589d2777482e97ca845 Mon Sep 17 00:00:00 2001 From: Jialin Wang Date: Mon, 18 Feb 2008 01:00:15 +0000 Subject: [PATCH] stateArticle pour visualiser l'etat des articles pour roles differents Policy failures: Code warning - failed on resource stateArticle.jsp. Reason: No end tag ()., line 16 - failed on resource StateArticleController.java. Reason: The import java.util.Hashtable is never used, line Override reason: --- .../WEB-INF/jsp/secure/userinformation.jsp | 2 +- .../WebContent/WEB-INF/jsp/stateArticle.jsp | 26 ++++++ YACOSWeb/WebContent/WEB-INF/jsp/tableBord.jsp | 6 +- .../controller/StateArticleController.java | 88 +++++++++++++++++++ 4 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 YACOSWeb/WebContent/WEB-INF/jsp/stateArticle.jsp create mode 100644 YACOSWeb/src/org/yacos/web/system/controller/StateArticleController.java diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/secure/userinformation.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/secure/userinformation.jsp index c6f11c8..9ebe671 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/secure/userinformation.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/secure/userinformation.jsp @@ -5,7 +5,7 @@
- ${ currentUser.firstName } ${ currentUser.lastName }
+ ${ currentUser.firstName } ${ currentUser.lastName }
diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/stateArticle.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/stateArticle.jsp new file mode 100644 index 0000000..f69f7cb --- /dev/null +++ b/YACOSWeb/WebContent/WEB-INF/jsp/stateArticle.jsp @@ -0,0 +1,26 @@ +<%@ include file="/WEB-INF/decorators/include.jsp"%> + + + + +

list state of Articles

+ + + + + + + + + + + + + +
+

${article.title}

+
+

${article.state}

+
+ + \ No newline at end of file diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/tableBord.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/tableBord.jsp index fe8cff0..887118d 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/tableBord.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/tableBord.jsp @@ -34,7 +34,7 @@
  • ">
  • ">
  • ">
  • -
  • ">
  • +
  • ">
  • ">
  • ">
  • @@ -48,7 +48,7 @@

    @@ -62,7 +62,7 @@ diff --git a/YACOSWeb/src/org/yacos/web/system/controller/StateArticleController.java b/YACOSWeb/src/org/yacos/web/system/controller/StateArticleController.java new file mode 100644 index 0000000..38af082 --- /dev/null +++ b/YACOSWeb/src/org/yacos/web/system/controller/StateArticleController.java @@ -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 ht=new Hashtable(); + List
    articles=new ArrayList
    (); + + 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; + } + + +} \ No newline at end of file