CALL FOR:
Paging in (search)list of editwizards (more than 10 pages) and extended paging information


Called by: Jaco de Groot
Total tally on this call : +8

START:             08/30/2004 11:45
END OF CALL:       09/02/2004 11:45

YEA (8) : Gerard van Enk, Johannes Verelst, Eduard Witteveen, Rob Vermeulen, Rico Jansen, Pierre van Rooden, Michiel Meeuwissen, Nico Klasens

ABSTAIN (0) :

NAY (0) :

VETO (0) :


Indicate if you would like this hack to be added to the 1.7 branch:

Total tally on this call : +7

YEA (7) : Gerard van Enk, Johannes Verelst, Eduard Witteveen, Rob Vermeulen, Pierre van Rooden, Michiel Meeuwissen, Nico Klasens

ABSTAIN (1) : Rico Jansen

NAY (0) :

VETO (0) :


No votes, assumed abstained (7): Marcel Maatkamp, Andre van Toly, Daniel Ockeloen, Kees Jongenburger, Rob van Maris, Mark Huijser, Ernst Bunders



Result:
Call succeeded, code can be added to both the CVS 1.8 and the CVS 1.7 branches.




Jaco de Groot wrote:
CALL FOR:
Extending the (search)list of the editwizards to show more than 10 pages and to show more paging information (i.e. number of items on page and number of pages found).
LINKS:
Four patches are attachted to this mail that are needed to make it work.
START OF CALL: 20040830
END OF CALL: 20040903


[_] +1 (YEA)
[_] +0 (ABSTAIN )
[_] -1 (NAY), because :
[_] VETO, because:

Please, also indicate if you would like this hack to be added to the 1.7 branch:

[_] +1 (YEA)
[_] +0 (ABSTAIN )
[_] -1 (NAY), because :
[_] VETO, because:

Jaco


------------------------------------------------------------------------

--- list.jsp.orig Mon Aug 30 12:51:42 2004
+++ list.jsp Mon Aug 30 22:17:59 2004
@@ -158,7 +158,7 @@
if (log.isDebugEnabled()) {
-log.trace("Got " + results.size() + " results");
+log.trace("Got " + results.size() + " of " + resultsSize + " results");
}
@@ -170,7 +170,7 @@
if (end > resultsSize) end = resultsSize;
// place all objects
-String s = "<list count=\"" + results.size() + "\" />";
+String s = "<list offsetstart=\"" + (start + 1) + "\" offsetend=\"" + (start + results.size()) + "\" count=\"" + results.size() + "\" totalcount=\"" + resultsSize + "\" />";
Document doc = Utils.parseXML(s);
log.trace("Create document");
@@ -247,8 +247,22 @@
Utils.setAttribute(pages, "showing", maxpages + "");
}
-for (int i = 0; i<pagecount && i<maxpages; i++) {
+int pageOffset = 0;
+currentpage = start / len;
+pageOffset = currentpage - (maxpages / 2);
+if (pageOffset < 0) {
+ pageOffset = 0;
+}
+if (pageOffset + maxpages > pagecount) {
+ pageOffset = pagecount - maxpages;
+ if (pageOffset < 0) {
+ pageOffset = 0;
+ }
+}
+
+for (int i = pageOffset; i<pagecount && i - pageOffset <maxpages; i++) {
org.w3c.dom.Node pagenode = doc.createElement("page");
+ Utils.setAttribute(pagenode, "number", (i+1)+"");
Utils.setAttribute(pagenode, "start", (i*len)+"");
Utils.setAttribute(pagenode, "current", (i==currentpage)+"");
Utils.setAttribute(pagenode, "previous", (i==currentpage-1)+"");



------------------------------------------------------------------------

--- list.xsl.orig Mon Aug 30 23:36:50 2004
+++ list.xsl Mon Aug 30 23:37:12 2004
@@ -264,13 +264,13 @@
<xsl:template match="page">
<a class="pagenav" title="{$tooltip_goto}{position()}" href="{$listpage}&amp;[EMAIL PROTECTED]">
- <xsl:value-of select="position()" />
+ <xsl:value-of select="@number" />
</a>
<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
</xsl:template>
<xsl:template match="[EMAIL PROTECTED]&apos;true&apos;]">
- <xsl:value-of select="position()" />
+ <xsl:value-of select="@number" />
<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
</xsl:template>



------------------------------------------------------------------------

--- prompts.xsl.orig    Mon Aug 30 12:59:29 2004
+++ prompts.xsl Mon Aug 30 22:17:56 2004
@@ -110,14 +110,14 @@
 <xsl:variable name="tooltip_logout" >Uitloggen en terug naar de 
startpagina</xsl:variable>
 <!-- prompts and tooltips for lists -->
 <xsl:template name="prompt_edit_list" >
-  <xsl:value-of select="$title" disable-output-escaping="yes"  />(<xsl:value-of 
select="/list/@count" /> items)
+  <xsl:value-of select="$title" disable-output-escaping="yes"  />(items <xsl:value-of select="/list/@offsetstart"/>-<xsl:value-of 
select="/list/@offsetend"/>/<xsl:value-of select="/list/@totalcount" />, pagina <xsl:value-of select="/list/pages/@currentpage" />/<xsl:value-of 
select="/list/pages/@count" />)
 </xsl:template>
 <xsl:variable name="tooltip_edit_list" >Dit zijn de items die u kan 
wijzigen.</xsl:variable>
 <!-- searchlist prompts/tooltips -->
 <xsl:variable name="tooltip_select_search">Selecteer een of meer items uit de 
lijst</xsl:variable>
 <xsl:template name="prompt_no_results" >Geen items gevonden</xsl:template>
 <xsl:template name="prompt_more_results" >(Meer items gevonden...)</xsl:template>
-<xsl:template name="prompt_result_count" >(<xsl:value-of select="/list/@count" /> items 
gevonden)</xsl:template>
+<xsl:template name="prompt_result_count" >(items <xsl:value-of select="/list/@offsetstart"/>-<xsl:value-of 
select="/list/@offsetend"/>/<xsl:value-of select="/list/@totalcount" />, pagina <xsl:value-of select="/list/pages/@currentpage" 
/>/<xsl:value-of select="/list/pages/@count" />)</xsl:template>
 <xsl:variable name="tooltip_cancel_search" >Annuleer</xsl:variable>
 <xsl:variable name="tooltip_end_search" >Toevoegen</xsl:variable>
 <!-- searchlist error messages for forms validation  -->


------------------------------------------------------------------------

--- searchlist.xsl.orig Mon Aug 30 13:29:06 2004
+++ searchlist.xsl Mon Aug 30 13:29:10 2004
@@ -169,6 +169,7 @@
<xsl:if test="not(/list/@showing)">
<xsl:text></xsl:text>
<span class="pagenav">
+ <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
<xsl:call-template name="prompt_result_count" />
</span>
</xsl:if>
@@ -225,16 +226,18 @@
<xsl:template match="page">
<a class="pagenav" title="{$tooltip_goto}{position()}" href="javascript:browseTo([EMAIL PROTECTED]);">
- <xsl:value-of select="position()" />
+ <xsl:value-of select="@number" />
</a>
+ <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
<xsl:text />
</xsl:template>
<xsl:template match="[EMAIL PROTECTED]&apos;true&apos;]">
<span class="pagenav-current">
- <xsl:value-of select="position()" />
+ <xsl:value-of select="@number" />
<xsl:text></xsl:text>
</span>
+ <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file


--
Pierre van Rooden
Mediapark, C 107 tel. +31 (0)35 6772815
"Never summon anything bigger than your head."




Reply via email to