use of fi.otavanopisto.muikku.plugins.forum.model.EnvironmentForumArea in project muikku by otavanopisto.
the class ForumController method createEnvironmentForumArea.
public EnvironmentForumArea createEnvironmentForumArea(String name, String description, Long groupId) {
UserEntity owner = sessionController.getLoggedUserEntity();
ResourceRights rights = resourceRightsController.create();
ForumAreaGroup group = groupId != null ? findForumAreaGroup(groupId) : null;
EnvironmentForumArea forumArea = environmentForumAreaDAO.create(name, description, group, false, owner, rights);
return forumArea;
}
use of fi.otavanopisto.muikku.plugins.forum.model.EnvironmentForumArea in project muikku by otavanopisto.
the class ForumController method listLatestForumThreads.
public List<ForumThread> listLatestForumThreads(int firstResult, int maxResults) {
List<EnvironmentForumArea> environmentForums = listEnvironmentForums();
// List<WorkspaceForumArea> workspaceForums = listCourseForums();
List<ForumArea> forumAreas = new ArrayList<ForumArea>();
for (EnvironmentForumArea ef : environmentForums) {
forumAreas.add(ef);
}
// for (WorkspaceForumArea wf : workspaceForums) {
// forumAreas.add(wf);
// }
List<ForumThread> threads;
if (!forumAreas.isEmpty())
threads = forumThreadDAO.listLatestOrdered(forumAreas, firstResult, maxResults);
else
threads = new ArrayList<ForumThread>();
return threads;
}
Aggregations