Posted by lexhung on July 1, 2006 at 4:43pm
This is the current XML-RPC interface used in Drupal Manager. The information provided here may differ from the implementation in the modules, but I'll update to match this post. This document is what I'll stick to when implementing the interface.
Interface of module remoteconfig
- struct remoteconfig.getConfigPageContent(string)
- Description : The configuration page contents includes a form structure similar to Drupal Form API but with some extended attributes like #subpages and modified #type (“form” à “_page”)
Param : string config_path : path to the configuration page.
Return : config page's content.
- struct remoteconfig.submitConfigPage(string, struct, string)
- Description : Submit a configuration page. The data that is submitted have structure
similar to the data being submitted from an HTML in variable $_POST['edit']
Param :
string config_path : path to the configuration page
struct submit_data : submit data structure
string operation : operation to be performed
Returns : array of messages (often from drupal_get_message())
Interface of module system_rpc
- struct system.login(string,string)
- Description :Log a user in the system. This function persist the session using Drupal builtin session management.
Param :
string username : username
string password : password
Return : user structure of the logged in user if sucess. Error code if failed. - array system.logout()
- Description: Log a user out of system.
Return : logout message. - array system.checkLogin()
-
Description : Check for cached session.
Return : user structure of the logged in user if sucess. Error code if failed.
Interface of module node_rpc
- array remoteconfig.getNodesListByQuery(struct, int, int)
- Description :Get a list of nodes sastify a query structure.
Param :
struct query_object : query_object
int pagesize : size of page each page
int pageno : index of page to retrieve
Return : a list of nodes info including nodes name, title and someother attributes. - struct remoteconfig.getNodeDetails(int)
- Description: Get detailed information about a node. Equivalent to node_load PHP function
Param : int nid : node's ID number.
Return : node's data structure - array remoteconfig.getNodeComments(int)
-
Description : Load an array of comments attached to a node
Param : int nid : node's ID number.
Return : array of comment structures attached to a node - struct remoteconfig.getNodeEditForm(int)
- Description : Get the form struct of a node
Param : int nid : node's ID number.
Return : node form's data structure - struct remoteconfig.submitNode(int, struct)
- Description : Submit a node.
Param : int nid : node's ID number.
struct node_data : node data collected by remote form.
Return : node form's data structure - struct remoteconfig.deleteNode(int)
- Description : Remove a node
Param : int nid : node's ID number.
Return : deletion status - struct remoteconfig.getNodeTypes()
- Description : Get the list of node types available
Return : array of node types
Interface of module taxonomy_rpc
- array taxonomy.getVocabularies()
- Description :Get a list of taxonomy vocabularies available
Return : an array of vocabularies name. - array taxonomy.getTermSubtree(int, int , int)
- Description: Get detailed information about a node. Equivalent to node_load PHP function
Param : int vid : vocabulary id number
int root : term's id of the base node
int depth : depth of tree to retrieve
Return : array of taxonomy terms
Comments
login?
does one pass login credentials with every request? that would be acceptable IMO.
login?
For now, I'm using Firefox built-in session management. The session id (PHPSESSID) will be passed together with every request made (stored in Cookie). In other browsers (or other applications) we can simulate this action by adding the variable PHPSESSID=session_id in Cookie field of the HTTP header (the session_id is returned after success login).
I think this approach may be a litle more secure and more convenient than have to store and passing username/password or including the session id in the method call.