protected void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
        {
            //Register Inbound Pipe
            PublishingSystemFactory.RegisterPipe(XmlInboundPipe.PipeName, typeof(XmlInboundPipe));

            //Register Mappings
            var mappingsList = XmlInboundPipe.GetDefaultMapping();
            PublishingSystemFactory.RegisterPipeMappings(XmlInboundPipe.PipeName, true, mappingsList);

            //Register Pipe Settings
            RssPipeSettings pipeSettings = new RssPipeSettings();
            pipeSettings.IsInbound = true;
            pipeSettings.IsActive = true;
            pipeSettings.MaxItems = 25;
            pipeSettings.InvocationMode = PipeInvokationMode.Push;
            pipeSettings.UIName = "Brafton Feed";
            pipeSettings.PipeName = XmlInboundPipe.PipeName;
            pipeSettings.ResourceClassId = typeof(PublishingModuleExtensionsResources).Name;

            PublishingSystemFactory.RegisterPipeSettings(XmlInboundPipe.PipeName, pipeSettings);

            //Register Pipe Definitions
            var definitions = XmlInboundPipe.CreateDefaultPipeDefinitions();
            PublishingSystemFactory.RegisterPipeDefinitions(XmlInboundPipe.PipeName, definitions);

            //Register Outbound Pipe
            PublishingSystemFactory.RegisterPipe(CustomContentOutboundPipe.PipeName, typeof(CustomContentOutboundPipe));
        }
示例#2
0
        /// <inheritdoc />
        public virtual FeedViewModel GetViewModel()
        {
            var viewModel = new FeedViewModel();

            viewModel.InsertionOption = this.InsertionOption;
            viewModel.CssClass        = this.CssClass;

            if (this.FeedId != null && this.FeedId != Guid.Empty)
            {
                RssPipeSettings pipe = PublishingManager.GetManager().GetPipeSettings <RssPipeSettings>().Where(p => p.Id == this.FeedId).FirstOrDefault();
                if (pipe != null)
                {
                    string url   = RouteHelper.ResolveUrl(String.Concat("~/", Config.Get <PublishingConfig>().FeedsBaseURl, "/", pipe.UrlName), UrlResolveOptions.Absolute);
                    string title = (!string.IsNullOrEmpty(this.TextToDisplay)) ? HttpUtility.HtmlEncode(this.TextToDisplay) : string.Empty;

                    if (this.InsertionOption == FeedInsertionOption.AddressBarOnly || this.InsertionOption == FeedInsertionOption.PageAndAddressBar)
                    {
                        viewModel.HeadLink = string.Format(
                            CultureInfo.CurrentCulture,
                            @"<link rel=""alternate"" type=""application/rss+xml"" title=""{0}"" href=""{1}""/>",
                            title,
                            url);
                    }
                    if (this.InsertionOption == FeedInsertionOption.PageOnly || this.InsertionOption == FeedInsertionOption.PageAndAddressBar)
                    {
                        viewModel.Title           = title;
                        viewModel.Url             = url;
                        viewModel.Tooltip         = this.Tooltip;
                        viewModel.OpenInNewWindow = this.OpenInNewWindow;
                    }
                }
            }

            return(viewModel);
        }