roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r421613 [1/4] - in /incubator/roller/branches/roller_3.0: src/org/apache/roller/business/hibernate/ src/org/apache/roller/business/search/operations/ src/org/apache/roller/model/ src/org/apache/roller/pojos/ src/org/apache/roller/ui/authori...
Date Thu, 13 Jul 2006 13:07:47 GMT
Author: snoopdave
Date: Thu Jul 13 06:07:42 2006
New Revision: 421613

URL: http://svn.apache.org/viewvc?rev=421613&view=rev
Log:
- Added new Andreas08 theme contributed by Raible and ported Andreas08 to the 
  new Atlas macros/models. 

- Reintroduced standalone pager concept, supporting latest, single-entry, 
  day and month views. Pager is now working in all four modes and preserves
  category and locale state across requests.

- Moved new WeblogManager locale parameter before offset and lenght, which
  by convention are supposed to be the last arguments in the query methods.

- Introduced new Atlas macros in WEB-INF/velocity/weblog.vm. Used comment and
  comment form code contributed by Raible.Macros implemented so far:

      #showWeblogEntriesPager($pager)
      #showWeblogEntryComments($entry)
      #showWeblogEntryCommentForm($entry)
      #showCategoryLinksList($weblog $categoryPath)
      #showWeblogEntriesLinkList($categoryPath $max)

Added:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java
      - copied, changed from r421220, incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java
    incubator/roller/branches/roller_3.0/web/themes/andreas08/
    incubator/roller/branches/roller_3.0/web/themes/andreas08/Weblog.vm   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/_css.vm   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/_day.vm   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/_decorator.vm   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/aquadot.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/calendar.png   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/close.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/closelabel.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/feed-icon-16x16.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/fieldbg.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/header_blue.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/header_bluepurple.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/header_greenblue.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/header_purple.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/loading.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/next.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/nextlabel.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/prev.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/prevlabel.gif   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/images/squares.jpg   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/scripts/
    incubator/roller/branches/roller_3.0/web/themes/andreas08/scripts/effects.js   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/scripts/lightbox.js   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/scripts/prototype.js   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/scripts/scriptaculous.js   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/andreas08.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/forms.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/layout-navtop-subright.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/layout.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/lightbox.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/nav-horizontal.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/tools.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/styles/typo.css   (with props)
    incubator/roller/branches/roller_3.0/web/themes/andreas08/theme.css   (with props)
Removed:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/util/WeblogEntriesCollectionPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/util/WeblogEntriesPager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/util/WeblogEntriesPermalinkPager.java
Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/model/WeblogManager.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryManagementAction.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/BigWeblogCalendarModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/WeblogCalendarModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ConfigModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/FeedModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ModelLoader.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SearchResultsModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SiteModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/util/cache/FuturePostingsInvalidationJob.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/BloggerAPIHandler.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/MetaWeblogAPIHandler.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/   (props changed)
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogEntryTest.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/branches/roller_3.0/web/WEB-INF/classes/roller.properties
    incubator/roller/branches/roller_3.0/web/WEB-INF/classes/themes/css.vm
    incubator/roller/branches/roller_3.0/web/WEB-INF/velocity/weblog.vm

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateRollerPlanetManagerImpl.java Thu Jul 13 06:07:42 2006
@@ -121,9 +121,8 @@
                             null,                        // catName
                             WeblogEntryData.PUBLISHED,   // status
                             null,                        // sortby (null means pubTime)
-                            0,                           // offset
-                            entryCount,                  // length
-                            null);                       // locale
+null,                             0,                           // offset
+                            entryCount);                       // locale
                     
                     sub.setLastUpdated(siteUpdated);
                     saveSubscription(sub);

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java Thu Jul 13 06:07:42 2006
@@ -403,9 +403,9 @@
             String      catName,
             String      status,
             String      sortby,
+            String      locale,
             int         offset,
-            int         length,
-            String      locale) throws RollerException {
+            int         length) throws RollerException {
         
         WeblogCategoryData cat = null;
         if (StringUtils.isNotEmpty(catName) && website != null) {
@@ -955,9 +955,9 @@
             Date    endDate,
             String  catName,
             String  status,
+            String  locale,
             int     offset,
-            int     length,
-            String  locale) throws RollerException {
+            int     length) throws RollerException {
         return getWeblogEntryMap(
             website,
             startDate,
@@ -965,9 +965,9 @@
             catName,
             status,
             false,
+            locale,
             offset,
-            length,
-            locale);
+            length);
     }
     
     public Map getWeblogEntryStringMap(
@@ -976,9 +976,10 @@
             Date    endDate,
             String  catName,
             String  status,
+            String  locale,
             int     offset,
-            int     length,
-            String  locale) throws RollerException {
+            int     length
+            ) throws RollerException {
         return getWeblogEntryMap(
             website,
             startDate,
@@ -986,9 +987,10 @@
             catName,
             status,
             true,
+            locale,
             offset,
-            length,
-            locale);
+            length
+            );
     }
     
     private Map getWeblogEntryMap(
@@ -998,9 +1000,10 @@
             String  catName,
             String  status,
             boolean stringsOnly,
+            String  locale,
             int     offset,
-            int     length,
-            String  locale) throws RollerException {
+            int     length
+            ) throws RollerException {
         
         TreeMap map = new TreeMap(reverseComparator);
         
@@ -1012,9 +1015,8 @@
             catName,
             status,
             null,
-            offset,
-            length,
-            locale);
+locale,             offset,
+            length);
         
         Calendar cal = Calendar.getInstance();
         if (website != null) {

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/business/search/operations/RebuildWebsiteIndexOperation.java Thu Jul 13 06:07:42 2006
@@ -110,7 +110,7 @@
                         null,                      // catName
                         WeblogEntryData.PUBLISHED, // status
                         null,                      // sortby (null means pubTime)
-                        0, -1, null);     // offset, length, locale
+null,                         0, -1);     // offset, length, locale
                 
                 for (Iterator wbItr = entries.iterator(); wbItr.hasNext();) {
                     WeblogEntryData entry = (WeblogEntryData) wbItr.next();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/model/WeblogManager.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/model/WeblogManager.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/model/WeblogManager.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/model/WeblogManager.java Thu Jul 13 06:07:42 2006
@@ -80,9 +80,9 @@
             String      catName,
             String      status,
             String      sortBy,
+            String      locale,             
             int         offset,
-            int         range,
-            String      locale)
+            int         range)
             throws RollerException;
        
     /**
@@ -105,9 +105,9 @@
             Date        endDate,
             String      catName,
             String      status,
+            String      locale,
             int         offset,
-            int         range,
-            String      locale)
+            int         range)
             throws RollerException;
         
     /**
@@ -130,9 +130,9 @@
             Date        endDate,
             String      catName,
             String      status,
+            String      locale,
             int         offset,
-            int         range,
-            String      locale)
+            int         range)
             throws RollerException;    
     
     /**

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java Thu Jul 13 06:07:42 2006
@@ -601,28 +601,36 @@
     
     /**
      * True if comments are still allowed on this entry considering the
-     * allowComments and commentDays fields.
+     * allowComments and commentDays fields as well as the website and 
+     * site-wide configs.
      *
      * @roller.wrapPojoMethod type="simple"
      */
     public boolean getCommentsStillAllowed() {
-        if(DRAFT.equals(this.status) || PENDING.equals(this.status))
+        if(DRAFT.equals(this.status) || PENDING.equals(this.status)) {
             return false;
-        
+        }
+        if (!RollerRuntimeConfig.getBooleanProperty("users.comments.enabled")) {
+            return false;
+        }
+        if (website.getAllowComments() != null && !website.getAllowComments().booleanValue()) {
+            return false;
+        }
+        if (getAllowComments() != null && !getAllowComments().booleanValue()) {
+            return false;
+        }
         boolean ret = false;
-        if (getAllowComments() == null || getAllowComments().booleanValue()) {
-            if (getCommentDays() == null || getCommentDays().intValue() == 0) {
+        if (getCommentDays() == null || getCommentDays().intValue() == 0) {
+            ret = true;
+        } else {
+            Calendar expireCal = Calendar.getInstance(
+                    getWebsite().getLocaleInstance());
+            expireCal.setTime(getPubTime());
+            expireCal.add(Calendar.DATE, getCommentDays().intValue());
+            Date expireDay = expireCal.getTime();
+            Date today = new Date();
+            if (today.before(expireDay)) {
                 ret = true;
-            } else {
-                Calendar expireCal = Calendar.getInstance(
-                        getWebsite().getLocaleInstance());
-                expireCal.setTime(getPubTime());
-                expireCal.add(Calendar.DATE, getCommentDays().intValue());
-                Date expireDay = expireCal.getTime();
-                Date today = new Date();
-                if (today.before(expireDay)) {
-                    ret = true;
-                }
             }
         }
         return ret;
@@ -709,6 +717,19 @@
         return list;
     }
     
+    /**
+     * @roller.wrapPojoMethod type="simple"
+     */    
+    public int getCommentCount() {
+        List comments = getComments(true, true);
+        return comments.size();
+    }
+    
+    /** No-op to please XDoclet */
+    public void setCommentCount(int ignored) {
+        // no-op
+    }
+    
     //------------------------------------------------------------------------
     
     /**
@@ -1046,9 +1067,10 @@
     /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
     public void setPublished(boolean value) {
     }
-        
+  
     /**
      * Get entry text, transformed by plugins enabled for entry.
+     * @roller.wrapPojoMethod type="simple"
      */
     public String getTransformedText() {
         return render(text);
@@ -1062,6 +1084,7 @@
     
     /**
      * Get entry summary, transformed by plugins enabled for entry.
+     * @roller.wrapPojoMethod type="simple"
      */
     public String getTransformedSummary() {
         return render(summary);

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WebsiteData.java Thu Jul 13 06:07:42 2006
@@ -34,12 +34,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.ThemeNotFoundException;
-import org.apache.roller.config.RollerConfig;
 import org.apache.roller.config.RollerRuntimeConfig;
 import org.apache.roller.model.PluginManager;
 import org.apache.roller.model.Roller;
 import org.apache.roller.model.ThemeManager;
 import org.apache.roller.model.UserManager;
+import org.apache.roller.model.WeblogManager;
 
 
 /**
@@ -265,9 +265,27 @@
         return template;
     }
     
+    /**
+     * Lookup a template id for this website by pageName.
+     * @roller.wrapPojoMethod type="simple"
+     */        
+    public String findPageIdByName(String pageName) {        
+        String template_id = null;        
+        try {
+            Template pd = this.getPageByName(pageName);
+            if(pd != null) {
+                template_id = pd.getId();
+            }
+        } catch(Exception e) {
+            mLogger.error("ERROR: getting page ID by name", e);
+        }              
+        return template_id;
+    }
+    
     
     /**
      * Lookup a template for this website by link.
+     * @roller.wrapPojoMethod type="pojo"
      */
     public Template getPageByLink(String link) throws RollerException {
         
@@ -330,7 +348,7 @@
         
         
         // now get theme pages if needed and put them in place of db pages
-        if(this.editorTheme != null && !this.editorTheme.equals(Theme.CUSTOM)) {
+        if (this.editorTheme != null && !this.editorTheme.equals(Theme.CUSTOM)) {
             try {
                 Template template = null;
                 ThemeManager themeMgr = RollerFactory.getRoller().getThemeManager();
@@ -1071,6 +1089,41 @@
             }
         }
         return initializedPlugins;
+    }
+    
+    /**
+     * @roller.wrapPojoMethod type="pojo-collection" class="org.apache.roller.pojos.WeblogCategoryData"
+     */
+    public List getWeblogCategories() {
+        List ret = new ArrayList();
+        try {           
+            WeblogCategoryData category = this.getDefaultCategory();
+            ret = category.getWeblogCategories();
+        } catch (RollerException e) {
+            mLogger.error("ERROR: fetching categories", e);
+        }
+        return ret;
+    }
+    
+    /**
+     * @roller.wrapPojoMethod type="pojo-collection" class="org.apache.roller.pojos.WeblogCategoryData"
+     */
+    public List getWeblogCategories(String categoryPath) {
+        List ret = new ArrayList();
+        try {
+            Roller roller = RollerFactory.getRoller();
+            WeblogManager wmgr = roller.getWeblogManager();            
+            WeblogCategoryData category = null;
+            if (categoryPath != null && !categoryPath.equals("nil")) {
+                category = wmgr.getWeblogCategoryByPath(this, null, categoryPath);
+            } else {
+                category = this.getDefaultCategory();
+            }
+            ret = category.getWeblogCategories();
+        } catch (RollerException e) {
+            mLogger.error("ERROR: fetching categories", e);
+        }
+        return ret;
     }
 }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryManagementAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryManagementAction.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryManagementAction.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryManagementAction.java Thu Jul 13 06:07:42 2006
@@ -155,9 +155,8 @@
                     category,
                     status,
                     queryForm.getSortby(),
-                    queryForm.getOffset(),
-                    queryForm.getCount() + 1,
-                    null);
+null,                     queryForm.getOffset(),
+                    queryForm.getCount() + 1);
            if (entries.size() > queryForm.getCount()) {
                more = true;
                entries.remove(entries.size()-1);

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java Thu Jul 13 06:07:42 2006
@@ -137,7 +137,7 @@
                 null,              // catName
                 WeblogEntryData.PUBLISHED, // status
                 null,              // sortby (null for pubTime)
-                0, 20, null);   
+null,                 0, 20);   
     }
 
     /**
@@ -158,7 +158,7 @@
                 null,              // catName
                 WeblogEntryData.DRAFT, // status
                 "updateTime",      // sortby 
-                0, 20, null);  // maxEntries
+null,                 0, 20);  // maxEntries
     }
     
     /**
@@ -179,7 +179,7 @@
                 null,              // catName
                 WeblogEntryData.PENDING, // status
                 "updateTime",      // sortby
-                0, 20, null);  
+null,                 0, 20);  
     }
  
     public List getHoursList()

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java Thu Jul 13 06:07:42 2006
@@ -447,10 +447,9 @@
      */
     public String getContextUrl(HttpServletRequest request, WebsiteData website) {
         return website.getURL();
-    }
+    }       
     
-    
-    /** Get absolute URL of Roller context */
+    /** Get context path of Roller, drops trailing slash */
     public String getContextUrl(HttpServletRequest request) {
         String url = request.getContextPath();
         if (url.endsWith("/")) {

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/BigWeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/BigWeblogCalendarModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/BigWeblogCalendarModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/BigWeblogCalendarModel.java Thu Jul 13 06:07:42 2006
@@ -74,8 +74,7 @@
                     endDate,                   // endDate
                     catName,                   // cat
                     WeblogEntryData.PUBLISHED, // status
-                    0, -1,
-                    locale);
+locale,                     0, -1);
         } catch (RollerException e) {
             mLogger.error(e);
             monthMap = new HashMap();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/WeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/WeblogCalendarModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/WeblogCalendarModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/tags/calendar/WeblogCalendarModel.java Thu Jul 13 06:07:42 2006
@@ -139,8 +139,7 @@
                     endDate,                   // endDate
                     cat,                   // cat
                     WeblogEntryData.PUBLISHED, // status
-                    0, -1,
-                    locale);
+locale,                     0, -1);
         } catch (RollerException e) {
             log.error(e);
             monthMap = new HashMap();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ConfigModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ConfigModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ConfigModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ConfigModel.java Thu Jul 13 06:07:42 2006
@@ -18,13 +18,20 @@
 
 package org.apache.roller.ui.rendering.model;
 
+import java.net.MalformedURLException;
 import java.util.Arrays;
+import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.PageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
 import org.apache.roller.config.RollerRuntimeConfig;
+import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper;
 import org.apache.roller.ui.core.RollerContext;
+import org.apache.struts.util.RequestUtils;
 
 
 /**
@@ -33,6 +40,12 @@
  */
 public class ConfigModel implements Model {
     
+   private static Log log = LogFactory.getLog(ConfigModel.class); 
+        
+    /** TODO 3.0: remove dependency on request and pageContext */
+    private HttpServletRequest request = null;
+    private PageContext pageContext = null;
+    
     /** Hand-picked list of runtime properties to be made available */
     private static List allowedProperties = 
         Arrays.asList(new String[] {
@@ -61,21 +74,38 @@
     
     /** Init page model based on request */
     public void init(Map map) throws RollerException {
-        // nothing to do yet
+        request = (HttpServletRequest)map.get("request");
+        pageContext = (PageContext)map.get("pageContext");
     }
     
     
-    /** Relative URL of Roller server, e.g. /roller */
+    /** Relative URL of Roller, e.g. /roller */
     public String getContextURL() {
         // TODO 3.0: fix getContextUrl() to not require request object
-        return RollerContext.getRollerContext().getContextUrl(null);
+        return RollerContext.getRollerContext().getContextUrl(request);
     }
     
     
-    /** Absolute URL of Roller server, e.g. http://localhost:8080/roller */
+    /** Absolute URL of Roller, e.g. http://localhost:8080/roller */
     public String getAbsoluteContextURL() {
         return RollerContext.getRollerContext().getAbsoluteContextUrl();
     }
+    
+    
+    /** URL for editing a weblog entry */
+    public String getWeblogEntryEditURL(WeblogEntryDataWrapper entry) {
+        String ret = null;
+        Hashtable params = new Hashtable();
+        params.put("entryid", entry.getId());
+        params.put("anchor", entry.getAnchor());
+        try {
+            ret = RequestUtils.computeURL(pageContext,
+                "weblogEdit", null, null, null, params, null, false);
+        } catch (MalformedURLException mue) {
+            log.warn("RollerRequest.editEntryUrl exception: ", mue);
+        }
+        return ret;
+    } 
     
     
     /** 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/FeedModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/FeedModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/FeedModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/FeedModel.java Thu Jul 13 06:07:42 2006
@@ -101,7 +101,7 @@
             WeblogManager wmgr = roller.getWeblogManager();
             List entries = wmgr.getWeblogEntries(weblog,
                 null, null, new Date(), categoryPath, WeblogEntryData.PUBLISHED, 
-                "pubTime", 0, weblog.getEntryDisplayCount(), locale);
+                "pubTime", locale, 0, weblog.getEntryDisplayCount());
             for (Iterator it = entries.iterator(); it.hasNext();) {
                 WeblogEntryData entry = (WeblogEntryData) it.next();
                 results.add(WeblogEntryDataWrapper.wrap(entry));

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ModelLoader.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ModelLoader.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ModelLoader.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/ModelLoader.java Thu Jul 13 06:07:42 2006
@@ -82,7 +82,7 @@
         // Only load old model if it's specified
         String useOldModel = 
             RollerConfig.getProperty("velocity.pagemodel.classname");        
-        if (useOldModel != null) { 
+        if (useOldModel != null && useOldModel.trim().length() > 0) { 
             ContextLoader.setupContext(model, request, response, pageContext, weblogRequest);            
         }
     }

Copied: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java (from r421220, incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java)
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java?p2=incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java&p1=incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java&r1=421220&r2=421613&rev=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java Thu Jul 13 06:07:42 2006
@@ -34,45 +34,45 @@
 import org.apache.roller.pojos.CommentData;
 import org.apache.roller.pojos.WeblogCategoryData;
 import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WeblogTemplate;
 import org.apache.roller.pojos.WebsiteData;
 import org.apache.roller.pojos.wrapper.CommentDataWrapper;
+import org.apache.roller.pojos.wrapper.TemplateWrapper;
 import org.apache.roller.pojos.wrapper.WeblogCategoryDataWrapper;
 import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper;
 import org.apache.roller.pojos.wrapper.WebsiteDataWrapper;
 import org.apache.roller.ui.authoring.struts.formbeans.CommentFormEx;
-import org.apache.roller.ui.rendering.util.WeblogEntriesCollectionPager;
-import org.apache.roller.ui.rendering.util.WeblogEntriesPager;
-import org.apache.roller.ui.rendering.util.WeblogEntriesPermalinkPager;
 import org.apache.roller.ui.rendering.util.WeblogPageRequest;
 
 
 /**
- * Model provides information needed to render a weblog page.
+ * Model provides information needed to render a weblog page. 
+ * Includes methods for paging through a collection of entries restricted by category. 
+ * The getEntries() method must be called first, before any pager methods will work.
  */
-public class PageRenderModel implements Model {
-    
-    protected static Log log = LogFactory.getLog(PageRenderModel.class);
+public class PageModel implements Model {
     
+    protected static Log           log = LogFactory.getLog(PageModel.class);    
     private HttpServletRequest     request = null;
     private WebsiteData            weblog = null;
-    private int                    offset = 0;
-    private String                 categoryPath = null;
+    private WeblogEntryData        entry = null;
+    private String                 cat = null; 
     private String                 entryAnchor = null;
     private String                 dateString = null;
-    private int page = 0;
+    private String                 weblogPage = null;
+    private String                 locale = null;
+    private int                    page = 0;
     private WeblogEntryDataWrapper nextEntry = null;
     private WeblogEntryDataWrapper prevEntry = null;
     private WeblogEntryDataWrapper firstEntry = null;
     private WeblogEntryDataWrapper lastEntry = null;
     
-    private WeblogEntriesPager pager = null;
-    
     
     /** 
      * Creates an un-initialized new instance, Roller calls init() to complete
      * construction. 
      */
-    public PageRenderModel() {}
+    public PageModel() {}
     
     
     /** 
@@ -97,9 +97,11 @@
             throw new RollerException("expected pageRequest from init data");
         }
         
-        categoryPath = parsed.getWeblogCategory();
+        cat = parsed.getWeblogCategory();
         entryAnchor = parsed.getWeblogAnchor();
         dateString = parsed.getWeblogDate();
+        weblogPage = parsed.getWeblogPage();
+        locale = parsed.getLocale();
         page = parsed.getPageNum();
         
         // lookup weblog object
@@ -107,14 +109,8 @@
         UserManager umgr = roller.getUserManager();
         weblog = umgr.getWebsiteByHandle(parsed.getWeblogHandle(), Boolean.TRUE);
         
-        // get the entry pager which represents this page
-        if (entryAnchor != null) {
-            this.pager = new WeblogEntriesPermalinkPager(weblog, entryAnchor);
-        } else {
-            this.pager = new WeblogEntriesCollectionPager(weblog, dateString, categoryPath, page);
-        }
-    }
-    
+
+    }    
     
     /**
      * Get weblog being displayed.
@@ -125,85 +121,74 @@
     
     
     /**
-     * Is this page considered a permalink?
+     * Get weblog entry being displayed or null if none specified by request.
      */
-    public boolean isPermalink() {
-        return false;
-    }
-    
-    
-    /**
-     * A map of entries representing this page.
-     *
-     * 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() {
-        return this.pager.getEntries();
-    }
-    
-    
-    /**
-     * Link value for next collection view
-     */
-    public String getNextLink() {
-        return this.pager.getNextLink();
+    public WeblogEntryDataWrapper getWeblogEntry() {      
+        WeblogEntryDataWrapper ret = null;
+        if (entryAnchor != null) {
+            Roller roller = RollerFactory.getRoller();
+            try {
+                WeblogManager wmgr = roller.getWeblogManager();
+                WeblogEntryData entry = wmgr.getWeblogEntryByAnchor(weblog, entryAnchor);
+                ret = WeblogEntryDataWrapper.wrap(entry);
+            } catch (RollerException e) {
+                log.error("ERROR: getting weblog entry");
+            }
+        }        
+        return ret;
     }
     
-    /**
-     * Link name for next collection view
-     */
-    public String getNextLinkName() {
-        return this.pager.getNextLinkName();
-    }
     
     /**
-     * Link value for prev collection view
+     * Get weblog entry being displayed or null if none specified by request.
      */
-    public String getPrevLink() {
-        return this.pager.getPrevLink();
+    public TemplateWrapper getWeblogPage() {       
+        TemplateWrapper ret = null;
+        try {
+            if (weblogPage != null) {
+                Roller roller = RollerFactory.getRoller();
+                UserManager umgr = roller.getUserManager();
+                WeblogTemplate template = umgr.getPageByName(weblog, weblogPage);
+                ret = TemplateWrapper.wrap(template);
+
+            } else {
+                ret = TemplateWrapper.wrap(weblog.getDefaultPage());
+            }  
+        } catch (RollerException e) {
+            log.error("ERROR: getting page template");
+        }
+        return ret;
     }
     
-    /**
-     * Link name for prev collection view
-     */
-    public String getPrevLinkName() {
-        return this.pager.getPrevLinkName();
-    }
     
     /**
-     * Does this pager represent a multi-page collection?
+     * Is this page considered a permalink?
      */
-    public boolean isMultiPage() {
-        return this.pager.isMultiPage();
+    public boolean isPermalink() {
+        return entryAnchor != null;
     }
     
-    /**
-     * Link value for next page in current collection view
-     */
-    public String getNextPageLink() {
-        return this.pager.getNextPageLink();
-    }
     
     /**
-     * Link name for next page in current collection view
+     * A map of entries representing this page. The collection is grouped by 
+     * days of entries.  Each value is a list of entry objects keyed by the 
+     * date they were published.
+     * @param catArgument Category restriction (null or "nil" for no restriction)
      */
-    public String getNextPageName() {
-        return this.pager.getNextPageName();
+    public WeblogEntriesPager getWeblogEntriesPager(String catArgument) {        
+        // category specified by argument wins over request parameter
+        String chosenCat = (catArgument != null) ? catArgument : cat;            
+        return new WeblogEntriesPagerImpl(weblog, dateString, entryAnchor, chosenCat, locale, page);
     }
     
-    /**
-     * Link value for prev page in current collection view
-     */
-    public String getPrevPageLink() {
-        return this.pager.getPrevPageLink();
-    }
     
     /**
-     * Link value for prev page in current collection view
+     * A map of entries representing this page. The collection is grouped by 
+     * days of entries.  Each value is a list of entry objects keyed by the 
+     * date they were published.
      */
-    public String getPrevPageName() {
-        return this.pager.getPrevPageName();
+    public WeblogEntriesPager getWeblogEntriesPager() {
+        return getWeblogEntriesPager(null);
     }
     
     
@@ -216,10 +201,9 @@
         try {
             Roller roller = RollerFactory.getRoller();
             WeblogManager wmgr = roller.getWeblogManager();
-            WeblogCategoryData cat = wmgr.getWeblogCategoryByPath(
-                    weblog, categoryPath);
-            if (cat != null) {
-                ret = WeblogCategoryDataWrapper.wrap(cat);
+            WeblogCategoryData category = wmgr.getWeblogCategoryByPath(weblog, cat);
+            if (category != null) {
+                ret = WeblogCategoryDataWrapper.wrap(category);
             }
         } catch (Exception e) {
             log.error("ERROR: fetching category");
@@ -246,10 +230,11 @@
                     null,       // user
                     null,       // startDate
                     new Date(), // endDate
-                    cat,        // categoryPath or null
+                    cat,        // cat or null
                     WeblogEntryData.PUBLISHED, 
                     "pubTime",  // sortby
-                    0,          // offset
+                    null, 
+                    0,
                     length); 
             
             // wrap pojos
@@ -319,8 +304,7 @@
         }
         return commentForm;
     }
-    
-    
+        
     /**
      * Get preview comment or null if none exists.
      */
@@ -339,7 +323,6 @@
         }
         return commentWrapper;
     }
-    
 }
 
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SearchResultsModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SearchResultsModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SearchResultsModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SearchResultsModel.java Thu Jul 13 06:07:42 2006
@@ -50,7 +50,7 @@
  *
  * Also adds some new methods which are specific only to search results.
  */
-public class SearchResultsModel extends PageRenderModel {
+public class SearchResultsModel extends PageModel {
     
     private static final ResourceBundle bundle = 
             ResourceBundle.getBundle("ApplicationResources");

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SiteModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SiteModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SiteModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/SiteModel.java Thu Jul 13 06:07:42 2006
@@ -216,7 +216,7 @@
             }
             // TODO 3.0: we may want this to be constrained by a locale
             List entries = wmgr.getWeblogEntries( 
-                website, user, startDate, new Date(), cat, WeblogEntryData.PUBLISHED, "pubTime", offset, length, null);
+                website, user, startDate, new Date(), cat, WeblogEntryData.PUBLISHED, "pubTime", null, offset, length);
             for (Iterator it = entries.iterator(); it.hasNext();) {
                 WeblogEntryData entry = (WeblogEntryData) it.next();
                 results.add(WeblogEntryDataWrapper.wrap(entry));

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesModel.java Thu Jul 13 06:07:42 2006
@@ -19,10 +19,12 @@
 package org.apache.roller.ui.rendering.model;
 
 import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Hashtable;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -32,11 +34,13 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
+import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper;
 import org.apache.roller.pojos.wrapper.WebsiteDataWrapper;
 import org.apache.roller.ui.core.RollerSession;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.util.RegexUtil;
 import org.apache.roller.util.Utilities;
+import org.apache.struts.util.RequestUtils;
 
 
 /**
@@ -135,7 +139,7 @@
     public boolean isUserAuthenticated() {
         return (request.getUserPrincipal() != null);
     }
-    
+        
     //-------------------------------------------------------------- Date utils
     /**
      * Return date for current time.

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=421613&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 Thu Jul 13 06:07:42 2006
@@ -0,0 +1,73 @@
+package org.apache.roller.ui.rendering.model;
+
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.commons.lang.StringUtils;
+import org.apache.roller.RollerException;
+import org.apache.roller.model.RollerFactory;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper;
+import org.apache.roller.util.DateUtil;
+
+
+/**
+ * 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 next collection view
+     */
+    public String getNextCollectionLink();
+    /**
+     * Link name for next collection view
+     */
+    public String getNextCollectionName();    
+    /**
+     * Link value for prev collection view
+     */
+    public String getPrevCollectionLink(); 
+    /**
+     * Link name for prev collection view
+     */
+    public String getPrevCollectionName();  
+    /**
+     * Does this pager represent a multi-page collection?
+     */
+    //public boolean isMultiPage();
+    /**
+     * Link value for next page in current collection view
+     */
+    public String getNextLink();
+    /**
+     * Link 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();  
+}
+

Added: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java?rev=421613&view=auto
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java (added)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntriesPagerImpl.java Thu Jul 13 06:07:42 2006
@@ -0,0 +1,662 @@
+/*
+ * 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.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.commons.collections.comparators.ReverseComparator;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.roller.RollerException;
+import org.apache.roller.model.Roller;
+import org.apache.roller.model.RollerFactory;
+import org.apache.roller.model.WeblogManager;
+import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
+import org.apache.roller.pojos.wrapper.WeblogEntryDataWrapper;
+import org.apache.roller.util.DateUtil;
+
+
+/**
+ * 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 class WeblogEntriesPagerImpl implements WeblogEntriesPager {
+    
+    /**
+     * Behavior of the pager is detemined by the mode, which is itself a pager.
+     * The mode may be LatestMode, SingleEntryMode, DayMode or MonthMode.
+     */
+    protected WeblogEntriesPager mode = null;
+    
+    protected Map            entries = null;
+    protected WebsiteData    weblog = null;
+    protected int            offset = 0;
+    protected int            page = 0;
+    protected int            length = 0;
+    protected String         cat = null; 
+    protected String         dateString = null; 
+    protected String         entryAnchor = null;
+    protected String         locale = null;
+    protected boolean        more = false;
+        
+    protected static Log log =
+            LogFactory.getFactory().getInstance(WeblogEntriesPagerImpl.class); 
+    
+    public WeblogEntriesPagerImpl(
+            WebsiteData weblog, 
+            String dateString, 
+            String entryAnchor,
+            String cat,
+            String locale,
+            int page) { 
+        
+        this.weblog = weblog;
+        this.dateString = dateString;
+        this.entryAnchor = entryAnchor;
+        this.cat = cat;
+        this.locale = locale;
+        this.page = page;
+        
+        length = weblog.getEntryDisplayCount();
+        if(page > 0) {
+            this.page = page;
+        }
+        this.offset = length * page;
+                
+        // determine which mode to use
+        if (entryAnchor != null) {
+            mode = new SingleEntryMode();
+        } else if (dateString != null && dateString.length() == 8) {
+            mode = new DayMode();
+        } else if (dateString != null && dateString.length() == 6) {
+            mode = new MonthMode();
+        } else {
+            mode = new LatestMode();
+        }
+    }
+        
+    public Map getEntries() {
+        return mode.getEntries();
+    }
+    
+    public String getNextLink() {
+        return mode.getNextLink();
+    }
+
+    public String getNextName() {
+        return mode.getNextName();
+    }
+
+    public String getPrevLink() {
+        return mode.getPrevLink();
+    }
+
+    public String getPrevName() {
+        return mode.getPrevName();
+    }
+
+    public String getNextCollectionLink() {
+        return mode.getNextCollectionLink();
+    }
+
+    public String getNextCollectionName() {
+        return mode.getNextCollectionName();
+    }
+
+    public String getPrevCollectionLink() {
+        return mode.getPrevCollectionLink();
+    }
+
+    public String getPrevCollectionName() {
+        return mode.getPrevCollectionName();
+    }
+    
+    //-------------------------------------------------------------------------
+    
+    /**
+     * We're paging through the latest entries in the blog.
+     * In this mode there's no prev/next collection.
+     */
+    class LatestMode implements WeblogEntriesPager {
+        
+        public LatestMode() {
+            LatestMode.this.getEntries();
+        }
+        
+        public Map getEntries() {
+            return getEntriesImpl(null, new Date());
+        }
+
+        public String getNextLink() {
+            String ret = null;
+            if (more) {
+                ret = weblog.getURL() + queryString(1);                
+            }
+            return ret;
+        }
+
+        public String getNextName() {
+            String ret = null;
+            if (getNextLink() != null) {
+                ret = "Next"; // TODO: I18N
+            }
+            return ret;
+        }
+
+        public String getPrevLink() {
+            String ret = null;
+            if (page > 0) {
+                ret = weblog.getURL() + queryString(-1);
+            }
+            return ret;
+        }
+
+        public String getPrevName() {
+            String ret = null;
+            if (getNextLink() != null) {
+                ret = "Prev"; // TODO: I18N
+            }
+            return ret;
+        }
+
+        public String getNextCollectionLink() {
+            return null;
+        }
+
+        public String getNextCollectionName() {
+            return null;
+        }
+
+        public String getPrevCollectionLink() {
+            return null;
+        }
+
+        public String getPrevCollectionName() {
+            return null;
+        }
+       
+     }
+
+    //-------------------------------------------------------------------------
+    
+    /**
+     * We're showing one weblog entry.
+     * Next/prev return permalinks of next and previous weblog entries.
+     * In this mode there's no prev/next collection.
+     */
+    class SingleEntryMode implements WeblogEntriesPager {
+        String nextLink = null;
+        WeblogEntryData entry = null;
+        WeblogEntryData nextEntry = null;
+        WeblogEntryData prevEntry = null;
+        
+        public SingleEntryMode() {
+            SingleEntryMode.this.getEntries();
+        }
+        
+        /**
+         * Wrap entry up in map of lists.
+         */
+        public Map getEntries() {
+            if (entries == null) try {
+                Roller roller = RollerFactory.getRoller();
+                WeblogManager wmgr = roller.getWeblogManager();
+                entry = wmgr.getWeblogEntryByAnchor(weblog, entryAnchor);
+                if (entry == null || !entry.getStatus().equals(WeblogEntryData.PUBLISHED)) {
+                    entry = null;
+                } else {
+                    entries = new TreeMap();
+                    entries.put(new Date(entry.getPubTime().getTime()), 
+                        Collections.singletonList(WeblogEntryDataWrapper.wrap(entry)));
+                } 
+            } catch (Exception e) {
+                log.error("ERROR: fetching entry");
+            }
+            return entries;
+        }
+
+        public String getNextLink() {
+            String ret = null;
+            if (getNextEntry() != null) {
+                ret = getNextEntry().getPermalink() + queryString(0);
+            }
+            return ret;
+        }
+
+        public String getNextName() {
+            String ret = null;
+            if (getNextEntry() != null) {
+                ret = getNextEntry().getTitle();
+            }
+            return ret;
+        }
+
+        public String getPrevLink() {
+            String ret = null;
+            if (getPrevEntry() != null) {
+                ret = getPrevEntry().getPermalink() + queryString(0);
+            }
+            return ret;
+        }
+
+        public String getPrevName() {
+            String ret = null;
+            if (getPrevEntry() != null) {
+                ret = getPrevEntry().getTitle();
+            }
+            return ret;
+        }
+
+        public String getNextCollectionLink() {
+            return null;
+        }
+
+        public String getNextCollectionName() {
+            return null;
+        }
+
+        public String getPrevCollectionLink() {
+            return null;
+        }
+
+        public String getPrevCollectionName() {
+            return null;
+        }   
+        
+        private WeblogEntryData getNextEntry() {
+            if (nextEntry == null) try {
+                Roller roller = RollerFactory.getRoller();
+                WeblogManager wmgr = roller.getWeblogManager();
+                nextEntry = wmgr.getNextEntry(entry, cat);
+                // make sure that entry is published and not to future
+                if (nextEntry != null && nextEntry.getPubTime().after(new Date()) 
+                    && nextEntry.getStatus().equals(WeblogEntryData.PUBLISHED)) {
+                    nextEntry = null;
+                }
+            } catch (RollerException e) {
+                log.error("ERROR: getting next entry", e);
+            }
+            return nextEntry;
+        }
+        
+        private WeblogEntryData getPrevEntry() {
+            if (prevEntry == null) try {
+                Roller roller = RollerFactory.getRoller();
+                WeblogManager wmgr = roller.getWeblogManager();
+                prevEntry = wmgr.getPreviousEntry(entry, cat); 
+                // make sure that entry is published and not to future
+                if (prevEntry != null && prevEntry.getPubTime().after(new Date()) 
+                    && prevEntry.getStatus().equals(WeblogEntryData.PUBLISHED)) {
+                    prevEntry = null;
+                }
+            } catch (RollerException e) {
+                log.error("ERROR: getting prev entry", e);
+            }
+            return prevEntry;
+        }
+    }
+    
+    //-------------------------------------------------------------------------
+
+    /**
+     * We're paging through entries in one day.
+     * Next/prev methods return links to offsets within day's entries.
+     * Next/prev collection methods return links to next and previous days.
+     */
+    class DayMode implements WeblogEntriesPager {
+        private Date day;
+        private Date nextDay;
+        private Date prevDay;
+        
+        public DayMode() {
+            DayMode.this.getEntries();
+            day = parseDate(dateString);
+            
+            Calendar cal = Calendar.getInstance();
+            
+            cal.setTime(day);
+            cal.add(Calendar.DAY_OF_MONTH, 1);
+            cal.set(Calendar.HOUR, 0);
+            cal.set(Calendar.MINUTE, 0);
+            cal.set(Calendar.SECOND, 0);
+            nextDay = cal.getTime();
+            if (nextDay.after(getToday())) {
+                nextDay = null;
+            }
+            
+            cal.setTime(day);
+            cal.add(Calendar.DAY_OF_MONTH, -1);
+            cal.set(Calendar.HOUR, 23);
+            cal.set(Calendar.MINUTE, 59);
+            cal.set(Calendar.SECOND, 59);
+            prevDay = cal.getTime();
+        }
+        
+        public Map getEntries() {
+            Date date = parseDate(dateString);
+            Calendar cal = Calendar.getInstance(weblog.getTimeZoneInstance());
+            Date startDate = null;
+            Date endDate = date;
+            startDate = DateUtil.getStartOfDay(endDate, cal);
+            endDate = DateUtil.getEndOfDay(endDate, cal);
+            return getEntriesImpl(startDate, endDate);
+        }
+
+        public String getNextLink() {
+            String ret = null;
+            if (more) {
+                ret = weblog.getURL() + "/date/" + dateString  + queryString(1);
+            }
+            return ret;
+        }
+
+        public String getNextName() {
+            String ret = null;
+            if (getNextLink() != null) {
+                ret = "Next"; // TODO: I18N
+            }
+            return ret;
+        }
+
+        public String getPrevLink() {
+            String ret = null;
+            if (page > 0) {
+                ret = weblog.getURL() + "/date/" + dateString + queryString(-1);
+            }
+            return ret;
+        }
+
+        public String getPrevName() {
+            String ret = null;
+            if (getNextLink() != null) {
+                ret = "Prev"; // TODO: I18N
+            }
+            return ret;
+        }
+
+        public String getNextCollectionLink() {
+            String ret = null;
+            if (nextDay != null) {
+                String next = DateUtil.format8chars(nextDay);
+                ret = weblog.getURL() + "/date/" + next + queryString(0);
+            }
+            return ret;
+        }
+
+        public String getNextCollectionName() {
+            String ret = null;
+            if (nextDay != null) {
+                ret = DateUtil.format8chars(nextDay);
+            }
+            return ret;
+        }
+
+        public String getPrevCollectionLink() {
+            String ret = null;
+            if (prevDay != null) {
+                String prev = DateUtil.format8chars(prevDay);
+                ret = weblog.getURL() + "/date/" + prev + queryString(0);
+            }
+            return ret;
+        }
+
+        public String getPrevCollectionName() {
+            String ret = null;
+            if (prevDay != null) {
+                ret = DateUtil.format8chars(prevDay);
+            }
+            return ret;
+        }
+    }
+    
+    //-------------------------------------------------------------------------
+
+    /**
+     * We're paging through entries within one month.
+     * Next/prev methods return links to offsets within month's entries.
+     * Next/prev collection methods return links to next and previous months.
+     */
+    class MonthMode implements WeblogEntriesPager {
+        private Date month;
+        private Date nextMonth;
+        private Date prevMonth;
+        
+        public MonthMode() {
+            MonthMode.this.getEntries();
+            month = parseDate(dateString);
+            
+            Calendar cal = Calendar.getInstance();
+            
+            cal.setTime(month);
+            cal.add(Calendar.MONTH, 1);
+            nextMonth = cal.getTime();
+            if (nextMonth.after(getToday())) {
+                nextMonth = null;
+            }
+            
+            cal.setTime(month);
+            cal.add(Calendar.MONTH, -1);
+            prevMonth = cal.getTime();
+        }
+        
+        public Map getEntries() {
+            Date date = parseDate(dateString);
+            Calendar cal = Calendar.getInstance(weblog.getTimeZoneInstance());
+            cal.setTime(date);
+            cal.add(Calendar.DATE, 1);
+            date = cal.getTime();
+            Date startDate = DateUtil.getStartOfMonth(date, cal);;
+            Date endDate = DateUtil.getEndOfMonth(date, cal);;
+            return getEntriesImpl(startDate, endDate);
+        }
+
+        public String getNextLink() {
+            String ret = null;
+            if (more) {
+                ret = weblog.getURL() + "/date/" + dateString  + queryString(1);
+            }
+            return ret;
+        }
+
+        public String getNextName() {
+            String ret = null;
+            if (getNextLink() != null) {
+                ret = "Next"; // TODO: I18N
+            }
+            return ret;
+        }
+
+        public String getPrevLink() {
+            String ret = null;
+            if (offset > 0) {
+                int prevOffset = offset + length;
+                prevOffset = (prevOffset < 0) ? 0 : prevOffset;
+                ret = weblog.getURL() + "/date/" + dateString + queryString(-1);
+            }
+            return ret;
+        }
+
+        public String getPrevName() {
+            String ret = null;
+            if (getNextLink() != null) {
+                ret = "Prev"; // TODO: I18N
+            }
+            return ret;
+        }
+
+        public String getNextCollectionLink() {
+            String ret = null;
+            if (nextMonth != null) {
+                String next = DateUtil.format6chars(nextMonth); 
+                ret = weblog.getURL() + "/date/" + next + queryString(0);
+            }
+            return ret;
+        }
+
+        public String getNextCollectionName() {
+            String ret = null;
+            if (nextMonth != null) {
+                ret = DateUtil.format6chars(nextMonth);
+            }
+            return ret;
+        }
+
+        public String getPrevCollectionLink() {
+            String ret = null;
+            if (prevMonth != null) {
+                String prev = DateUtil.format6chars(prevMonth);
+                ret = weblog.getURL() + "/date/" + prev + queryString(0);
+            }
+            return ret;
+        }
+
+        public String getPrevCollectionName() {
+            String ret = null;
+            if (prevMonth != null) {
+                ret = DateUtil.format6chars(prevMonth);
+            }
+            return ret;
+        }        
+    }  
+                
+    //------------------------------------------------------------------------
+    
+    /**
+     * Get current values specified by request, a map of lists of entry  
+     * wrappers, keyed by date objects, where each list holds entries 
+     * for one day.
+     */
+    private Map getEntriesImpl(Date startDate, Date endDate) {
+        if (entries == null) {
+            entries = new TreeMap(new ReverseComparator());
+            try {
+                Roller roller = RollerFactory.getRoller();
+                WeblogManager wmgr = roller.getWeblogManager();
+                Map mmap = RollerFactory.getRoller().getWeblogManager().getWeblogEntryObjectMap(
+                        weblog,
+                        startDate,
+                        endDate,
+                        cat,
+                        WeblogEntryData.PUBLISHED, 
+                        locale,
+                        offset,  
+                        length + 1);
+                              
+                // need to wrap pojos
+                int count = 0;
+                java.util.Date key = null;
+                Iterator days = mmap.keySet().iterator();
+                while(days.hasNext()) {
+                    key = (java.util.Date)days.next();
+
+                    // now we need to go through each entry in a day and wrap
+                    List wrapped = new ArrayList();
+                    List unwrapped= (List) mmap.get(key);
+                    for(int i=0; i < unwrapped.size(); i++) {
+                        wrapped.add(i, 
+                            WeblogEntryDataWrapper.wrap((WeblogEntryData)unwrapped.get(i)));
+                        if (++count < length) {
+                            entries.put(key, wrapped);
+                        } else {
+                            more = true;
+                        }
+                    }                            
+                }
+            } catch (Exception e) {
+                log.error("ERROR: getting entry month map", e);
+            }
+        }
+        return entries;
+    }
+    
+    /** 
+     * Parse data as either 6-char or 8-char format.
+     */
+    private Date parseDate(String dateString) {
+        Date ret = null;
+        SimpleDateFormat char8DateFormat = DateUtil.get8charDateFormat();
+        SimpleDateFormat char6DateFormat = DateUtil.get6charDateFormat();
+        if (   dateString!=null
+                && dateString.length()==8
+                && StringUtils.isNumeric(dateString) ) {
+            ParsePosition pos = new ParsePosition(0);
+            ret = char8DateFormat.parse( dateString, pos );
+            
+            // make sure the requested date is not in the future
+            Date today = getToday();
+            if (ret.after(today)) ret = today;
+        }
+        if (   dateString!=null
+                && dateString.length()==6
+                && StringUtils.isNumeric(dateString) ) {
+            ParsePosition pos = new ParsePosition(0);
+            ret = char6DateFormat.parse( dateString, pos );
+            
+            // make sure the requested date is not in the future
+            Date today = getToday();
+            if (ret.after(today)) ret = today;
+        }
+        return ret;
+    }
+    
+    /**
+     * Return today based on current blog's timezone/locale.
+     */
+    private Date getToday() {
+        Calendar todayCal = Calendar.getInstance();
+        todayCal = Calendar.getInstance(
+            weblog.getTimeZoneInstance(), weblog.getLocaleInstance());
+        todayCal.setTime(new Date());
+        return todayCal.getTime();
+    }
+    
+    /**
+     * Create query string to convey pager's state.
+     * @param pageAdd To be added to page number, or 0 for no page number
+     */
+    private String queryString(int pageAdd) {
+        String ret = "";
+        Map params = new HashMap();
+        if (pageAdd != 0) params.put("page", Integer.toString(page + pageAdd));
+        if (cat != null) params.put("cat", cat);
+        if (locale != null) params.put("lang", locale);
+        for (Iterator keys = params.keySet().iterator(); keys.hasNext();) {
+            String key = (String) keys.next();
+            String value = (String)params.get(key);
+            if (ret.length() == 0) {
+                ret = "?" + key + "=" + value;
+            } else {
+                ret += "&" + key + "=" + value;
+            }
+        }
+        return ret;
+    }
+}

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PageServlet.java Thu Jul 13 06:07:42 2006
@@ -409,6 +409,9 @@
         // add locale
         key.append("/").append(pageRequest.getLocale());
         
+        // add locale
+        key.append("/").append(pageRequest.getPageNum());
+        
         // add login state
         if(pageRequest.getAuthenticUser() != null) {
             key.append("/user=").append(pageRequest.getAuthenticUser());

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldWeblogPageModel.java Thu Jul 13 06:07:42 2006
@@ -380,8 +380,7 @@
                     endDate,                      // endDate
                     catParam,                     // catName
                     WeblogEntryData.PUBLISHED,    // status
-                    0, -1,
-                    mLocale);  
+mLocale,                     0, -1);  
             
             // need to wrap pojos
             java.util.Date key = null;
@@ -484,8 +483,7 @@
                     catParam,                    // catName
                     WeblogEntryData.PUBLISHED,   // status
                     null,                        // sortby (null for pubTime)
-                    0, maxEntries,               // maxEntries
-                    mLocale);    
+mLocale,                     0, maxEntries);    
             
             // wrap pojos
             ret = new ArrayList(mEntries.size());

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/util/cache/FuturePostingsInvalidationJob.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/util/cache/FuturePostingsInvalidationJob.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/util/cache/FuturePostingsInvalidationJob.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/util/cache/FuturePostingsInvalidationJob.java Thu Jul 13 06:07:42 2006
@@ -96,7 +96,7 @@
             
             // get all published entries between start and end date
             expiringEntries = mgr.getWeblogEntries(null, null, start, end, null, 
-                    null, WeblogEntryData.PUBLISHED, 0, -1, null);
+                    null, WeblogEntryData.PUBLISHED, null, 0, -1);
             
             this.nextExpirations = expiringEntries;
             

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java Thu Jul 13 06:07:42 2006
@@ -209,9 +209,8 @@
                     null,              // catName
                     null,              // status
                     "updateTime",      // sortby
-                    start,             // offset (for range paging)
-                    max + 1,           // maxEntries
-                    null);             // locale
+null,                     start,             // offset (for range paging)
+                    max + 1);             // locale
             Feed feed = new Feed();
             feed.setTitle("Entries for blog[" + handle + "]");
             List atomEntries = new ArrayList();

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/BloggerAPIHandler.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/BloggerAPIHandler.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/BloggerAPIHandler.java Thu Jul 13 06:07:42 2006
@@ -475,7 +475,7 @@
                         null,                   // startDate
                         new Date(),             // endDate
                         null,                   // catName
-                        null, 0, -1, null);
+                        null, null, 0, -1);
                 
                 Iterator iter = entries.values().iterator();
                 while (iter.hasNext()) {

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/MetaWeblogAPIHandler.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/MetaWeblogAPIHandler.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/xmlrpc/MetaWeblogAPIHandler.java Thu Jul 13 06:07:42 2006
@@ -420,7 +420,7 @@
                     null,              // catName
                     null,              // status
                     "updateTime",      // sortby
-                    0, numposts, null);  
+null,                     0, numposts);  
                 
                 Iterator iter = entries.iterator();
                 while (iter.hasNext()) {

Propchange: incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Jul 13 06:07:42 2006
@@ -1,2 +1,3 @@
 .LCKPlanetManagerTest.java~
 .LCKPlanetManagerLocalTest.java~
+.LCKWeblogEntryTest.java~

Modified: incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogEntryTest.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogEntryTest.java?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogEntryTest.java (original)
+++ incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogEntryTest.java Thu Jul 13 06:07:42 2006
@@ -186,7 +186,7 @@
         
         // get all entries for weblog
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, 0, -1, null);
+        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, 0, -1);
         assertNotNull(entries);
         assertEquals(3, entries.size());
         assertEquals(entry3, entries.get(0));
@@ -199,39 +199,39 @@
         
         // get all published entries only 
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, WeblogEntryData.PUBLISHED, null, 0, -1, null);
+        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, WeblogEntryData.PUBLISHED, null, null, 0, -1);
         assertNotNull(entries);
         assertEquals(2, entries.size());
         
         // get all entries in date range
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, entry2.getPubTime(), entry2.getPubTime(), null, null, null, 0, -1, null);
+        entries = mgr.getWeblogEntries(testWeblog, null, entry2.getPubTime(), entry2.getPubTime(), null, null, null, null, 0, -1);
         assertNotNull(entries);
         assertEquals(1, entries.size());
         assertEquals(entry2, entries.get(0));
         
         // get all entries, limited to maxSize
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, 0, 2, null);
+        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, 0, 2);
         assertNotNull(entries);
         assertEquals(2, entries.size());
         
         // get all entries in category
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, testWeblog.getDefaultCategory().getName(), null, null, 0, -1, null);
+        entries = mgr.getWeblogEntries(testWeblog, null, null, null, testWeblog.getDefaultCategory().getName(), null, null, null, 0, -1);
         assertNotNull(entries);
         assertEquals(3, entries.size());
         
         // get all entries, limited by offset/range
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, 1, 1, null);
+        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, null, 1, 1);
         assertNotNull(entries);
         assertEquals(1, entries.size());
         assertEquals(entry2, entries.get(0));
         
         // get all entries, limited by locale
         entries = null;
-        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, 0, -1, "en_US");
+        entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, "en_US", 0, -1);
         assertNotNull(entries);
         assertEquals(1, entries.size());
         assertEquals(entry1, entries.get(0));
@@ -271,13 +271,13 @@
         
         // get object map
         entryMap = null;
-        entryMap = mgr.getWeblogEntryObjectMap(testWeblog, null, null, null, null, 0, -1, null);
+        entryMap = mgr.getWeblogEntryObjectMap(testWeblog, null, null, null, null, null, 0, -1);
         assertNotNull(entryMap);
         assertTrue(entryMap.keySet().size() > 1);
         
         // get string map
         entryMap = null;
-        entryMap = mgr.getWeblogEntryStringMap(testWeblog, null, null, null, null, 0, -1, null);
+        entryMap = mgr.getWeblogEntryStringMap(testWeblog, null, null, null, null, null, 0, -1);
         assertNotNull(entryMap);
         assertTrue(entryMap.keySet().size() > 1);
                 

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/classes/ApplicationResources.properties Thu Jul 13 06:07:42 2006
@@ -630,6 +630,7 @@
 macro.weblog.date.toStringFormat=EEEE MMMM dd, yyyy
 macro.weblog.preview=Preview
 macro.weblog.commentpermalink.title=comment permalink
+macro.weblog.readMore=Read More
 
 macro.weblog.postedby=Posted by
 macro.weblog.on=on

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/classes/roller.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/classes/roller.properties?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/classes/roller.properties (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/classes/roller.properties Thu Jul 13 06:07:42 2006
@@ -88,7 +88,7 @@
 
 # Set of page models to be created for weblog rendering
 rendering.pageRenderModels=\
-org.apache.roller.ui.rendering.model.PageRenderModel,\
+org.apache.roller.ui.rendering.model.PageModel,\
 org.apache.roller.ui.rendering.model.ConfigModel
 
 rendering.feedRenderModels=\

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/classes/themes/css.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/classes/themes/css.vm?rev=421613&r1=421612&r2=421613&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/classes/themes/css.vm (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/classes/themes/css.vm Thu Jul 13 06:07:42 2006
@@ -1,4 +1,7 @@
-<link rel="stylesheet" type="text/css" href="$ctxPath/themes/base.css" />
-#if( $theme )
-    <link rel="stylesheet" type="text/css" href="#showThemePath($theme)/theme.css" />
-#end
\ No newline at end of file
+<link rel="stylesheet" type="text/css" href="$config.contextURL/themes/base.css" />
+@import url($config.contextURL/themes/andreas08/styles/tools.css);
+@import url($config.contextURL/themes/andreas08/styles/typo.css);
+@import url($config.contextURL/themes/andreas08/styles/forms.css);
+@import url($config.contextURL/themes/andreas08/styles/layout-navtop-subright.css);
+@import url($config.contextURL/themes/andreas08/styles/layout.css);
+@import url($config.contextURL/themes/andreas08/styles/andreas08.css);
\ No newline at end of file



Mime
View raw message