I decided to re-engineer it from the ground up. JPolite V2 is then a complete re-design from the ground up with nothing from V1 except for the look & feel. The code structure is much clearer which makes it easier for customization, as well as integration with other jQuery plugins.
A new feature that is now being tested with JPolite is called XDO (XML Data Object), which currently supports JSON objects only. The whole idea is based on some discussion around “Thin Server Architecture” and REST architecture style, that a browser client first construct the foundation of a web app with STATIC content (HTML, CSS and JavaScript) from a web server, and then exchange only DATA (XML, JSON, TXT) with the application server, which relieves the server from the burden of generating HTML markup. This feature is still experimental with lots enhancements expected.
I'm working on a project that uses data in JSON format (www.json.org). It took me a while to get it going in processing, so I thought I'd post what I did here. If there's a better way (which undoubtedly there is!), please let me know.
Andrew Odewahn
--
Here are the steps I took (on Windows):
1. Download http://www.json.org/java/json.zip from json.org. Save it in a some directory, which I'll call %DOWNLOAD_HOME%.
2. Unzip it. Be sure you preserve the archive's directory structure (/org/json/) when you unzip the file.
3. Change directory into %DOWNLOAD_HOME%orgjson
JSON ... it's the intersection of all modern programming languages. All languages have some sense of data, and structures of data. They all have simple values like number strings, and booleans. They all have some sense of a sequence of values. ... Every language has some sense of a collection of named values; it might be an object, or a record, or a struct, or a hash, or a property list, or something. All languages have these, these are universal ideas.
... But they all have the same idea about what the data looks like, and JSON has the thing that's common to everything. By being at the intersection, it turns out to be the thing that everybody can agree on, so it's really easy to pass data back and forth.
Prior data interchange formats tended to try to be the union of all the languages, and that turns out to be horrendously complex, and very difficult to deal with. JSON, by being so simple, actually became really easy to use.
Features: * Multiple Data Representations: Treemaps, Radial Layouts, HyperTrees/Graphs, SpaceTree-like Layouts, and more... * Major Browsers Support: IE6+, Firefox2+, Safari3+, Opera9.5+ * Open Source: Licensed under the BSD License * Library Agnostic: You may use the JIT with your favorite DOM manipulation framework * Extensible: All visualization classes are mutable, so you can easily add/override any method you want. * Composable: Visualizations can be combined in order to create new visualization methods.
Firstly, define all the necessary information for a given module ID in _modules variable, e.g.,
...
m301:{l:"m301.html", t:"Module Definition"},
m302:{l:"m302.html", t:"Layout Definition"},
m303:{l:"m303.html", t:"Column Width Definition", c:"green"},
...
Wherein:
There are actually 3 protocols and 2 APIs that are used in Wave:
- Federation (XMPP)
- The robot protocol (JSONRPC)
- The gadget API (OpenSocial)
- The wave embed API (Javascript)
- The client-server protocol (As defined by GWT)
The last one in that list is really nothing that needs to be, or will probably ever be documented, it is generated by GWT and when you build your own Wave client you will need to define how it talks to your Wave server. The rest of the protocols and APIs are based on existing technologies.
google.visualization.Query.setResponse({
version: '0.6',
status: 'ok',
sig: '202289222',
table: {
cols: [{
id: 'A',
label: 'Name',
type: 'string',
pattern: ''
},
{
id: 'B',
label: 'Value',
type: 'number',
pattern: '#0.###############'
}],
rows: [{
c: [{
v: 'One'
},
{
v: 1.0,
f: '1'
}]
},
{
c: [{
v: 'Ten'
},
{
v: 10.0,
f: '10'
}]
}]
}
});
( pretty printed by http://jsbeautifier.org/ )