Friday 8 June 2007

Web Views Using AJAX Part 4 (Getting Data)

OK... I have a plan for the look and feel of my ViewR application now all I need is a way to get data into it. I have had a look at the XML returned from &readdesign and &readviewentries I know XML is a wonderful thing and we should all LOVE it to bits. However I am unimpressed by the speed at which the XML is parsed both by the server and in the client. I had a brief look at the JSON return that you can get in V7 using &outputformat=JSON and while better it still does not bring in all the data I would like (also the format may be changing in V8*)

So I think I am going to write and agent that will allow me to get the data back as formatted JS object assignment strings and then run the eval() function to load it into memory. I don't know if this will be any faster I hope so. This will not be in "proper" JSON format but one of my own devising.

A read at the help shows that if I use a NotesViewNavigator i should get the data in the format I need. Mind you I am concerned about the way record positioning between server GETs will be handled. Say the last served nav entry is at the 3rd document of a category Position 2.1.3.
There are another 2 entries in this category (2.1.4 and 2.1.5). I think that the GET that will handle the next page should do one of the following
  • Indicate that not all the records for this category are being displayed
  • Skip back to the last cat start to keep the docs in the context of the view's cats
The second of these options is fine for small datasets but what of large datasets with potentially large (100+) documents in each discrete category. Hmmmmmmmmmmmmmmmm.....

No comments:

Disqus for Domi-No-Yes-Maybe