Policy failures:
Code warning - failed on resource MainController.java. Reason: The import org.yacos.core.conferences.Conference is never used, line 5 - failed on resource SArticleController.java. Reason: The method toURL() from the type File is deprecated, line 6 Override reason: s
This commit is contained in:
@@ -2,6 +2,7 @@ package org.yacos.web.author.controller;
|
||||
|
||||
import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -19,6 +20,10 @@ public class MainController extends SimpleFormController {
|
||||
|
||||
logger.info("Returning main view");
|
||||
|
||||
/*ajout en session d'un idconf et loginUser;*/
|
||||
request.getSession().setAttribute("user","toto");
|
||||
request.getSession().setAttribute("conference",1);
|
||||
//FIXME
|
||||
return new ModelAndView("main");
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,11 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||
import org.springframework.web.servlet.view.RedirectView;
|
||||
|
||||
import org.yacos.core.article.*;
|
||||
import org.yacos.web.author.form.*;
|
||||
import org.yacos.core.article.Article;
|
||||
import org.yacos.core.article.IArticleManager;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.users.User;
|
||||
import org.yacos.web.author.form.FormSubmission;
|
||||
|
||||
public class SArticleController extends SimpleFormController {
|
||||
|
||||
@@ -33,9 +35,13 @@ public class SArticleController extends SimpleFormController {
|
||||
HttpServletResponse response, Object command, BindException errors)
|
||||
throws ServletException, IllegalStateException {
|
||||
|
||||
//on recupère l'id de conference
|
||||
Conference conf = (Conference)request.getSession().getAttribute("conference");
|
||||
//on recupère le login de l'utilisateur
|
||||
User user = (User)request.getSession().getAttribute("user");
|
||||
|
||||
String title = ((FormSubmission) command).getTitle();
|
||||
String theme = ((FormSubmission) command).getTheme();
|
||||
String mainauthor = ((FormSubmission) command).getMainauthor();
|
||||
//String secondaryauthor = ((FormSubmission) command).getSecondaryauthor();
|
||||
//TODO : get secondary author working
|
||||
List<String> liste = ((FormSubmission) command).getListe();
|
||||
@@ -68,7 +74,7 @@ public class SArticleController extends SimpleFormController {
|
||||
System.out.println(e);
|
||||
}
|
||||
|
||||
articleManager.addArticle(0, title, theme, nomFile, mainauthor, liste, 1);
|
||||
articleManager.addArticle(title, theme, nomFile, user.getLogin(), liste, Article.State.SUMMARY, conf.getId());
|
||||
|
||||
return new ModelAndView(new RedirectView(getSuccessView()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user