Data Providers Fundamentals

Details on Sitecore data templates and inheritance. Concepts on using and extending content items that are customised for Sitecore Commerce 7.5, powered by Commerce Server and Commerce Server 11.1.

Sitecore Commerce 7.5, powered by Commerce Server and Commerce Server 11.1 makes use of predefined item templates to represent product and category derfinitions in Sitecore. These templates are arranged in a hierarchy to enable inheritance. Template inheritance allows us to use change management best practices to modify templates for Commerce Items.

Data providers dynamically generate children types based on the parent item. Sitecore data providers dynamically load external implementations based on the parents and current item data template ids. Through configuration, you can specify which external provider to use for a template id. There are two data providers:
  1. Data providers called directly by Sitecore based on the base DataProvider class.
  2. Catalog item specific data providers base on the BaseCatalogProvider class.
The following table details the supported data providers:
Table 1. Sitecore Data Providers
Provider Description
DataProvider Provides the base functionality that is common to all data providers.
CatalogReadOnlyDataProvider Derived from: DataProvider This provider will allow only read-only access to the catalog content with the exception of the SitecoreID and SitecoreSettings properties. All write operations will simply be ignored. This catalog data provider will be assigned to both “web” databases.
CatalogDataProvider Derived from: CatalogReadOnlyDataProvider This provider derives/inherits from the ReadOnlyCatalogDataProvider and provides all of the create, update and delete functionality. This catalog data provider will be assigned to the “master” Sitecore database
CatalogDataFolderProvider Generates the children catalog items of a parent catalog folder (Commerce Catalog Folder template).
CatalogProvider

Generates the children a Category items for a parent Category (Commerce Category template).

Generate the fields for a specific category. Notice we are not generating any child Products. This because they do not appear in the content tree.

ProductItemProvider Generates the fields for a specific Product.
ProductVariantItemProvider Generates the fields for a specific Variant.
RelationshipItemProvider Generate the fields for a specific Relationship.

Example Configuration

    <commerceServer configurationProvider="CommerceServer.SitecoreIntegration.DefaultConfigurationProvider, CommerceServer.SitecoreIntegration">
      <templates>
        <template name="Commerce Catalog Folder" 
                  id="{334E2B54-F913-411D-B159-A7B16D65242C}" 
      dataprovider="CommerceServer.SitecoreIntegration.CatalogDataFolderProvider, 
                    CommerceServer.SitecoreIntegration"/>
        <template name="Commerce Catalog" 
                  id="{93AF861A-B6F4-45BE-887D-D93D4B95B39D}"
            dataprovider="CommerceServer.SitecoreIntegration.CommerceCatalogProvider, 
                          CommerceServer.SitecoreIntegration"/>
        <template name="Commerce Category" 
                  id="{4C4FD207-A9F7-443D-B32A-50AA33523661}" 
           dataprovider="CommerceServer.SitecoreIntegration.CategoryItemProvider, 
                         CommerceServer.SitecoreIntegration"/>
        <template name="Commerce Product" 
                  id="{225F8638-2611-4841-9B89-19A5440A1DA1}" 
           dataprovider="CommerceServer.SitecoreIntegration.ProductItemProvider, 
                         CommerceServer.SitecoreIntegration" />
        <template name="Commerce Product Variant" 
                  id="{C92E6CD7-7F14-46E7-BBF5-29CE31262EF4}" 
     dataprovider="CommerceServer.SitecoreIntegration.ProductVariantItemProvider,
                   CommerceServer.SitecoreIntegration" />

        <template name="Commerce Product – Item Type" id="1" 
          dataprovider="CommerceServer.SitecoreIntegration.ProductItemProvider, 
                        CommerceServer.SitecoreIntegration"/>
        <template name="Commerce Category – Item Type" id="2" 
         dataprovider="CommerceServer.SitecoreIntegration.CategoryItemProvider, 
                       CommerceServer.SitecoreIntegration"/>
        <template name="Commerce Variant Item – Item Type" id="3" 
   dataprovider="CommerceServer.SitecoreIntegration.ProductVariantItemProvider, 
                 CommerceServer.SitecoreIntegration"/>
        <template name="Commerce Catalog – Item Type " id="4" 
              dataprovider="CommerceServer.SitecoreIntegration.CatalogProvider, 
                            CommerceServer.SitecoreIntegration"/>
      </templates>
</commerceServer>