Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter
In directory james.mmbase.org:/tmp/cvs-serv14645

Modified Files:
        globals.jsp showNewsletters.jsp 
Log Message:
cmsc_725(Add the pagination of the jsp which is used to show results.Modify the 
.properties which is used in showing.)


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter


Index: globals.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/globals.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- globals.jsp 30 Apr 2008 08:21:10 -0000      1.1
+++ globals.jsp 20 May 2008 05:29:01 -0000      1.2
@@ -1,2 +1,9 @@
+<%@ page import="com.finalist.cmsc.mmbase.PropertiesUtil" %>
+
 <[EMAIL PROTECTED] file="../../globals.jsp"%>
+<[EMAIL PROTECTED] language="java" contentType="text/html;charset=utf-8"%>
+
 <fmt:setBundle basename="newsletter" scope="request" />
\ No newline at end of file
+<c:set var="pagesize">
+   <%=PropertiesUtil.getProperty("repository.search.results.per.page")%>
+</c:set>


Index: showNewsletters.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/webapp/editors/newsletter/showNewsletters.jsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- showNewsletters.jsp 14 May 2008 05:32:48 -0000      1.5
+++ showNewsletters.jsp 20 May 2008 05:29:01 -0000      1.6
@@ -1,10 +1,12 @@
 <%@ page language="java" pageEncoding="utf-8"%>
 
-<[EMAIL PROTECTED] import="org.apache.struts.Globals;"%>
+<[EMAIL PROTECTED] import="org.apache.struts.Globals"%>
+<[EMAIL PROTECTED] file="globals.jsp"%>
 
 <[EMAIL PROTECTED] uri="http://jakarta.apache.org/struts/tags-html"; 
prefix="html"%>
 <[EMAIL PROTECTED] uri="http://java.sun.com/jsp/jstl/core"; prefix="c"%>
 <[EMAIL PROTECTED] uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt"%>
+<[EMAIL PROTECTED] uri="http://jsptags.com/tags/navigation/pager"; prefix="pg"%>
 
 <fmt:setBundle basename="newsletter-log" scope="request" />
 
@@ -12,12 +14,9 @@
 <html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
        <head>
                <title>newsletters</title>
-                <link rel="icon" href="<c:url value='/favicon.ico'/>"
-                       type="image/x-icon" />
-               <link rel="shortcut icon" href="<c:url value='/favicon.ico'/>"
-                       type="image/x-icon" />
-               <link href="<c:url value='/editors/css/newsletter.css'/>" 
type="text/css"
-                       rel="stylesheet" />
+      <link rel="icon" href="<c:url value='/favicon.ico'/>" 
type="image/x-icon" />
+      <link rel="shortcut icon" href="<c:url value='/favicon.ico'/>" 
type="image/x-icon" />
+      <link href="<c:url value='/editors/css/newsletter.css'/>" 
type="text/css" rel="stylesheet" />
 
                <!-- calendar stylesheet -->
                <link rel="stylesheet" type="text/css" media="all"
@@ -25,30 +24,20 @@
                        title="win2k-cold-1" />
 
                <!-- main calendar program -->
-               <script type="text/javascript"
-                       src="<c:url 
value='/editors/newsletter/js/calendar.js'/>">
-               </script>
+      <script type="text/javascript" src="<c:url 
value='/editors/newsletter/js/calendar.js'/>"></script>
+
 
                <!-- language for the calendar -->
-               <script type="text/javascript"
-                       src="<c:url 
value='/editors/newsletter/js/lang/calendar-en.js'/>">
-               </script>
+      <script type="text/javascript" src="<c:url 
value='/editors/newsletter/js/lang/calendar-en.js'/>" ></script>
 
                <!-- the following script defines the Calendar.setup helper 
function, which makes
        adding a calendar a matter of 1 or 2 lines of code. -->
-               <script type="text/javascript"
-                       src="<c:url 
value='/editors/newsletter/js/calendar-setup.js'/>">
-               </script>
+      <script type="text/javascript" src="<c:url 
value='/editors/newsletter/js/calendar-setup.js'/>"></script>
 
                <!-- the format needs -->
-               <script src="<c:url value='/editors/utils/rowhover.js'/>"
-                       type="text/javascript">
-               </script>
-               <script src="<c:url value='/js/window.js'/>" 
type="text/javascript">
-               </script>
-               <script src="<c:url value='/js/transparent_png.js'/>"
-                       type="text/javascript">
-               </script>
+      <script src="<c:url value='/editors/utils/rowhover.js'/>" 
type="text/javascript"></script>
+      <script src="<c:url value='/js/window.js'/>" 
type="text/javascript"></script>
+      <script src="<c:url value='/js/transparent_png.js'/>" 
type="text/javascript"></script>
 
                <!--the reset button needs  -->
                <script language="javascript"> 
@@ -73,8 +62,9 @@
                        <div class="tab_active">
                                <div class="body">
                                        <div>
-                                               <a name="activetab"> 
<fmt:message
-                                                               
key="newsletterlog.newsletter.log" /> </a>
+                  <a name="activetab">
+                     <fmt:message key="newsletterlog.newsletter.log" /> 
+                  </a>
                                        </div>
                                </div>
                        </div>
@@ -82,31 +72,22 @@
 
                <div class="editor">
                        <div class="body">
-                               <html:form method="POST"
-                                       
action="/editors/newsletter/NewsletterStatistic">
-
+            <html:form method="POST" 
action="/editors/newsletter/NewsletterStatistic">
                                        <table style="width: 600px">
                                                <tr>
+                     <td> <fmt:message key="newsletterlog.newsletter" /> </td>
                                                        <td>
-                                                               <fmt:message 
key="newsletterlog.newsletter" />
-                                                       </td>
-                                                       <td>
-                                                               <html:select 
property="newsletters" styleId="newsletters"
-                                                                       
style="width:150px">
-                                                                       
<html:optionsCollection name="newsletters" label="title"
-                                                                               
value="id" />
+                        <html:select property="newsletters" 
styleId="newsletters" style="width:150px">
+                           <html:optionsCollection name="newsletters" 
label="title" value="id" />
                                                                </html:select>
                                                        </td>
-                                                       <td></td>
-                                                       <td></td>
+                     <td>&nbsp;</td>
+                     <td>&nbsp;</td>
                                                </tr>
                                                <tr>
+                     <td> <fmt:message key="newsletterlog.from" /> </td>
                                                        <td>
-                                                               <fmt:message 
key="newsletterlog.from" />
-                                                       </td>
-                                                       <td>
-                                                               <html:text 
property="startDate" styleId="f_date_b"
-                                                                       
readonly="true" style="width:125px" />
+                        <html:text property="startDate" styleId="f_date_b" 
readonly="true" style="width:125px" />
                                                                <button 
type="reset" id="f_trigger_b" style="width: 25px">
                                                                        
<fmt:message key="newsletterlog.doc" />
                                                                </button>
@@ -119,12 +100,9 @@
                                                                                
});
                        </script>
                                                        </td>
+                     <td> <fmt:message key="newsletterlog.to" /> </td>
                                                        <td>
-                                                               <fmt:message 
key="newsletterlog.to" />
-                                                       </td>
-                                                       <td>
-                                                               <html:text 
property="endDate" styleId="f_date_be"
-                                                                       
readonly="true" style="width:125px" />
+                        <html:text property="endDate" styleId="f_date_be" 
readonly="true" style="width:125px" />
                                                                <button 
type="reset" id="f_trigger_be" style="width: 25px">
                                                                        
<fmt:message key="newsletterlog.doc" />
                                                                </button>
@@ -139,40 +117,34 @@
                                                        </td>
                                                </tr>
                                                <tr>
-                                                       <td></td>
+                     <td>&nbsp;</td>
                                                        <c:choose>
                                                                <c:when 
test="${requestScope.searchForm==null}">
                                                                        <td>
+                              <input type="radio" name="detailOrSum" value="1" 
checked="checked" />
                                                                                
<fmt:message key="newsletterlog.summary" />
-                                                                               
<input type="radio" name="detailOrSum" value="1"
-                                                                               
        checked="checked" />
-
-                                                                               
<fmt:message key="newsletterlog.detail" />
                                                                                
<input type="radio" name="detailOrSum" value="2" />
+                                 <fmt:message key="newsletterlog.detail" />
                                                                        </td>
                                                                </c:when>
                                                                <c:when 
test="${requestScope.searchForm.detailOrSum=='1'}">
                                                                        <td>
+                              <input type="radio" name="detailOrSum" value="1" 
checked="checked" />
                                                                                
<fmt:message key="newsletterlog.summary" />
-                                                                               
<input type="radio" name="detailOrSum" value="1"
-                                                                               
        checked="checked" />
-
-                                                                               
<fmt:message key="newsletterlog.detail" />
                                                                                
<input type="radio" name="detailOrSum" value="2" />
+                                 <fmt:message key="newsletterlog.detail" />
                                                                        </td>
                                                                </c:when>
                                                                <c:when 
test="${requestScope.searchForm.detailOrSum=='2'}">
                                                                        <td>
-                                                                               
<fmt:message key="newsletterlog.summary" />
                                                                                
<input type="radio" name="detailOrSum" value="1" />
-
+                                 <fmt:message key="newsletterlog.summary" />
+                              <input type="radio" name="detailOrSum" value="2" 
checked="checked" />
                                                                                
<fmt:message key="newsletterlog.detail" />
-                                                                               
<input type="radio" name="detailOrSum" value="2"
-                                                                               
        checked="checked" />
                                                                        </td>
                                                                </c:when>
                                                        </c:choose>
-                                                       <td colspan="2"></td>
+                     <td colspan="2">&nbsp;</td>
                                                </tr>
                                                <tr>
                                                        <td>
@@ -181,7 +153,7 @@
                                                                <input 
type="button" onclick="javascript:resets()"
                                                                        
value="<fmt:message key="newsletterlog.reset" />" />
                                                        </td>
-                                                       <td colspan="3"></td>
+                     <td colspan="3">&nbsp;</td>
                                                </tr>
                                        </table>
                                </html:form>
@@ -200,46 +172,37 @@
                                        <table>
                                                <thead>
                                                        <tr>
-                                                               <th></th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.summary.newsletter" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.summary.removed" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.summary.subscribe" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.summary.unsubscribe" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.summary.bounces" />
-                                                               </th>
-
-                                                               <th></th>
+                        <th>&nbsp;</th>
+                        <th> <fmt:message 
key="newsletterlog.summary.newsletter" /> </th>
+                        <th> <fmt:message key="newsletterlog.summary.removed" 
/> </th>
+                        <th> <fmt:message 
key="newsletterlog.summary.subscribe" /> </th>
+                        <th> <fmt:message 
key="newsletterlog.summary.unsubscribe" /> </th>
+                        <th> <fmt:message key="newsletterlog.summary.bounces" 
/> </th>
+                        <th>&nbsp;</th>
                                                        </tr>
                                                </thead>
                                                <tbody class="hover">
-                                                       <tr class="swap" 
onMouseOver="this.style.background='yellow';"
-                                                               
onMouseOut="this.style.background='transparent'">
-                                                               <td></td>
-                                                               <td 
onMouseDown="objClick(this);">
-                                                                       
${requestScope.result.name}
-                                                               </td>
+                     <tr class="swap">
+                        <td>&nbsp;</td>
                                                                <td 
onMouseDown="objClick(this);">
-                                                                       
${requestScope.result.removed}
-                                                               </td>
-                                                               <td 
onMouseDown="objClick(this);">
-                                                                       
${requestScope.result.subscribe}
-                                                               </td>
-                                                               <td 
onMouseDown="objClick(this);">
-                                                                       
${requestScope.result.unsubscribe}
-                                                               </td>
-                                                               <td 
onMouseDown="objClick(this);">
-                                                                       
${requestScope.result.bounches}
+                           <c:if 
test="${requestScope.result.name=='newsletter.summary.bydate'}" >
+                              <fmt:message 
key="newsletterlog.summary.statistic" />
+                           </c:if>
+                           <c:if 
test="${requestScope.result.name=='newsletter.summary.all'}" >
+                              <fmt:message 
key="newsletterlog.summary.statistic" />
+                           </c:if>
+                           <c:if 
test="${requestScope.result.name=='newsletter.summary.all.bydate'}" >
+                              <fmt:message 
key="newsletterlog.summary.statistic" />
+                           </c:if>
+                           <c:if 
test="${requestScope.result.name=='newsletter.summary'}" >
+                              <fmt:message 
key="newsletterlog.summary.statistic" />
+                           </c:if>
                                                                </td>
-                                                               <td></td>
+                        <td onMouseDown="objClick(this);"> 
${requestScope.result.removed} </td>
+                        <td onMouseDown="objClick(this);"> 
${requestScope.result.subscribe} </td>
+                        <td onMouseDown="objClick(this);"> 
${requestScope.result.unsubscribe} </td>
+                        <td onMouseDown="objClick(this);"> 
${requestScope.result.bounches} </td>
+                        <td>&nbsp;</td>
                                                        </tr>
                                                </tbody>
                                        </table>
@@ -248,63 +211,65 @@
 
                        <c:if test="${!empty requestScope.records}">
                                <div class="body">
+               <pg:pager maxPageItems="${pagesize}" 
url="NewsletterStatistic.do">
+               <pg:param name="action" value="search" />
                                        <table>
                                                <thead>
-                                                       <tr></tr>
+                     <tr>&nbsp;</tr>
                                                        <tr>
-                                                               <th></th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.detail.newsletter" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.detail.logdate" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.detail.removed" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.detail.subscribe" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.detail.unsubcribe" />
-                                                               </th>
-                                                               <th>
-                                                                       
<fmt:message key="newsletterlog.detail.bounces" />
-                                                               </th>
-                                                               <th></th>
+                        <th>&nbsp;</th>
+                        <th> <fmt:message 
key="newsletterlog.detail.newsletter" /> </th>
+                        <th> <fmt:message key="newsletterlog.detail.logdate" 
/> </th> 
+                        <th> <fmt:message key="newsletterlog.detail.removed" 
/> </th> 
+                        <th> <fmt:message key="newsletterlog.detail.subscribe" 
/> </th> 
+                        <th> <fmt:message 
key="newsletterlog.detail.unsubcribe" /> </th> 
+                        <th> <fmt:message key="newsletterlog.detail.bounces" 
/> </th>
+                        <th>&nbsp;</th>
                                                        </tr>
                                                </thead>
                                                <tbody class="hover">
+                     <c:set var="num" scope="page" value="0" />
                                                        <c:forEach 
var="newsletterlog" items="${requestScope.records}">
-                                                               <tr 
class="swap" onMouseOver="this.style.background='yellow';"
-                                                                       
onMouseOut="this.style.background='transparent'">
-                                                                       
<td></td>
-                                                                       <td 
onMouseDown="objClick(this);">
-                                                                               
<c:out value="${newsletterlog.name}" />
-                                                                       </td>
-                                                                       <td 
onMouseDown="objClick(this);">
-                                                                               
<c:out value="${newsletterlog.showingdate}" />
-                                                                       </td>
-                                                                       <td 
onMouseDown="objClick(this);">
-                                                                               
<c:out value="${newsletterlog.removed}" />
-                                                                       </td>
-                                                                       <td 
onMouseDown="objClick(this);">
-                                                                               
<c:out value="${newsletterlog.subscribe}" />
-                                                                       </td>
-                                                                       <td 
onMouseDown="objClick(this);">
-                                                                               
<c:out value="${newsletterlog.unsubscribe}" />
+                        <c:if test="${num%pagesize%2==0}">
+                           <pg:item>
+                              <tr class="swap">
+                                 <td>&nbsp;</td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.name}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.showingdate}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.removed}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.subscribe}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.unsubscribe}" /> </td>
+                                 <td onMouseDown="objClick(this);" 
style="white-space: nowrap;">
+                                    <c:out value="${newsletterlog.bounches}" />
                                                                        </td>
+                                 <td>&nbsp;</td>
+                               </tr>
+                            </pg:item>
+                         </c:if>
+                         <c:if test="${num%pagesize%2==1}">
+                            <pg:item>
+                              <tr>
+                                 <td>&nbsp;</td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.name}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.showingdate}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.removed}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.subscribe}" /> </td>
+                                 <td onMouseDown="objClick(this);"> <c:out 
value="${newsletterlog.unsubscribe}" /> </td>
                                                                        <td 
onMouseDown="objClick(this);" style="white-space: nowrap;">
                                                                                
<c:out value="${newsletterlog.bounches}" />
                                                                        </td>
-                                                                       
<td></td>
+                                 <td>&nbsp;</td>
                                                                </tr>
+                            </pg:item>
+                         </c:if>
+                         <c:set var="num" scope="page" value="${num+1}" />
                                                        </c:forEach>
                                                </tbody>
                                        </table>
+               <%@ include file="pager_index.jsp"%>
+               </pg:pager>
                                </div>
                        </c:if>
-
                </div>
        </body>
 </html>
\ No newline at end of file
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to