public TextFolderManagerWrapper(ITextFolderProvider textFolderProvider, TextFolderManager textFolderManger, ISiteProvider siteProvider) : base(textFolderProvider) { _textFolderManager = textFolderManger; _siteProvider = siteProvider; }
public TextContentController(TextContentManager textContentManager, TextFolderManager textFolderManager, WorkflowManager workflowManager, ITextContentBinder binder) { TextContentManager = textContentManager; TextFolderManager = textFolderManager; WorkflowManager = workflowManager; Binder = binder; }
public Service(RepositoryManager repositoryManager, SchemaManager schemaManager, TextFolderManager textFolderManager , IIncomeDataManager incomeDataManager) { _textFolderManager = textFolderManager; _repositoryManager = repositoryManager; _schemaManager = schemaManager; _incomeDataManager = incomeDataManager; }
public Service(RepositoryManager repositoryManager, SchemaManager schemaManager, TextFolderManager textFolderManager, SiteManager siteManager , IIncomeDataManager incomeDataManager) { _textFolderManager = textFolderManager; _repositoryManager = repositoryManager; _schemaManager = schemaManager; _incomeDataManager = incomeDataManager; _siteManager = siteManager; }
public Service(RepositoryManager repositoryManager, SchemaManager schemaManager, TextFolderManager textFolderManager, SiteManager siteManager , IIncomeDataManager incomeDataManager, ITextContentProvider textContentProvider) { _textFolderManager = textFolderManager; _repositoryManager = repositoryManager; _schemaManager = schemaManager; _incomeDataManager = incomeDataManager; _siteManager = siteManager; _textContentProvider = textContentProvider; }
public object OnResolved(object resolvedObject) { if (resolvedObject != null) { // Sync content folder if (resolvedObject is TextFolderManager) { ITextFolderProvider textFolderProvider = EngineContext.Current.Resolve <ITextFolderProvider>(); TextFolderManager textFolderManager = (TextFolderManager)resolvedObject; ISiteProvider siteProvider = EngineContext.Current.Resolve <ISiteProvider>(); return(new TextFolderManagerWrapper(textFolderProvider, textFolderManager, siteProvider)); } } return(resolvedObject); }
public object OnResolved(object resolvedObject) { if (resolvedObject != null) { // Sync content folder if (resolvedObject is TextFolderManager) { ITextFolderProvider textFolderProvider = EngineContext.Current.Resolve <ITextFolderProvider>(); TextFolderManager textFolderManager = (TextFolderManager)resolvedObject; ISiteProvider siteProvider = EngineContext.Current.Resolve <ISiteProvider>(); return(new TextFolderManagerWrapper(textFolderProvider, textFolderManager, siteProvider)); } // Sync content schema if (resolvedObject is ISchemaProvider) { ISchemaProvider schemaProvider = (ISchemaProvider)resolvedObject; ISiteProvider siteProvider = EngineContext.Current.Resolve <ISiteProvider>(); return(new SchemaProviderWrapper(schemaProvider, siteProvider)); } if (resolvedObject is SchemaManager) { ISchemaProvider schemaProvider = EngineContext.Current.Resolve <ISchemaProvider>(); SchemaManager schemaManager = (SchemaManager)resolvedObject; ISiteProvider siteProvider = EngineContext.Current.Resolve <ISiteProvider>(); return(new SchemaManagerWrapper(schemaProvider, schemaManager, siteProvider)); } // Sync site setting if (resolvedObject is SiteManager) { ISiteProvider siteProvider = EngineContext.Current.Resolve <ISiteProvider>(); IRepositoryProvider repositoryProvider = EngineContext.Current.Resolve <IRepositoryProvider>(); SiteManagerWrapper siteManagerWrapper = new SiteManagerWrapper(siteProvider, repositoryProvider); return(siteManagerWrapper); } } return(resolvedObject); }
public virtual ActionResult Delete(string folderName, string parentFolder, string[] folders, string[] docs) { var data = new JsonResultData(ModelState); data.RunWithTry((resultData) => { TextFolder textFolder = new TextFolder(Repository, folderName).AsActual(); var schema = textFolder.GetSchema().AsActual(); if (docs != null) { foreach (var doc in docs) { if (string.IsNullOrEmpty(doc)) { continue; } TextContentManager.Delete(Repository, textFolder, doc); } } if (folders != null) { foreach (var f in folders) { if (string.IsNullOrEmpty(f)) { continue; } var folderPathArr = FolderHelper.SplitFullName(f); TextFolderManager.Remove(Repository, new TextFolder(Repository, folderPathArr)); } } resultData.ReloadPage = true; }); return(Json(data)); }
public ModuleEvents(SchemaManager schemaManager, TextFolderManager textFolderManager) { this._schemaManager = schemaManager; this._textFolderManager = textFolderManager; }
public ModuleTextContentController(TextContentManager textContentManager, TextFolderManager textFolderManager, WorkflowManager workflowManager, ITextContentBinder binder, ITextContentProvider textContentProvider) : base(textContentManager, textFolderManager, workflowManager, binder, textContentProvider) { }
public TextFolderController(TextFolderManager manager) { Manager = manager; }
public ModuleTextFolderController(TextFolderManager manager) : base(manager) { }
public virtual ActionResult Index(string folderName, string parentUUID, string parentFolder, string search , IEnumerable <WhereClause> whereClause, int?page, int?pageSize, string sortField = null, string sortDir = null) { //compatible with the Folder parameter changed to FolderName. folderName = folderName ?? this.ControllerContext.RequestContext.GetRequestValue("Folder"); TextFolder textFolder = new TextFolder(Repository, folderName).AsActual(); var schema = textFolder.GetSchema().AsActual(); SchemaPath schemaPath = new SchemaPath(schema); ViewData["Folder"] = textFolder; ViewData["Schema"] = schema; ViewData["Template"] = textFolder.GetFormTemplate(FormType.Grid); ViewData["WhereClause"] = whereClause; SetPermissionData(textFolder); IEnumerable <TextFolder> childFolders = new TextFolder[0]; //Skip the child folders on the embedded folder grid. if (string.IsNullOrEmpty(parentFolder)) { if (!page.HasValue || page.Value <= 1) { childFolders = TextFolderManager.ChildFolders(textFolder, search).Select(it => it.AsActual()); } } IContentQuery <TextContent> query = textFolder.CreateQuery(); query = SortByField(sortField, sortDir, query); bool showTreeStyle = schema.IsTreeStyle; //如果有带搜索条件,则不输出树形结构 if (!string.IsNullOrEmpty(search)) { IWhereExpression exp = new FalseExpression(); foreach (var item in schema.Columns.Where(it => it.ShowInGrid)) { exp = new OrElseExpression(exp, (new WhereContainsExpression(null, item.Name, search))); } if (exp != null) { query = query.Where(exp); } showTreeStyle = false; } if (whereClause != null && whereClause.Count() > 0) { var expression = WhereClauseToContentQueryHelper.Parse(whereClause, schema, new MVCValueProviderWrapper(ValueProvider)); query = query.Where(expression); showTreeStyle = false; } if (!string.IsNullOrWhiteSpace(parentUUID)) { query = query.WhereEquals("ParentUUID", parentUUID); } else { //有两种情况需要考虑要不要查询所有的数据(ParentUUID=null) //1.树形结构数据,第一次查询需要过滤ParentUUID==null //2.自嵌套的目前结构,也需要过滤ParentUUID==null var selfEmbedded = textFolder.EmbeddedFolders != null && textFolder.EmbeddedFolders.Contains(textFolder.FullName, StringComparer.OrdinalIgnoreCase); if (showTreeStyle || selfEmbedded) { query = query.Where(new OrElseExpression(new WhereEqualsExpression(null, "ParentUUID", null), new WhereEqualsExpression(null, "ParentUUID", ""))); } } if (childFolders != null) { childFolders = childFolders .Select(it => it.AsActual()) .Where(it => it.Visible) .Where(it => Kooboo.CMS.Content.Services.ServiceFactory.WorkflowManager.AvailableViewContent(it, User.Identity.Name)); } page = page ?? 1; pageSize = pageSize ?? textFolder.PageSize; //var pagedList = query.ToPageList(page.Value, pageSize.Value); //IEnumerable<TextContent> contents = pagedList.ToArray(); //if (Repository.EnableWorkflow == true) //{ // contents =WorkflowManager.GetPendWorkflowItemForContents(Repository, contents.ToArray(), User.Identity.Name); //} //var workflowContentPagedList = new PagedList<TextContent>(contents, page.Value, pageSize.Value, pagedList.TotalItemCount); //ViewData["ContentPagedList"] = workflowContentPagedList; return(View(new TextContentGrid() { ChildFolders = childFolders.ToArray(), ContentQuery = query, PageIndex = page.Value, PageSize = pageSize.Value, ShowTreeStyle = showTreeStyle })); }
public EmptyContentWhenFolderDeleted(TextFolderManager manager) : base(manager) { }