I’m trying to parse a JSON from a rest service. This service does not put the data into the format that I think ItemFileReadStore wants, but I cannot change it. Everything I have found in the dojo library for reading JSON data requires an identifier, which my data does not have. This is the JSON data:
{"ChannelReadResponse":[
{"Event": {"@entityOrigin":"System","@entityId":"0x080e00000136ad8986520af104608052","Name":"Untitled","SymbolCode":"OHVPEV---------","TimeObserved":"2012-04-13T21:09:49.207Z","CreatedUser":"Helpdesk","ModifiedUser":"Helpdesk","CreatedTime":"2012-04-13T21:09:49.207Z","ModifiedTime":"2012-04-17T15:51:12.496Z"},
{“@entityOrigin”:”System”,”@entityId”:”0x080e00000136bb54ec770af104608028″,”Name”:”My Event”,”SymbolCode”:”OHVPE———-“,”Severity”:”SIGACT”,”Outcome”:”Effective”,”TimeObserved”:”2012-04-16T14:34:29.796Z”,”CreatedUser”:”Helpdesk”,”ModifiedUser”:”Helpdesk”,”CreatedTime”:”2012-04-16T14:34:29.796Z”,”ModifiedTime”:”2012-04-17T15:50:52.499Z”}
]
,”Channel”:{“@writable”:”false”,”@connected”:”true”,”@entityId”:”0x080e00000136ad8500760af104608064″,”Name”:”Ozone”,
“Members”:{“Member”:[{“@entityOrigin”:”System”,”@entityRef”:”0x080e00000136ad8986520af104608052″},{“@entityOrigin”:”System”,”@entityRef”:”0x080e00000136bb54ec770af104608028″}]
}}},
{“Event”: {“@entityOrigin”:”System”,”@entityId”:”0x080e00000136bc3c92d80af104608042″,”Name”:”From2″,”SymbolCode”:”OHVPE———-“,”TimeObserved”:”2012-04-16T19:43:03.150Z”,”CreatedUser”:”Helpdesk”,”ModifiedUser”:”Helpdesk”,”CreatedTime”:”2012-04-16T19:43:03.150Z”,”ModifiedTime”:”2012-04-16T19:43:03.150Z”},
“Channel”: {“@writable”:”false”,”@connected”:”true”,”@entityId”:”0x080e00000136bc3c92d80af104608034″,”Name”:”Ozone2″,
“Members”:{“Member”:{“@entityOrigin”:”System”,”@entityRef”:”0x080e00000136bc3c92d80af104608042″}}}
]}
]}
Is there any way to work with this data? I specifically want all the Events out of it.
Just massage it into the form that the store wants. For example, if you get the data back in a variable called ‘data’, you could easily just do:
Then just use the
jsonobject in the store.