Running import as a PMC extension
For Partners
Running import as a PMC extension
To increase performance, it is possible to run the PMC import pipeline inside PMC.
Building the extension
To run an import pipeline as a scheduled extension inside PMC, an extension that inherits from the ScheduledExtensionBase
in Avensia.Storefront.Connector.InriverPmc.Import.Extensions
needs to be built. In the Execute
-method for that extension, these steps should be performed:
- A StructureMap
Container
should be created, where the currentinRiverContext
is registered - A
StorefrontRunner
should be initialized with theContainer
and theBootstrapper
containing the pipeline setup - The
Run
method in the base extension class should be called with theContainer
as input parameter
The pipeline setup, with Entity Definition Models etc, is done in the same way as described in Setting up inRiver PMC import. One difference though is that the Configuration section is not needed, since connection settings for inRiver remoting is not applicable.
An example of the above setup is included in the Starter package in the project Avensia.Storefront.PmcImportExtension
Setting up a Staging API endpoint
To make it possible for the PMC extension to read data from the Avensia Storefront Staging database, an API endpoint needs to be setup.
This is done by setting up a Web Api project and add a reference to Avensia.Storefront.Connector.StagingApi
. The project needs to use StructureMap
for dependency injection, and a Bootstrapper
needs to be created to initialize the StructureMap container with needed Storefront registrations.
In addition, the StructureMapFilterProvider
defined in Avensia.Storefront.Connector.StagingApi
needs to be registered as a IFilterProvider
.
An example of the above setup is included in the Starter package in the project Avensia.Storefront.StagingApi
Upload and configure the extension
Create a zip file with the binaries from your extension build, and upload the zip file to your PMC package in PMC Control Center under Connect / Packages. Add a new Scheduled Extension under Connect / Extensions and select your extension from the dll in the zip package. After creating the new extension, click on Get Default Settings to populate settings. Update the following values:
Setting name | Description |
---|---|
StagingApiEndpoint |
The http-address to your staging endpoint - example: http://my_site/avensiastorefront/staging |
StagingApiUsername |
Username for api authorization |
StagingApiPassword |
Password for api authorization |
PeriodicityInMinutes |
How often to run the pipeline |
StorefrontConfiguration |
XML-string that contains the storefront configuration needed to run the pipeline (same structure as in the storefront.config |
StorefrontLicense |
File content of your valid storefront license to run in this PMC environment |