Interface ProductDataMapping
- All Known Implementing Classes:
ProductDataMappingDefault
Interface for ProductDataMapping Plugins.
Actually, custom product data mappings are just Plugin methods with method
type PRODUCT_DATA_MAPPING. In addition,
ProductDataMappings must implement the ProductDataMapping interface.
-
Method Summary
Modifier and TypeMethodDescriptioncreateProductFromBucket(Bucket bucket, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a Bucket entitycreateProductFromCord(Cord cord, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a Cord entitycreateProductFromKeyValue(KeyValue keyValue, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a KeyValue entitycreateProductFromMediaAsset(MediaAsset asset, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a MediaAsset entitycreateProductFromPlanning(Planning planning, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a Planning entitycreateProductFromPrice(Price price, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a Price entitycreateProductFromTableData(TableData data, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a TableData entitycreateProductFromText(Text text, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) Creates a Product from a Text entity<T extends EntityData>
List<Product>entitiesToProducts(List<T> entities, EntityData parent, EntityModel model, Context context, CometIdBuilder idBuilder) Creates a list of Products from a list or arbitrary EnttyData objects.
-
Method Details
-
entitiesToProducts
<T extends EntityData> List<Product> entitiesToProducts(List<T> entities, EntityData parent, EntityModel model, Context context, CometIdBuilder idBuilder) throws CometException Creates a list of Products from a list or arbitrary EnttyData objects.
This is the method usually called by product data providers to map entities retrieved from the EntityModelManager to Comet3 products.
Developers usually wont implement this method, but inherit from
ProductDataMappingDefaultinstead and implement the methods to map create... methods to map a single instance of a specific type to Product.- Type Parameters:
T- the type parameter- Parameters:
entities- the list of entities to mapparent- parent entity (Bucket or Planning instance) or nullmodel- entity modelcontext- request contextidBuilder- the ID builder to use- Returns:
- list of Products
- Throws:
CometException- the comet exception
-
createProductFromBucket
Product createProductFromBucket(Bucket bucket, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a Bucket entity
- Parameters:
bucket- the source Bucketmodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromCord
Product createProductFromCord(Cord cord, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a Cord entity
- Parameters:
cord- the source Cordmodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromKeyValue
Product createProductFromKeyValue(KeyValue keyValue, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a KeyValue entity
- Parameters:
keyValue- the source KeyValuemodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromMediaAsset
Product createProductFromMediaAsset(MediaAsset asset, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a MediaAsset entity
- Parameters:
asset- the source MediaAssetmodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromPrice
Product createProductFromPrice(Price price, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a Price entity
- Parameters:
price- the source Pricemodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromText
Product createProductFromText(Text text, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a Text entity
- Parameters:
text- the source Textmodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromTableData
Product createProductFromTableData(TableData data, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a TableData entity
- Parameters:
data- the source TableDatamodel- the entity modelparent- parent entity (Bucket or Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-
createProductFromPlanning
Product createProductFromPlanning(Planning planning, EntityModel model, EntityData parent, Context context, CometIdBuilder idBuilder) throws CometException Creates a Product from a Planning entity
- Parameters:
planning- the source Planningmodel- the entity modelparent- parent entity (Planning instance) or nullcontext- request contextidBuilder- the ID builder to use- Returns:
- a Product
- Throws:
CometException- the comet exception
-