Registering Pipe Definitions

The pipe definitions are a collection of items describing the type members used by the mappings. They are used in the UI for changing the default mappings.

Creating pipe definitions

To create default pipe definitions from the build-in Content pipe, use the following code:

IDefinitionField[] definitions = PublishingSystemFactory.CreateDefaultContentPipeDefinitions();

To create custom pipe definitions, use the following code:

IDefinitionField[] definitions = new IDefinitionField[]
{
    new SimpleDefinitionField(PublishingConstants.FieldContent, Res.Get<PublishingMessages>().RssContent),
    new SimpleDefinitionField(PublishingConstants.FieldLink, Res.Get<PublishingMessages>().RssLink)
};

Registering pipe definitions

After you create the pipe definitions, you must register them. Use the following code:

PublishingSystemFactory.RegisterPipeDefinitions("MyCustomPipeName", definitions);

Modifying pipe definitions

You can modify the definitions of a build-in pipe or custom pipe.

To modify the pipe definitions you use the GetPipeDefinitions method:

var definitions = PublishingSystemFactory.GetPipeDefinitions( ContentInboundPipe.PipeName );

The method GetPipeDefinitions accepts the name of the pipe as a parameter. It returns a copy of the registered definitions. After your modifications, you must register them again to apply the changes:

PublishingSystemFactory.RegisterPipeDefinitions( ContentInboundPipe.PipeName, definitions );

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK