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