Permalink
Browse files

Added delete method support

  • Loading branch information...
vikram0 committed Aug 5, 2010
1 parent f2f9cd3 commit 42a9760229508b8f0ff44d5c540d5d5d971dac90
Showing with 83 additions and 21 deletions.
  1. +83 −21 wordpress/wordpress.post.xml
@@ -6,22 +6,24 @@
<bindings>
<insert itemPath="" produces="XML">
<urls>
- <url></url>
+ <url/>
+
</urls>
<inputs>
- <key id='username' type='xs:string' paramType='variable' required="true" />
- <key id='password' type='xs:string' paramType='variable' required="true" />
- <key id='blogurl' type='xs:string' paramType='variable' required="true" />
- <value id='allow_comments' type='xs:string' paramType='variable' required="false" default="1" />
- <value id='tags' type='xs:string' paramType='variable' required="false"/>
- <value id='keywords' type='xs:string' paramType='variable' required="false"/>
- <value id='convert_breaks' type='xs:string' paramType='variable' required="false" default="0" />
- <value id='title' type='xs:string' paramType='variable' required="true" />
- <value id='excerpt' type='xs:string' paramType='variable' required="false"/>
- <value id='description' type='xs:string' paramType='variable' required="true"/>
- <value id='moretext' type='xs:string' paramType='variable' required="false"/>
- <value id='allow_pings' type='xs:string' paramType='variable' required="false" default= "0" />
- <value id='publish' type='xs:string' paramType='variable' required="false" default= "1" />
+ <key id="username" type="xs:string" paramType="variable" required="true"/>
+ <key id="password" type="xs:string" paramType="variable" required="true"/>
+ <key id="blogurl" type="xs:string" paramType="variable" required="true"/>
+ <value id="allow_comments" type="xs:string" paramType="variable" required="false" default="1"/>
+ <value id="tags" type="xs:string" paramType="variable" required="false"/>
+ <value id="keywords" type="xs:string" paramType="variable" required="false"/>
+ <value id="convert_breaks" type="xs:string" paramType="variable" required="false" default="0"/>
+
+ <value id="title" type="xs:string" paramType="variable" required="true"/>
+ <value id="excerpt" type="xs:string" paramType="variable" required="false"/>
+ <value id="description" type="xs:string" paramType="variable" required="true"/>
+ <value id="moretext" type="xs:string" paramType="variable" required="false"/>
+ <value id="allow_pings" type="xs:string" paramType="variable" required="false" default="0"/>
+ <value id="publish" type="xs:string" paramType="variable" required="false" default="1"/>
</inputs>
<execute><![CDATA[
@@ -192,6 +194,7 @@
]]></execute>
</insert>
+
<update itemPath="" produces="XML">
<urls>
<url/>
@@ -382,16 +385,16 @@
]]></execute>
</update>
-
<select itemPath="" produces="XML">
<urls>
- <url></url>
+ <url/>
</urls>
<inputs>
- <key id='postid' type='xs:string' paramType='variable' required="true" />
- <key id='blogurl' type='xs:string' paramType='variable' required="true" />
- <key id='username' type='xs:string' paramType='variable' required="true" />
- <key id='password' type='xs:string' paramType='variable' required="true" />
+
+ <key id="postid" type="xs:string" paramType="variable" required="true"/>
+ <key id="blogurl" type="xs:string" paramType="variable" required="true"/>
+ <key id="username" type="xs:string" paramType="variable" required="true"/>
+ <key id="password" type="xs:string" paramType="variable" required="true"/>
</inputs>
<execute><![CDATA[
postData = <methodCall>
@@ -424,5 +427,64 @@
response.object = results;
]]></execute>
</select>
+ <delete itemPath="" produces="XML">
+ <urls>
+
+ <url/>
+ </urls>
+ <inputs>
+ <key id="username" type="xs:string" paramType="variable" required="true"/>
+ <key id="password" type="xs:string" paramType="variable" required="true"/>
+ <key id="blogurl" type="xs:string" paramType="variable" required="true"/>
+ <key id="postid" type="xs:string" paramType="variable" required="true"/>
+ </inputs>
+ <execute><![CDATA[
+ postData = <methodCall>
+ <methodName>metaWeblog.deletePost</methodName>
+ <params>
+ <param>
+ <value>
+ <string>1</string>
+ </value>
+ </param>
+ <param>
+ <value>
+ <string>{postid}</string>
+ </value>
+ </param>
+ <param>
+ <value>
+ <string>{username}</string>
+ </value>
+ </param>
+ <param>
+ <value>
+ <string>{password}</string>
+ </value>
+ </param>
+ <param>
+ <value>
+ <boolean>1</boolean>
+ </value>
+ </param>
+ </params>
+ </methodCall>;
+
+ url = blogurl + "/xmlrpc.php";
+ myRequest = y.rest(url);
+ myRequest.contentType("text/xml");
+ //myRequest.accept("text/xml");
+ myRequest.header("Connection", "close");
+ results = myRequest.put('<?xml version="1.0" encoding="UTF-8"?>' + postData.toString()).response;
+
+
+ //code = results.params.param.value.boolean.toString();
+
+ response.object = results;
+ //response.object = <code>{code}</code>;
+
+ ]]></execute>
+
+ </delete>
</bindings>
-</table>
+</table>

0 comments on commit 42a9760

Please sign in to comment.