roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r427220 - in /incubator/roller/branches/roller_3.0: src/org/apache/roller/ui/rendering/model/ web/WEB-INF/velocity/
Date Mon, 31 Jul 2006 19:29:03 GMT
Author: snoopdave
Date: Mon Jul 31 12:29:02 2006
New Revision: 427220

URL: http://svn.apache.org/viewvc?rev=427220&view=rev
Log:
Pager.getItems() across all pagers, except WeblogEntriesPager

Added:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPager.java
Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CommentsPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/Pager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PlanetEntriesPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UsersPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesListPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CommentsPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CommentsPager.java?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CommentsPager.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CommentsPager.java
Mon Jul 31 12:29:02 2006
@@ -52,10 +52,10 @@
             int            page,
             int            length) {
         super(weblog, weblogPage, locale, sinceDays, page, length);
-        getComments();
+        getItems();
     }
     
-    public List getComments() {
+    public List getItems() {
         if (comments == null) {
             List results = new ArrayList();
             Calendar cal = Calendar.getInstance();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/Pager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/Pager.java?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/Pager.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/Pager.java
Mon Jul 31 12:29:02 2006
@@ -18,6 +18,8 @@
 
 package org.apache.roller.ui.rendering.model;
 
+import java.util.List;
+
 /**
  * Common pager interface.
  */
@@ -51,5 +53,10 @@
      * Link value for prev page in current collection view
      */
     public String getPrevName();
+    
+    /**
+     * Get current list of items available from the pager.
+     */
+    public List getItems();
     
 }

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PlanetEntriesPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PlanetEntriesPager.java?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PlanetEntriesPager.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PlanetEntriesPager.java
Mon Jul 31 12:29:02 2006
@@ -57,10 +57,10 @@
         super(weblog, weblogPage, locale, sinceDays, page, length);
         this.feedURL = feedURL;
         this.groupHandle = groupHandle;
-        getEntries();
+        getItems();
     }
     
-    public List getEntries() {
+    public List getItems() {
         if (entries == null) {
             List results = new ArrayList();
             Calendar cal = Calendar.getInstance();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UsersPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UsersPager.java?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UsersPager.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UsersPager.java
Mon Jul 31 12:29:02 2006
@@ -51,7 +51,7 @@
             int            page,
             int            length) {
         super(weblog, weblogPage, locale, sinceDays, page, length);
-        getUsers();
+        getItems();
     }
     
     /** Creates a new instance of CommentPager */
@@ -65,10 +65,10 @@
             int            length) {
         super(weblog, weblogPage, locale, sinceDays, page, length);
         this.letter = letter;
-        getUsers();
+        getItems();
     }
     
-    public List getUsers() {
+    public List getItems() {
         if (users == null) {
             List results = new ArrayList();
             try {            

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesListPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesListPager.java?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesListPager.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesListPager.java
Mon Jul 31 12:29:02 2006
@@ -60,10 +60,10 @@
         this.queryWeblog = queryWeblog;
         this.queryUser = queryUser;
         this.queryCat = queryCat;
-        getEntries();
+        getItems();
     }
     
-    public List getEntries() {
+    public List getItems() {
         if (entries == null) {
             List results = new ArrayList();
             Calendar cal = Calendar.getInstance();

Added: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPager.java?rev=427220&view=auto
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPager.java
(added)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPager.java
Mon Jul 31 12:29:02 2006
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.ui.rendering.model;
+
+import java.util.Map;
+
+/**
+ * Pager for weblog entries, handles latest, single-entry, month and day views.
+ * Collection returned is a list of lists of entries, where each list of 
+ * entries represents one day.
+ */
+public interface WeblogEntriesPager {  
+        
+    /**
+     * A map of entries representing this collection.
+     *
+     * The collection is grouped by days of entries.  Each value is a list of
+     * entry objects keyed by the date they were published.
+     */
+    public Map getEntries();
+        
+    /**
+     * Link value for returning to pager home
+     */
+    public String getHomeLink();
+
+    /**
+     * Name of pager home.
+     */
+    public String getHomeName();
+
+    /**
+     * Link value for next page in current collection view
+     */
+    public String getNextLink();
+
+    /**
+     * Name for next page in current collection view
+     */
+    public String getNextName();
+
+    /**
+     * Link value for prev page in current collection view
+     */
+    public String getPrevLink();
+
+    /**
+     * Link value for prev page in current collection view
+     */
+    public String getPrevName();
+    
+        /**
+     * Link value for next collection view
+     */
+    public String getNextCollectionLink();
+    
+    /**
+     * Name for next collection view
+     */
+    public String getNextCollectionName();  
+    
+    /**
+     * Link value for prev collection view
+     */
+    public String getPrevCollectionLink(); 
+    
+    /**
+     * Name for prev collection view
+     */
+    public String getPrevCollectionName(); 
+    
+}
+

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogsPager.java
Mon Jul 31 12:29:02 2006
@@ -50,7 +50,7 @@
             int            page,
             int            length) {
         super(weblog, weblogPage, locale, sinceDays, page, length);
-        getWeblogs();
+        getItems();
     }
     
     /** Creates a new instance of CommentPager */
@@ -64,10 +64,10 @@
             int            length) {
         super(weblog, weblogPage, locale, sinceDays, page, length);
         this.letter = letter;
-        getWeblogs();
+        getItems();
     }
     
-    public List getWeblogs() {
+    public List getItems() {
         if (weblogs == null) {
             List results = new ArrayList();
             Calendar cal = Calendar.getInstance();

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm?rev=427220&r1=427219&r2=427220&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/site.vm Mon Jul 31 12:29:02
2006
@@ -48,12 +48,12 @@
 
 ##-----------------------------------------------------------------------------
 #macro(showEntriesPager $pager)
-    #if($pager.entries.size() > 0)
-        #set($entryCount = $pager.entries.size() - 1)
-        #set($startDate = $pager.entries.get(0).pubTime)
+    #if($pager.items.size() > 0)
+        #set($entryCount = $pager.items.size() - 1)
+        #set($startDate = $pager.items.get(0).pubTime)
         #set($endDate = $entries.get($entryCount).pubTime)
     #end
-    #foreach($entry in $pager.entries)
+    #foreach($entry in $pager.items)
         #if($velocityCount < $maxResults)
             #showEntry($entry)
         #end
@@ -120,7 +120,7 @@
 
     <h2 class="pageTitle">Recent posts</h2>
     #set($entriesPager = $site.getWeblogEntriesPager($weblog, $null, $null, 90, 5)) 
-    #if($entriesPager.entries.size() > 0)  
+    #if($entriesPager.items.size() > 0)  
         <table class="rollertable"> 
         <thead>
             <tr>
@@ -129,7 +129,7 @@
                 <th>Title</th>
             </tr>
         </thead>  
-        #foreach($entry in $entriesPager.entries)
+        #foreach($entry in $entriesPager.items)
             <tr>
                 <td>$entry.creator.userName</td>
                 <td>#formatDate($text.get("macro.weblog.date.toStringFormat") $entry.pubTime)</td>
@@ -182,7 +182,7 @@
                 </tr>
             </thead>
            <tbody>
-              #foreach($weblog in $weblogsPager.weblogs)
+              #foreach($weblog in $weblogsPager.items)
                <tr>
                   <th scope="row" class="name"><a href="$baseURL/$weblog.handle">$weblog.handle</a></th>
                   <td class="description">$weblog.name</td>
@@ -254,7 +254,7 @@
 
     <h2 class="pageTitle">User's recent posts</h2>
     #set($entriesPager = $site.getWeblogEntriesPager($null, $user, $null, 90, 5)) 
-    #if($entriesPager.entries.size() > 0)  
+    #if($entriesPager.items.size() > 0)  
         <table class="rollertable"> 
         <thead>
             <tr>
@@ -263,7 +263,7 @@
                 <th>Title</th>
             </tr>
         </thead>  
-        #foreach($entry in $entriesPager.entries)
+        #foreach($entry in $entriesPager.items)
             <tr>
                 <td><a href="$entry.website.url">$entry.website.handle</a></td>
                 <td>#formatDate($text.get("macro.weblog.date.toStringFormat") $entry.pubTime)</td>
@@ -310,7 +310,7 @@
                     <th>Full name</th>
                 </tr>
             </thead>
-        #foreach($u in $usersPager.users)
+        #foreach($u in $usersPager.items)
                <tr>
                   <td>$u.userName</td>
                   <td><a href="?userName=$u.userName">Profile</a></td>
@@ -332,13 +332,13 @@
 
 ##-----------------------------------------------------------------------------
 #macro(showCommentsPager $commentsPager)
-    #if($commentsPager.comments.size() > 0)
-        #set($commentCount = $commentsPager.comments.size() - 1)
-        #set($startDate = $commentsPager.comments.get(0).postTime)
-        #set($endDate = $commentsPager.comments.get($commentCount).postTime)
+    #if($commentsPager.items.size() > 0)
+        #set($commentCount = $commentsPager.items.size() - 1)
+        #set($startDate = $commentsPager.items.get(0).postTime)
+        #set($endDate = $commentsPager.items.get($commentCount).postTime)
     #end
 
-    #foreach($comment in $commentsPager.comments)
+    #foreach($comment in $commentsPager.items)
             <div class="entry">
                 <span class="entryDetails">
                     <a href="${baseURL}$utils.escapeHTML($comment.weblogEntry.permaLink)">



Mime
View raw message