XML- RPC
Actions
Edit
Add New Page
Add New Child Page
Copy
Move
Refresh
History
Delete
Set Access
Printable
Create Attachment
Referring Pages
Actions
Tags
Action
Post
Page Template
Default Template
Information
Documentation
Release Notes
Support
License
About
Home
My Pages
My Journal
My Photo Album
My Notes
Sandbox
Site Reference
Pages Index
Wiki Journal
Missing Pages
Site Explorer
Deleted Pages
Look & Feel
Left Menu
Top Menu
Page
Styles
Images and Icons
Administration
Users & Groups
Access Rights
System
OpenForum Settings
Documentation
Actions
Extensions
Jar Manager
Issue Tracking
Source Code
Post Action
Processes
XML-RPC
requests using sjs
Parameters
Post Data
xml? - The method request
Usage:
-Example-
file.attachmentExists
/Home
page.wiki
file.attachmentExists
/Home
page.wiki
Server Side Javascript for POST method
post.sjs
formBased = transaction.getParameter("formBased"); try{ if(formBased!=null && formBased=="true") { transaction.getPostData(); xmlData = transaction.getPostParameter("xml"); } else { transaction.getRawPostData(); xmlData = transaction.getPostParameter("data"); } } catch(e) { file.saveAttachment( "/OpenForum/Actions/XML-RPC","exception.txt",e ); transaction.sendPage(e); return; } file.saveAttachment( "/OpenForum/Actions/XML-RPC","request.xml",xmlData ); xmlDoc = js.getStringAsXml( xmlData ); methodName = xmlDoc.getElementByName("methodName").getValue(); methodCall = methodName+"("; params = xmlDoc.getElementByName("params"); for(loop=0;loop
0) { methodCall += ","; } if(param.getName().equals("string")) { methodCall += "\""+param.getValue()+"\""; } } methodCall += ");"; try{ resultValue = eval(methodCall); } catch(e) { transaction.sendPage(e); return; } resultXml = js.getStringAsXml("
"); value = resultXml.addChild("params").addChild("param").addChild("value").addChild("string"); value.setValue(resultValue); transaction.sendPage( "\n"+resultXml.toXml() );
by Anon on 21/04/2008 at 10:09 PM