Exemplo n.º 1
0
        protected override void OnLoadSyndication(LoadSyndicationEventArgs e)
        {
            // add the item
            Entry entry = new Entry(
                this.SectionInformation.Title,
                this.SectionInformation.UrlPath,
                this.SectionInformation.Touched
                );

            entry.Links.Add(new Link(this.SectionInformation.UrlPath, LinkRelationship.Self));
            entry.Content = new ManagedFusion.Syndication.Content("text/html", this.Properties["Content"]);

            // add entry to the feed
            e.Syndication.Items.Add(entry);
        }
Exemplo n.º 2
0
        /// <summary></summary>
        public void ProcessRequest()
        {
            ManagedFusion.Modules.Configuration.ConfigurationPage page = null;

            // checks to see if the center module has anything added to it
            if (this.Config.Pages != null)
            {
                page = this.Config.FindPage(InternalLocation);

                // an alternative handler is being loaded so no futher processing has to be done
                if (page.Handler != null)
                    return;
            }

            // executes the correct even depending on if we are creating a page or syndication
            if (SectionInformation.Syndicated
                && Context.Request.Url.Query.ToLower().IndexOf("feed") > -1)
            {
                LoadSyndicationEventArgs pcea = new LoadSyndicationEventArgs(this._syndication);
                this.OnLoadSyndication(pcea);
            }
            else
            {
                Content beforeModule = new Content();
                Content afterModule = new Content();

                // setup content holders
                LoadModuleEventArgs phea = new LoadModuleEventArgs(
                    this._holders,
                    beforeModule,
                    afterModule
                    );
                this.OnLoad(phea);

                #region Controls Before the Module

                // add the controls that are before the module
                if (beforeModule.Controls.Count > 0)
                    this._centerHolder.Controls.Add(beforeModule);

                // center pane
                foreach (ContainerInfo c in this.SectionInformation.Containers.GetContainersForPosition((int)CenterPosition.BeforeModule))
                    this._centerHolder.Controls.Add(new ContainerHolder(c));

                #endregion

                // checks to see if the center module has anything added to it
                if (page != null && page.Control != null)
                {
                    // load current control according to the page address
                    foreach (Control c in GetControls(page))
                        this._centerHolder.Controls.Add(c);
                }

                #region Controls After the Module

                // add the controls that are after the module
                if (afterModule.Controls.Count > 0)
                    this._centerHolder.Controls.Add(afterModule);

                // center pane
                foreach (ContainerInfo c in this.SectionInformation.Containers.GetContainersForPosition((int)CenterPosition.AfterModule))
                    this._centerHolder.Controls.Add(new ContainerHolder(c));

                #endregion

                // configure the containers
                this.ConfigureContainers();
            }
        }
Exemplo n.º 3
0
 protected virtual void OnLoadSyndication(LoadSyndicationEventArgs e)
 {
     if (LoadSyndication != null)
         LoadSyndication(this, e);
 }
Exemplo n.º 4
0
        protected override void OnLoadSyndication(LoadSyndicationEventArgs e)
        {
            BlogDatabaseProvider dbprovider = Databases.Providers["OmniPortalBlog"] as BlogDatabaseProvider;
            BlogItem[] blogs = dbprovider.GetBlogs(this.Context);
            DateTime modified = DateTime.MinValue;

            // set the title for the feed
            e.Syndication.Title.InnerText = this.Properties["BlogTitle"];

            // populate content for syndication
            foreach(BlogItem blog in blogs)
            {
                // check to see if this blog is suppose to be syndicated
                // or has even been published yet
                if (blog.Syndicate == false || blog.Published == false)
                    continue;

                // check to see if the blog date modified is more recent than
                // the previous modified value
                if (blog.Modified > modified)
                    modified = blog.Modified;

                // get url id for the current entry
                Uri permalink = Common.Path.GetPortalUrl(String.Format("/archive/{0}.aspx", blog.ID));

                // add the item
                Entry entry = new Entry(
                    blog.Title,
                    permalink,
                    blog.Modified
                    );

                // set the author
                entry.Authors.Add(new Person("Fix Me")); // blog.Poster.FullName

                // set the title
                entry.Title.InnerText = blog.Title;

                // if there is a url for the title
                if (blog.TitleUrl != null)
                    entry.Links.Add(new Link(blog.TitleUrl, blog.Title, LinkRelationship.Alternate, "text/html"));

                // if there is a source url
                if (blog.SourceUrl != null)
                    entry.Links.Add(new Link(blog.SourceUrl, blog.Source, LinkRelationship.Related, "text/html"));

                // set the date time stamps for this entry
                entry.Published = blog.Issued;

                // set the body contents
                entry.Content = new Content("text/html", blog.Body);

                // add entry to the feed
                e.Syndication.Items.Add(entry);
            }

            // set the time the feed was last modified
            e.Syndication.Updated = modified;

            base.OnLoadSyndication (e);
        }