public void Application_Start(object sender, EventArgs e)
        {
            Trace = new TraceSource("Global", SourceLevels.All);
            Trace.Listeners.Add(SignalRTraceListener);
            Storage.Trace.Listeners.Add(SignalRTraceListener);

            RegisterRoutes(RouteTable.Routes);

            BundleTable.EnableOptimizations = true; // enables bundling for debug mode
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            Trace.TraceInformation("Checking Db Schema");
            using (Entities.ManualMigrationCheck check = new Entities.ManualMigrationCheck())
            {
                if (check.NewInstall)
                {
                    Trace.TraceInformation("New Install - Populating Initial Db Content");
                    using (Utils.PopulateDbFromJSON populator = new Utils.PopulateDbFromJSON())
                    {
                        populator.ImportCollection("ChronoZoom", "Cosmos", "cz.cosmos.json", true, true, true);
                        populator.ImportCollection("ChronoZoom", "AIDS Timeline", "cz.aidstimeline.json", false, true, true);
                    }
                }
            }

            Trace.TraceInformation("Application Starting");
        }
예제 #2
0
        public void Application_Start(object sender, EventArgs e)
        {
            Trace = new TraceSource("Global", SourceLevels.All);
            Trace.Listeners.Add(SignalRTraceListener);
            Storage.Trace.Listeners.Add(SignalRTraceListener);

            RouteTable.Routes.MapHubs();
            RegisterRoutes(RouteTable.Routes);

            /* Not using bundling as has issues merging CZ scripts. Bundling does have a few known gotchas, including comment on last line of a .js file commenting out a code line in next .js file.
             * Instead we use enable minification and .map creation in Web Essentials (a VS extension.)
             *
             * BundleTable.EnableOptimizations = true; // enables bundling for debug mode
             * BundleConfig.RegisterBundles(BundleTable.Bundles);
             */

            Trace.TraceInformation("Checking Db Schema");
            using (Entities.ManualMigrationCheck check = new Entities.ManualMigrationCheck())
            {
                if (check.NewInstall)
                {
                    Trace.TraceInformation("New Install - Populating Initial Db Content");
                    string populatedContentAdmin = ConfigurationManager.AppSettings["BaseCollectionsAdministrator"].ToString();
                    using (Utils.PopulateDbFromJSON populator = new Utils.PopulateDbFromJSON())
                    {
                        populator.LoadDataFromDump("Beta Content", "Beta Content", "beta-get.json", "beta-gettours.json", false, populatedContentAdmin);
                        populator.LoadDataFromDump("Sandbox", "Sandbox", "beta-get.json", null, true, null);
                        populator.LoadDataFromDump("Sandbox", "Extensions", "extensions-get.json", null, true, null);
                        populator.LoadDataFromDump("AIDS Timeline", "AIDS Timeline", "aidstimeline-get.json", "aidstimeline-gettours.json", false, populatedContentAdmin);
                    }
                }
            }

            Trace.TraceInformation("Application Starting");
        }