Inheritance: IContentStoreService
Esempio n. 1
0
        public Content(Node contentNode, bool includeProperties, bool includeChildren, bool onlyFileChildren, bool isContentType, int start, int limit)
        {
            ContentNode  = contentNode;
            withChildren = includeChildren;
            if (withChildren)
            {
                includeProperties = false;
            }

            if (includeProperties)
            {
                var types = new[] { DataType.Currency, DataType.DateTime,
                                    DataType.Int, DataType.String, DataType.Reference };
                this.Properties = contentNode.PropertyTypes
                                  .Where(pt => types.Contains(pt.DataType))
                                  .Where(pt => contentNode[pt] != null)
                                  .Select(pt => new ContentProperty(pt.DataType, pt.Name, EnsureData(contentNode[pt]))).ToArray();
            }

            if (!includeChildren)
            {
                return;
            }

            Children = new ContentStoreService().GetFeed2(ContentNode.Path, onlyFileChildren, false, start, limit);

            var content = SenseNet.ContentRepository.Content.Create(contentNode);

            content.ChildrenDefinition.EnableAutofilters    = FilterStatus.Disabled;
            content.ChildrenDefinition.EnableLifespanFilter = FilterStatus.Disabled;
            ChildCount = content.Children.Count();
        }
Esempio n. 2
0
        public Content(Node contentNode, bool includeProperties, bool includeChildren, bool onlyFileChildren, bool isContentType, int start, int limit)
        {
            ContentNode  = contentNode;
            withChildren = includeChildren;

            if (includeProperties)
            {
                var types = new[] { DataType.Currency, DataType.DateTime,
                                    DataType.Int, DataType.String, DataType.Reference };
                this.Properties = contentNode.PropertyTypes
                                  .Where(pt => types.Contains(pt.DataType))
                                  .Where(pt => contentNode[pt] != null)
                                  .Select(pt => new ContentProperty(pt.DataType, pt.Name, EnsureData(contentNode[pt]))).ToArray();
            }

            if (!includeChildren)
            {
                return;
            }

            Children = new ContentStoreService().GetFeed2(ContentNode.Path, onlyFileChildren, false, start, limit);

            var gc = ContentNode as sn.GenericContent;

            if (gc == null)
            {
                return;
            }

            ChildCount = gc.GetChildren(new QuerySettings {
                EnableAutofilters = false, EnableLifespanFilter = false
            }).Count;
        }
Esempio n. 3
0
        public ActionResult GetItem(string node)
        {
            AssertPermission();

            node = HttpUtility.UrlDecode(node);

            var a = new ContentStoreService().GetItem(node);

            return(this.Json(a, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetItem(string node)
        {
            AssertPermission();

            node = HttpUtility.UrlDecode(node);

            var a = new ContentStoreService().GetItem(node);
            return this.Json(a, JsonRequestBehavior.AllowGet);
        }
Esempio n. 5
0
        public Content(Node contentNode, bool includeProperties, bool includeChildren, bool onlyFileChildren, bool isContentType, int start, int limit)
        {
            ContentNode = contentNode;
            withChildren = includeChildren;

            if (includeProperties)
            {
                var types = new[] { DataType.Currency, DataType.DateTime, 
                    DataType.Int, DataType.String, DataType.Reference };
				this.Properties = contentNode.PropertyTypes
                    .Where(pt => types.Contains(pt.DataType))
                    .Where(pt => contentNode[pt] != null)
                    .Select(pt => new ContentProperty(pt.DataType, pt.Name, EnsureData(contentNode[pt]))).ToArray();
            }

		    if (!includeChildren) 
                return;

            Children = new ContentStoreService().GetFeed2(ContentNode.Path, onlyFileChildren, false, start, limit);

            var gc = ContentNode as sn.GenericContent;
            if (gc == null) 
                return;

            ChildCount = gc.GetChildren(new QuerySettings { EnableAutofilters = false, EnableLifespanFilter = false }).Count;
        }