Ejemplo n.º 1
0
 public getChildrenResponse(cmisObjectInFolderListType objects)
 {
     this.objects = objects;
 }
Ejemplo n.º 2
0
        public getChildrenResponse GetChildren(getChildrenRequest request)
        {
            var resultList = new cmisObjectInFolderListType();

            var repository = ModelHelper.GetRepository(request.repositoryId);


            IEnumerable<Kooboo.CMS.Content.Models.TextFolder> childFolders = null;
            if (request.folderId == "/")
            {
                childFolders = _textFolderManager.All(repository, null);
            }
            else
            {
                var textFolder = ModelHelper.GetTextFolder(request.repositoryId, request.folderId);
                childFolders = _textFolderManager.ChildFolders(textFolder);
            }

            resultList.numItems = childFolders.Count().ToString();
            var skipCount = 0;
            if (!string.IsNullOrEmpty(request.skipCount))
            {
                skipCount = request.skipCount.As<int>();
            }
            childFolders = childFolders.Skip(skipCount);
            if (string.IsNullOrEmpty(request.maxItems))
            {
                var maxItems = request.maxItems.As<int>();
                childFolders = childFolders.Take(maxItems);
            }
            resultList.objects = childFolders.Select(it => ToPathedCmisObject(it)/*ToPathedCmisObject(it)*/).ToArray();
            return new getChildrenResponse(resultList);
        }