This commit is contained in:
@@ -48,6 +48,7 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
|
||||
public void updateArticle(Article article) {
|
||||
em.merge(article);
|
||||
em.flush();
|
||||
|
||||
}
|
||||
|
||||
@@ -57,8 +58,8 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public Article getArticle(Integer id) {
|
||||
return em.find(Article.class, id);
|
||||
public Article getArticle(Integer articleId) {
|
||||
return em.find(Article.class, articleId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -70,46 +71,45 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
|
||||
Query query = em.createQuery("from Article a WHERE a.conference = ? ORDER BY a.title");
|
||||
query.setParameter(1, conf);
|
||||
if (query.getResultList()!=null)
|
||||
{System.out.println("je fini ici ds articleBean");}
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Article> getArticleOfAuthor(Conference conf, User author) {
|
||||
public List<Article> getArticleOfAuthor(Integer confId, String authorId) {
|
||||
Conference conf = em.find(Conference.class, confId);
|
||||
User author = em.find(User.class, authorId);
|
||||
Query query = em.createQuery("from Article a WHERE conference = ? and mainAuthor = ? ORDER BY a.title");
|
||||
query.setParameter(1, conf);
|
||||
query.setParameter(2, author);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
|
||||
/* @SuppressWarnings("unchecked")
|
||||
public List<Article> getAllArticles()
|
||||
{
|
||||
Query query =em.createQuery("SELECT a FROM Article a ORDER BY a.id");
|
||||
return query.getResultList();
|
||||
}*/
|
||||
|
||||
public List<Article> getArticlesOfMember(Conference conf, User member){
|
||||
public List<Article> getArticlesOfMember(Integer confId, String memberId){
|
||||
//TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
public void assignArticleToPCMember(Article article,User pcMember){
|
||||
article.assignToPCMember(pcMember);
|
||||
public void assignArticleToPCMember(Integer articleId,String memberId){
|
||||
Article article = this.getArticle(articleId);
|
||||
User PCMember = em.find(User.class, memberId);
|
||||
article.assignToPCMember(PCMember);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public List<User> getArticlePCMembers(Article article) {
|
||||
public List<User> getArticlePCMembers(Integer articleId) {
|
||||
Article article = this.getArticle(articleId);
|
||||
return (List<User>) article.getPCMembers();
|
||||
}
|
||||
|
||||
public void delegateArticleToReferee(Article article, User referee, User pcMember){
|
||||
article.delegateTo(referee,pcMember);
|
||||
public void delegateArticleToReferee(Integer articleId, String refereeId, String memberId){
|
||||
Article article = this.getArticle(articleId);
|
||||
User PCMember = em.find(User.class, memberId);
|
||||
User referee = em.find(User.class, refereeId);
|
||||
article.delegateTo(referee,PCMember);
|
||||
}
|
||||
|
||||
public List<User> getArticleReferees(Article article) {
|
||||
public List<User> getArticleReferees(Integer articleId) {
|
||||
Article article = this.getArticle(articleId);
|
||||
return (List<User>) article.getReferees();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user