Class CatalogItemAssetImportExport
Implements bulk catalog item asset import/export through serialized objects.
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.Assets.ImportExport
Assembly: Mediachase.Commerce.dll
Version: 10.8.0Syntax
public class CatalogItemAssetImportExport
Remarks
Asset path: For now, it is the file name, which matches up to the Name column in the tblWorkContent table in the CMS database. This may change to use actual file paths (blob paths?) in the future. Asset key: Matches the ContentGUID column in tblContent. This is not exported and is only for internal use. Currently during import/export, the asset key is used to match the file specified by the AssetPath element (in the XML) with image content in the CMS database. Asset type: Currently, this is the qualified class names of applicable content class (IContentImage). This may change to allow users to specify MIME types in the future.
Constructors
CatalogItemAssetImportExport()
Declaration
[Obsolete("This constructor is no longer used, use one with EntryIdentityResolver instead. Will remain at least until Feb 2018.")]
public CatalogItemAssetImportExport()
CatalogItemAssetImportExport(ICatalogSystem)
Declaration
[Obsolete("This constructor is no longer used, use one with EntryIdentityResolver instead. Will remain at least until Feb 2018.")]
public CatalogItemAssetImportExport(ICatalogSystem catalogSystem)
Parameters
Type | Name | Description |
---|---|---|
ICatalogSystem | catalogSystem |
CatalogItemAssetImportExport(ICatalogSystem, IContentLoader, NodeIdentityResolver, EntryIdentityResolver)
Declaration
[Obsolete("This constructor is no longer used, use one with IMimeTypeResolver instead. Will remain at least until July 2018.")]
public CatalogItemAssetImportExport(ICatalogSystem catalogSystem, IContentLoader contentLoader, NodeIdentityResolver nodeIdentityResolver, EntryIdentityResolver entryIdentityResolver)
Parameters
Type | Name | Description |
---|---|---|
ICatalogSystem | catalogSystem | |
EPiServer.IContentLoader | contentLoader | |
NodeIdentityResolver | nodeIdentityResolver | |
EntryIdentityResolver | entryIdentityResolver |
CatalogItemAssetImportExport(ICatalogSystem, IContentLoader, NodeIdentityResolver, EntryIdentityResolver, IMimeTypeResolver)
Initializes a new instance of the CatalogItemAssetImportExport class.
Declaration
public CatalogItemAssetImportExport(ICatalogSystem catalogSystem, IContentLoader contentLoader, NodeIdentityResolver nodeIdentityResolver, EntryIdentityResolver entryIdentityResolver, IMimeTypeResolver mimeTypeResolver)
Parameters
Type | Name | Description |
---|---|---|
ICatalogSystem | catalogSystem | The catalog system. |
EPiServer.IContentLoader | contentLoader | The content loader. |
NodeIdentityResolver | nodeIdentityResolver | The node identity resolver. |
EntryIdentityResolver | entryIdentityResolver | The entry identity resolver. |
EPiServer.Web.IMimeTypeResolver | mimeTypeResolver | The mime type resolver |
CatalogItemAssetImportExport(ICatalogSystem, IContentRepository)
Declaration
[Obsolete("This constructor is no longer used, use one with EntryIdentityResolver instead. Will remain at least until Feb 2018.")]
public CatalogItemAssetImportExport(ICatalogSystem catalogSystem, IContentRepository contentRepository)
Parameters
Type | Name | Description |
---|---|---|
ICatalogSystem | catalogSystem | |
EPiServer.IContentRepository | contentRepository |
Properties
AddMessage
Declaration
public Action<IBackgroundTaskMessage> AddMessage { get; set; }
Property Value
Type | Description |
---|---|
System.Action<IBackgroundTaskMessage> |
Methods
ExportXml(String)
Exports catalog item assets into an XML file to be used for bulk import.
Declaration
public void ExportXml(string outputPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | outputPath | Path to write the XML export to. |
ExportXml(XmlWriter)
Declaration
public void ExportXml(XmlWriter exportWriter)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | exportWriter |
ImportXml(String, OverwriteOptionsEnum)
Imports catalog item assets in bulk from a pre-existing XML file.
Declaration
public bool ImportXml(string sourceXmlFile, OverwriteOptionsEnum overwriteOptions)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceXmlFile | XML file name. |
OverwriteOptionsEnum | overwriteOptions | Option to overwrite catalog item assets. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if import succeeds. |
ImportXml(XmlReader, OverwriteOptionsEnum)
Imports catalog item assets in bulk from an XML stream.
Declaration
public bool ImportXml(XmlReader reader, OverwriteOptionsEnum overwriteOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | XML reader for incoming stream. |
OverwriteOptionsEnum | overwriteOptions | Option to overwrite catalog item assets. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if import succeeds. |