See the dojox/rpc/JsonRest reference documentation for more information.
Parameter | Type | Description |
---|---|---|
service | undefined | |
id | undefined |
adds an object to the list of dirty objects. This object contains a reference to the object itself as well as a cloned and trimmed version of old object for use with revert.
Parameter | Type | Description |
---|---|---|
object | undefined | |
_deleting | undefined |
Saves the dirty data using REST Ajax methods
Parameter | Type | Description |
---|---|---|
kwArgs | undefined |
deletes an object
Parameter | Type | Description |
---|---|---|
object | undefined | object to delete |
Fetches a resource by an absolute path/id and returns a dojo.Deferred.
Parameter | Type | Description |
---|---|---|
absoluteId | undefined |
Creates or gets a constructor for objects from this service
Parameter | Type | Description |
---|---|---|
service | Function | String | |
schema | undefined |
Return the ids attribute used by this service (based on it's schema). Defaults to "id", if not other id is defined
Parameter | Type | Description |
---|---|---|
service | undefined |
Returns the REST service and the local id for the given absolute id. The result is returned as an object with a service property and an id property
Parameter | Type | Description |
---|---|---|
absoluteId | String | This is the absolute id of the object |
returns true if the item is marked as dirty or true if there are any dirty items
Parameter | Type | Description |
---|---|---|
item | undefined | |
store | undefined |
Parameter | Type | Description |
---|---|---|
service | undefined | |
id | undefined | |
args | undefined |
Registers a service for as a JsonRest service, mapping it to a path and schema
Parameter | Type | Description |
---|---|---|
service | Function | This is the service to register |
servicePath | String | This is the path that is used for all the ids for the objects returned by service |
schema | Object |
Optional This is a JSON Schema object to associate with objects returned by this service |
Reverts all the changes made to JSON/REST data
Parameter | Type | Description |
---|---|---|
service | undefined |
Parameter | Type | Description |
---|---|---|
actions | undefined | |
kwArgs | undefined |
This provides a HTTP REST service with full range REST verbs include PUT,POST, and DELETE.
A normal GET query is done by using the service directly:
var restService = dojox.rpc.Rest("Project"); restService("4");
This will do a GET for the URL "/Project/4".
restService.put("4","new content");
This will do a PUT to the URL "/Project/4" with the content of "new content".
You can also use the SMD service to generate a REST service:
var services = dojox.rpc.Service({services: {myRestService: {transport: "REST",... services.myRestService("parameters");
The modifying methods can be called as sub-methods of the rest service method like:
services.myRestService.put("parameters","data to put in resource"); services.myRestService.post("parameters","data to post to the resource"); services.myRestService['delete']("parameters");
Parameter | Type | Description |
---|---|---|
path | String | |
isJson | Boolean |
Optional
|
schema | Object |
Optional
|
getRequest | Function |
Optional
|