Table of Contents

Class FeedProvider

Namespace
Dynamicweb.Ecommerce.Feeds
Assembly
Dynamicweb.Ecommerce.dll
[AddInUseParameterGrouping(true)]
public abstract class FeedProvider : ConfigurableAddIn, IParameterOptions
Inheritance
FeedProvider
Implements
Derived
Inherited Members

Properties

ApplyDomain

[AddInParameter("ApplyDomain")]
[AddInLabel("Apply domain on Image/Asset path")]
[AddInParameterGroup("Options")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
public bool ApplyDomain { get; set; }

Property Value

bool

AssetCategories

[AddInParameter("AssetCategories")]
[AddInLabel("Asset Categories")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? AssetCategories { get; set; }

Property Value

string

AssetContent

[AddInParameter("AssetContent")]
[AddInLabel("Asset content")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=All selected")]
public string? AssetContent { get; set; }

Property Value

string

Assets

[AddInParameter("Assets")]
[AddInLabel("Assets")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? Assets { get; set; }

Property Value

string

ExcludeVariantInfoOnVariants

[AddInParameter("ExcludeVariantInfoOnVariants")]
[AddInLabel("Selected \"Variant Info\" will only be included on MASTER products")]
[AddInParameterGroup("Options")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
public bool ExcludeVariantInfoOnVariants { get; set; }

Property Value

bool

FieldDisplayGroups

[AddInParameter("FieldDisplayGroups")]
[AddInLabel("Field Display Groups")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=All selected;sortBy=none")]
public string? FieldDisplayGroups { get; set; }

Property Value

string

IsBinaryOutput

Indicates whether GetOutput(Feed, FeedContextConfiguration)/GetOutputAsync(Feed, FeedContextConfiguration, CancellationToken) return Base64-encoded binary content rather than plain text. Consumers must Base64-decode the result when this is true. Defaults to false so every existing text-based provider is unaffected.

public virtual bool IsBinaryOutput { get; }

Property Value

bool

Remarks

Read it after GetOutput(Feed, FeedContextConfiguration)/GetOutputAsync(Feed, FeedContextConfiguration, CancellationToken) has run for the feed: a provider may decide it from the feed's provider configuration, which it loads while producing the output.

Price

[AddInParameter("Price")]
[AddInLabel("Price")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? Price { get; set; }

Property Value

string

Product

[AddInParameter("Product")]
[AddInLabel("Product System Fields")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=All selected")]
public string? Product { get; set; }

Property Value

string

ProductCategoryFields

[AddInParameter("Product Category Fields")]
[AddInLabel("Product Category Fields")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? ProductCategoryFields { get; set; }

Property Value

string

ProductFields

[AddInParameter("Product Custom Fields")]
[AddInLabel("Product Custom Fields")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? ProductFields { get; set; }

Property Value

string

ProductsList

[AddInParameter("Products List")]
[AddInLabel("Products List")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? ProductsList { get; set; }

Property Value

string

ShowPricesWithVat

[AddInParameter("ShowPricesWithVat")]
[AddInLabel("Show prices with VAT")]
[AddInParameterGroup("Options")]
[AddInParameterEditor(typeof(YesNoParameterEditor), "")]
public bool ShowPricesWithVat { get; set; }

Property Value

bool

StockUnits

[AddInParameter("StockUnits")]
[AddInLabel("Stock units")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? StockUnits { get; set; }

Property Value

string

VariantInfo

[AddInParameter("VariantInfo")]
[AddInLabel("Variant Info")]
[AddInParameterGroup(" ")]
[AddInParameterEditor(typeof(SelectionBoxParameterEditor), "leftheader=Excluded properties;rightheader=Included properties;translateheaders=true;showsearchbox=true;nodatatextright=Nothing selected")]
public string? VariantInfo { get; set; }

Property Value

string

Methods

CreateProductListSettings(ProductCatalogSettings, FeedContextConfiguration)

Creates the setting for the Product List

protected ProductListViewModelSettings CreateProductListSettings(ProductCatalogSettings settings, FeedContextConfiguration feedContextConfiguration)

Parameters

settings ProductCatalogSettings

The settings used to generate the Product List Settings

feedContextConfiguration FeedContextConfiguration

The feed used to generate the Product List Settings

Returns

ProductListViewModelSettings

CreateProductViewModelSettings(ProductCatalogSettings, FeedContextConfiguration)

Creates the setting for the ProductViewModel

protected ProductViewModelSettings CreateProductViewModelSettings(ProductCatalogSettings settings, FeedContextConfiguration feedContextConfiguration)

Parameters

settings ProductCatalogSettings

The settings used to generate the settings for the ProductViewModel

feedContextConfiguration FeedContextConfiguration

The feed used to generate the settings for the ProductViewModel

Returns

ProductViewModelSettings

GenerateFeedSettings(Feed)

Generates the settings used by the ViewEngine

protected ProductCatalogSettings GenerateFeedSettings(Feed feed)

Parameters

feed Feed

The feed used as the source for the settings

Returns

ProductCatalogSettings

GetApiUrls(Feed, Uri, List<string>, List<string>)

public static List<string> GetApiUrls(Feed feed, Uri url, List<string> languages, List<string> currencies)

Parameters

feed Feed
url Uri
languages List<string>
currencies List<string>

Returns

List<string>

GetApiUrls(Feed, Uri, List<string>, List<string>, List<string>)

public static List<string> GetApiUrls(Feed feed, Uri url, List<string> languages, List<string> currencies, List<string> shops)

Parameters

feed Feed
url Uri
languages List<string>
currencies List<string>
shops List<string>

Returns

List<string>

GetApiUrls(Feed, Uri, List<string>, List<string>, List<string>, List<string>)

public static List<string> GetApiUrls(Feed feed, Uri url, List<string> languages, List<string> currencies, List<string> shops, List<string> countries)

Parameters

feed Feed
url Uri
languages List<string>
currencies List<string>
shops List<string>
countries List<string>

Returns

List<string>

GetContentType()

Gets the content type for the output

public abstract string? GetContentType()

Returns

string

GetContentTypeAsync(CancellationToken)

Async version of GetContentType for symmetry / future-proofing. Default just wraps the sync method.

public virtual ValueTask<string?> GetContentTypeAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask<string>

GetDomain()

protected string? GetDomain()

Returns

string

GetDomain(FeedContextConfiguration)

Gets the domain chosen in the feed context (e.g. on a Feed File Export task), or the domain of the current request when none is chosen.

protected string? GetDomain(FeedContextConfiguration feedContextConfiguration)

Parameters

feedContextConfiguration FeedContextConfiguration

The feed context configuration holding the chosen domain.

Returns

string

The domain including scheme, e.g. https://shop.example.com, or null when none is available.

Remarks

The chosen domain takes precedence: a task started with "Run now" in the admin runs on a thread that still sees the admin request, so the request domain would otherwise replace the domain the user selected.

GetFeedModel(Feed, FeedContextConfiguration)

protected ProductListViewModel GetFeedModel(Feed Feed, FeedContextConfiguration feedContextConfiguration)

Parameters

Feed Feed
feedContextConfiguration FeedContextConfiguration

Returns

ProductListViewModel

GetFileExtension()

Gets the file name extension, including the leading dot, for a file holding this provider's output - derived from GetContentType(), and ".txt" for a content type without a known extension.

public virtual string GetFileExtension()

Returns

string

GetOutput(Feed, FeedContextConfiguration)

This method is used to get the output of the feed

public abstract string GetOutput(Feed feed, FeedContextConfiguration feedContextConfiguration)

Parameters

feed Feed

The feed which should be used as the source for the output

feedContextConfiguration FeedContextConfiguration

Returns

string

GetOutputAsync(Feed, FeedContextConfiguration, CancellationToken)

Async version of GetOutput. Backwards compatible: default implementation calls the sync GetOutput. Override this in new providers that can do real async work.

public virtual Task<string> GetOutputAsync(Feed feed, FeedContextConfiguration feedContextConfiguration, CancellationToken cancellationToken = default)

Parameters

feed Feed
feedContextConfiguration FeedContextConfiguration
cancellationToken CancellationToken

Returns

Task<string>

GetParameterOptions(string)

public virtual IEnumerable<ParameterOption> GetParameterOptions(string dropdownName)

Parameters

dropdownName string

Returns

IEnumerable<ParameterOption>
To top