SaaS CMS has officially launched! Learn more now.

Interface IContentChannelHandler

Specifies methods for manage data in EPiServer through a channel

Namespace: EPiServer.BaseLibrary
Assembly: EPiServer.dll
Version: 7.19.2
Syntax
public interface IContentChannelHandler

Methods

AppendDataToFile(String, String, Byte[], Boolean)

Appends data to a file.

Declaration
void AppendDataToFile(string channelId, string virtualFilePath, byte[] data, bool expectMoreData)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used

System.String virtualFilePath

The virtual path to the file

System.Byte[] data

The data to append to the file

System.Boolean expectMoreData

if set to true data is chunked and more data is expected.

DeleteContent(String, Guid)

Deletes the content with specified id.

Declaration
void DeleteContent(string channelId, Guid contentId)
Parameters
Type Name Description
System.String channelId

The channel id.

System.Guid contentId

The content id.

Remarks

All languages of the content will be deleted

DeleteContentLanguage(String, Guid, String)

Deletes a language version of a content.

Declaration
void DeleteContentLanguage(string channelId, Guid contentId, string cultureName)
Parameters
Type Name Description
System.String channelId

The channel id.

System.Guid contentId

The content id.

System.String cultureName

Name of the culture.

Remarks

It is not possible to delete MasterLanguage for a content without deleting content for all languages. In that case DeleteContent should be called without cultureName

Exceptions
Type Condition
System.InvalidOperationException

Will be thrown if language is MasterLanguage for content

DeleteDirectory(String, String)

Deletes the directory with the specified virtual path (which can be relative channel rootpath).

Declaration
void DeleteDirectory(string channelId, string virtualFilePath)
Parameters
Type Name Description
System.String channelId

The channel id.

System.String virtualFilePath

The virtual file path. If the path not starts with '~/' it will be appended to channel root path

DeleteFile(String, Guid, String)

Deletes a file from the page directory PageFile with the specified parent page and file name.

Declaration
void DeleteFile(string channelId, Guid pageId, string fileName)
Parameters
Type Name Description
System.String channelId

The channel id

System.Guid pageId

Id of parent page

System.String fileName

Name of file

DeleteFile(String, String)

Deletes the file with the specified virtual path (which can be relative channel rootpath).

Declaration
void DeleteFile(string channelId, string virtualFilePath)
Parameters
Type Name Description
System.String channelId

The channel id.

System.String virtualFilePath

The virtual file path. If the path not starts with '~/' it will be appended to channel root path

ImportContent(String, String, IDictionary<String, String>)

Creates a new content in EpiServer according to specified data and channel data.

Declaration
Guid ImportContent(string channelId, string contentName, IDictionary<string, string> propertyMap)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.String contentName

Name of the content.

System.Collections.Generic.IDictionary<System.String, System.String> propertyMap

The property map consisting of property name/property value

Returns
Type Description
System.Guid

The id of the created page

ImportContent(String, String, IDictionary<String, String>, String, Guid, Guid, String)

Creates or Updates a conent instance in EPiServer

Declaration
Guid ImportContent(string channelId, string contentName, IDictionary<string, string> propertyMap, string cultureName, Guid contentId, Guid parentContentId, string contentTypeName)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.String contentName

Name of the content.

System.Collections.Generic.IDictionary<System.String, System.String> propertyMap

The property map consisting of property name/property value

System.String cultureName

Name of the culture for the page

System.Guid contentId

The content id.

System.Guid parentContentId

The parent content id.

System.String contentTypeName

Name of the content type.

Returns
Type Description
System.Guid

The id of the created content.

Remarks

If parentContentId is System.Guid.Empty will the item be created under pageroot, fileroot or blockroot depending on which type contentTypeName refers to.

ImportFile(String, Byte[], Boolean, Guid, String, IDictionary<String, String>)

Imports a file to EPiServer according to a specified ContentChannel.

Declaration
string ImportFile(string channelId, byte[] data, bool expectMoreData, Guid fileId, string channelRelativeFilePath, IDictionary<string, string> summary)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.Byte[] data

The data to write to file

System.Boolean expectMoreData

if set to true data is chunked and more data is expected.

System.Guid fileId

The identity for the file

System.String channelRelativeFilePath

The file path relative to the root given on the ContentChannel. File name should be included in path

System.Collections.Generic.IDictionary<System.String, System.String> summary

Meta data for the file

Returns
Type Description
System.String

The virtual path to the created file

ImportFile(String, Byte[], Boolean, Guid, String, IDictionary<String, String>, Guid)

Imports the file to a page folder according to a specified ContentChannel.

Declaration
string ImportFile(string channelId, byte[] data, bool expectMoreData, Guid fileId, string fileName, IDictionary<string, string> summary, Guid pageId)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.Byte[] data

The data to write to file

System.Boolean expectMoreData

if set to true data is chunked and more data is expected.

System.Guid fileId

The identity for the file

System.String fileName

Name of the file.

System.Collections.Generic.IDictionary<System.String, System.String> summary

Meta data for the file.

System.Guid pageId

The id for the page whose page folder the file will be created in

Returns
Type Description
System.String

The virtual path to the created file

ImportFile(String, Byte[], Boolean, String)

Imports a file to EPiServer according to a specified ContentChannel.

Declaration
string ImportFile(string channelId, byte[] data, bool expectMoreData, string channelRelativeFilePath)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.Byte[] data

The data to write to file

System.Boolean expectMoreData

if set to true if more data is expected

System.String channelRelativeFilePath

The file path relative to the root given on the ContentChannel. File name should be included in path

Returns
Type Description
System.String

The virtual path to the created file

ImportFileMetaData(String, String, IDictionary<String, String>)

Imports metadata for a file to EPiServer according to a specified ContentChannel.

Declaration
string ImportFileMetaData(string channelId, string virtualFilePath, IDictionary<string, string> summary)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.String virtualFilePath

The virtual file path. If the path not starts with '~/' it will be appended to channel root path

System.Collections.Generic.IDictionary<System.String, System.String> summary

Meta data for the file

Returns
Type Description
System.String

The virtual path for the file

Extension Methods