DeBortoliWines / openerp-java-api

A Java API to connect to OpenERP and manage data using the XMLRPC interface.
Apache License 2.0
38 stars 71 forks source link

OdooCommand#callObjectFunction returns new class Response #29

Closed fpoyer closed 7 years ago

fpoyer commented 8 years ago

Response wraps either a successful or failed call, indicated by

isSuccessful().

In case of success, actual response can be obtained "as is" with

getResponseObject() or as an array with #getResponseObjectAsArray().

The latter will either cast the response object as an array of objects if it is an instance of one, and wrap the response object in a new array otherwise. In case of failure, the error cause can be accessed with

getErrorCause().

Also some code cleaning and refactoring.

Finally got to rename OpeneERPApiException to OdooApiException and OpenERPCommand to OdooCommand.

This fixes #7 by providing requested enhancement.

fpoyer commented 8 years ago

Please review changes and merge if accepted.