Registering Pipe Settings
The pipe settings contain the information for creating a pipe. They are used to restore a pipe saved in the database.
Creating pipe settings
To create default pipe settings from the build-in Content pipe, use the following code:
PipeSettings defaultInboundPipeSettings = PublishingSystemFactory.CreateDefaultContentInboundPipeSettings("MyCustomPipeName");
PipeSettings defaultOutboundPipeSettings = PublishingSystemFactory.CreateDefaultContentOutboundPipeSettings("MyCustomPipeName");
To create custom pipe settings, use the following code:
PipeSettings pipeSettings = new PipeSettings();
pipeSettings.IsActive = true;
pipeSettings.IsInbound = false;
pipeSettings.InvocationMode = PipeInvokationMode.Push;
First, you create the pipe settings. Then, you mark the pipe as outbound and of push type.
Registering pipe settings
After you create the pipe settings, you must register them. Use the following code:
PublishingSystemFactory.RegisterPipeSettings("MyCustomPipeName", pipeSettings);
Modifying pipe settings
You can modify the settings of a build-in pipe or custom pipe.
To modify the pipe settings you use the GetPipeSettings method:
var pipeSettings = PublishingSystemFactory.GetPipeSettings(ContentInboundPipe.PipeName);
pipeSettings.MaxItems = 50;
The method GetPipeSettings accepts the name of the pipe as a parameter. After you retrieve the settings, you set the MaxItems property to 50. The method returns a copy of the registered settings. After your modifications, you must register them again to apply the changes:
PublishingSystemFactory.RegisterPipeSettings(ContentInboundPipe.PipeName, pipeSettings);