Registering the Pipe

To register the pipe, perform the following procedure:

  1. Register the pipe components by adding the following code:
    private void RegisterXmlInboundPipe()
    {
        PublishingSystemFactory.RegisterPipe(XmlInboundPipe.PipeName, typeof(XmlInboundPipe));
     
        var mappingsList = XmlInboundPipe.GetDefaultMapping();
        PublishingSystemFactory.RegisterPipeMappings(XmlInboundPipe.PipeName, true, mappingsList);
     
        SitefinityContentPipeSettings pipeSettings = new SitefinityContentPipeSettings();
        pipeSettings.IsInbound = true;
        pipeSettings.IsActive = true;
        pipeSettings.MaxItems = 25;
        pipeSettings.InvocationMode = PipeInvokationMode.Push;
        pipeSettings.ContentTypeName = typeof(Telerik.Sitefinity.News.Model.NewsItem).FullName;
        pipeSettings.UIName = "XmlInboundPipeName";
        pipeSettings.PipeName = XmlInboundPipe.PipeName;
        pipeSettings.ResourceClassId = typeof(PublishingModuleExtensionsResources).Name;
     
        PublishingSystemFactory.RegisterPipeSettings(XmlInboundPipe.PipeName, pipeSettings);
     
        var definitions = XmlInboundPipe.CreateDefaultPipeDefinitions();
        PublishingSystemFactory.RegisterPipeDefinitions(XmlInboundPipe.PipeName, definitions);
    }
  2. Install the custom virtual paths by adding the following code:
    public static readonly string PublishingVirtualPath = "~/SFPublishing/";
     
    private void InstallCustomVirtualPaths( SiteInitializer initializer )
    {
        var virtualPathConfig = initializer.Context.GetConfig<VirtualPathSettingsConfig>();
        ConfigManager.Executed += new EventHandler<ExecutedEventArgs>( ConfigManager_Executed );
        var productsModuleVirtualPathConfig = new VirtualPathElement( virtualPathConfig.VirtualPaths )
        {
            VirtualPath = PublishingSystemExtensionsModule.PublishingVirtualPath + "*",
            ResolverName = "EmbeddedResourceResolver",
            ResourceLocation = "PublishingModuleExtensions"
        };
        if ( !virtualPathConfig.VirtualPaths.ContainsKey( PublishingSystemExtensionsModule.PublishingVirtualPath + "*" ) )
            virtualPathConfig.VirtualPaths.Add( productsModuleVirtualPathConfig );
    }
     
    private void ConfigManager_Executed( object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args )
    {
        if ( args.CommandName == "SaveSection" )
        {
            var section = args.CommandArguments as VirtualPathSettingsConfig;
            if ( section != null )
            {
                VirtualPathManager.Reset();
            }
        }
    }

First, you register the pipe and its components. Then, you create and register the mappings, settings and definitions. Finally, you install the custom virtual paths.

Next steps

+1-888-365-2779
sales@sitefinity.com

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