roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r393340 - in /incubator/roller/branches/roller-newbackend/src/org/roller/presentation: weblog/actions/WeblogEntryFormAction.java xmlrpc/BloggerAPIHandler.java xmlrpc/MetaWeblogAPIHandler.java
Date Wed, 12 Apr 2006 00:21:15 GMT
Author: agilliland
Date: Tue Apr 11 17:21:12 2006
New Revision: 393340

URL: http://svn.apache.org/viewcvs?rev=393340&view=rev
Log:
cleaning up frontend use of WeblogEntry.save() and WeblogEntry.remove().


Modified:
    incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java
    incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
    incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java?rev=393340&r1=393339&r2=393340&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java
Tue Apr 11 17:21:12 2006
@@ -302,7 +302,6 @@
 
                 mLogger.debug("Saving entry");
                 weblogMgr.storeWeblogEntry(entry);
-                RollerFactory.getRoller().commit();
                 
                 mLogger.debug("Populating form");
                 form.copyFrom(entry, request.getLocale());
@@ -567,20 +566,16 @@
                     RollerSession.getRollerSession(request);
             if (     rses.isUserAuthorizedToAuthor(wd.getWebsite())
             || (rses.isUserAuthorized(wd.getWebsite()) && wd.isDraft()) ) {
-                // Flush the page cache
-                //PageCacheFilter.removeFromCache(request, wd.getWebsite());
-                //CacheManager.invalidate(wd);
                 
                 // remove the index for it
+                // TODO: can we do this in a better way?
                 wd.setStatus(WeblogEntryData.DRAFT);
                 reindexEntry(RollerFactory.getRoller(), wd);
                 
                 // remove entry itself
-                wd.remove();
-                RollerFactory.getRoller().commit();
+                mgr.removeWeblogEntry(wd);
                 
                 // flush caches
-                //PageCacheFilter.removeFromCache(request, wd.getWebsite());
                 CacheManager.invalidate(wd);
                 
                 ActionMessages uiMessages = new ActionMessages();

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java?rev=393340&r1=393339&r2=393340&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
Tue Apr 11 17:21:12 2006
@@ -73,15 +73,17 @@
         validate(entry.getWebsite().getHandle(), userid, password);
         
         try {
-            entry.remove();
-            roller.commit();
+            // delete the entry
+            weblogMgr.removeWeblogEntry(entry);
+            
+            // notify cache
             flushPageCache(entry.getWebsite());
         } catch (Exception e) {
             String msg = "ERROR in blogger.deletePost: "+e.getClass().getName();
             mLogger.error(msg,e);
-            e.printStackTrace();
             throw new XmlRpcException(UNKNOWN_EXCEPTION, msg);
         }
+        
         return true;
     }
     
@@ -322,9 +324,12 @@
                     entry.setStatus(WeblogEntryData.DRAFT);
                 }
                 
-                entry.save();
-                roller.commit();
+                // save the entry
+                weblogMgr.storeWeblogEntry(entry);
+                
+                // notify cache
                 flushPageCache(entry.getWebsite());
+                
                 return true;
             } catch (Exception e) {
                 String msg = "ERROR in BlooggerAPIHander.editPost";
@@ -374,6 +379,7 @@
         try {
             RollerRequest rreq = RollerRequest.getRollerRequest();
             Roller roller = RollerFactory.getRoller();
+            WeblogManager weblogMgr = roller.getWeblogManager();
             
             Timestamp current = new Timestamp(System.currentTimeMillis());
             
@@ -382,7 +388,7 @@
             entry.setText(content);
             entry.setPubTime(current);
             entry.setUpdateTime(current);
-            // TODO: fix from backend refactoring
+            // TODO BACKEND: fix from backend refactoring
             //entry.setCreator(roller.getUser());
             entry.setWebsite(website);
             entry.setCategory(website.getBloggerCategory());
@@ -391,8 +397,11 @@
             } else {
                 entry.setStatus(WeblogEntryData.DRAFT);
             }
-            entry.save();
-            roller.commit();
+            
+            // save the entry
+            weblogMgr.storeWeblogEntry(entry);
+            
+            // notify cache
             flushPageCache(entry.getWebsite());
 /*
             String blogUrl = Utilities.escapeHTML(

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java?rev=393340&r1=393339&r2=393340&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java
Tue Apr 11 17:21:12 2006
@@ -157,8 +157,10 @@
                 entry.setCategory(cd);
             }
             
-            entry.save();
-            roller.commit();
+            // save the entry
+            weblogMgr.storeWeblogEntry(entry);
+            
+            // notify cache
             flushPageCache(entry.getWebsite());
             
             // TODO: Roller timestamps need better than 1 second accuracy
@@ -253,8 +255,10 @@
                 entry.setCategory(website.getBloggerCategory());
             }
             
-            entry.save();
-            roller.commit();
+            // save the entry
+            weblogMgr.storeWeblogEntry(entry);
+            
+            // notify cache
             flushPageCache(entry.getWebsite());
             
             // TODO: Roller timestamps need better than 1 second accuracy



Mime
View raw message