Skip to content

Commit

Permalink
Added delete method support
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram0 committed Aug 5, 2010
1 parent f2f9cd3 commit 42a9760
Showing 1 changed file with 83 additions and 21 deletions.
104 changes: 83 additions & 21 deletions wordpress/wordpress.post.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down Expand Up @@ -192,6 +194,7 @@
]]></execute>
</insert>

<update itemPath="" produces="XML">
<urls>
<url/>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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.