public interface JsonDataServiceExtraActions
DefaultJsonDataService
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.Modifier and Type | Method and Description |
---|---|
void |
doPostAction(Map<String,String> parameters,
org.codehaus.jettison.json.JSONObject content,
DefaultJsonDataService.DataSourceAction action,
String originalObject)
This method is executed on the
DefaultJsonDataService.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 the
DefaultJsonDataService.doPreAction(Map, String, DataSourceAction) Implement this method
to modify or validate the data before the action is executed. |
void doPreAction(Map<String,String> parameters, org.codehaus.jettison.json.JSONArray data, DefaultJsonDataService.DataSourceAction action)
DefaultJsonDataService.doPreAction(Map, String, DataSourceAction)
Implement this method
to modify or validate the data before the action is executed.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 REMOVEvoid doPostAction(Map<String,String> parameters, org.codehaus.jettison.json.JSONObject content, DefaultJsonDataService.DataSourceAction action, String originalObject)
DefaultJsonDataService.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
- 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.