Data Filtering in personalizationservices Extension
Handling data filtering in the personalizationservices Extension.
DAO Strategy Approach
- CxCustomization
- CxVariation
- CxAbstractAction
- CxActionResult
- CxCustomizationGroup
- CxPersonalizationBusinessProcess
- CxSegment
- CxTrigger
- CxUserToSegment
- The de.hybris.platform.personalizationservices.dao.impl.AbstractCxDao class exposes an overloaded queryList method which may override a default query with the one provided by one of available strategies (CxDaoStrategy).
- The de.hybris.platform.personalizationservices.dao.CxDaoStrategy is an interface which provides the information on the extra parameters required to produce different query. It is also able to produce such query if needed.
- The de.hybris.platform.personalizationservices.dao.CxDaoQueryBuilder interface and its default implementation DefaultCxDaoQueryBuilder are responsible for building a FlexibleSearchQuery from a default query and additional strategies implementing CxDaoStrategy.
- The de.hybris.platform.personalizationservices.dao.CxDaoStrategySelector interface and its default implementation DefaultCxDaoStrategySelector are responsible for selecting the best CxDaoStrategy instance to use based on a list of strategies and a list parameters.
- CxCustomizationCodeDaoStrategy which will be used of the customization code is passed as a parameter: GET /customizations?code=somecode
- CxCustomizationNameStatusesDaoStrategy which will filter the data based on name and status: GET /customizations?name=somename&status=ENABLED
For further examples, see Data Filtering for Customizations Displayed per Page.
GET /customizations GET /customizations?code=somecode GET /customizations?name=somename&status=ENABLED
DAO Type Approach
Unlike the DAO strategy approach, which allows to define multiple dedicated queries, the DAO type approach allows defining a class that supports a given type. This approach is supported only by de.hybris.platform.personalizationservices.action.impl.DefaultCxActionService, with the use of de.hybris.platform.personalizationservices.action.dao.CxActionTypeDao.
The ]DefaultCxActionService collects all beans that implement the CxActionTypeDao from the spring context and selects one of them using the CxActionType as a key to perform search. Currently, the CxCmsActionTypeDao supporting CxActionType.CXCMSACTION is the only implementation of this mechanism.