Project

General

Profile

task #3485

Updated by Andreas Müller over 3 years ago

The extend of the object graph retured by REST services is defined by three mechanisms:  

  

 1. The `CardinalityPropertyFilter`  

  

 1. Bean initialization strategies defined in the web service controllers 

 

 1. The `AutoPropertyInitializer`  


  


 see [[CdmRestServicesEntitySerialization]] and [[CdmEntityInitalization]] for more on this. 


 


 The two main REST service sections: generic REST API, Portal REST API are configured differently weheras the generic api id returning rather atomized entities and the portal service returns rather big object graphs. 


 


 Both service section could be merged into one if it would be possible to request for a specific object graph by supplying a initStrategy to the REST service. This would not only simplify the REST service layer but would also mean to improve the performance of client applications as the data portal since it would be possible to request exactly for the data which is needed. 


 


 Basically two things must be implemented for this: 

 

 1. All REST controllers must generally allow to specify the object bounds in form of an initStrategy / property path as request parameter: e.g.: `bounds=media,authors.titleCache` the properties defined in this parameter must be initialized and also those defined in the `AutoPropertyInitializer`  


    


   What is a good name for this parameter? _properties_, _bounds_, ... ??? 

 

 1. The serialization must also respect this request parameter and thus must only serialize the 

 

 properties defined in the initStrategy of in the {{AutoPropertyInitializer}}}s. It seems as if the `BeanInitializer` is the best place to implement this. The `BeanInitializer` therefore set all unwanted properties to NULL. Null properties are not initialized. 
 

Back