Changement du tableau de bord pour l'user.

This commit is contained in:
Frederic Debuire
2008-02-19 18:40:19 +00:00
parent 7b077bf07b
commit 448bcf60c2
3 changed files with 14 additions and 1 deletions

View File

@@ -138,6 +138,14 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
return query.getResultList();
}
@SuppressWarnings("unchecked")
public List<Article> getArticleOfAuthor(String authorId) {
User author = em.find(User.class, authorId);
Query query = em.createQuery("from Article a WHERE mainAuthor = ? ORDER BY a.title");
query.setParameter(1, author);
return query.getResultList();
}
@SuppressWarnings("unchecked")
public List<Article> getArticleOfAuthor(Integer confId, String authorId) {
Conference conf = em.find(Conference.class, confId);

View File

@@ -25,6 +25,11 @@ public interface IArticleManager {
//liste d'articles
//public List<Article> getArticles();
/*
* Return all the articles of an author
*/
public List<Article> getArticleOfAuthor(String authorId);
public List<Article> getArticles(Integer confId) throws ConferenceDoesntExistException;
public List<Article> getArticleOfAuthor(Integer confId, String authorId);
public List<Article> getArticlesOfMember(Integer confId, String memberId);

View File

@@ -158,7 +158,7 @@ public class UserManagerBean implements IUserManager{
}
@SuppressWarnings("unchecked")
public List<User> getUsers(int conf_id,RoleType type) {
public List<User> getUsers(int conf_id, RoleType type) {
Query query = em.createQuery("select user from User user, Role role where user.login = role.user and role.type = ? and role.conference = ?)");
query.setParameter(1, type);
Conference conference = em.find(Conference.class, conf_id);