From bf7cbab71a2acd235a00d0350d4117360b50818d Mon Sep 17 00:00:00 2001 From: Frederic Debuire Date: Mon, 4 Feb 2008 21:27:13 +0000 Subject: [PATCH] =?UTF-8?q?Dispatch:=20ca=20plante=20pu=20mais=20ca=20fait?= =?UTF-8?q?=20rien=20de=20sp=C3=A9cial=20pr=20l'instant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/dispatchArticle.jsp | 14 +- YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml | 459 +++++++++--------- .../controller/DispatchArticleController.java | 57 ++- 3 files changed, 273 insertions(+), 257 deletions(-) diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/dispatchArticle.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/dispatchArticle.jsp index bf59c69..1dab520 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/dispatchArticle.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/dispatchArticle.jsp @@ -3,7 +3,9 @@ - + + + @@ -19,8 +21,9 @@
articles to dispatchmembersmembers associate to the article
- - + + + @@ -33,7 +36,8 @@ - + +
list is empty !
@@ -47,7 +51,7 @@ - +
diff --git a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml index 629468f..8cf7657 100644 --- a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml +++ b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml @@ -1,12 +1,12 @@ - - - + + - - - MainController - - SArticleControllerOK - - - ListArticleController - - - SUserRegistrationController - - - SArticleController - - - ChoosePreferenceController - - - DispatchArticleController - - - AddConferenceController - - EvaluationController - - CreateReportController - - - ListConferenceController - - - ChooseConferenceController + + + + MainController + + SArticleControllerOK + + + ListArticleController + + + SUserRegistrationController + + + SArticleController + + + ChoosePreferenceController + + + DispatchArticleController + + + AddConferenceController + + EvaluationController + + CreateReportController + + + ListConferenceController + + + ChooseConferenceController ValidateArticleController - ValideOrRejectController - - - LogonController - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ValideOrRejectController + + LogonController + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dwrController - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dwrController + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + jndi-name="EvaluationManagerBean/remote" cache="true" /> + diff --git a/YACOSWeb/src/org/yacos/web/chairman/controller/DispatchArticleController.java b/YACOSWeb/src/org/yacos/web/chairman/controller/DispatchArticleController.java index e0dca24..66e5c98 100644 --- a/YACOSWeb/src/org/yacos/web/chairman/controller/DispatchArticleController.java +++ b/YACOSWeb/src/org/yacos/web/chairman/controller/DispatchArticleController.java @@ -1,6 +1,5 @@ package org.yacos.web.chairman.controller; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -14,7 +13,6 @@ import org.springframework.validation.BindException; import org.springframework.validation.Errors; 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.core.conferences.Conference; import org.yacos.core.conferences.IConferenceManager; @@ -28,7 +26,7 @@ import org.yacos.web.system.session.SessionService; public class DispatchArticleController extends SimpleFormController{ protected final Log logger = LogFactory.getLog(getClass()); - + private IArticleManager articleManager; public IArticleManager getArticleManager() { return articleManager; @@ -44,7 +42,7 @@ public class DispatchArticleController extends SimpleFormController{ public void setUserManager(IUserManager userManager) { this.userManager = userManager; } - + private IConferenceManager conferenceManager; public IConferenceManager getConferenceManager() { return conferenceManager; @@ -52,41 +50,52 @@ public class DispatchArticleController extends SimpleFormController{ public void setConferenceManager(IConferenceManager conferenceManager) { this.conferenceManager = conferenceManager; } - - + + protected Object formBackingObject(HttpServletRequest request) throws ConferenceDoesntExistException { logger.info("Returning dispatcher view"); - - //on recupere l'id de conference - int conf_id = (Integer)request.getSession().getAttribute("idCurrentConference"); - Collection members = userManager.getUsers(conf_id,RoleType.PCMEMBER); - request.getSession().setAttribute("members",members); - - return new FormDispatcher(); + FormDispatcher fd = new FormDispatcher(); + return fd; + + //Conference conf = SessionService.getInstance().getCurrentConference(); + //Collection members = userManager.getUsers(conf.getId(),RoleType.PCMEMBER); + + //request.getSession().setAttribute("members", members); } - + + @SuppressWarnings("unchecked") @Override protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception { + logger.info("Dispatch: In the referenceData method, adding object in the model"); + Map model = new HashMap(); - // Fetching conference Conference conf = SessionService.getInstance().getCurrentConference(); + Collection members = userManager.getUsers(conf.getId(),RoleType.PCMEMBER); model.put("articles", articleManager.getArticles(conf.getId())); + model.put("members", members); return model; } + - protected ModelAndView onSubmit(HttpServletRequest request, - HttpServletResponse response, - Object command, BindException errors) throws Exception { - - // Fetching conference - Conference conf = SessionService.getInstance().getCurrentConference(); - + @SuppressWarnings("unchecked") + protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { + /*Conference conf = SessionService.getInstance().getCurrentConference(); + FormDispatcher fd = (FormDispatcher)command; Article article = articleManager.getArticle(fd.getIdArticle()); + + return new ModelAndView("dispatchArticle", "articles", articleManager.getArticles(conf.getId()));*/ - return new ModelAndView("dispatchArticle", "articles", articleManager.getArticles(conf.getId())); + logger.info("Dispatch: In the onSubmit method"); + + Map model = new HashMap(); + Conference conf = SessionService.getInstance().getCurrentConference(); + Collection members = userManager.getUsers(conf.getId(),RoleType.PCMEMBER); + model.put("articles", articleManager.getArticles(conf.getId())); + model.put("members", members); + return new ModelAndView("dispatchArticle", model); } - + }