[jboss-svn-commits] JBL Code SVN: r6044 - labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Aug 31 12:26:50 EDT 2006
Author: unibrew
Date: 2006-08-31 12:26:48 -0400 (Thu, 31 Aug 2006)
New Revision: 6044
Modified:
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
Log:
[JBFORUMS-113] Now posts on TopicView are sorting according to user preference.
Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-08-31 15:52:50 UTC (rev 6043)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-08-31 16:26:48 UTC (rev 6044)
@@ -197,7 +197,11 @@
this.topic =
BaseController.getForumsModule().findTopicById(new Integer(topicId));
Collection posts = this.topic.getPosts();
-
+ if (this.userPreferences.getPreference(Constants.POST_ORDER_KEY).compareToIgnoreCase("ascending")==0) {
+ posts = this.getForumsModule().findPostsByTopicIdAsc(topic.getId(),0,Integer.MAX_VALUE);
+ } else {
+ posts = this.getForumsModule().findPostsByTopicIdDesc(topic.getId(),0,Integer.MAX_VALUE);
+ }
if (posts != null && posts.size() > 0) {
int currentPage = 0;
if (page != null && page.trim().length() > 0) {
More information about the jboss-svn-commits
mailing list