public static ListResult <FolderFile> GetFileList(ListCommand command, int parentFolderId, LibraryFileFilter filter) { var factory = new SiteFolderFactory(); var repository = factory.CreateRepository(); var folder = repository.GetById(parentFolderId); if (folder == null) { throw new Exception(string.Format(LibraryStrings.SiteFolderNotExists, parentFolderId)); } return(folder.GetFiles(command, filter)); }
public static LibraryResult Library(int id, string subFolder) { if (!SiteRepository.Exists(id)) { throw new Exception(string.Format(SiteStrings.SiteNotFound, id)); } var factory = new SiteFolderFactory(); var repository = factory.CreateRepository(); var folder = repository.GetBySubFolder(id, subFolder); return(new LibraryResult { Folder = folder }); }
private static PathSecurityResult CheckSiteFolder(string pathToFind, int siteId) { var result = new PathSecurityResult(); var factory = new SiteFolderFactory(); var siteFolder = FindLongest(pathToFind, factory.CreateRepository().GetPaths(siteId)); if (siteFolder != null) { result.Result = SecurityRepository.IsEntityAccessible(EntityTypeCode.SiteFolder, siteFolder.Id, ActionTypeCode.Update); result.FolderId = siteFolder.Id; } else { result.Result = SecurityRepository.IsEntityAccessible(EntityTypeCode.Site, siteId, ActionTypeCode.Update); } return(result); }