Projects/Projects:Property Selection In REST Webservices
Property Selection in REST Webservices - Functional Specifications
Currently when an Entity is fetched using the XML Rest Web Service, either all his children are included or none are, if the includeChildren property is set in the URL. All primitive properties are returned. If the Json Rest Web Service is used, then all the non children properties are returned.
This project will enable to fetch just a subset of the properties of the entities by specifying the list of desired properties in the URL. This will have several benefits:
- The size of the response will decrease.
- The server will be less loaded by avoiding to export all the unrequired properties.
To specify a list of properties, the _selectedProperties attribute must be included in the URL. This attribute contains the name of the properties separated by commas: http://localhost:8081/openbravo/ws/dal/ADWindow/100?_selectedProperties=id,name,aDTabList,aDTabList.id,aDTabList.name,aDTabList.aDFieldList,aDTabList.aDFieldList.name,aDTabList.aDFieldList.description
The response of this request would return a list of windows, with information about its tabs and fields.. Each window register will contain 2 primitive properties (id, and name), a list of its subtabs. For one of these subtabs its id and name will be included, and also a list of the fields belonging to that tab.
The analog request to the Json Rest webservice would be http://localhost:8081/openbravo/org.openbravo.service.json.jsonrest/ADWindow?_selectedProperties=id,name. This request would not return the list of tabs and fields, because the Json Rest Webservice does not return the child entities.