Exemplo 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 = ContentRepository.Content.Create(contentNode);

            content.ChildrenDefinition.EnableAutofilters    = FilterStatus.Disabled;
            content.ChildrenDefinition.EnableLifespanFilter = FilterStatus.Disabled;
            ChildCount = content.Children.Count();
        }
Exemplo n.º 2
0
        public ActionResult GetItem(string node)
        {
            AssertPermission();

            node = HttpUtility.UrlDecode(node);

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

            return(this.Json(a, JsonRequestBehavior.AllowGet));
        }