Register pipe settings
The pipe settings contain the information for creating a pipe. They are used to restore a pipe saved in the database.
-
Create the pipe settings.
You create default pipe settings from the built-inContentpipe. You then create the custom pipe settings. Then, you mark the pipe as outbound and of push type. -
Register the pipe settings.
After you create the pipe settings, you must register them. -
Modify pipe settings
You can modify the settings of a built-in pipe or custom pipe.
To modify the pipe settings you use theGetPipeSettingsmethod.The method
GetPipeSettingsaccepts the name of the pipe as a parameter. After you retrieve the settings, you set theMaxItemsproperty to 50. The method returns a copy of the registered settings. After your modifications, you must register them again to apply the changes.
Use the following code sample:
using Telerik.Sitefinity.Publishing;
using Telerik.Sitefinity.Publishing.Model;
using Telerik.Sitefinity.Publishing.Pipes;
namespace SitefinityWebApp
{
public class RegisterPipeSettings
{
public static void RegisterThePipeSettings()
{
// Get the default pipe settings using GetTemplatePipeSettings implemented in each pipe
PipeSettings defaultContentInboundPipeSettings = ContentInboundPipe.GetTemplatePipeSettings();
// To create custom pipe settings, use the following code
PipeSettings customPipeSettings = new PipeSettings();
customPipeSettings.IsActive = true;
customPipeSettings.IsInbound = false;
customPipeSettings.InvocationMode = PipeInvokationMode.Push;
// After creating the pipe settings, they can be registered
PublishingSystemFactory.RegisterPipeSettings("MyCustomPipeName", customPipeSettings);
// To get pipe settings for registered pipe use PublishingSystemFactory.GetPipeSettings
var changedPipeSettings = PublishingSystemFactory.GetPipeSettings(ContentInboundPipe.PipeName);
changedPipeSettings.MaxItems = 50;
// After we retrieve the settings, we set the MaxItems property to 50. The method returns a copy of the registered settings. After the modifications, we must register them again to apply the changes.
PublishingSystemFactory.RegisterPipeSettings(ContentInboundPipe.PipeName, changedPipeSettings);
}
}
}