Raw and ugly connector to access Smalldb interface from outter world. More...

Public Member Functions | |
| main () | |
| Block body. | |
Public Member Functions inherited from BackendBlock | |
| __construct ($smalldb) | |
| Setup block to act as expected. More... | |
Public Attributes | |
| const | force_exec = true |
| Block must be always executed. | |
Protected Attributes | |
| $inputs | |
| Block inputs. More... | |
| $outputs | |
| Block inputs. More... | |
Protected Attributes inherited from BackendBlock | |
| $smalldb | |
| Smalldb backend obtained from block storage. | |
Raw and ugly connector to access Smalldb interface from outter world.
Following examples assume that this block is located at http://example.com/smalldb-api/ and input id is connected to router's path_tail, so any additional path in uRL is interpreted as entity ID.
HTTP GET: http://example.com/smalldb-api/state/machine/id
State machine ID, state and properties are JSON encoded and sent back.
HTTP GET: http://example.com/smalldb-api/?filter1=value1&filter2=value2&...
Entire $_GET is passed as an only argument to StateMachine::AbstractBackend::createListing().
Return value is JSON encoded and sent back.
HTTP POST: http://example.com/smalldb-api/state/machine/id DATA: action, args_json
action is the action to be invoked, args_json contains JSON encoded list of arguments passed to StateMachine::Reference::__call().
Return value is JSON encoded and sent back.
|
protected |
Block inputs.
|
protected |
Block inputs.
1.8.8