This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.yacos.core.conferences;
|
package org.yacos.core.conferences;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ import javax.persistence.Query;
|
|||||||
|
|
||||||
import org.yacos.core.users.Role;
|
import org.yacos.core.users.Role;
|
||||||
import org.yacos.core.users.User;
|
import org.yacos.core.users.User;
|
||||||
import org.yacos.core.users.Role.RoleType;
|
import org.yacos.core.users.UserManagerBean;
|
||||||
|
|
||||||
|
|
||||||
@Stateless
|
@Stateless
|
||||||
@@ -24,11 +25,6 @@ public class ConferenceManagerBean implements IConferenceManager {
|
|||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public List<Conference> getConferences() {
|
|
||||||
return em.createQuery("from Conference conf ORDER BY conf.id").getResultList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Conference getConference(Integer id) {
|
public Conference getConference(Integer id) {
|
||||||
return em.find(Conference.class, id);
|
return em.find(Conference.class, id);
|
||||||
}
|
}
|
||||||
@@ -42,25 +38,29 @@ public class ConferenceManagerBean implements IConferenceManager {
|
|||||||
em.merge(conf);
|
em.merge(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@SuppressWarnings("unchecked")
|
||||||
public List<Article> getArticles(Integer conference_id) {
|
public List<Conference> getConferences() {
|
||||||
//FIXME cast a verifier lors des tests
|
return em.createQuery("from Conference conf ORDER BY conf.id").getResultList();
|
||||||
return getConference(conference_id).getArticles();
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
//FIXME
|
|
||||||
/*public void addArticle(User user) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}*/
|
public List<Conference> getConferences(User user){
|
||||||
|
List<Conference> list = new ArrayList<Conference>();
|
||||||
public List<Conference> getConferencesForUser(User user){
|
List<Role> tmpList = new UserManagerBean().getRoles();
|
||||||
return user.getConferences();
|
System.out.println("allo????????????????????");
|
||||||
|
Conference conf;
|
||||||
|
for (Role role : tmpList) {
|
||||||
|
conf = role.getConference();
|
||||||
|
if(!list.contains(conf)){
|
||||||
|
list.add(conf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* m<EFBFBD>thodes relatives aux roles
|
* méthodes relatives aux roles
|
||||||
* */
|
* */
|
||||||
|
|
||||||
public void addRole(Role.RoleType roleType, User user, Conference conf) {
|
public void addRole(Role.RoleType roleType, User user, Conference conf) {
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ public interface IConferenceManager {
|
|||||||
|
|
||||||
//list methodes
|
//list methodes
|
||||||
public List<Conference> getConferences();
|
public List<Conference> getConferences();
|
||||||
public List<Conference> getConferencesForUser(User user);
|
public List<Conference> getConferences(User user);
|
||||||
|
|
||||||
|
|
||||||
//role methode
|
//role methode
|
||||||
public void addRole(Role.RoleType roleType, User user, Conference conf);
|
public void addRole(Role.RoleType roleType, User user, Conference conf);
|
||||||
|
|||||||
Reference in New Issue
Block a user