Example #1
0
        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();
        }
Example #2
0
 public Cms(NodeTreeCmsSettings settings = null)
 {
     Initialize(settings);
 }
Example #3
0
 public Cms(NodeTreeCmsSettings settings = null)
 {
     Initialize(settings);
 }
Example #4
0
        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();
        }