use of it.vige.rubia.ForumsModule in project rubia-forums by flashboss.
the class ViewForum method execute.
/**
*/
@PostConstruct
public void execute() {
// parse the input parameters
int forumId = -1;
String f = getParameter(p_forumId);
if (f != null && f.trim().length() > 0) {
forumId = parseInt(f);
}
// ForumsModule is stored as a final variable so that anonymous
// class
// could use it.
final ForumsModule fm = forumsModule;
// grab the data to be displayed for this page
if (forumId != -1) {
// be displayed
try {
forum = fm.findForumById(forumId);
// Getting sticky topics for this page
Collection<Topic> stickies = getStickyThreads();
// Getting announcements
Collection<Topic> announcements = getAnnouncements();
normalThreads = fm.findTopicsDesc(forum, NORMAL, 0, MAX_VALUE);
normalThreadsDataModel = new ListDataModel<Topic>(normalThreads);
Collection<Topic> listOfTopics = new LinkedList<Topic>();
listOfTopics.addAll(stickies);
listOfTopics.addAll(announcements);
listOfTopics.addAll(normalThreads);
// Getting sticky topics for this page
topicLastPosts = fm.findLastPostsOfTopics(listOfTopics);
// topic minipaging
for (Topic cour : listOfTopics) {
if (cour.getReplies() > 0) {
PageNavigator topicNav = new PageNavigator(cour.getReplies() + 1, // this
userPreferences.getPostsPerTopic(), // current page of the navigator
0) {
/**
*/
private static final long serialVersionUID = 6277599446838264687L;
protected Collection<Integer> initializePage() {
return null;
}
};
topicNavigator.put(cour.getId(), topicNav);
}
}
} catch (ModuleException e) {
log.error(e);
}
}
}
Aggregations