roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gango...@apache.org
Subject svn commit: r333105 - in /incubator/roller/trunk/src/org/roller/presentation: bookmarks/actions/ weblog/actions/
Date Sun, 13 Nov 2005 20:04:54 GMT
Author: gangolli
Date: Sun Nov 13 12:04:50 2005
New Revision: 333105

URL: http://svn.apache.org/viewcvs?rev=333105&view=rev
Log:
Add page cache invalidation on actions related to bookmarks, folders, and referrers.

Modified:
    incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java
    incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java
    incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java
    incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java
    incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ReferersAction.java

Modified: incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java?rev=333105&r1=333104&r2=333105&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java
Sun Nov 13 12:04:50 2005
@@ -19,6 +19,7 @@
 import org.roller.pojos.PermissionsData;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
+import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.bookmarks.formbeans.BookmarkFormEx;
 
 /**
@@ -60,7 +61,8 @@
         {
             form.copyTo(bd, request.getLocale());
             bd.save();
-            RollerFactory.getRoller().commit();            
+            RollerFactory.getRoller().commit();
+            PageCacheFilter.removeFromCache(request,bd.getWebsite());
             request.setAttribute(
                 RollerRequest.FOLDERID_KEY, bd.getFolder().getId());
         }

Modified: incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java?rev=333105&r1=333104&r2=333105&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java
Sun Nov 13 12:04:50 2005
@@ -30,9 +30,11 @@
 import org.roller.model.RollerFactory;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
+import org.roller.pojos.WebsiteData;
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
+import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.bookmarks.formbeans.BookmarksForm;
 
 /**
@@ -97,8 +99,8 @@
         Roller roller = RollerFactory.getRoller();
         BookmarksPageModel pageModel = new BookmarksPageModel(
             request, response, mapping, (BookmarksForm)actionForm);
-        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(
-            pageModel.getFolder().getWebsite()))
+        WebsiteData website = pageModel.getFolder().getWebsite();
+        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
         {
             BookmarkManager bmgr = roller.getBookmarkManager();
             BookmarksForm form = (BookmarksForm)actionForm;
@@ -124,6 +126,7 @@
                 }
             }
             roller.commit();
+            PageCacheFilter.removeFromCache(request,website);
 
             // recreate model now that folder  is deleted
             pageModel = new BookmarksPageModel(
@@ -159,8 +162,9 @@
         BookmarksPageModel pageModel = new BookmarksPageModel(
             request, response, mapping, (BookmarksForm)actionForm);
         request.setAttribute("model", pageModel);
-        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(
-            pageModel.getFolder().getWebsite()))
+        WebsiteData website = pageModel.getFolder().getWebsite();
+
+        if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
         {
             try 
             {
@@ -206,6 +210,7 @@
                     }
                 }
                 roller.commit();
+                PageCacheFilter.removeFromCache(request,website);
                 saveMessages(request, messages);
             }
             catch (RollerException e)

Modified: incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java?rev=333105&r1=333104&r2=333105&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java
Sun Nov 13 12:04:50 2005
@@ -19,6 +19,7 @@
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
+import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.bookmarks.formbeans.FolderFormEx;
 
 /**
@@ -67,6 +68,7 @@
             form.copyTo(fd, request.getLocale());
             fd.save();
             RollerFactory.getRoller().commit();
+            PageCacheFilter.removeFromCache(request,website);
         }
         else
         {

Modified: incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java?rev=333105&r1=333104&r2=333105&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java
Sun Nov 13 12:04:50 2005
@@ -26,6 +26,7 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import org.roller.presentation.RollerSession;
+import org.roller.presentation.pagecache.PageCacheFilter;
 
 /////////////////////////////////////////////////////////////////////////////
 /**
@@ -114,6 +115,7 @@
                             rreq.getWebsite(), folderName, data);
                         
                         RollerFactory.getRoller().commit();
+                        PageCacheFilter.removeFromCache(request,rreq.getWebsite());
                     }
                     else 
                     {

Modified: incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ReferersAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ReferersAction.java?rev=333105&r1=333104&r2=333105&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ReferersAction.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/weblog/actions/ReferersAction.java
Sun Nov 13 12:04:50 2005
@@ -23,6 +23,7 @@
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
+import org.roller.presentation.pagecache.PageCacheFilter;
 
 /**
  * Display today's referers.
@@ -32,10 +33,10 @@
  * @struts.action-forward name="referers.page" path=".referers"
  */
 public class ReferersAction extends DispatchAction
-{    
-    private static Log mLogger = 
+{
+    private static Log mLogger =
         LogFactory.getFactory().getInstance(ReferersAction.class);
-        
+
     public ActionForward unspecified(
         ActionMapping       mapping,
         ActionForm          actionForm,
@@ -45,7 +46,7 @@
     {
         return view(mapping, actionForm, request, response);
     }
-    
+
     /**
      * execute
      */
@@ -60,20 +61,20 @@
         RefererManager refmgr = RollerFactory.getRoller().getRefererManager();
         try
         {
-            if (rreq.getWebsite() != null 
+            if (rreq.getWebsite() != null
                  && rollerSession.isUserAuthorizedToAuthor(rreq.getWebsite()) )
-            {   
+            {
                 BasePageModel pageModel = new BasePageModel(
                         "referers.todaysReferers", req, res, mapping);
                 req.setAttribute("model", pageModel);
                 req.setAttribute("pageHits",
                     new Integer(refmgr.getDayHits(rreq.getWebsite())));
-                    
+
                 req.setAttribute("totalHits",
                     new Integer(refmgr.getTotalHits(rreq.getWebsite())));
-                    
+
                 List refs = refmgr.getTodaysReferers(rreq.getWebsite());
-                req.setAttribute("referers",refs);        
+                req.setAttribute("referers",refs);
             }
         }
         catch (Exception e)
@@ -81,10 +82,10 @@
             mLogger.error("ERROR in action",e);
             throw new ServletException(e);
         }
-        
+
         return forward;
     }
-    
+
     public ActionForward reset(
         ActionMapping mapping, ActionForm form,
         HttpServletRequest req, HttpServletResponse res)
@@ -95,13 +96,14 @@
         RollerSession rollerSession = RollerSession.getRollerSession(req);
         try
         {
-            if (rreq.getWebsite() != null 
+            if (rreq.getWebsite() != null
                   && rollerSession.isUserAuthorizedToAuthor(rreq.getWebsite()) )
             {
                 RefererManager refmgr = RollerFactory.getRoller().getRefererManager();
                 WebsiteData website = rreq.getWebsite();
                 refmgr.forceTurnover(website.getId());
                 RollerFactory.getRoller().commit();
+                PageCacheFilter.removeFromCache(req,website);
             }
             this.servlet.log("ReferersAction.reset(): don't have permission");
         }
@@ -112,7 +114,7 @@
         }
         return view(mapping, form, req, res);
     }
-    
+
     public ActionForward delete(
             ActionMapping mapping, ActionForm form,
             HttpServletRequest req, HttpServletResponse res)
@@ -123,7 +125,7 @@
         RollerSession rollerSession = RollerSession.getRollerSession(req);
         try
         {
-            if (rreq.getWebsite() != null 
+            if (rreq.getWebsite() != null
                  && rollerSession.isUserAuthorizedToAuthor(rreq.getWebsite()) )
             {
                 RefererManager refmgr = RollerFactory.getRoller().getRefererManager();
@@ -137,11 +139,12 @@
                         refmgr.removeReferer(deleteIds[i]);
                     }
                     RollerFactory.getRoller().commit();
+                    PageCacheFilter.removeFromCache(req,website);
                     ActionMessages messages = new ActionMessages();
                     messages.add(null, new ActionMessage("referers.deletedReferers"));
                     saveMessages(req, messages);
                 }
-                else 
+                else
                 {
                     ActionErrors errors = new ActionErrors();
                     errors.add(null, new ActionError("referers.noReferersSpecified"));
@@ -158,4 +161,3 @@
         return view(mapping, form, req, res);
     }
 }
-



Mime
View raw message