Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023778Openbravo ERPA. Platformpublic2013-05-09 12:532013-05-23 01:32
dbaz 
dbaz 
highminoralways
closedfixed 
5
 
3.0MP233.0MP23 
AugustoMauch
Core
No
0023778: A way to manipulate the returned records (before they be returned) of a standard DataSource is needed
A new mechanism to manipulate the returned records (before they be returned) of a standard DataSource is needed.

So, if additional manual logic is needed for transform the expected records, there should be a mechanism to handle that, so the returned json will has these modifications.
.
No tags attached.
Issue History
2013-05-09 12:53dbazNew Issue
2013-05-09 12:53dbazAssigned To => dbaz
2013-05-09 12:53dbazModules => Core
2013-05-09 12:53dbazTriggers an Emergency Pack => No
2013-05-09 12:58dbazNote Added: 0058517
2013-05-09 12:58dbazReview Assigned To => AugustoMauch
2013-05-09 12:58dbazIssue Monitored: AugustoMauch
2013-05-09 13:11hgbotCheckin
2013-05-09 13:11hgbotNote Added: 0058518
2013-05-09 13:11hgbotStatusnew => resolved
2013-05-09 13:11hgbotResolutionopen => fixed
2013-05-09 13:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/713f4b92501db647e461fcf87f5e194adf7d1e01 [^]
2013-05-09 13:16AugustoMauchNote Added: 0058519
2013-05-09 13:16AugustoMauchStatusresolved => closed
2013-05-09 13:16AugustoMauchFixed in Version => 3.0MP23
2013-05-23 01:32hudsonbotCheckin
2013-05-23 01:32hudsonbotNote Added: 0058785

Notes
(0058517)
dbaz   
2013-05-09 12:58   
100% risk free

There is a new method "bobFetchTransformation" in "DefaultJsonDataService" that can be overwritten to do the custom logic in the BaseOBObjects that are going to be returned later in a json.

This feature has some remarks:
* If the number of the returned bobs change, there could be problems because endRow and totalRows parameters will be out-of-sync with that the requester expects, and some values can be missing in the following fetches. If there is no pagination (all values are returned at once), there is no problem.
* If any bob is modified, the original entity is being modified, so a good practice could be clone the bob (using DalUtil.copy, for example) before modify it, and then return the clone.

The test-case for this issue, is as simple as verify that any standard DataSource still work as before.
(0058518)
hgbot   
2013-05-09 13:11   
Repository: erp/devel/pi
Changeset: 713f4b92501db647e461fcf87f5e194adf7d1e01
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Thu May 09 13:10:02 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/713f4b92501db647e461fcf87f5e194adf7d1e01 [^]

Fixed issue 23778: added 'bobFetchTransformation' method to 'DefaultJsonDataService'

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
---
(0058519)
AugustoMauch   
2013-05-09 13:16   
Code reviewed and verified in pi@713f4b92501d
(0058785)
hudsonbot   
2013-05-23 01:32   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/97c7f6256af7 [^]

Maturity status: Test