Menu

CP2JavaWS / News: Recent posts

0.8 version release

- refactored the request management (mode switch, CPURLConnection/CPJSONP creation, delegate and auth. delegate creation, encoding and decoding) in a new class, CP2JavaWSHttpSender, as it is used by both CPRemoteService and CP2JavaWSTableViewDelegate.
- the CP2JavaWSHttpSender allows to specify if call arguments have to be encoded (CP to js conversion before js to JSON), and if result has to be decoded (js to CP after JSON to js).
- For remote service methods that have generic argument types (Object), we can now pass to the CP2JavaWSHttpSender an array of generic parameters indexes (required as on the Java server side we then cannot discover the generic Object type from the passed parameter value).
- reponses with error code didn't trigger anymore the failHandler since CPURConnection doesn't check anymore for error codes (in order to allow to perform action depending on the error code).
- fixed a problem in Decoder, where empty Date on JS object was setted as undefined on the CP object instead of null,
and where JS boolean fields with false value where treated as unset.... read more

Posted by Jerome Denanot 2009-07-14

0.72 release

- Modified server-side demo HabilitationServiceImpl to return true for the 
genericDAOService methods.

- CP2JavaWSEndpoint init had a bug with testing presence of sameDomain 
argument : replaced if(aSameDomain) with if (aSameDomain!=nil).

- CP2JavaWSTableViewDelegate : in sendSynchRequest, added the test for 
sameDomain (was ok for sendAsynchRequest) to use JSONP mode if not same 
domain.

- Modified hibernate config .hbm file to use assigned generator for the id, as AppEngine does not provides the InetAddress class.
However Hibernate's SessionFactoryImpl still owns a static field of type UUIDHexGenerator that is always initialized, and that extends AbstractUUIDGenerator, whose uses InetAddress in its static init part.
Then had to redefine AbstractUUIDGenerator (included in same original package name in the demo project's src folder) : when deploying to AppEngine we have to comment the line that uses InetAddress and uncomment the line that uses a random generated address (based on JUG project, also licenced under LGPL).... read more

Posted by Jerome Denanot 2009-06-12

0.71 release

Note : now uses json2lib stringify and parse methods from latest Cappuccino main branch (and future 0.71 version). Then it does not work for version 0.7 (or you should replace these methods manually by these from CPValue).
These two new methods should lead to general better performance.

- fixed a cache problem : now if an asynchronous request was pending before a cache fault, its return is ignored (as the state isn't the same as originally expected after a cache fault).... read more

Posted by Jerome Denanot 2009-06-08

0.7 release

- New component, CP2JavaWSTableViewDelegate, 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).... read more

Posted by Jerome Denanot 2009-06-02

0.6 release

- added a mode for custom (Cappuccino based) digest authentication dialog (previous version client-side digest authentication and dialog were managed by the browser only). The mode is setted on the server-side authentication filter configuration (<browserMode> parameter in the web.xml - set it to false for custom dialog).

- a default Cappuccino authentication dialog is provided (CP2JavaWS client code also manages transparently digest authorization request creation, cnonce and and nonce counter, and sending of original request when authentication successes).
That dialog also shows the endpoint url's (we could use a composite app that makes calls to various enpoints/different webapps on the same domain - same protocol, host and port -, and then have multiple authentication challenges).... read more

Posted by Jerome Denanot 2009-05-02

0.5 release

- full digest authentication (rfc2617) support (tested on Safari and Firefox), with automatic retrigger of original connection.
Besides digest parameters settings (nonce life, realm, etc.), the authentication filter allows to set list of services that require (or not) authentication (using includes and excludes).
Authentication occurs only once (for the first service that requires it).... read more

Posted by Jerome Denanot 2009-04-22

0.4 release

- Decoding and encoding now support cycles/references. Existing objects's references are replaced with a path ($ref:<pathFromRootObject>) when encoding to JSON. The path follows EL/BeanUtils rules : someKey.anotherKey, someKey[0](key).anotherKey, [index], (key), someKey(key)[1](key2).anotherKey, etc.
When decoding, references/paths are replaced with the previously decoded objects.
A new CPPropertyUtils class allows to get/set these nestedProperties on the cllient side, in the same way as Java's commons BeanUtils (the two frameworks manage nested dictionaries and arrays, and multiple dimensions arrays). You have to use at least commons beanutils 1.8.... read more

Posted by Jerome Denanot 2009-04-16

0.32 release

Encoding and decoding of client objects now also supports CPCoding, through new CP2JSEncoder/CP2JSDecoder.

These coder provide transparent backward compatibility with previous versions of CP2JavaWS that were based on the CPJSONAware protocol :

- if no CPCoding implementation is found on custom objects, it uses instead the old toJSObject/objectWithJSObject methods from CPJSONAware categories.

- Furthermore it does the switch at each node level ! That is for custom objects we can etiher implement CPCoding protocol's methods (if the serialization requires particular work, for example to exclude some attributes or choose arbitrary JSON keys - different from ivar names), or benefit from the automatic encoding of objects provided by the CPJSONAware categories (then custom objects have to import CPObject_CPJSONAware.j, and JSON keys will match exactly ivar names).

Posted by Jerome Denanot 2009-04-06

0.31 release

- CP2JavaWSJSONServlet has been replaced by a filter. Then no need anymore for a servlet.
If a servlet is still present, your application could then manage both JSON requests
(originated from Cappuccino client applications using CP2JavaWSRemoteService proxy), through the CPJSONFilter,
and classic web requests (managed by your servlet, Struts or Spring MVC servlet for example).

- the CPJSONFilter can work with any service factory (custom framework and/or IOC container).
A listener is provided for integration with spring container (see the provided demo).
You have then to add cp2javaws-springsupport.jar in web-inf/lib besides cp2javaws-filter.jar (and spring.jar obviously).
If not using Spring, spring.jar (and cp2javaws-springsupport.jar) can be removed, avoiding any dependency.... read more

Posted by Jerome Denanot 2009-02-09

0.3 version release

- major refactoring and code cleaning, completely rewritten encoding and decoding on the client-side and server-side.
- that version now uses Objective-J categories to encode/decode full objects graphs, and allows to customize encoding/decoding (if needed) for custom objects
- encoding and decoding now manages any depth, including nested collections
- collections (CPArray/List and CPDictionary/Map) elements can be heterogeneous
- method's arguments (JSON encoded parameters) and return now provide the objjClassName for each node (including collections's elements),
so the client-side is independant from server-side technology (language).
Besides the CP2JavaJSONServlet, a PHP implementation could then be added for example, keeping the same client-side CP proxy classes.
- the custom Objective-J classes to Java custom classes mapping has now to be done using a properties file on the server-side.... read more

Posted by Jerome Denanot 2009-02-02

0.2-beta release

The 0.2 version brings many enhancements/fixes : JSONP now works correctly, services results can be of type collection (List/Map), preliminary support for custom objects id added (objects that contain simple attributes) for services calls arguments and return. Additional examples are provided.

Posted by Jerome Denanot 2009-01-12