public override NCMIS.ObjectModel.MetaData.TypeDefinitionList GetTypeChildren(string repositoryId, string typeId, bool includePropertyDefinitions, int?maxItems, int skipCount) { var list = new NCMIS.ObjectModel.MetaData.TypeDefinitionList() { Types = new TypeDefinition[0] }; if (string.IsNullOrEmpty(typeId)) { Kooboo.CMS.Content.Models.Repository repository = new Models.Repository(repositoryId); var schemas = ServiceFactory.SchemaManager.All(repository, "").Select(it => new TypeDocumentDefinition() { Versionable = false, ContentStreamAllowed = NCMIS.ObjectModel.MetaData.ContentStreamAllowed.Allowed, BaseId = BaseObjectTypeId.CmisDocument, ControllableAcl = false, ControllablePolicy = false, Creatable = true, Description = it.Name, DisplayName = it.Name, Fileable = false, FulltextIndexed = false, Id = it.Name, IncludedInSupertypeQuery = false, LocalName = it.Name, LocalNamespace = typeof(Schema).ToString(), ParentId = "", Queryable = true, QueryName = "Schema", PropertyDefinitions = includePropertyDefinitions ? null : it.AsActual().Columns.Select(c => ColumnDefinition(c)).ToArray() }).Skip(skipCount); var count = schemas.Count(); var take = maxItems.HasValue ? maxItems.Value : count; list.NumItems = count.ToString(); list.HasMoreItems = count > count + take; list.Types = schemas.Take(take).ToArray(); } return(list); }
public override NCMIS.ObjectModel.MetaData.TypeDefinitionList GetTypeChildren(string repositoryId, string typeId, bool includePropertyDefinitions, int? maxItems, int skipCount) { var list = new NCMIS.ObjectModel.MetaData.TypeDefinitionList() { Types = new TypeDefinition[0] }; if (string.IsNullOrEmpty(typeId)) { Kooboo.CMS.Content.Models.Repository repository = new Models.Repository(repositoryId); var schemas = ServiceFactory.SchemaManager.All(repository, "").Select(it => new TypeDocumentDefinition() { Versionable = false, ContentStreamAllowed = NCMIS.ObjectModel.MetaData.ContentStreamAllowed.Allowed, BaseId = BaseObjectTypeId.CmisDocument, ControllableAcl = false, ControllablePolicy = false, Creatable = true, Description = it.Name, DisplayName = it.Name, Fileable = false, FulltextIndexed = false, Id = it.Name, IncludedInSupertypeQuery = false, LocalName = it.Name, LocalNamespace = typeof(Schema).ToString(), ParentId = "", Queryable = true, QueryName = "Schema", PropertyDefinitions = includePropertyDefinitions ? null : it.AsActual().Columns.Select(c => ColumnDefinition(c)).ToArray() }).Skip(skipCount); var count = schemas.Count(); var take = maxItems.HasValue ? maxItems.Value : count; list.NumItems = count.ToString(); list.HasMoreItems = count > count + take; list.Types = schemas.Take(take).ToArray(); } return list; }