[jboss-svn-commits] JBL Code SVN: r7608 - in labs/jbossforums/trunk/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:14:27 EST 2006
Author: unibrew
Date: 2006-11-15 03:14:25 -0500 (Wed, 15 Nov 2006)
New Revision: 7608
Modified:
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
Log:
[JBFORUMS-141] Small bugfix to new pagination.
Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java 2006-11-15 08:14:11 UTC (rev 7607)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java 2006-11-15 08:14:25 UTC (rev 7608)
@@ -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/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java 2006-11-15 08:14:11 UTC (rev 7607)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/PageNavigator.java 2006-11-15 08:14:25 UTC (rev 7608)
@@ -96,7 +96,15 @@
{
return this.currentPage;
}
-
+
+ /**
+ *
+ *
+ */
+ public int getPageSize()
+ {
+ return this.pageSize;
+ }
/**
*
Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java 2006-11-15 08:14:11 UTC (rev 7607)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java 2006-11-15 08:14:25 UTC (rev 7608)
@@ -302,7 +302,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
@@ -313,22 +313,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/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-11-15 08:14:11 UTC (rev 7607)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2006-11-15 08:14:25 UTC (rev 7608)
@@ -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