Exemple #1
0
        private IEnumerable <IContent> BringExistingNodeFirst(IContent node, IContent existingNode)
        {
            int cnt = _cs.CountChildren(node.Id);

            if (cnt <= 1)
            {
                return(Enumerable.Empty <IContent>());
            }
            return(BringExistingNodeFirstDo(node, existingNode, cnt));
        }
Exemple #2
0
        private void ContentService_Published(IContentService contentService, ContentPublishedEventArgs e)
        {
            foreach (var content in e.PublishedEntities)
            {
                if (content.ContentType.Alias.InvariantEquals(SiteContainer.ModelTypeAlias))
                {
                    var noOfChildren = contentService.CountChildren(content.Id);

                    if (noOfChildren == 0)
                    {
                        var domainService       = Current.Services.DomainService;
                        var localizationService = Current.Services.LocalizationService;
                        var domain = HttpContext.Current.Request.Url.Host;

                        var siteRoot = CreateSiteRoot(contentService, content, domainService, localizationService, domain);

                        CreateRepositories(contentService, content);
                        CreatePages(contentService, siteRoot);

                        contentService.SaveAndPublishBranch(content, true);
                    }
                }
            }
        }
 /// <summary>
 /// Returns true if there is any content in the recycle bin
 /// </summary>
 /// <param name="contentService"></param>
 /// <returns></returns>
 public static bool RecycleBinSmells(this IContentService contentService)
 {
     return(contentService.CountChildren(Constants.System.RecycleBinContent) > 0);
 }
 public int CountChildren(int parentId, string documentTypeAlias = null)
 {
     return(inner.CountChildren(parentId, documentTypeAlias));
 }