roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r417044 [1/3] - in /incubator/roller/branches/roller_3.0: ./ metadata/database/ src/org/apache/roller/business/ src/org/apache/roller/business/hibernate/ src/org/apache/roller/pojos/ src/org/apache/roller/ui/core/ src/org/apache/roller/ui/r...
Date Sun, 25 Jun 2006 19:33:53 GMT
Author: snoopdave
Date: Sun Jun 25 12:33:50 2006
New Revision: 417044

URL: http://svn.apache.org/viewvc?rev=417044&view=rev
Log:

Summary of changes in this commit

*** Introduced the RenderDayPager interface

New interface defines pager for collections that are 1) organzied as a map
of lists where each map represents one day and 2) part of a sequence of 
collections. Created a weblog entry specific implementation called 
WeblogEntriesPager which encapsulates all of the next/prev logic from the 
old PageModel for main, single-entry, day and month modes.

*** Simplified PageRenderModel

PageRenderModel no longer provides pager methods, instead it returns a 
WeblogEntriesPager. Plus, I added to PageRenderModel simple methods for getting 
most recent 100 entries or comments suitable for side-bar displays to recent 
weblog activity.

*** Elimiated WeblogPagePluginHelper class

Replaced it with methods in WeblogEntryData getTransformedText() and 
getTransformedSummary(). Per-request caching of initialized plugins is done 
by the WebsiteData object.

*** Made front-page properties into runtime properties

   site.frontpage.weblog.handle
   site.frontpage.weblog.aggregated

*** Cleaned up presentation-side of unit tests

Removed unnecessary tests and other classes, refactored away old RollerTestBase
class and made all of the test work again against the 3.0 code base.


Added:
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/MockPrincipal.java
      - copied, changed from r416919, incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/core/MockPrincipal.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/MockRollerContext.java
      - copied, changed from r416919, incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/core/MockRollerContext.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/ServletTestBase.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/util/BlacklistTest.java
      - copied, changed from r416919, incubator/roller/branches/roller_3.0/tests/org/apache/roller/BlacklistTest.java
Removed:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/roller-persistence.png
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/roller-services-impl.png
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/WeblogEntryPluginsHelper.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/BlacklistTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/DateTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/RollerTestBase.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/SearchServletTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/TestAll.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/core/
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/filters/
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/rendering/velocity/ArchiveParserTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/rendering/velocity/VelocityServletTestBase.java
Modified:
    incubator/roller/branches/roller_3.0/build.xml
    incubator/roller/branches/roller_3.0/metadata/database/createdb.vm
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernatePlanetManagerImpl.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/package.html
    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/core/RollerContext.java
    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/RenderModelLoader.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesHelper.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.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/servlets/PreviewServlet.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/SearchServlet.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/DateUtil.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/IndexManagerTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/PermissionTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/PlanetManagerLocalTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/PlanetManagerTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogEntryTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogStatsTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/business/WeblogTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/StrutsActionTestBase.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/authoring/struts/actions/BookmarksActionTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/authoring/struts/actions/WeblogEntryActionTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/rendering/velocity/plugins/smileys/SmileysTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/ui/rendering/velocity/plugins/textile/TextileTest.java
    incubator/roller/branches/roller_3.0/tests/org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.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/rollerRuntimeConfigDefs.xml

Modified: incubator/roller/branches/roller_3.0/build.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/build.xml?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/build.xml (original)
+++ incubator/roller/branches/roller_3.0/build.xml Sun Jun 25 12:33:50 2006
@@ -830,6 +830,8 @@
 </target>
 
 <target name="build-tests" depends="build" description="Build unit tests" >
+    
+    <delete dir="${ro.build}/tests" failonerror="false" />
 
     <mkdir dir="${build.tests}" />
     <mkdir dir="${build.tests}/logs" />
@@ -918,6 +920,7 @@
         <formatter type="xml"/>
         <batchtest toDir="${build.reports}/business/xml">
             <fileset dir="${build.tests}/WEB-INF/classes">
+		<include name="org/apache/roller/business/BookmarkTest.class"/>
 		<include name="org/apache/roller/business/UserTest.class"/> 
 	        <include name="org/apache/roller/business/WeblogTest.class"/>
 	        <include name="org/apache/roller/business/PermissionTest.class"/>
@@ -930,7 +933,6 @@
 		<include name="org/apache/roller/business/FileManagerTest.class"/>
 		<include name="org/apache/roller/business/IndexManagerTest.class"/>
 	        <include name="org/apache/roller/business/PlanetManagerTest.class"/>
-		<include name="org/apache/roller/business/BookmarkTest.class"/>
 		<include name="org/apache/roller/business/RefererTest.class"/>
             </fileset>
         </batchtest>
@@ -962,16 +964,15 @@
     <junit fork="true" dir="${build.tests}" showOutput="true">
         <batchtest toDir="${build.reports}/presentation/xml">
             <fileset dir="${build.tests}/WEB-INF/classes">
-                <include name="org/apache/roller/presentation/**/*Test.class"/> 
-	            <exclude name="**/ApplicationResourcesTest.class"/>
-	            <exclude name="**/ArchiveParserTest.class"/>
-	            <exclude name="**/AtomCollectionTest.class"/>
-	            <exclude name="**/AtomServletTest.class"/>
-	            <exclude name="**/ExportRssTest.class"/>
-	            <exclude name="**/LanguageUtilTest.class"/>            
+                <include name="org/apache/roller/ui/authoring/struts/actions/BookmarksActionTest.class"/>           
+                <include name="org/apache/roller/ui/authoring/struts/actions/WeblogEntryActionTest.class"/>           
+                <include name="org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.class"/>  
+                <include name="org/apache/roller/ui/rendering/velocity/plugins/smileys/SmileysTest.class"/>           
+                <!--
+                <include name="org/apache/roller/ui/rendering/velocity/plugins/textile/TextileTest.class" /> 
+                -->
             </fileset>
         </batchtest>
-        <!--arg value="org.apache.roller.presentation.velocity.ExportRssTest"/-->
         <jvmarg value="-Dro.build=${ro.build}"/>
         <jvmarg value="-Dcatalina.base=${build.tests}"/> <!-- needed to satisfy ref in log4j.properties -->
         <jvmarg value="-Droller.custom.config=${build.tests}/roller-custom.properties"/>

Modified: incubator/roller/branches/roller_3.0/metadata/database/createdb.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/metadata/database/createdb.vm?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/metadata/database/createdb.vm (original)
+++ incubator/roller/branches/roller_3.0/metadata/database/createdb.vm Sun Jun 25 12:33:50 2006
@@ -102,13 +102,14 @@
     defaultplugins    varchar(255),
     isenabled         $BOOLEAN_SQL_TYPE_TRUE not null,
     isactive          $BOOLEAN_SQL_TYPE_TRUE not null,
-    datecreated      $TIMESTAMP_SQL_TYPE not null,
+    datecreated          $TIMESTAMP_SQL_TYPE not null,
     blacklist            $TEXT_SQL_TYPE,
     defaultallowcomments $BOOLEAN_SQL_TYPE_TRUE not null,
     defaultcommentdays   integer default 7 not null,
     commentmod           $BOOLEAN_SQL_TYPE_FALSE not null,
-    displaycnt        integer default 15 not null,
-    lastmodified       $TIMESTAMP_SQL_TYPE
+    displaycnt           integer default 15 not null,
+    lastmodified         $TIMESTAMP_SQL_TYPE,
+    pagemodels           varchar(512) default null
 );
 create index ws_userid_idx    on website(userid);
 create index ws_isenabled_idx on website(isenabled);

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernatePlanetManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernatePlanetManagerImpl.java?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernatePlanetManagerImpl.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/business/hibernate/HibernatePlanetManagerImpl.java Sun Jun 25 12:33:50 2006
@@ -146,14 +146,14 @@
         return config;
     }    
     
-    public PlanetSubscriptionData getSubscription(String feedUrl) 
+    public PlanetSubscriptionData getSubscription(String feedURL) 
         throws RollerException {
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
             Criteria criteria =
                     session.createCriteria(PlanetSubscriptionData.class);
             criteria.setMaxResults(1);
-            criteria.add(Expression.eq("feedUrl", feedUrl));
+            criteria.add(Expression.eq("feedURL", feedURL));
             List list = criteria.list();
             return list.size()!=0 ? (PlanetSubscriptionData)list.get(0) : null;
         } catch (HibernateException e) {
@@ -171,7 +171,7 @@
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
             Criteria criteria =
                     session.createCriteria(PlanetSubscriptionData.class);
-            criteria.addOrder(Order.asc("feedUrl"));
+            criteria.addOrder(Order.asc("feedURL"));
             List list = criteria.list();
             return list.iterator();
         } catch (Throwable e) {
@@ -266,16 +266,16 @@
         return handles;
     }
     
-     public List getFeedEntries(String feedUrl, int offset, int length)
+     public List getFeedEntries(String feedURL, int offset, int length)
         throws RollerException {
         // TODO: ATLAS getFeedEntries DONE       
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
             Criteria criteria = session.createCriteria(PlanetEntryData.class);
-            criteria.add(Expression.eq("subscription.feedUrl", feedUrl));
+            criteria.add(Expression.eq("subscription.feedURL", feedURL));
             criteria.addOrder(Order.desc("pubTime"));
             criteria.setFirstResult(offset);
-            criteria.setMaxResults(length);
+            if (length != -1) criteria.setMaxResults(length);
             return criteria.list();
         } catch (HibernateException e) {
             throw new RollerException(e);
@@ -311,7 +311,7 @@
                 Query query = session.createQuery(sb.toString());
                 query.setEntity("group", group);
                 query.setFirstResult(offset);
-                query.setMaxResults(length);
+                if (length != -1) query.setMaxResults(length);
                 query.setParameter("endDate", endDate);
                 if (startDate != null) {
                     query.setParameter("startDate", startDate);
@@ -329,7 +329,7 @@
                 sb.append("order by entry.pubTime desc");
                 Query query = session.createQuery(sb.toString());
                 query.setFirstResult(offset);
-                query.setMaxResults(length);
+                if (length != -1) query.setMaxResults(length);
                 query.setParameter("endDate", endDate);
                 if (startDate != null) {
                     query.setParameter("startDate", startDate);
@@ -440,7 +440,7 @@
             // Fetch latest entries for each subscription
 //            Set newEntries = null;
 //            int count = 0;
-//            if (!StringUtils.isEmpty(localURL) && sub.getFeedUrl().startsWith(localURL)) {
+//            if (!StringUtils.isEmpty(localURL) && sub.getFeedURL().startsWith(localURL)) {
 //                newEntries = getNewEntriesLocal(sub, feedFetcher, feedInfoCache);
 //            } else {
 //                newEntries = getNewEntriesRemote(sub, feedFetcher, feedInfoCache);
@@ -476,13 +476,13 @@
         
         Set newEntries = new TreeSet();
         SyndFeed feed = null;
-        URL feedUrl = null;
+        URL feedURL = null;
         Date lastUpdated = new Date();
         try {
-            feedUrl = new URL(sub.getFeedURL());
+            feedURL = new URL(sub.getFeedURL());
             log.debug("Get feed from cache "+sub.getFeedURL());
-            feed = feedFetcher.retrieveFeed(feedUrl);
-            SyndFeedInfo feedInfo = feedInfoCache.getFeedInfo(feedUrl);
+            feed = feedFetcher.retrieveFeed(feedURL);
+            SyndFeedInfo feedInfo = feedInfoCache.getFeedInfo(feedURL);
             if (feedInfo.getLastModified() != null) {
                 long lastUpdatedLong =
                         ((Long)feedInfo.getLastModified()).longValue();
@@ -540,11 +540,11 @@
                         new PlanetEntryData(feed, romeEntry, sub);
                 if (entry.getPubTime() == null) {
                     log.debug(
-                            "No published date, assigning fake date for "+feedUrl);
+                            "No published date, assigning fake date for "+feedURL);
                     entry.setPubTime(new Timestamp(cal.getTimeInMillis()));
                 }
                 if (entry.getPermaLink() == null) {
-                    log.warn("No permalink, rejecting entry from "+feedUrl);
+                    log.warn("No permalink, rejecting entry from "+feedURL);
                 } else {
                     newEntries.add(entry);
                 }

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/business/package.html
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/business/package.html?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/business/package.html (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/business/package.html Sun Jun 25 12:33:50 2006
@@ -21,24 +21,6 @@
   <title></title>
 </head>
 <body>
-Abstract implementation of the business layer interfaces.
-
-<p>At this level we avoid dependance on specific persistence engines 
-(e.g. Hibernate). We do this by using an interface named 
-{@link org.apache.roller.business.PersistenceStrategy PersistenceStrategy}
-to store, retrieve and remove 
-{@link org.apache.roller.pojos.PersistentObject PersistentObjects}.</p>
-
-<img src="roller-persistence.png" 
-    alt="diagram of Roller persistence object and strategy" />
-
-<p>The diagram below illustrates the dependency relationships between the 
-{@link org.apache.roller.pojos org.apache.roller.pojos},
-{@link org.apache.roller.model org.apache.roller.model}, and
-org.apache.roller.business packages.</p>
-
-<img src="roller-services-impl.png" 
-    alt="diagram of Roller business and persistence layers" />
-
+Non-database dependent Roller manager implementations.
 </body>
 </html>

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=417044&r1=417043&r2=417044&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 Sun Jun 25 12:33:50 2006
@@ -44,6 +44,7 @@
 import org.apache.roller.config.RollerConfig;
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.UserManager;
+import org.apache.roller.model.WeblogEntryPlugin;
 import org.apache.roller.model.WeblogManager;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.util.Utilities;
@@ -1033,7 +1034,32 @@
     /** no-op: needed only to satisfy XDoclet, use setStatus() instead */
     public void setPublished(boolean value) {
     }
+        
+    /**
+     * Get entry text, transformed by plugins enabled for entry.
+     */
+    public String getTransformedText() {
+        return render(text);
+    }
+    /**
+     * No-op to please XDoclet.
+     */
+    public void setTransformedText(String t) {
+        // no-op
+    }
     
+    /**
+     * Get entry summary, transformed by plugins enabled for entry.
+     */
+    public String getTransformedSummary() {
+        return render(summary);
+    }
+    /**
+     * No-op to please XDoclet.
+     */
+    public void setTransformedSummary(String t) {
+        // no-op
+    }    
     
     /**
      * Determine if the specified user has permissions to edit this entry.
@@ -1057,4 +1083,36 @@
         return false;
     }
     
+    /**
+     * Transform string based on plugins enabled for this weblog entry.
+     */
+    private String render(String str) {
+        String ret = str;
+        mLogger.debug("Applying page plugins to string");
+        Map plugins = this.website.getInitializedPlugins();
+        if (str != null && plugins != null) {
+            List entryPlugins = getPluginsList();
+            
+            // if no Entry plugins, don't bother looping.
+            if (entryPlugins != null && !entryPlugins.isEmpty()) {
+                
+                // now loop over mPagePlugins, matching
+                // against Entry plugins (by name):
+                // where a match is found render Plugin.
+                Iterator iter = plugins.keySet().iterator();
+                while (iter.hasNext()) {
+                    String key = (String)iter.next();
+                    if (entryPlugins.contains(key)) {
+                        WeblogEntryPlugin pagePlugin = (WeblogEntryPlugin)plugins.get(key);
+                        try {
+                            ret = pagePlugin.render(this, ret);
+                        } catch (Throwable t) {
+                            mLogger.error("ERROR from plugin: " + pagePlugin.getName(), t);
+                        }
+                    }
+                }
+            }
+        }        
+        return ret;
+    } 
 }

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=417044&r1=417043&r2=417044&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 Sun Jun 25 12:33:50 2006
@@ -36,6 +36,8 @@
 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;
 
@@ -92,6 +94,7 @@
     private WeblogCategoryData bloggerCategory = null;
     private WeblogCategoryData defaultCategory = null;
     
+    private Map initializedPlugins = null;
     
     public WebsiteData() {    
     }
@@ -1040,6 +1043,22 @@
     }
     public void setPageModels(String pageModels) {
         this.pageModels = pageModels;
+    }
+
+    /**
+     * Get initialized plugins for use during rendering process.
+     */
+    public Map getInitializedPlugins() {
+        if (initializedPlugins == null) {
+            try {
+                Roller roller = RollerFactory.getRoller();
+                PluginManager ppmgr = roller.getPagePluginManager();
+                initializedPlugins = ppmgr.getWeblogEntryPlugins(this, new HashMap()); 
+            } catch (Exception e) {
+                this.mLogger.error("ERROR: initializing plugins");
+            }
+        }
+        return initializedPlugins;
     }
 }
 

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=417044&r1=417043&r2=417044&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 Sun Jun 25 12:33:50 2006
@@ -503,7 +503,8 @@
      */
     public boolean isFrontPageWeblog(String weblogHandle) {
         
-        String frontPageHandle = RollerConfig.getProperty("frontpage.weblog.handle");
+        String frontPageHandle = RollerRuntimeConfig.getProperty(
+                "site.frontpage.weblog.handle");
         
         return (frontPageHandle.equals(weblogHandle));
     }
@@ -516,8 +517,8 @@
      */
     public boolean isSiteWideWeblog(String weblogHandle) {
         
-        boolean siteWide = 
-                RollerConfig.getBooleanProperty("frontpage.weblog.aggregatedFeeds");
+        boolean siteWide = RollerRuntimeConfig.getBooleanProperty(
+                "site.frontpage.weblog.aggregated");
         
         return (isFrontPageWeblog(weblogHandle) && siteWide);
     }

Modified: 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/PageRenderModel.java?rev=417044&r1=417043&r2=417044&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/PageRenderModel.java Sun Jun 25 12:33:50 2006
@@ -17,18 +17,13 @@
  */
 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.TimeZone;
 import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
@@ -47,7 +42,6 @@
 import org.apache.roller.ui.authoring.struts.formbeans.CommentFormEx;
 import org.apache.roller.ui.core.RollerSession;
 import org.apache.roller.ui.rendering.util.WeblogPageRequest;
-import org.apache.roller.util.DateUtil;
 
 /**
  * Model provides information needed to render a weblog page.
@@ -67,16 +61,23 @@
     protected static Log log =
             LogFactory.getFactory().getInstance(PageRenderModel.class);
     
-    /** Creates a new instance of AtlasWeblogPageModel */
+    /** 
+     * Creates an un-initialized new instance, Roller calls init() to complete
+     * construction. 
+     */
     public PageRenderModel() {
     }
     
-    /** Template context name to be used for model */
+    /** 
+     * Template context name to be used for model.
+     */
     public String getModelName() {
         return "model";
     }
     
-    /** Init page model based on request */
+    /** 
+     * Init page model based on request. 
+     */
     public void init(Map initData) throws RollerException {
         
         HttpServletRequest request = (HttpServletRequest) initData.get("request");
@@ -104,7 +105,9 @@
     }
     
     /**
-     * Get weblog entry to be displayed; null if not on single-entry page or if entry not published.
+     * Get weblog entry to be displayed; null if not on single-entry page or 
+     * if entry not published. The entry is also available from teh pager,
+     * so this is a convenience method.
      */
     public WeblogEntryDataWrapper getWeblogEntry() {
        WeblogEntryDataWrapper ret = null;
@@ -124,7 +127,8 @@
     }
     
     /**
-     * Get weblog category or null if request does not specify one.
+     * Get weblog category specified by request, or null if the category path
+     * found in the request does not exist in the current weblog.
      */
     public WeblogCategoryDataWrapper getWeblogCategory() {
         WeblogCategoryDataWrapper ret = null;
@@ -141,235 +145,59 @@
         }
         return ret;
     }
-    
+
     /**
-     * Get weblog entries as specified by the date and category specified or 
-     * implied by the URL.  
-     * @param cat Category restriction or null for all categories
-     * @return List of WeblogEntryDataWrapper objects.
-     */
-    public List getWeblogEntries(String cat, int offset, int length) {        
-        if (cat != null && "nil".equals(cat)) cat = null;
-        List ret = new ArrayList();
-        try {
-            Roller roller = RollerFactory.getRoller();
-            WeblogManager wmgr = roller.getWeblogManager();
-            Date date = parseDate(dateString);
-            
-            boolean isDaySpecified = false;
-            boolean isMonthSpecified = false;
-            if (dateString != null && dateString.length() == 8) {
-                isDaySpecified = true;
-            }  
-            else if (dateString != null && dateString.length() == 6) {
-                isMonthSpecified = true;
-            }
-            
-            String chosenCatPath = cat != null ? cat : categoryPath;
-            if (chosenCatPath == null) {
-                // no category specifed so use default
-                chosenCatPath = weblog.getDefaultCategory().getPath();
-                chosenCatPath = chosenCatPath.equals("/") ? null : chosenCatPath;
-            }
-            
-            // if weblog is specified, use its timezone
-            Calendar cal = null;
-            if (weblog != null) {
-                TimeZone tz = weblog.getTimeZoneInstance();
-                cal = Calendar.getInstance(tz);
-            } else {
-                cal = Calendar.getInstance();
-            }
-            
-            Date startDate = null;
-            Date endDate = date;
-            if (endDate == null) endDate = new Date(); 
-            if (isDaySpecified) {
-                // URL specified a specific day so get all entries for it
-                startDate = DateUtil.getStartOfDay(endDate, cal);
-                endDate = DateUtil.getEndOfDay(endDate, cal);
-            } else if (isMonthSpecified) {
-                // URL specified a specific month so get all entries for it
-                startDate = DateUtil.getStartOfMonth(endDate, cal);
-                endDate = DateUtil.getEndOfMonth(endDate, cal);
-            }
-            List entries = wmgr.getWeblogEntries(
-                    weblog,        // weblog
-                    null,          // user
-                    startDate,     // startDate
-                    endDate,       // endDate
-                    chosenCatPath, // catName
-                    WeblogEntryData.PUBLISHED, // status
-                    null,          // sortby (null for pubTime)
-                    offset,        // offset into results
-                    length); // max results to return
-            
-            // wrap pojos
-            ret = new ArrayList(entries.size());
-            Iterator it = entries.iterator();
-            int i=0;
-            while(it.hasNext()) {
-                ret.add(i, WeblogEntryDataWrapper.wrap((WeblogEntryData) it.next()));
-                i++;
-            }
-            setFirstAndLastEntries( ret );
-                        
-        } catch (Exception e) {
-            log.error("ERROR: getting entry list", e);
-        }
-        return ret;
+     * Return pager for displaying weblog entries, next/prev pagers, etc.
+     */    
+    public RenderDayPager getWeblogEntriesPager(String cat) {
+       return new WeblogEntriesPager(
+               request, weblog, entryAnchor, categoryPath, cat, dateString);
     }
     
     /**
-     * Get most recent weblog entries for day or month specified by request.
-     * @return Map of Lists of weblog entry objects, keyed by 8-char date strings.
+     * Get up to 100 most recent published entries in weblog.
+     * @param cat Category path or null for no category restriction
+     * @param length Max entries to return (1-100)
+     * @return List of WeblogEntryDataWrapper objects.
      */
-    public Map getWeblogEntriesMonthMap(String cat, int offset, int length) {
+    public List getRecentWeblogEntries(String cat, int length) {  
         if (cat != null && "nil".equals(cat)) cat = null;
-        Map ret = new HashMap();
+        if (length > 100) length = 100;
+        if (length < 1) return Collections.emptyList();
+        List recentEntries = new ArrayList();
         try {
-            Roller roller = RollerFactory.getRoller();
-            WeblogManager wmgr = roller.getWeblogManager();
-            Date date = parseDate(dateString);
-            
-            boolean isDaySpecified = false;
-            boolean isMonthSpecified = false;
-            if (dateString != null && dateString.length() == 8) {
-                isDaySpecified = true;
-            }  
-            else if (dateString != null && dateString.length() == 6) {
-                isMonthSpecified = true;
-            }
-            
-            String chosenCatPath = cat != null ? cat : categoryPath;
-            if (chosenCatPath == null) {
-                // no category specifed so use default
-                chosenCatPath = weblog.getDefaultCategory().getPath();
-                chosenCatPath = chosenCatPath.equals("/") ? null : chosenCatPath;
-            }
-            
-            // if weblog is specified, use its timezone
-            Calendar cal = null;
-            if (weblog != null) {
-                TimeZone tz = weblog.getTimeZoneInstance();
-                cal = Calendar.getInstance(tz);
-            } else {
-                cal = Calendar.getInstance();
-            }
-            
-            Date startDate = null;
-            Date endDate = date;
-            if (endDate == null) endDate = new Date();
-            if (isDaySpecified) {
-                // URL specified a specific day so get all entries for it
-                startDate = DateUtil.getStartOfDay(endDate, cal);
-                endDate = DateUtil.getEndOfDay(endDate, cal);
-            } else if (isMonthSpecified) {
-                // URL specified a specific month so get all entries for it
-                startDate = DateUtil.getStartOfMonth(endDate, cal);
-                endDate = DateUtil.getEndOfMonth(endDate, cal);
-            }
-            Map mmap = RollerFactory.getRoller().getWeblogManager().getWeblogEntryObjectMap(
-                    weblog,
-                    startDate,
-                    endDate,
-                    chosenCatPath,
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+            List recent = wmgr.getWeblogEntries(
+                    weblog, 
+                    null,       // user
+                    null,       // startDate
+                    new Date(), // endDate
+                    cat,        // categoryPath or null
                     WeblogEntryData.PUBLISHED, 
-                    offset,  
-                    length);
-            
-            // need to wrap pojos
-            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 wrappedEntries = new ArrayList();
-                List entries = (List) mmap.get(key);
-                for(int i=0; i < entries.size(); i++) {
-                    wrappedEntries.add(i,
-                            WeblogEntryDataWrapper.wrap((WeblogEntryData)entries.get(i)));
-                }
-                mmap.put(key, wrappedEntries);
-            }
-            
-            ret = mmap;
-            
-            setFirstAndLastEntries( ret );
+                    "pubTime",  // sortby
+                    0,          // offset
+                    length); 
             
-        } catch (Exception e) {
-            log.error("ERROR: getting entry month map", e);
-        }
-        return ret;
-    }
-    
-    /**
-     * Get weblog entry to be displayed or null if not on single-entry page.
-     */
-    public WeblogEntryDataWrapper getWeblogEntryNext() {
-        try {
-            Roller roller = RollerFactory.getRoller();
-            WeblogManager wmgr = roller.getWeblogManager();
-            WeblogCategoryData category = wmgr.getWeblogCategoryByPath(
-                    weblog, categoryPath);
-            WeblogEntryDataWrapper currentEntry = getWeblogEntry();
-            if (firstEntry != null) currentEntry = firstEntry;
-            if (nextEntry == null && currentEntry != null) {
-                String catName = null;
-                if (category != null) {
-                    catName = category.getName();
-                }
-                WeblogEntryData next =
-                        wmgr.getNextEntry(currentEntry.getPojo(), catName);
-
-                if (nextEntry != null)
-                    nextEntry = WeblogEntryDataWrapper.wrap(next);
-
-                // make sure that mNextEntry is not published to future
-                if (nextEntry != null && nextEntry.getPubTime().after(new Date())) {
-                    nextEntry = null;
-                }
-            }
-        } catch (RollerException e) {
-            log.error("ERROR: getting next entry", e);
-        }
-        return nextEntry;
-    }
-    
-    /**
-     * Get weblog entry to be displayed or null if not on single-entry page.
-     */
-    public WeblogEntryDataWrapper getWeblogEntryPrev() {
-        try {
-            Roller roller = RollerFactory.getRoller();
-            WeblogManager wmgr = roller.getWeblogManager();
-            WeblogCategoryData category = wmgr.getWeblogCategoryByPath(
-                    weblog, categoryPath);
-            WeblogEntryDataWrapper currentEntry = getWeblogEntry();
-            if (lastEntry != null) currentEntry = lastEntry;
-            if (prevEntry == null && currentEntry != null ) {
-                String catName = null;
-                if (category != null) {
-                    catName = category.getName();
-                }
-                WeblogEntryData prev =
-                        wmgr.getPreviousEntry(currentEntry.getPojo(), catName);
-                if(prev != null) {
-                    prevEntry = WeblogEntryDataWrapper.wrap(prev);
-                }
+            // wrap pojos
+            recentEntries = new ArrayList(recent.size());
+            Iterator it = recent.iterator();
+            while(it.hasNext()) {
+                recentEntries.add(WeblogEntryDataWrapper.wrap((WeblogEntryData) it.next()));
             }
         } catch (RollerException e) {
-            log.error("ERROR: getting next entry", e);
+            log.error("ERROR: getting comments", e);
         }
-        return prevEntry;
+        return recentEntries;
     }
     
     /**
-     * Get most recent approved and non-spam comments in weblog.
+     * Get up to 100 most recent approved and non-spam comments in weblog.
+     * @param length Max entries to return (1-100)
      * @return List of CommentDataWrapper objects.
      */
-    public List getComments(int offset, int length) {        
+    public List getRecentComments(int length) {   
+        if (length > 100) length = 100;
+        if (length < 1) return Collections.emptyList();
         List recentComments = new ArrayList();
         try {
             WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
@@ -383,7 +211,7 @@
                     Boolean.TRUE,  // approved only
                     Boolean.FALSE, // no spam
                     true,          // we want reverse chrono order
-                    offset,        // offset
+                    0,             // offset
                     length);       // length
             
             // wrap pojos
@@ -399,7 +227,8 @@
     }
     
     /**
-     * Get comment form to be displayed or null if not on single-entry page.
+     * Get comment form to be displayed, may contain preview data. 
+     * @return Comment form object or null if not on a comment page.
      */
     public CommentFormEx getCommentForm() {
         CommentFormEx commentForm =
@@ -434,90 +263,6 @@
         return commentWrapper;
     }
     
-    public boolean isUserAuthorizedToAdmin() {
-        try {
-            RollerSession rses = RollerSession.getRollerSession(request);
-            if (rses.getAuthenticatedUser() != null) {
-                return rses.isUserAuthorizedToAdmin(weblog);
-            }
-        } catch (RollerException e) {
-            log.warn("ERROR: checking user authorization", e);
-        }
-        return false;
-    }
-    
-    public boolean isUserAuthenticated() {
-        return (request.getUserPrincipal() != null);
-    }
-    
-    /** Pull the last WeblogEntryData out of the Map. */
-    private void setFirstAndLastEntries(Map days) {
-        int numDays = days.keySet().size();
-        if (numDays > 0) // there is at least one day 
-        {
-            // get first entry in map
-            Object[] keys = days.keySet().toArray(new Object[numDays]);
-            List vals = (List)days.get( keys[0] );
-            int valSize = vals.size();
-            if (valSize > 0) {
-                firstEntry = (WeblogEntryDataWrapper)vals.get(0);
-            }
-            
-            // get last entry in map
-            vals = (List)days.get( keys[--numDays] );
-            valSize = vals.size();
-            if (valSize > 0) {
-                lastEntry = (WeblogEntryDataWrapper)vals.get(--valSize);
-            }
-        }
-    }
-    
-    /** Pull the last WeblogEntryData out of the List. */
-    private void setFirstAndLastEntries(List entries) {
-        if (entries.size() > 0) {
-            firstEntry = (WeblogEntryDataWrapper)entries.get(0);
-            if (entries.size() > 1) {
-                lastEntry = (WeblogEntryDataWrapper)entries.get(entries.size() - 1);
-            } else {
-                lastEntry = (WeblogEntryDataWrapper)entries.get(0);                
-            }
-        }
-    }
-    
-    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;
-    }
-    
-    private Date getToday() {
-        Calendar todayCal = Calendar.getInstance();
-        todayCal = Calendar.getInstance(
-                weblog.getTimeZoneInstance(),weblog.getLocaleInstance());
-        todayCal.setTime(new Date());
-        return todayCal.getTime();
-    }
 }
 
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/RenderModelLoader.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/RenderModelLoader.java?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/RenderModelLoader.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/RenderModelLoader.java Sun Jun 25 12:33:50 2006
@@ -57,22 +57,11 @@
     /**
      * Load generic utility helpers.
      */
-    public static void loadUtilityHelpers(Map model) {
-        UtilitiesHelper utils = new UtilitiesHelper();
+    public static void loadUtilityHelpers(Map model, HttpServletRequest request) {
+        UtilitiesHelper utils = new UtilitiesHelper(request);
         model.put("utils", utils);
     }
-    
-    
-    /**
-     * Load weblog entry plugin helpers.
-     */
-    public static void loadPluginHelpers(WebsiteData weblog, Map model) 
-        throws RollerException {
-        WeblogEntryPluginsHelper plugins = new WeblogEntryPluginsHelper(weblog, model);
-        model.put("plugins", plugins);
-    }
-    
-    
+               
     /**
      * Load old page models, but only if velocity.pagemodel.classname defined.
      */

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesHelper.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesHelper.java?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesHelper.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/UtilitiesHelper.java Sun Jun 25 12:33:50 2006
@@ -24,9 +24,14 @@
 import java.util.Date;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+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;
@@ -36,6 +41,11 @@
  */
 public class UtilitiesHelper {
     
+    private HttpServletRequest request;
+    
+    protected static Log log =
+            LogFactory.getFactory().getInstance(UtilitiesHelper.class); 
+    
     private static Pattern mLinkPattern =
             Pattern.compile("<a href=.*?>", Pattern.CASE_INSENSITIVE);    
     private static final Pattern OPENING_B_TAG_PATTERN = 
@@ -78,7 +88,87 @@
             Pattern.compile("&lt;a href=.*?&gt;", Pattern.CASE_INSENSITIVE);
     private static final Pattern QUOTE_PATTERN = 
             Pattern.compile("&quot;", Pattern.CASE_INSENSITIVE);
+    
+    public UtilitiesHelper(HttpServletRequest request) {
+        this.request = request;
+    }
             
+    //---------------------------------------------------- Authentication utils 
+    
+    public boolean getUserAuthorizedToAuthor(WebsiteDataWrapper weblog) {
+        try {
+            RollerSession rses = RollerSession.getRollerSession(request);
+            if (rses.getAuthenticatedUser() != null) {
+                return rses.isUserAuthorizedToAuthor(weblog.getPojo());
+            }
+        } catch (Exception e) {
+            log.warn("ERROR: checking user authorization", e);
+        }
+        return false;
+    }
+    
+    public boolean getUserAuthorizedToAdmin(WebsiteDataWrapper weblog) {
+        try {
+            RollerSession rses = RollerSession.getRollerSession(request);
+            if (rses.getAuthenticatedUser() != null) {
+                return rses.isUserAuthorizedToAdmin(weblog.getPojo());
+            }
+        } catch (Exception e) {
+            log.warn("ERROR: checking user authorization", e);
+        }
+        return false;
+    }
+    
+    public boolean isUserAuthenticated() {
+        return (request.getUserPrincipal() != null);
+    }
+    
+    //-------------------------------------------------------------- Date utils
+    /**
+     * Return date for current time.
+     */
+    public static Date getNow() {
+        return new Date();
+    }
+    
+    /**
+     * Format date using SimpleDateFormat format string.
+     */
+    public static String formatDate(Date d, String fmt) {
+        SimpleDateFormat format = new SimpleDateFormat(fmt);
+        return format.format(d);
+    }
+    
+    /**
+     * Format date in ISO-8601 format.
+     */
+    public static String formatIso8601Date(Date d) {
+        return DateUtil.formatIso8601(d);
+    }
+    
+    /**
+     * Format date in ISO-8601 format.
+     */
+    public static String formatIso8601Day(Date d) {
+        return DateUtil.formatIso8601Day(d);
+    }
+    
+    /**
+     * Return a date in RFC-822 format.
+     */
+    public static String formatRfc822Date(Date date) {
+        return DateUtil.formatRfc822(date);
+    }
+    
+    /**
+     * Return a date in RFC-822 format.
+     */
+    public static String format8charsDate(Date date) {
+        return DateUtil.format8chars(date);
+    }
+
+    //------------------------------------------------------------ String utils
+    
     public static boolean isEmpty(String str) {
         if (str == null) return true;
         return "".equals(str.trim());
@@ -92,13 +182,6 @@
         return StringUtils.split(str1, str2);
     }
     
-    public static String replace(String src, String target, String rWith) {
-        return StringUtils.replace(src, target, rWith);
-    }
-    
-    public static String replace(String src, String target, String rWith, int maxCount) {
-        return StringUtils.replace(src, target, rWith, maxCount);
-    }
     
     public static boolean equals(String str1, String str2) {
         return StringUtils.equals(str1, str2);
@@ -123,7 +206,20 @@
     public static String unescapeHTML(String str) {
         return StringEscapeUtils.unescapeHtml(str);
     }
-               
+    
+    public static String replace(String src, String target, String rWith) {
+        return StringUtils.replace(src, target, rWith);
+    }
+    
+    public static String replace(String src, String target, String rWith, int maxCount) {
+        return StringUtils.replace(src, target, rWith, maxCount);
+    }
+    
+    private static String replace(String string, Pattern pattern, String replacement) {
+        Matcher m = pattern.matcher(string);
+        return m.replaceAll(replacement);
+    }
+    
     /**
      * Remove occurences of html, defined as any text
      * between the characters "&lt;" and "&gt;".  Replace
@@ -149,50 +245,6 @@
         String ret = StringUtils.replace(s, "\n", "<br />");
         return ret;
     }
-    
-    /**
-     * Return date for current time.
-     */
-    public static Date getNow() {
-        return new Date();
-    }
-    
-    /**
-     * Format date using SimpleDateFormat format string.
-     */
-    public static String formatDate(Date d, String fmt) {
-        SimpleDateFormat format = new SimpleDateFormat(fmt);
-        return format.format(d);
-    }
-    
-    /**
-     * Format date in ISO-8601 format.
-     */
-    public static String formatIso8601Date(Date d) {
-        return DateUtil.formatIso8601(d);
-    }
-    
-    /**
-     * Format date in ISO-8601 format.
-     */
-    public static String formatIso8601Day(Date d) {
-        return DateUtil.formatIso8601Day(d);
-    }
-    
-    /**
-     * Return a date in RFC-822 format.
-     */
-    public static String formatRfc822Date(Date date) {
-        return DateUtil.formatRfc822(date);
-    }
-    
-    /**
-     * Return a date in RFC-822 format.
-     */
-    public static String format8charsDate(Date date) {
-        return DateUtil.format8chars(date);
-    }
-    
     /**
      * Strips HTML and truncates.
      */
@@ -394,11 +446,6 @@
         return s;
     }
     
-    private static String replace(String string, Pattern pattern, String replacement) {
-        Matcher m = pattern.matcher(string);
-        return m.replaceAll(replacement);
-    }
-    
     /**
      * Convert a byte array into a Base64 string (as used in mime formats)
      */
@@ -428,4 +475,5 @@
         
         return tt.toString();
     }
+       
 }

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/FeedServlet.java Sun Jun 25 12:33:50 2006
@@ -206,8 +206,7 @@
             }
             
             // utility helpers and plugin helpers
-            RenderModelLoader.loadUtilityHelpers(model);
-            RenderModelLoader.loadPluginHelpers(weblog, model);
+            RenderModelLoader.loadUtilityHelpers(model, request);
 
             // Feeds get weblog's custom models too
             RenderModelLoader.loadCustomModels(weblog, model, initData);

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=417044&r1=417043&r2=417044&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 Sun Jun 25 12:33:50 2006
@@ -268,9 +268,8 @@
             }
             
             // add helpers
-            RenderModelLoader.loadUtilityHelpers(model);
+            RenderModelLoader.loadUtilityHelpers(model, request);
             RenderModelLoader.loadWeblogHelpers(pageContext, model);
-            RenderModelLoader.loadPluginHelpers(weblog, model);
 
             // Feeds get weblog's custom models too
             RenderModelLoader.loadCustomModels(weblog, model, initData);

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PreviewServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PreviewServlet.java?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PreviewServlet.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/PreviewServlet.java Sun Jun 25 12:33:50 2006
@@ -174,9 +174,8 @@
             }
             
             // add helpers
-            RenderModelLoader.loadUtilityHelpers(model);
+            RenderModelLoader.loadUtilityHelpers(model, request);
             RenderModelLoader.loadWeblogHelpers(pageContext, model);
-            RenderModelLoader.loadPluginHelpers(tmpWebsite, model);
 
             // Feeds get weblog's custom models too
             RenderModelLoader.loadCustomModels(tmpWebsite, model, initData);

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/SearchServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/SearchServlet.java?rev=417044&r1=417043&r2=417044&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/SearchServlet.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/servlets/SearchServlet.java Sun Jun 25 12:33:50 2006
@@ -137,9 +137,8 @@
             }
             
             // add helpers
-            RenderModelLoader.loadUtilityHelpers(model);
+            RenderModelLoader.loadUtilityHelpers(model, request);
             RenderModelLoader.loadWeblogHelpers(pageContext, model);
-            RenderModelLoader.loadPluginHelpers(weblog, model);
 
             // Feeds get weblog's custom models too
             RenderModelLoader.loadCustomModels(weblog, model, initData);

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=417044&r1=417043&r2=417044&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 Sun Jun 25 12:33:50 2006
@@ -192,10 +192,10 @@
     
     /** Get number of approved non-spam comments for entry */
     public int getCommentCount(String entryId, boolean noSpam, boolean approvedOnly) {
-        try {
+        /*try {
             WeblogEntryData entry = mWeblogMgr.getWeblogEntry(entryId);
             return entry.getComments(noSpam, approvedOnly).size();
-        } catch (RollerException alreadyLogged) {}
+        } catch (RollerException alreadyLogged) {}*/
         return 0;
     }
     



Mime
View raw message