Package org.openbravo.service.json
Interface JsonDataServiceExtraActions
-
public interface JsonDataServiceExtraActions
Classes implementing this interface are injected in theDefaultJsonDataService
class. Using this interface it is possible to customize the data that it is being send to or retrieved from the database on any action.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
doPostAction(Map<String,String> parameters, org.codehaus.jettison.json.JSONObject content, DefaultJsonDataService.DataSourceAction action, String originalObject)
This method is executed on theDefaultJsonDataService.doPostAction(Map, String, DataSourceAction, String)
Implement this method to modify or validate the data after the action is executed and before is returned to the client.void
doPreAction(Map<String,String> parameters, org.codehaus.jettison.json.JSONArray data, DefaultJsonDataService.DataSourceAction action)
This method is executed on theDefaultJsonDataService.doPreAction(Map, String, DataSourceAction)
Implement this method to modify or validate the data before the action is executed.
-
-
-
Method Detail
-
doPreAction
void doPreAction(Map<String,String> parameters, org.codehaus.jettison.json.JSONArray data, DefaultJsonDataService.DataSourceAction action)
This method is executed on theDefaultJsonDataService.doPreAction(Map, String, DataSourceAction)
Implement this method to modify or validate the data before the action is executed.- Parameters:
parameters
- The Map with the parameters of the DataSource call.data
- JSONArray with the records that are going to be inserted, updated or deleted. Modify this object in case it is required to modify the data before executing the action. Fetch operations receive an empty array.action
- The action of the DataSource call. Possible values are FETCH, ADD, UPDATE and REMOVE
-
doPostAction
void doPostAction(Map<String,String> parameters, org.codehaus.jettison.json.JSONObject content, DefaultJsonDataService.DataSourceAction action, String originalObject)
This method is executed on theDefaultJsonDataService.doPostAction(Map, String, DataSourceAction, String)
Implement this method to modify or validate the data after the action is executed and before is returned to the client.- Parameters:
parameters
- The Map with the parameters of the DataSource call.content
- JSONObject with the current content that is returned to the client. Modify this object in case it is required to modify the data before is returned.action
- The action of the DataSource call. Possible values are FETCH, ADD, UPDATE and REMOVEoriginalObject
- JSONObject String available only on ADD and UPDATE with the original values of the data.
-
-