public void Initialize(NodeTreeCmsSettings settings) { // Control settings if (settings == null) { settings = new NodeTreeCmsSettings(); } if (String.IsNullOrEmpty(settings.DbPath)) { settings.DbPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/Cms"); } if (String.IsNullOrEmpty(settings.AdminUrl)) { settings.AdminUrl = "/admin"; } if (!settings.AdminUrl.StartsWith("/")) { settings.AdminUrl = "/" + settings.AdminUrl; } if (String.IsNullOrEmpty(settings.DefaultViewPath)) { settings.DefaultViewPath = "Default.cshtml"; } //if (String.IsNullOrEmpty(settings.ContentRootUrl)) // settings.ContentRootUrl = "/"; this.settings = settings; var path = settings.DbPath; dbProvider = new LiveDbProvider(path); nodeTree = dbProvider.DocumentNode_NodeTree(); if (nodeTree == null) { InitializeDocumentNodes(); } dbProvider.UpdateDatabaseImage(); }
public Cms(NodeTreeCmsSettings settings = null) { Initialize(settings); }
public void Initialize(NodeTreeCmsSettings settings) { // Control settings if (settings == null) settings = new NodeTreeCmsSettings(); if (String.IsNullOrEmpty(settings.DbPath)) settings.DbPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/Cms"); if (String.IsNullOrEmpty(settings.AdminUrl)) settings.AdminUrl="/admin"; if (!settings.AdminUrl.StartsWith("/")) settings.AdminUrl = "/" + settings.AdminUrl; if (String.IsNullOrEmpty(settings.DefaultViewPath)) settings.DefaultViewPath = "Default.cshtml"; //if (String.IsNullOrEmpty(settings.ContentRootUrl)) // settings.ContentRootUrl = "/"; this.settings = settings; var path = settings.DbPath; dbProvider = new LiveDbProvider(path); nodeTree = dbProvider.DocumentNode_NodeTree(); if (nodeTree == null) InitializeDocumentNodes(); dbProvider.UpdateDatabaseImage(); }