roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r528068 - in /roller/trunk/apps/planet: src/java/org/apache/roller/planet/business/ src/java/org/apache/roller/planet/business/hibernate/ src/java/org/apache/roller/planet/tasks/ test/java/org/apache/roller/planet/business/
Date Thu, 12 Apr 2007 18:09:52 GMT
Author: agilliland
Date: Thu Apr 12 11:09:50 2007
New Revision: 528068

URL: http://svn.apache.org/viewvc?view=rev&rev=528068
Log:
The PlanetManager.getEntries() method for a single group should allow for a start and end
date as well.


Modified:
    roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/PlanetManager.java
    roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
    roller/trunk/apps/planet/src/java/org/apache/roller/planet/tasks/StaticPlanetModel.java
    roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/EntryFunctionalTests.java

Modified: roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/PlanetManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/PlanetManager.java?view=diff&rev=528068&r1=528067&r2=528068
==============================================================================
--- roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/PlanetManager.java
(original)
+++ roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/PlanetManager.java
Thu Apr 12 11:09:50 2007
@@ -157,13 +157,23 @@
     /**
      * Get Entries for a Group in reverse chonological order.
      *
-     * @param groups Restrict to entries from these groups (list of PlanetGroupData objects)
+     * Entries may be constrained to a certain timeframe and the offset and
+     * length parameters can be used to retrieve a specific segment of the 
+     * results.
+     *
+     * @param group Get entries from the subscriptions in the specified group.
+     * @param startDate The oldest date for entries to include.
+     * @param endDate The newest date for entries to include.
      * @param offset Offset into results (for paging)
-     * @param len    Maximum number of results to return (for paging)
+     * @param length Maximum number of results to return (for paging)
      */
-    public List getEntries(PlanetGroupData group, int offset, int len) 
-        throws RollerException;
-       
+    public List getEntries(PlanetGroupData group, 
+                           Date startDate, 
+                           Date endDate,
+                           int offset, 
+                           int length) throws RollerException;
+    
+    
     /**
      * Get Entries for a Group in reverse chonological order, optionally 
      * constrained to a certain timeframe.

Modified: roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java?view=diff&rev=528068&r1=528067&r2=528068
==============================================================================
--- roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
(original)
+++ roller/trunk/apps/planet/src/java/org/apache/roller/planet/business/hibernate/HibernatePlanetManagerImpl.java
Thu Apr 12 11:09:50 2007
@@ -311,10 +311,12 @@
     
     
     // Lookup Entries from a specific group
-    public List getEntries(PlanetGroupData group, int offset, int len) 
+    public List getEntries(PlanetGroupData group, Date startDate, Date endDate, 
+                           int offset, int length) 
             throws RollerException {
-        return getEntries(Collections.singletonList(group), null, null, offset, len);
+        return getEntries(Collections.singletonList(group), startDate, endDate, offset, length);
     } 
+    
     
     // Lookup Entries from a specific list of groups
     public List getEntries(List groups, Date startDate, 

Modified: roller/trunk/apps/planet/src/java/org/apache/roller/planet/tasks/StaticPlanetModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/src/java/org/apache/roller/planet/tasks/StaticPlanetModel.java?view=diff&rev=528068&r1=528067&r2=528068
==============================================================================
--- roller/trunk/apps/planet/src/java/org/apache/roller/planet/tasks/StaticPlanetModel.java
(original)
+++ roller/trunk/apps/planet/src/java/org/apache/roller/planet/tasks/StaticPlanetModel.java
Thu Apr 12 11:09:50 2007
@@ -81,7 +81,7 @@
     
     public List getAggregation(
             PlanetGroupData group, int maxEntries) throws RollerException {
-        return planetManager.getEntries(group, 0, maxEntries);
+        return planetManager.getEntries(group, null, null, 0, maxEntries);
     }
     
     

Modified: roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/EntryFunctionalTests.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/EntryFunctionalTests.java?view=diff&rev=528068&r1=528067&r2=528068
==============================================================================
--- roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/EntryFunctionalTests.java
(original)
+++ roller/trunk/apps/planet/test/java/org/apache/roller/planet/business/EntryFunctionalTests.java
Thu Apr 12 11:09:50 2007
@@ -93,7 +93,7 @@
         
         // by group
         PlanetGroupData group = mgr.getGroupById(testGroup1.getId());
-        assertEquals(3, mgr.getEntries(group, 0, 10).size());
+        assertEquals(3, mgr.getEntries(group, null, null, 0, 10).size());
     }
     
     



Mime
View raw message