This is an auto-generated topic for <a href="
http://modxcms.com/extras/package/605">SIMPLX_RPC 0.1-alpha</a> by larscwallin.
Brief Description:
SIMPLX RPC - by Lars C Wallin
Version 0.1 - 091120
* What is this Snippet anyway?
SIMPLX RPC is a remote method invocation Snippet which makes it possible to call the ModX API from the client browser using XMLHTTP or similar. This means that you can fetch (for now...) data from ModX without reloading the page. This means more interactive, dynamic, responsive, personal web sites
The RPC (Remote Procedure Call) capability has been missing for too long in ModX i think. Well it turned out to be a real piece of cake to code it (much thanks to the simplicity of the ModX API but also thanks to the built in support for json in PHP). So here you are
This Snippet simply wraps the modx API (
http://wiki.modxcms.com/index.php/Ja:API:DocumentParser) with the json-rpc protocol (
http://groups.google.com/group/json-rpc/web/json-rpc-1-2-proposal).
It should match the documented API spot on i think.
Note that this implementation uses named parameters. This means that the parameters collection must be
represented as a JavaScript object with key/value pairs. This ensures that parameter sequence is not an
issue when calling in method calls.
* Why did i make it a Snippet?
Well because it was the simplest and most plug-n-play way to do it. Also, what you get out-of-the-box by making it a Snippet is the ability to have access control over the remote api using the built in ModX security (as the remote service is just a document in ModX).
* Whats next
- Error handeling (according to the json-rpc spec.)
- Security considerations
- Create Update Delete features
* IMPORTANT
Please respect the SIMPLX_ namespace as i will make more contributions within it.