AppliesTo: | Component: | Priority: | CurrentState: | WaitingFor: | TargetRelease | ReleasedIn |
---|---|---|---|---|---|---|
Extension | SetGetPlugin | Enhancement | Closed | patch | 6.0.2 |
%SET{ "normal" value="normal value" }%
/normal value/
%SET{ value="missing name" }%
//
//
%SET{ json_string = "json string value" }%
/json string value/
%SET{ json_n_string = "json string
new line" }%
/json string new line/
%SET{ array = [ 1, 2, 3 ] }%
/[1,2,3]/
%SET{ json_array = [ "a", "b", "c" ] }%
/["a","b","c"]/
%GET{ json_array[1] }%
/b/
%SET{ json_array[4] = "d" }%
%GET{ json_array }%
/["a","b","c",null,"d"]/
%SET{ new_array[1] = "x" }%
%GET{ new_array }%
/[null,"x"]/
%SET{ new_array[2] = "y" }%
%GET{ new_array }%
/[null,"x","y"]/
%GET{ persistent_array }%
/["a","b","c","d"]/
%SET{ persistent_array[1] = "x" remember="1" }%
%GET{ persistent_array }%
/["a","x","c","d"]/
%SET{ persistent_array[2] = "y" remember="1" }%
%GET{ persistent_array }%
/["a","x","y","d"]/
%SET{ persistent_array = [ "a", "b", "c", "d" ] remember="1" }%
%GET{ persistent_array }%
/["a","b","c","d"]/
%SET{ arrayOfArray = [ [ "a", "b", "c" ], [ "d", "e", "f" ], [ "g", "h", "i" ] ] }%
/[["a","b","c"],["d","e","f"],["g","h","i"]]/
%GET{ arrayOfArray[2] }%
/["g","h","i"]/
%GET{ arrayOfArray[2][1] }%
/h/
%SET{ json_object = { "a": "A", "b": "B", "c": "C" } }%
/{"c":"C","a":"A","b":"B"}/
%GET{ json_object.b }%
/B/
%SET{ json_object.d = "D" }%
%GET{ json_object }%
/{"c":"C","a":"A","b":"B","d":"D"}/
%SET{ new_object.x = "X" }%
%GET{ new_object }%
/{"x":"X"}/
%SET{ new_object.y = "Y" }%
%GET{ new_object }%
/{"y":"Y","x":"X"}/
%SET{ arrayOfObj = [ { "a": "A", "b": "B", "c": "C" }, { "d": "D", "e": "E", "f": "F" }, { "g": "G", "h": "H", "i": "I" } ] }%
/[{"c":"C","a":"A","b":"B"},{"e":"E","d":"D","f":"F"},{"h":"H","g":"G","i":"I"}]/
%GET{ arrayOfObj[2] }%
/{"h":"H","g":"G","i":"I"}/
%GET{ arrayOfObj[2].h }%
/H/
%GET{ arrayOfObj[2].x }%
/ERROR: Invalid JSON path, syntax or range./
%GET{ arrayOfObj }%
/[{"c":"C","a":"A","b":"B"},{"e":"E","d":"D","f":"F"},{"h":"H","g":"G","i":"I"}]/
%SET{ arrayOfObj[2].x = "X" }%
%GET{ arrayOfObj }%
/[{"c":"C","a":"A","b":"B"},{"e":"E","d":"D","f":"F"},{"h":"H","g":"G","x":"X","i":"I"}]/
%SET{ menu = { "File": { "New": [ "new", "F" ], "Open": [ "open", "F" ] }, "Edit": { "Copy": [ "cpy", "F" ], "Paste": [ "pst", "F" ] } } }%
/{"File":{"New":["new","F"],"Open":["open","F"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"]}}/
%SET{ menu.File.Open[1] = "T" }%
%GET{ menu }%
/{"File":{"New":["new","F"],"Open":["open","T"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"]}}/
%SET{ menu.Edit.Cut = [ "cut", "T" ] }%
%GET{ menu }%
/{"File":{"New":["new","F"],"Open":["open","T"]},"Edit":{"Copy":["cpy","F"],"Cut":["cut","T"],"Paste":["pst","F"]}}/
%SET{ complex = {"method": "handleMessage", "params": ["user1", "we were just talking"], "id": null, "array":[1,11,234,-5,1e5,1e7, true, false]} }%
/{"array":[1,11,234,-5,100000,10000000,true,false],"params":["user1","we were just talking"],"id":null,"method":"handleMessage"}/
%GET{ complex.array[3] }%
/-5/
%GET{ complex.params[1] }%
/we were just talking/
%SET{ complexWidget = {"widget": { "debug": "on", "window": { "title": "Sample Konfabulator Widget", "name": "main_window", "width": 500, "height": 500 }, "image": { "src": "Images/Sun.png", "name": "sun1", "hOffset": 250, "vOffset": 250, "alignment": "center" }, "text": { "data": "Click Here", "size": 36, "style": "bold", "name": "text1", "hOffset": 250, "vOffset": 100, "alignment": "center", "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" } }} }%
/{"widget":{"window":{"width":500,"name":"main_window","title":"Sample Konfabulator Widget","height":500},"text":{"hOffset":250,"vOffset":100,"name":"text1","style":"bold","data":"Click Here","size":36,"onMouseUp":"sun1.opacity = (sun1.opacity / 100) * 90;","alignment":"center"},"debug":"on","image":{"hOffset":250,"src":"Images/Sun.png","alignment":"center","vOffset":250,"name":"sun1"}}}/
%GET{ complexWidget.widget.window }%
/{"width":500,"name":"main_window","title":"Sample Konfabulator Widget","height":500}/
%GET{ complexWidget.widget.window.title }%
/Sample Konfabulator Widget/
%SET{ error = [ 1, 2, } ] }%
/ERROR: malformed JSON string, neither array, object, number, string or atom, at character offset 8 (before "} ]")/
ItemTemplate | |
---|---|
Summary | SET and GET with support for JSON objects and JSON path |
ReportedBy |
TWiki:Main.PeterThoeny![]() |
Codebase | ~twiki4, 6.0.1 |
SVN Range | TWiki-6.0.1-trunk, Thu, 15 Jan 2015, build 28675 |
AppliesTo | Extension |
Component | SetGetPlugin |
Priority | Enhancement |
CurrentState | Closed |
WaitingFor | |
Checkins |
TWikirev:28698![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
TargetRelease | patch |
ReleasedIn | 6.0.2 |