Elements of the Plugin.Sample.ContentHub plugin
Sample source code you can use to build your own Content Hub to Sitecore XC extension connector.
The Plugin.Sample.ContentHub
plugin contains the sample source code you need to build your own Content Hub to Sitecore XC extension connector.
This topic highlights some of the main elements of the plugin. For details, you can access the plugin source code in the Sitecore.Commerce.Engine.SDK
ZIP package, in the Sitecore.Commerce.Engine.SDK.*.*.**\src\Plugin.Sample.ContentHub folder.
The Plugin.Sample.ContentHub
plugin is compatible and tested with Sitecore Experience Commerce 10.0 and Sitecore Content Hub release 3.2.203.
For integration with any other version of Sitecore Content Hub, you must create your own plugin extensions for compatibility.
Commands
The Plugin.Sample.ContentHub
plugin defines the ImportEntityCommand
class. The ImportEntityCommand
command is used for importing changes to a Content Hub product entity property .
The ImportEntityCommand
executes the ImportEntityPipeline
.
Components
The Plugin.Sample.ContentHub
sample plugin defines the following component classes:
-
ContentHubImage
-
ContentHubImagesComponent
The ContentHubImage class
The ContentHubImage
class defines the following information about the asset retrieved from Content Hub DAM:
Parameter name |
Description |
---|---|
"url" |
The URL of the image. (Uri) |
"width" |
The width (in pixels) of the image. (Integer) |
"height" |
The height (in pixels) of the image. (Integer) |
"alternateText" |
The alternative information for an image if a user cannot view it. (String) |
"isMaster" |
Determines whether the image is master (main) or not. (Boolean) |
"linkId" |
The related public link ID. (string) |
The ContentHubImagesComponent class
The ContentHubImagesComponent
class represents a list of images retrieved from Content Hub DAM.
Models
The Plugin.Sample.ContentHub
plugin defines the following model classes:
-
AssetRendition
-
Changeset
-
ConversionConfiguration
-
CroppingConfiguration
-
DeleteEntityMessage
-
EntityMessage
-
FileProperties
-
PropertyChange
-
PropertyMap
-
Ratio
-
RelationChange
-
SaveEntityMessage
-
ServiceBusMessage
-
ServiceBusMessageContext
Pipelines
The Plugin.Sample.ContentHub
plugin defines pipelines used to import updates to PCM products and DAM assets to Sitecore XC. The following table lists the pipelines and provides a brief summary.
Pipeline |
Description |
---|---|
|
The main pipeline called when the Commerce Engine receives notification from the Azure Service Bus. Imports updated entities from Content Hub (using the |
|
When a PCM product is updated, this pipeline fetches the equivalent sellable item in the Commerce Engine and synchronizes changes to the entity properties or related images. |
|
When an asset is updated, this pipeline retrieves all CMP products linked to updated assets, and then calls the |
|
Imports updates made to an image public link managed in DAM. |
Arguments
The Plugin.Sample.ContentHub
plugin defines the ImportEntityArgument
class, which contains information used for the import process.
EntityViews block
The GetSellableItemContentHubImagesViewBlock
populates a sellable item view (in the XC Business Tools) with images information from DAM.
Policies
The Plugin.Sample.ContentHub
plugin defines the following policies used to configure various aspects of the connector in the Commerce Engine:
-
AssetSynchronizationPolicy
-
AzureServiceBusPolicy
-
BizFxPolicy
-
ContentHubClientPolicy
-
ProductSynchronizationPolicy
-
SynchronizationPolicy
These policies are exposed for configuration in the Plugin.Sample.ContentHub.PolicySet.json
file. The path to the file is Commerce.SDK/src/Sitecore.Commerce.Engine/wwwroot/data/Environments/PlugIn.ContentHub.PolicySet-1.0.0.json.disabled
. The policies and their properties are described here.