logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

roller/src/org/roller/presentation/weblog/actions WeblogEntryFormAction.jav: msg#00065

Subject: roller/src/org/roller/presentation/weblog/actions WeblogEntryFormAction.java,1.36,1.37
Update of /cvsroot/roller/roller/src/org/roller/presentation/weblog/actions
In directory 
sc8-pr-cvs1:/tmp/cvs-serv18011/src/org/roller/presentation/weblog/actions

Modified Files:
        WeblogEntryFormAction.java 
Log Message:
Refactoring weblogs.com ping : sorry untested.

Index: WeblogEntryFormAction.java
===================================================================
RCS file: 
/cvsroot/roller/roller/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** WeblogEntryFormAction.java  9 Jun 2003 15:44:47 -0000       1.36
--- WeblogEntryFormAction.java  9 Jun 2003 21:03:43 -0000       1.37
***************
*** 5,11 ****
  import java.sql.Timestamp;
  import java.util.ArrayList;
- import java.util.Hashtable;
  import java.util.ListIterator;
- import java.util.Vector;
  
  import javax.servlet.ServletException;
--- 5,9 ----
***************
*** 21,26 ****
  import org.apache.struts.action.ActionMapping;
  import org.apache.struts.actions.DispatchAction;
- import org.apache.xmlrpc.XmlRpcClient;
- import org.apache.xmlrpc.XmlRpcException;
  import org.roller.model.RollerSpellCheck;
  import org.roller.model.UserManager;
--- 19,22 ----
***************
*** 37,40 ****
--- 33,37 ----
  import org.roller.presentation.weblog.formbeans.WeblogEntryFormEx;
  import org.roller.presentation.weblog.tags.EditWeblogCalendarModel;
+ import org.roller.presentation.xmlrpc.RollerXmlRpcClient;
  
  import com.swabunga.spell.event.SpellCheckEvent;
***************
*** 212,216 ****
                      String url = 
RollerContext.getRollerContext(request).createEntryPermalink(entry,request,true);
                      String blogName = entry.getWebsite().getName();
!                     String result = sendWeblogsPing(url, blogName);
                      if (result != null) // error condition
                      {
--- 209,213 ----
                      String url = 
RollerContext.getRollerContext(request).createEntryPermalink(entry,request,true);
                      String blogName = entry.getWebsite().getName();
!                     String result = RollerXmlRpcClient.sendWeblogsPing(url, 
blogName);
                      if (result != null) // error condition
                      {
***************
*** 233,265 ****
      }
  
-     /**
-      * 
-      */
-     private String sendWeblogsPing(String blogUrl, String blogName)
-     {
-         String postTo = "http://rpc.weblogs.com:80/RPC2";;
-         try
-         {            
-             XmlRpcClient client = new XmlRpcClient(postTo);
-             Vector params = new Vector();
-             params.addElement(blogName);
-             params.addElement(blogUrl);
-             Hashtable result = 
(Hashtable)client.execute("weblogUpdates.ping", params);
-             Boolean error = (Boolean)result.get("flerror");
-             if (error.booleanValue())
-                 return (String)result.get("message");
-         }
-         catch (IOException ioe)
-         {
-             ioe.printStackTrace();
-             return "Unable to connect.";
-         }
-         catch (XmlRpcException xre)
-         {
-             xre.printStackTrace();
-             return "Bad response.";
-         }
-         return null;
-     }
  
      //-----------------------------------------------------------------------
--- 230,233 ----




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.


<Prev in Thread] Current Thread [Next in Thread>