You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2006/05/16 00:42:01 UTC

svn commit: r406759 - in /incubator/roller/trunk: metadata/database/230-to-240-migration.vm metadata/database/createdb.vm src/org/apache/roller/pojos/WebsiteData.java

Author: agilliland
Date: Mon May 15 15:42:00 2006
New Revision: 406759

URL: http://svn.apache.org/viewcvs?rev=406759&view=rev
Log:
adding new "lastmodified" field to website table for tracking the last time a weblog had a visible change.


Modified:
    incubator/roller/trunk/metadata/database/230-to-240-migration.vm
    incubator/roller/trunk/metadata/database/createdb.vm
    incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java

Modified: incubator/roller/trunk/metadata/database/230-to-240-migration.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/230-to-240-migration.vm?rev=406759&r1=406758&r2=406759&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/230-to-240-migration.vm (original)
+++ incubator/roller/trunk/metadata/database/230-to-240-migration.vm Mon May 15 15:42:00 2006
@@ -8,4 +8,4 @@
 
 #addColumnNotNull("pingtarget" "autoenabled" $BOOLEAN_SQL_TYPE $BOOLEAN_FALSE)
 
-
+alter table website add column lastmodified $TIMESTAMP_SQL_TYPE default null;

Modified: incubator/roller/trunk/metadata/database/createdb.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/metadata/database/createdb.vm?rev=406759&r1=406758&r2=406759&view=diff
==============================================================================
--- incubator/roller/trunk/metadata/database/createdb.vm (original)
+++ incubator/roller/trunk/metadata/database/createdb.vm Mon May 15 15:42:00 2006
@@ -107,7 +107,8 @@
     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
+    displaycnt        integer default 15 not null,
+    lastmodified       $TIMESTAMP_SQL_TYPE
 );
 create index ws_userid_idx    on website(userid);
 create index ws_isenabled_idx on website(isenabled);

Modified: incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java?rev=406759&r1=406758&r2=406759&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java Mon May 15 15:42:00 2006
@@ -15,6 +15,7 @@
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */
+
 package org.apache.roller.pojos;
 
 import java.util.ArrayList;
@@ -80,13 +81,15 @@
     private int     defaultCommentDays = 0;
     private Boolean moderateComments  = Boolean.FALSE;
     private int     entryDisplayCount = 15;
+    private Date    lastModified     = new Date();
     
     // Associated objects
     private UserData creator = null; // TODO: decide if website.user is needed
     private List     permissions = new ArrayList();
     private WeblogCategoryData bloggerCategory = null;
     private WeblogCategoryData defaultCategory = null;
-        
+    
+    
     public WebsiteData() {    
     }
     
@@ -822,6 +825,8 @@
         this.enabled = other.getEnabled();
         this.dateCreated = other.getDateCreated();
         this.entryDisplayCount = other.getEntryDisplayCount();
+        this.active = other.getActive();
+        this.lastModified = other.getLastModified();
     }
     
     /**
@@ -984,5 +989,28 @@
     
     /** No-op */
     public void setCommentModerationRequired(boolean modRequired) {}    
+
+    
+    /**
+     * The last time any visible part of this weblog was modified.
+     * This includes a change to weblog settings, entries, themes, templates, 
+     * comments, categories, bookmarks, folders, etc.
+     *
+     * Pings and Referrers are explicitly not included because pings to not
+     * affect visible changes to a weblog, and referrers change so often that
+     * it would diminish the usefulness of the attribute.
+     *
+     * @roller.wrapPojoMethod type="simple"
+     * @ejb:persistent-field
+     * @hibernate.property column="lastmodified" not-null="true"
+     */
+    public Date getLastModified() {
+        return lastModified;
+    }
+
+    public void setLastModified(Date lastModified) {
+        this.lastModified = lastModified;
+    }
+    
 }