Project

General

Profile

Actions

task #3485

open

object graph returned by REST services can be specified by initstrategy

Added by Andreas Kohlbecker almost 11 years ago. Updated about 3 years ago.

Status:
New
Priority:
New
Category:
cdmlib-remote
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Severity:
normal

Description

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

  1. The CardinalityPropertyFilter

  2. Bean initialization strategies defined in the web service controllers

  3. 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.

Actions

Also available in: Atom PDF