Author: christian.bauer(a)jboss.com
Date: 2008-05-21 04:11:08 -0400 (Wed, 21 May 2008)
New Revision: 8243
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
Log:
Outdated feed entries are purged on persist, not only on update
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java 2008-05-21
07:38:53 UTC (rev 8242)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java 2008-05-21
08:11:08 UTC (rev 8243)
@@ -171,6 +171,8 @@
historicalCopy = new WikiDocument();
historicalCopy.flatCopy(getInstance(), true);
+ purgeFeedEntries();
+
return true;
}
@@ -221,11 +223,7 @@
setPushOnSiteFeed(false);
}
- // Feeds should not be removed by a maintenance thread: If there
- // is no activity on the site, feeds shouldn't be empty but show the last
updates.
- Calendar oldestDate = GregorianCalendar.getInstance();
- oldestDate.add(Calendar.DAY_OF_YEAR,
-Preferences.instance().get(WikiPreferences.class).getPurgeFeedEntriesAfterDays().intValue());
- feedDAO.purgeOldFeedEntries(oldestDate.getTime());
+ purgeFeedEntries();
// Write history log and prepare a new copy for further modification
if (!isMinorRevision()) {
@@ -367,6 +365,14 @@
return "wikiDocumentFeedEntryManager";
}
+ protected void purgeFeedEntries() {
+ // Feeds should not be removed by a maintenance thread: If there
+ // is no activity on the site, feeds shouldn't be empty but show the last
updates.
+ Calendar oldestDate = GregorianCalendar.getInstance();
+ oldestDate.add(Calendar.DAY_OF_YEAR,
-Preferences.instance().get(WikiPreferences.class).getPurgeFeedEntriesAfterDays().intValue());
+ feedDAO.purgeOldFeedEntries(oldestDate.getTime());
+ }
+
/* -------------------------- Public Features ------------------------------ */
// TODO: We need to duplicate this here, otherwise it will only validated on
persist():
http://jira.jboss.com/jira/browse/JBSEAM-2671