Esempio n. 1
0
        public ITreeNode GetDocument(int NodeID, string PageType = null, string[] Columns = null)
        {
            DocumentQuery Query = (!string.IsNullOrWhiteSpace(PageType) ? new DocumentQuery(PageType) : new DocumentQuery());

            Query.Culture(cultureName)
            .CombineWithDefaultCulture()
            .CombineWithAnyCulture()
            .Published(!latestVersionEnabled)
            .LatestVersion(latestVersionEnabled)
            .OnSite(_SiteRepo.CurrentSiteName());
            if (Columns != null && Columns.Length > 0)
            {
                Query.Columns(Columns);
            }
            Query.WhereEquals("NodeID", NodeID);
            return(Query.FirstOrDefault());
        }
Esempio n. 2
0
        private ITreeNode GetDocumentByNodeGuidInternal(Guid NodeGuid, string SiteName, string Culture, string[] Columns = null, string PageType = null)
        {
            DocumentQuery Query = (!string.IsNullOrWhiteSpace(PageType) ? new DocumentQuery(PageType) : new DocumentQuery());

            Query.Culture(Culture)
            .CombineWithDefaultCulture()
            .CombineWithAnyCulture()
            .Published(!_repoContext.PreviewEnabled())
            .LatestVersion(_repoContext.PreviewEnabled())
            .OnSite(SiteName);
            if (Columns != null && Columns.Length > 0)
            {
                Query.Columns(Columns);
            }
            Query.WhereEquals("NodeGuid", NodeGuid);
            return(Query.FirstOrDefault());
        }
Esempio n. 3
0
        public ITreeNode GetDocumentByNodeID(int NodeID, string Culture, string[] Columns = null, string PageType = null)
        {
            DocumentQuery Query = (!string.IsNullOrWhiteSpace(PageType) ? new DocumentQuery(PageType) : new DocumentQuery());

            string CultureToUse = (!string.IsNullOrWhiteSpace(Culture) ? Culture : _repoContext.CurrentCulture());

            Query.Culture(CultureToUse)
            .CombineWithDefaultCulture()
            .CombineWithAnyCulture()
            .Published(!_repoContext.PreviewEnabled())
            .LatestVersion(_repoContext.PreviewEnabled());

            if (Columns != null && Columns.Length > 0)
            {
                Query.Columns(Columns);
            }
            Query.WhereEquals("NodeID", NodeID);
            return(Query.FirstOrDefault());
        }