CP2JavaWS 0.7 : remote tables browsing

Posted: June 2, 2009 in IT/Dev
Tags: , , , , , , , , , , ,

A new version of CP2JavaWS is available at sourceforge :

– New CP2JavaWSTableViewDelegate component, that manages retrieving of rows objects values automatically : triggers requests to the server through CP2JavaWS bridge classes when needed. It allows fast browsing of large table selection results without stressing the application server nor database server, and without requiring any pagination !

No GWT component, JSF or other provides that feature yet : they all use pagination (data splitted into multiple pages), that is less practical, less intuitive and slower to reach the desired element (if you have hundreds of elements you can’t have all pages number displayed, so you have to use many times forward/fast forward buttons).

Requests are sent ahead asynchronously when we reach near cache’s end, so the application user interface remains responsive.

The requested rows count (next or previous cache size) adapts automatically to the current visible rows (that depends from the enclosing scrollview size – could be resized then).

Use of fast scroll using the scrollbar or scroll area is allowed (generates a cache fault and then a synchronous – that time only – call to reset all caches from the new requested position).

Ready for column sorting (infos are passed to the remote service’s read method) once the datasource delegate method is managed in CPTableView.

Can pass selection criteria (SQL, HQL, or any other WHERE clause part string) to the remote service’s read method if selection must be restricted (pass null to browse the whole table).

Use (see included example) :
– create the CPTableView and columns as usual but pass the corresponding attribute of the remote collection’s elements class as the column id (you can pass any nested property using EL type path, as CPPropertyUtils is used here).
– create the table datasource (and set it as the tableView datasource) passing the endPoint, remote Java service interface name, read method and get size (whole table size) method names, index/primary key attribute name, additional criterias string :

tableViewDelegate = [CP2JavaWSTableViewDelegate createForEndPoint:endPoint1 javaServiceInterface:"com.cp2javaws.demo.services.DemoService" readMethod:"readCustomersForIndexCriteriaAndCountIsForward" sizeMethod:"customersCount" idAttName:"customerId" criterias:nil];

The read method on the server must follow this signature : (Integer indexCriteriaValue, Integer count, Boolean isForward, String criterias, List sortDescriptors).

Fixes :

– fixed a problem with CP2JavaWSURLConnection’s instance authDelegate scope, that lead to the application not working if using index.html (uses Press and then all global vars appear in the same file – same scope) instead of index-debug.html.
– fixed a problem when encoding/decoding null attributes values (if using custom CPCoding implementation and not checking for null attributes – ok when relying on automatic mode). These fields are now ignored (not included in JSON string).
– now follows correct rules when checking for sameDomain setting at endPoint creation (allows use of a local file for the client CP application if the server is local and Safari is used).

– Added preliminary support for synchronous calls (do not manage digest authentication yet). Then asynchronous mode remains the default (should also be preferred as it allows more responsive user interface).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s