Ajout d'une méthode pour avoir la conférence à laquelle appartient un article
This commit is contained in:
@@ -166,6 +166,25 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
public Conference getConferenceForArticle(Integer articleId) {
|
||||
//try {
|
||||
//ut.begin();
|
||||
Article article = em.find(Article.class, articleId);
|
||||
Conference conf = article.getConference();
|
||||
//ut.commit();
|
||||
return conf;
|
||||
/*} catch (Exception e) {
|
||||
try {
|
||||
ut.rollback();
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;*/
|
||||
}
|
||||
|
||||
|
||||
public void assignArticleToPCMember(Integer articleId,String memberId){
|
||||
try{
|
||||
ut.begin();
|
||||
@@ -208,9 +227,9 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
|
||||
|
||||
public List<User> getArticlePCMembers(Integer articleId) {
|
||||
Article article = this.getArticle(articleId);
|
||||
List<User> users = (List<User>)article.getPcMembers();
|
||||
return users;
|
||||
Article article = this.getArticle(articleId);
|
||||
List<User> users = (List<User>)article.getPcMembers();
|
||||
return users;
|
||||
}
|
||||
|
||||
public void delegateArticleToReferee(Integer articleId, String refereeId, String memberId){
|
||||
@@ -241,10 +260,10 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
User PCMember = em.find(User.class, memberId);
|
||||
User referee = em.find(User.class, refereeId);
|
||||
Query query = em.createQuery(
|
||||
"delete from Delegation where article=:article and referee=:referee and pcMember=:pcMember")
|
||||
.setParameter("article", article)
|
||||
.setParameter("referee", referee)
|
||||
.setParameter("pcMember", PCMember);
|
||||
"delete from Delegation where article=:article and referee=:referee and pcMember=:pcMember")
|
||||
.setParameter("article", article)
|
||||
.setParameter("referee", referee)
|
||||
.setParameter("pcMember", PCMember);
|
||||
@SuppressWarnings("unused")
|
||||
int affectedRows = query.executeUpdate();
|
||||
ut.commit();
|
||||
|
||||
@@ -7,6 +7,7 @@ import javax.ejb.Remote;
|
||||
|
||||
import org.yacos.core.article.Article.State;
|
||||
import org.yacos.core.article.Preference.PreferenceType;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.exceptions.ConferenceDoesntExistException;
|
||||
|
||||
|
||||
@@ -35,6 +36,11 @@ public interface IArticleManager {
|
||||
public List<Article> getArticlesOfMember(Integer confId, String memberId);
|
||||
//public List<Article> getAllArticles();
|
||||
|
||||
/*
|
||||
* return the conference which own the article
|
||||
*/
|
||||
public Conference getConferenceForArticle(Integer articleId);
|
||||
|
||||
|
||||
//gestion des preferences
|
||||
public Preference addPreference(Integer articleId, String userLogin, PreferenceType preferenceType);
|
||||
|
||||
Reference in New Issue
Block a user