JsonStore Module
From OpenSimulator
(Created page with "== Introduction == The JsonStore module enables scripts and region modules to share structured data among themselves. == Enabling the Module == == JsonStore Path Syntax =...") |
Revision as of 15:06, 17 April 2012
Introduction
The JsonStore module enables scripts and region modules to share structured data among themselves.
Enabling the Module
JsonStore Path Syntax
JsonStore Value Syntax
JsonStore Script Functions
- JsonCreateStore
- JsonDestroyStore
- JsonReadNotecard
- JsonWriteNotecard
- JsonTestPath/JsonTestPathJson
- JsonGetValue/JsonGetValueJson
- JsonTakeValue/JsonTakeValueJson
- JsonReadValue/JsonReadValueJson
- JsonSetValue/JsonSetValueJson
key storeID = JsonCreateStore(string jsonvalue)
Create a JsonStore and initialize it using the Json encoded value. The new store identifier is returned.
integer status = JsonDestroyStore(key storeID)
Destroy the JsonStore associated with the provided identifier. Return 1 if the operation is successful.
key requestID = JsonReadNotecard(key storeID, string path, key assetID)
Request that the Json encoded content of a notecard be decoded and placed in the structure in the store at the given path. The function returns the request identifier. When the operation completes, a link_message event is generated with the request identifier.
key requestID = JsonWriteNotecard(key storeID, string path, string notecard)
Request that the value identified by the given path be Json encoded and written to the notecard. The function returns the request identifier. When the operation completes, a link_message event is generated with the request identifier.
int status = JsonTestPath(key storeID, string path)
int JsonTestPathJson(key storeID, string path)
Check to see if there is a value identified by the path. In the case of JsonTestPath() the value must be a string. In the case of JsonTestPathJson() the value can be a string, an array, or a dictionary. The function returns 1 when there is an appropriate value.