Setting up inRiver PMC export
For Partners
Setting up PMC export
Dependency registration
Create a new class in the Infrastructure
folder that inherits from the ProjectDependencyRegistration
in Avensia.Storefront.InriverPmc.Export
.
Override the RegisterDependenciesInModuleContainer
method, call the base implementation and then add the different document types that should be staged. These are added as handlers implementing the IDocumentHandler
interface. There are predefined implementations for categories, products, media and product kits. The complete registration should look something like this:
public class PmcExportRegistration : Avensia.Storefront.InriverPmc.Export.ProjectDependencyRegistration { public override void RegisterDependenciesInModuleContainer(RegistrationContext context) { base.RegisterDependenciesInModuleContainer(context); context.ConfigurationExpression.For<IDocumentHandler>().Add<CategoryDocumentHandler>(); context.ConfigurationExpression.For<IDocumentHandler>().Add<ProductDocumentHandler>(); context.ConfigurationExpression.For<IDocumentHandler>().Add<MediaDocumentHandler>(); context.ConfigurationExpression.For<IDocumentHandler>().Add<ProductKitDocumentHandler>(); } }
Your registration then needs to be added to your project dependencies in the bootstrapper:
public class Bootstrapper : StorefrontBootstrapper { ... ... protected override void RegisterProjectDependencies(ProjectDependencyRegistrations projectDependency) { ... projectDependency.AddRegistration(new PmcExportRegistration()); ... } ... ... }
Pipeline registration
In your bootstrapper, register a module with a step task PmcCatalogStagingStep
:
moduleRegistration.RegisterModuleSetProducer( ImportModules.PmcStaging, m => { m.AddStepTask(t => { t.Name("Staging"); t.AddStep<PmcCatalogStagingStep>("PmcCatalog"); }); });
Configuration
The PMC configuration can be setup in a separate config-file, which then needs to be referenced in web.config
:
<configSections> ... <section name="storefront.pmc"
type="Avensia.Storefront.Connector.InriverPmc.Configuration.PmcConfigurationSection,
Avensia.Storefront.Connector.InriverPmc.Configuration, Version=1.0.0, Culture=neutral" /> ... </configSections> <storefront.pmc configSource="<filename.config>" />
In the config file, there should be a section called storefront.pmc
. In that section the PMC export settings are set on the inbound
element:
<storefront.pmc> <inbound settingname1=value settingname2=value ... /> </storefront.pmc>
Settings
Setting name | Description |
---|---|
enablePop |
Specifies whether data read from PMC should be considered consumed after staging it. Should be set to true in a production environment, but can be set to false during development to be able to repeat staging with the same source data multiple times. |
apiKey |
The shared secret apiKey specified for the InboundDataExtension in PMC |
endpoint |
The PMC InboundDataExtension http endpoint |
httpClientBatchSize |
Maximum number of entities to fetch from PMC on each request |
channelEntityTypeId |
The PMC entity type id for a channel |
channelNodeEntityTypeId |
The PMC entity type id for a channel node |
productEntityTypeId |
The PMC entity type id for a product |
itemEntityTypeId |
The PMC entity type id for a variation |
resourceEntityTypeId |
The PMC entity type id for a resource |
productKitEntityTypeId |
The PMC entity type id for a product kit entity |
productRecordIdField |
The PMC field name for a product unique record id |
itemRecordIdField |
The PMC field name for a variation unique record id |
resourceFilenameField |
The PMC field name for a resource filename |
productRelationLinkTypeIds |
Comma separated list of PMC link type ids for product relations |
productKitLinkEntityTypeId |
The PMC link entity type id for product kits |
productKitLinkTypeIds |
The PMC link type ids for links from product kits |
productKitGroupEntityTypeId |
The PMC field name for a product kit group name |
productKitUniqueIdEntityTypeId |
The PMC field name for a product kit unique record id |
Media downloader configuration
Media is downloaded from the PMC Asset Service by using the URL supplied in the staging document. To set up this to work with the standard HttpMediaDownloader
during catalog import, the configuration in storefront.config
should look like this:
<httpMediaDownloader>
<add name="HttpMediaDownloader" baseUrl="" storeId="<AX store id>
" /> </httpMediaDownloader>