Policy failures:
Code warning - failed on resource DispatchArticleController.java. Reason: ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized, line 51 - failed on resource DispatchArticleController.java. Reason: The import java.util.List is never used, line 6 - failed on resource DispatchArticleController.java. Reason: Type safety: The expression of type ArrayList needs unchecked conversion to conform to ArrayList<String>, line 5 Override reason: dispatcharticle v0.1
This commit is contained in:
@@ -0,0 +1,64 @@
|
|||||||
|
package org.yacos.web.PCmember.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.Controller;
|
||||||
|
import org.yacos.core.article.Article;
|
||||||
|
import org.yacos.core.conferences.Conference;
|
||||||
|
import org.yacos.core.conferences.IConferenceManager;
|
||||||
|
import org.yacos.core.users.*;
|
||||||
|
|
||||||
|
public class DispatchArticleController implements Controller{
|
||||||
|
|
||||||
|
protected final Log logger = LogFactory.getLog(getClass());
|
||||||
|
|
||||||
|
private IConferenceManager conferenceManager;
|
||||||
|
|
||||||
|
public IConferenceManager getConferenceManager() {
|
||||||
|
return conferenceManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConferenceManager(IConferenceManager conferenceManager) {
|
||||||
|
this.conferenceManager = conferenceManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
private UsersManager userManager;
|
||||||
|
|
||||||
|
public UsersManager getUserManager() {
|
||||||
|
return userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserManager(UsersManager userManager) {
|
||||||
|
this.userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelAndView handleRequest(HttpServletRequest arg0,
|
||||||
|
HttpServletResponse arg1) throws Exception {
|
||||||
|
Date date = new Date();
|
||||||
|
Conference conf = new Conference(1,"lalal","lalala","lalala",date,date,date,date,date);
|
||||||
|
conferenceManager.addConference(conf);
|
||||||
|
conf = conferenceManager.getConference(1);
|
||||||
|
|
||||||
|
Article a = new Article(1,"title","topic","url","autor",new ArrayList(),1);
|
||||||
|
Collection<Article> articles = new ArrayList<Article>();
|
||||||
|
articles.add(a);
|
||||||
|
conf.setArticles(articles);
|
||||||
|
logger.info(conferenceManager.getConference(1).getArticles());
|
||||||
|
articles = conferenceManager.getArticles(1);
|
||||||
|
|
||||||
|
Collection<User> members = userManager.getUsers();
|
||||||
|
arg0.getSession().setAttribute("members",members);
|
||||||
|
|
||||||
|
return new ModelAndView("dispatchArticle","articles",articles);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user