Scarab commit: svn commit: r10337 - trunk/src/java/org/tigris/scarab/xmlrpc/ScarabUpdateHandlerClient.java

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: ptillemans
Date: 2006-11-07 18:23:02-0800
New Revision: 10337

Added:
   trunk/src/java/org/tigris/scarab/xmlrpc/ScarabUpdateHandlerClient.java   (contents, props changed)

Log:
SCB2124: Synchronize a drop down list with an external list of values using xmlrpc

Added: trunk/src/java/org/tigris/scarab/xmlrpc/ScarabUpdateHandlerClient.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/xmlrpc/ScarabUpdateHandlerClient.java?view=auto&rev=10337
==============================================================================
--- (empty file)
+++ trunk/src/java/org/tigris/scarab/xmlrpc/ScarabUpdateHandlerClient.java	2006-11-07 18:23:02-0800
@@ -0,0 +1,58 @@
+package org.tigris.scarab.xmlrpc;

+

+import java.net.URL;

+import java.util.Vector;

+

+import org.apache.fulcrum.xmlrpc.DefaultXmlRpcClientComponent;

+import org.apache.fulcrum.xmlrpc.XmlRpcClientComponent;

+

+/**

+ * This class is just an example of invoking the SimpleHandler class via

+ * the XmlRpc service.

+ * 

+ * @author jorgeuriarte

+ * @see org.tigris.scarab.util.SimpleHandler

+ *

+ */

+public class ScarabUpdateHandlerClient

+{

+

+    public void testXmlRpc() throws Exception

+    {

+        XmlRpcClientComponent cli = new DefaultXmlRpcClientComponent();

+        Vector v = new Vector();

+        Vector o = new Vector();

+        v.add("Status");            // Module

+        

+        o.add("Newer");                  // IssueID

+        o.add("Closed");                  // IssueID

+        o.add("Killed");                  // IssueID

+        o.add("Dunno");                  // IssueID

+        v.add(o);

+        

+        Vector vRdo = (Vector)cli.executeRpc(new URL("http://localhost:12345/dmm"), "dmm.updateAttributeOptions", v);

+        System.out.println("The call was successful: " + (vRdo.get(0)));

+        System.out.println("The comment was added: " + vRdo.get(1));

+

+        

+        v = new Vector();

+        v.add("Status");            // Module

+        vRdo = (Vector)cli.executeRpc(new URL("http://localhost:12345/dmm"), "dmm.sortAttributeOptions", v);

+

+        System.out.println("The call was successful: " + (vRdo.get(0)));

+        System.out.println("The comment was added: " + vRdo.get(1));

+    }

+    

+    public static void main(String args[])

+    {

+        ScarabUpdateHandlerClient shc = new ScarabUpdateHandlerClient();

+        try

+        {

+            shc.testXmlRpc();

+        }

+        catch (Exception e)

+        {

+            System.err.println("Error invoking service: " + e);

+        }

+    }

+} 
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.