Ajax pagination and sorting

Ajax Optimisations

I have optimized the grid to load much faster and it is reaching a very usable speed.  The problem is I had to remove some good data from the API call in order to get this speed.  For testing, it is working fine.  I will now try to optimize the Grid class further so that I wont have to use such large API calls to retrieve all data and will still be able to display enough relevant information.  This data flaw is only related to the nodes list instantiation of the grid for choosing nodes for association for slices, other uses of the grid should be fine.

Adding sorting is still going to be a problem due to how slow our current sorting function are, relating to the dictionaries returned by API calls.  This is currently the main limitation of the grid and will apply to all future uses of grids anywhere in the GUI.  I will work on making stronger sorting functions in order to optimize this limitation.

AJAX and drupal

Need to get it to display in drupal GUI, currently the way drupal loads a page is by loading it all into a buffer then displaying it all at once rather than sequentially, this is preventing it from displaying withing drupal.  Ill need to look into how to get the Grid or any ajax functionality to load when the page is printed from a buffer. 

Sorting on column heads is also a work in progress.  Editing on the fly is also being tested and has a few bugs.  This will likely be how many pages will work now, allowing editing on the fly with no page reloads.  The slowness in teh grid is only tied to large API calls, with smaller filtered calls the AJAX loads are barely noticeable.

API Populated Grid Running

The grid has been built using the API instead of direct DB queries.  The porting from DB to API was much more complex than predicted, but a few more things were learned in the process.  The grid is a LOT slower now that it uses the API calls, it was almost instant using the DB, but now there is a 3-5 second delay in refreshing the data as you paginate.  More optimization of the PHP and JScript code will have to be made in order to speed this up.  Also, the grid does not display within drupals GUI as of now.

 Current Bugs:

  • long load time 
  • diplay in drupal GUI <

Restructuring Web Code

After discussions with Stephen about our functional web code, we are beginning an effort to write code in a much more modular easy to follow style, much more like the current API sturcture.  This means that all future updates and changes to the web will be geared toward simplifying the code we write by using more of both drupals features as well as the API itself.  Building more Classes of objects rather than creating each page with a seperate script. 

Stephen has also been working on rebuilding our functional web pages into drupal nodes/pages.  He talks about it here.  This is a cool idea because it will allow drupal to cache and search through our pages as well as using many other features within durpal that we have been unable to tap into due to the split nature of the website.

August 21, 2007

Having some problems swapping from a direct db access to using the API.  Because PHP scripts are called behind the scenes in an AJAX application, the session can be accessed at different points of the application, not just on page load.  This is casusing some confusion in development and we are working on syncing up the different session calls in the included PLC gui and those in the AJAX scripts.  Also, the sorting functions need to be rewritten to adapt to the new XSL style sheet as they no longer oppoerate properly.  The XSL syntax is very intricate and adhearing to it is fundamental to the effort of using these style sheets to begin with.

August 10, 2007

I have converted from the older javascript generates all AJAX model to a new one using XSL templating for XML output, simplifying both HTML and javascript code.  These new templates will allow the jscript to just apply HTML code to the XML data it recieves from any asynchronous calls made.  The Grid will now pull data from the API, break the results into smaller paginated array, send back an XML file to the script, aplly a XSL template to it and generate the new look for the page on the fly.  No refreshing of pages will be necessary for even updating these pages. 

More to come on the fun trail of learning XSL and how to properly template web 2.0 documents. 

August 6, 2007

A test AJAX grid has been built using a test MySQL database in order to make sure all functionality is working on the client side of the browser. The new paginating grid allows moving through pages of the data as well as updating any of this information to happen on the fly with no refreshing of the page. This will increase overall speed of accessing this data as well as ease of use viewing and finding relevent information.

Next is to change the code to use the API rather than direct database access which should be fairly straight forward but will require some tweaks to both the JScript code as well as the XSL style sheet (which is somewhat confusing and complex to do). Also, once that conversion is done, we will have to implement it within drupal and make sure all the displaying and CSS associated with the grid do not conflict or cause errors in the drupal GUI.

July 31, 2007

Discussion has started with users and 1Lab about how the node index and slice node mapping page should look now that we have federated PLCs and nodes. These nodes should appear different, but still have some uniformity within the list. We will be adding some sortable filters on each list so users can find federated nodes easier and differentiate them from local nodes. The slice node mapping page will have much more information for each node, be sortable by this information, and have some Comon data for each node so the slice user can make intelligent decisions about which nodes to add their sl
Syndicate content