Interface ProductDataMapping

  • All Known Implementing Classes:
    ProductDataMappingDefault

    public interface ProductDataMapping

    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 Detail

      • entitiesToProducts

        <T extends EntityData> java.util.List<Product> entitiesToProducts​(java.util.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 ProductDataMappingDefault instead 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 map
        parent - parent entity (Bucket or Planning instance) or null
        model - entity model
        context - request context
        idBuilder - 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 Bucket
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 Cord
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 KeyValue
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 MediaAsset
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 Price
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 Text
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 TableData
        model - the entity model
        parent - parent entity (Bucket or Planning instance) or null
        context - request context
        idBuilder - 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 Planning
        model - the entity model
        parent - parent entity (Planning instance) or null
        context - request context
        idBuilder - the ID builder to use
        Returns:
        a Product
        Throws:
        CometException - the comet exception