Exemple #1
0
 public getFolderTreeResponse(cmisObjectInFolderContainerType[] objects)
 {
     this.objects = objects;
 }
Exemple #2
0
        public getFolderTreeResponse GetFolderTree(getFolderTreeRequest request)
        {
            var resultList = new cmisObjectListType();
            var repository = ModelHelper.GetRepository(request.repositoryId);

            cmisObjectInFolderContainerType root = new cmisObjectInFolderContainerType();
            IEnumerable<Kooboo.CMS.Content.Models.TextFolder> childFolders = null;
            if (request.folderId == "/")
            {
                root.objectInFolder = new cmisObjectInFolderType() { pathSegment = "/" };
                childFolders = _textFolderManager.All(repository, null);
            }
            else
            {
                var textFolder = ModelHelper.GetTextFolder(request.repositoryId, request.folderId);
                root.objectInFolder = ToPathedCmisObject(textFolder);
                childFolders = _textFolderManager.ChildFolders(textFolder);
            }
            int? maxDepth = null;
            if (!string.IsNullOrEmpty(request.depth))
            {
                maxDepth = request.depth.As<int>();
            }
            root.children = childFolders.Select(it => ToPathedCmisObjectContainer(it, maxDepth)).Where(it => it != null).ToArray();

            return new getFolderTreeResponse(new[] { root });
        }
Exemple #3
0
 public getDescendantsResponse(cmisObjectInFolderContainerType[] objects)
 {
     this.objects = objects;
 }
Exemple #4
0
 private cmisObjectInFolderContainerType ToPathedCmisObjectContainer(Kooboo.CMS.Content.Models.TextFolder textFolder, int? maxDepth)
 {
     if (maxDepth != null && textFolder.NamePaths.Length > maxDepth.Value)
     {
         return null;
     }
     cmisObjectInFolderContainerType container = new cmisObjectInFolderContainerType();
     container.objectInFolder = ToPathedCmisObject(textFolder);
     container.children = _textFolderManager.ChildFolders(textFolder).Select(it => ToPathedCmisObjectContainer(it, maxDepth)).Where(it => it != null).ToArray();
     return container;
 }