Beispiel #1
0
    /// <summary>
    /// Toggles which buckets and embeddables are enabled for this content revision by default.
    /// </summary>
    /// <param name="page">The IContentEntity object that represents the page.</param>
    private void LoadBucketsAndEmbeddables(IContentEntity page)
    {
        var    business = new Content();
        var    content  = (List <IContentRow>)business.LoadContent(page.CurrentRevision.Value);
        string bucket   = String.Empty;

        foreach (var b in content)
        {
            switch (b.bucketID)
            {
            case 1:
                chkHeader.Checked = true;
                bucket            = "AddHeaderEmbeddableRow";
                break;

            case 2:
                chkPrimaryNav.Checked = true;
                bucket = "AddPrimaryNavEmbeddableRow";
                break;

            case 3:
                chkContent.Checked = true;
                bucket             = "AddContentEmbeddableRow";
                break;

            case 4:
                chkSubNav.Checked = true;
                bucket            = "AddSubNavEmbeddableRow";
                break;

            case 5:
                chkFooter.Checked = true;
                bucket            = "AddFooterEmbeddableRow";
                break;

            default:
                break;
            }

            var uniqueID = Guid.NewGuid();

            AddEmbeddableRowToBucket(uniqueID.ToString(), bucket, b.embeddableID);
            AddEmbeddableToList(uniqueID, bucket, b.embeddableID);
        }
    }
        /// <summary>
        /// Loads the content for a page.
        /// </summary>
        /// <param name="id">the ID of the page</param>
        private void LoadContent(Guid id)
        {
            var business = new Content();

            _entity = business.GetContentEntity(id);

            IList <IContentRow> content = business.LoadContent(_entity.CurrentRevision.Value);

            foreach (IContentRow c in content)
            {
                string bucket = String.Empty;
                switch (c.bucketID)
                {
                case 1:
                    bucket = "header.ascx";
                    break;

                case 2:
                    bucket = "primarynav.ascx";
                    break;

                case 3:
                    bucket = "content.ascx";
                    break;

                case 4:
                    bucket = "subnav.ascx";
                    break;

                case 5:
                    bucket = "footer.ascx";
                    break;
                }

                LoadBuckets(bucket, c.embeddableID);
            }
        }