[jboss-svn-commits] JBL Code SVN: r7606 - in labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui: action view

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 15 03:02:28 EST 2006


Author: unibrew
Date: 2006-11-15 03:02:25 -0500 (Wed, 15 Nov 2006)
New Revision: 7606

Modified:
   labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
   labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java
   labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
   labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
Log:
[JBFORUMS-141] Small bugfix to new pagination.

Modified: labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
===================================================================
--- labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java	2006-11-15 07:53:47 UTC (rev 7605)
+++ labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java	2006-11-15 08:02:25 UTC (rev 7606)
@@ -456,22 +456,21 @@
             protected Collection initializePage() {
             
                 int beginIndex = this.getBeginIndex();
-                int endIndex = this.getEndIndex();
                 int totalEntries = this.getNumberOfEntries();
-                        
+                int pageSize = this.getPageSize();
+                
                 //reset the page navigation if the start cursor is outside the range (both forward and backward)
                 if(beginIndex >= totalEntries || beginIndex < 0)
                 {
                     this.setCurrentPage(0); //go to the first page
                     beginIndex = this.getBeginIndex();
-                    endIndex = this.getEndIndex();
                 }
                 
                 try {
                     return fm.findTopicsDesc(forum,
                                              Constants.POST_NORMAL,
                                              beginIndex,
-                                             endIndex);
+                                             pageSize);
                 } catch (ModuleException e) {
                     JSFUtil.handleException(e);
                 }

Modified: labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java
===================================================================
--- labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java	2006-11-15 07:53:47 UTC (rev 7605)
+++ labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java	2006-11-15 08:02:25 UTC (rev 7606)
@@ -96,7 +96,15 @@
     {
         return this.currentPage;
     }
-    
+
+    /**
+     * 
+     *
+     */
+    public int getPageSize()
+    {
+        return this.pageSize;
+    }    
       
     /**
      * 

Modified: labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
===================================================================
--- labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java	2006-11-15 07:53:47 UTC (rev 7605)
+++ labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java	2006-11-15 08:02:25 UTC (rev 7606)
@@ -307,7 +307,7 @@
                  //setup the page data
                  pageNumber = Integer.parseInt(page);
              }
-                                     
+             System.out.println("PAGENUMBER: "+pageNumber);              
              //setup the pageNavigator for this forum
              this.pageNavigator = new PageNavigator(
                 forum.getTopicCount(), //total number of entries to be split up into pages
@@ -318,22 +318,21 @@
                  protected Collection initializePage() {
                  
                      int beginIndex = this.getBeginIndex();
-                     int endIndex = this.getEndIndex();
                      int totalEntries = this.getNumberOfEntries();
-                             
+                     int pageSize = this.getPageSize();
+                     
                      //reset the page navigation if the start cursor is outside the range (both forward and backward)
                      if(beginIndex >= totalEntries || beginIndex < 0)
                      {
                          this.setCurrentPage(0); //go to the first page
                          beginIndex = this.getBeginIndex();
-                         endIndex = this.getEndIndex();
                      }
                      
                      try {
                          return fm.findTopicsDesc(forum,
                                                   Constants.POST_NORMAL,
                                                   beginIndex,
-                                                  endIndex);
+                                                  pageSize);
                      } catch (ModuleException e) {
                          JSFUtil.handleException(e);
                      }

Modified: labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
===================================================================
--- labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java	2006-11-15 07:53:47 UTC (rev 7605)
+++ labs/jbossforums/branches/forums22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java	2006-11-15 08:02:25 UTC (rev 7606)
@@ -223,21 +223,20 @@
                                 protected Collection initializePage() {
                                 
                                     int beginIndex = this.getBeginIndex();
-                                    int endIndex = this.getEndIndex();
                                     int totalEntries = this.getNumberOfEntries();
-                                            
+                                    int pageSize = this.getPageSize();
+                                    
                                     //reset the page navigation if the start cursor is outside the range (both forward and backward)
                                     if(beginIndex >= totalEntries || beginIndex < 0)
                                     {
                                         this.setCurrentPage(0); //go to the first page
                                         beginIndex = this.getBeginIndex();
-                                        endIndex = this.getEndIndex();
                                     }
                                 
                                     try {
                                         return fm.findPostIdsAsc(topic.getId(),
                                                                  beginIndex,
-                                                                 endIndex);
+                                                                 pageSize);
                                     } catch (ModuleException e) {
                                         JSFUtil.handleException(e);
                                     }
@@ -258,21 +257,20 @@
                                 protected Collection initializePage() {
                                     
                                     int beginIndex = this.getBeginIndex();
-                                    int endIndex = this.getEndIndex();
                                     int totalEntries = this.getNumberOfEntries();
-                                            
+                                    int pageSize = this.getPageSize();
+                                    
                                     //reset the page navigation if the start cursor is outside the range (both forward and backward)
                                     if(beginIndex >= totalEntries || beginIndex < 0)
                                     {
                                         this.setCurrentPage(0); //go to the first page
                                         beginIndex = this.getBeginIndex();
-                                        endIndex = this.getEndIndex();
                                     }
                                     
                                     try {
                                         return fm.findPostIdsDesc(topic.getId(),
                                                                   beginIndex,
-                                                                  endIndex);
+                                                                  pageSize);
                                     } catch (ModuleException e) {
                                         JSFUtil.handleException(e);
                                     }




More information about the jboss-svn-commits mailing list