Author: agilliland
Date: Fri Jan 13 16:14:01 2006
New Revision: 368930

URL: http://svn.apache.org/viewcvs?rev=368930&view=rev
Log:
allow users to control the number of entries displayed via the weblog settings 
page.

- added a new column "displaycnt" to website table
- updated WebsiteData to hold new entryDisplayCount attribute
- updated edit-website.jsp to include new form field for display count
- update showWeblogEntries macros to use website display count


Modified:
    incubator/roller/trunk/metadata/database/200-to-210-migration.vm
    incubator/roller/trunk/metadata/database/createdb.vm
    incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java
    incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/trunk/web/WEB-INF/classes/weblog.vm
    incubator/roller/trunk/web/website/edit-website.jsp

Modified: incubator/roller/trunk/metadata/database/200-to-210-migration.vm
URL: 
http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/200-to-210-migration.vm?rev=368930&r1=368929&r2=368930&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/200-to-210-migration.vm (original)
+++ incubator/roller/trunk/metadata/database/200-to-210-migration.vm Fri Jan 13 
16:14:01 2006
@@ -18,3 +18,7 @@
 
 -- If you don't already have this, you need it:
 create index we_status_idx on weblogentry(status);
+
+
+-- Add weblog displaydays column
+#addColumnNotNull("website" "displaycnt" "integer" "15")
\ No newline at end of file

Modified: incubator/roller/trunk/metadata/database/createdb.vm
URL: 
http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/createdb.vm?rev=368930&r1=368929&r2=368930&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/createdb.vm (original)
+++ incubator/roller/trunk/metadata/database/createdb.vm Fri Jan 13 16:14:01 
2006
@@ -105,7 +105,8 @@
     blacklist            $TEXT_SQL_TYPE,
     defaultallowcomments $BOOLEAN_SQL_TYPE_TRUE not null,
     defaultcommentdays   integer default 7 not null,
-    commentmod           $BOOLEAN_SQL_TYPE_FALSE not null    
+    commentmod           $BOOLEAN_SQL_TYPE_FALSE not null,
+    displaycnt        integer default 15 not null
 );
 create index ws_userid_idx    on website(userid);
 create index ws_isenabled_idx on website(isenabled);

Modified: incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java
URL: 
http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java?rev=368930&r1=368929&r2=368930&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java Fri Jan 13 
16:14:01 2006
@@ -39,8 +39,7 @@
 {
     public static final long serialVersionUID = 206437645033737127L;
     
-    private static Log mLogger = 
-        LogFactory.getFactory().getInstance(WebsiteData.class);
+    private static Log mLogger = LogFactory.getLog(WebsiteData.class);
     
     // Simple properties
     private String  id = null;
@@ -65,6 +64,7 @@
     private Boolean defaultAllowComments = Boolean.TRUE;
     private int defaultCommentDays = 0;
     private Boolean moderateComments = Boolean.FALSE;
+    private int entryDisplayCount = 15;
        
     // Associated objects
     private UserData creator = null; // TODO: decide if website.user is needed
@@ -906,7 +906,8 @@
         this.timeZone = other.getTimeZone();
         this.defaultPlugins = other.getDefaultPlugins();
         this.enabled = other.getEnabled();
-        this.dateCreated = getDateCreated();
+        this.dateCreated = other.getDateCreated();
+        this.entryDisplayCount = other.getEntryDisplayCount();
     }
     
     /**
@@ -1054,6 +1055,23 @@
     public void setAdminUserCount(int adminUserCount) 
     {
         // no-op
+    }
+
+    
+    /**
+     * @roller.wrapPojoMethod type="simple"
+     * @ejb:persistent-field
+     * @hibernate.property column="displaycnt" not-null="true"
+     */
+    public int getEntryDisplayCount() {
+        return entryDisplayCount;
+    }
+
+    /**
+     * @ejb:persistent-field
+     */
+    public void setEntryDisplayCount(int entryDisplayCount) {
+        this.entryDisplayCount = entryDisplayCount;
     }
     
 }

Modified: 
incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties
URL: 
http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties?rev=368930&r1=368929&r2=368930&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties 
(original)
+++ incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources.properties 
Fri Jan 13 16:14:01 2006
@@ -1465,6 +1465,7 @@
 line to be added to the blacklist used to check comments, trackbacks and 
referrers.
 websiteSettings.editorSettings=Editor
 websiteSettings.commentSettings=Comments
+websiteSettings.entryDisplayCount=Number of entries to display on weblog
 
 websiteSettings.button.update=Update Weblog Settings
 websiteSettings.button.rebuildIndex=Rebuild Search Index

Modified: incubator/roller/trunk/web/WEB-INF/classes/weblog.vm
URL: 
http://svn.apache.org/viewcvs/incubator/roller/trunk/web/WEB-INF/classes/weblog.vm?rev=368930&r1=368929&r2=368930&view=diff
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/weblog.vm (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/weblog.vm Fri Jan 13 16:14:01 
2006
@@ -160,6 +160,7 @@
  * @param category   Only display weblog entries from this category.
  *#
 #macro( showWeblogEntriesInCategory $pageName $maxEntries $category )
+    #set( $maxEntries = $website.entryDisplayCount )
     #if ( $pageModel.getWeblogEntry() )
         #set( $entry = $pageModel.getWeblogEntry() )
     #end
@@ -212,6 +213,15 @@
  *#
 #macro( showWeblogEntries $pageName $maxEntries )
 #showWeblogEntriesInCategory($pageName $maxEntries 'nil')
+#end
+
+#**
+ * Shows weblog entries using the standard "_day" template for
+ * the display of each day. The number of entries to display is controlled
+ * by the entryDisplayCount property under weblog settings.
+ *#
+#macro( displayWeblogEntries )
+#showWeblogEntriesInCategory("_day" 15 'nil')
 #end
 
 #**

Modified: incubator/roller/trunk/web/website/edit-website.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/roller/trunk/web/website/edit-website.jsp?rev=368930&r1=368929&r2=368930&view=diff
==============================================================================
--- incubator/roller/trunk/web/website/edit-website.jsp (original)
+++ incubator/roller/trunk/web/website/edit-website.jsp Fri Jan 13 16:14:01 2006
@@ -70,6 +70,12 @@
        </td>
         <td class="description"><%-- <fmt:message key="websiteSettings.tip." 
/> --%></td>
     </tr>
+    
+    <tr>
+        <td class="label"><fmt:message key="websiteSettings.entryDisplayCount" 
/></td>
+        <td class="field"><html:text property="entryDisplayCount" 
size="4"/></input></td>
+        <td class="description"><%-- <fmt:message key="websiteSettings.tip." 
/> --%></td>
+    </tr>
 
     
     <%-- ***** Comment settings ***** --%>


Reply via email to