[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action ...
Christian Bauer
christian at hibernate.org
Sat Aug 25 16:07:59 EDT 2007
User: cbauer
Date: 07/08/25 16:07:59
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/action
DocumentHome.java
Log:
Making feed entry generation more selective
Revision Changes Path
1.21 +13 -5 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DocumentHome.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- DocumentHome.java 25 Aug 2007 19:15:11 -0000 1.20
+++ DocumentHome.java 25 Aug 2007 20:07:59 -0000 1.21
@@ -87,8 +87,10 @@
// Create feed entries (needs identifiers assigned, so we run after persist())
if (outcome != null && getInstance().getReadAccessLevel() == UserRoleAccessFactory.GUESTROLE_ACCESSLEVEL && isPushOnFeeds()) {
- feedDAO.createFeedEntry(isPushOnSiteFeed(), getInstance());
+ feedDAO.createFeedEntry(getInstance(), isPushOnSiteFeed());
getEntityManager().flush();
+ pushOnFeeds = false;
+ pushOnSiteFeed = false;
}
return outcome;
@@ -100,12 +102,14 @@
syncFormToInstance(getParentDirectory());
// Update feed entries
- if (getInstance().getReadAccessLevel() == UserRoleAccessFactory.GUESTROLE_ACCESSLEVEL) {
+ if (getInstance().getReadAccessLevel() == UserRoleAccessFactory.GUESTROLE_ACCESSLEVEL && isPushOnFeeds()) {
feedDAO.updateFeedEntry(getInstance(), isPushOnSiteFeed());
- feedDAO.purgeOldFeedEntries();
+ pushOnFeeds = false;
+ pushOnSiteFeed = 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.
- }
+ feedDAO.purgeOldFeedEntries();
// Write history log and prepare a new copy for further modification
if (!isMinorRevision()) {
@@ -172,6 +176,10 @@
syncFormToInstance(getParentDirectory());
}
+ public boolean isSiteFeedEntryPresent() {
+ return feedDAO.findSiteFeedEntry(getInstance()) != null;
+ }
+
public boolean isPushOnFeeds() {
return pushOnFeeds;
}
More information about the jboss-cvs-commits
mailing list