Register pipe settings

The pipe settings contain the information for creating a pipe. They are used to restore a pipe saved in the database.

  1. Create the pipe settings.
    You create default pipe settings from the built-in Content pipe. You then create the custom pipe settings. Then, you mark the pipe as outbound and of push type.

  2. Register the pipe settings.
    After you create the pipe settings, you must register them.

  3. Modify pipe settings
    You can modify the settings of a built-in pipe or custom pipe.
    To modify the pipe settings you use the GetPipeSettings method.

    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.

Use the following code sample:

C#
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);
       }
   }
}
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
New to Sitefinity?