1+ /*==============================================================================================================================
2+ | Author Ignia, LLC
3+ | Client Ignia, LLC
4+ | Project OnTopicSample OnTopic Site
5+ \=============================================================================================================================*/
6+ using System ;
7+ using System . Configuration ;
8+ using System . Web . Routing ;
9+ using OnTopic . Data . Caching ;
10+ using OnTopic . Data . Sql ;
11+ using OnTopic . Web ;
12+
13+ namespace OnTopic . Editor . Web . Host {
14+
15+ /*============================================================================================================================
16+ | CLASS: GLOBAL
17+ \---------------------------------------------------------------------------------------------------------------------------*/
18+ /// <summary>
19+ /// Provides default configuration for the application, including any special processing that needs to happen relative to
20+ /// application events (such as <see cref="Application_Start"/> or <see cref="System.Web.HttpApplication.Error"/>.
21+ /// </summary>
22+ public class Global : System . Web . HttpApplication {
23+
24+ /*==========================================================================================================================
25+ | EVENT: APPLICATION START
26+ >===========================================================================================================================
27+ | Runs once when the first page of your application is run for the first time by any user
28+ \-------------------------------------------------------------------------------------------------------------------------*/
29+ [ Obsolete ]
30+ protected void Application_Start ( object sender , EventArgs e ) {
31+
32+ /*------------------------------------------------------------------------------------------------------------------------
33+ | ESTABLISH TOPIC LOOKUP SERVICE
34+ >-------------------------------------------------------------------------------------------------------------------------
35+ | This ensures that the TopicFactory is able to correctly create `ConfigurableAttributeDescriptor` topics as their
36+ | strongly typed class, which is necessary to provide access to members which parse and query the DefaultConfiguration
37+ | property.
38+ \-----------------------------------------------------------------------------------------------------------------------*/
39+ TopicFactory . TypeLookupService = new WebFormsTopicLookupService ( ) ;
40+
41+ /*------------------------------------------------------------------------------------------------------------------------
42+ | CONFIGURE REPOSITORY
43+ \-----------------------------------------------------------------------------------------------------------------------*/
44+ var connectionString = ConfigurationManager . ConnectionStrings [ "OnTopic" ] . ConnectionString ;
45+ var sqlTopicRepository = new SqlTopicRepository ( connectionString ) ;
46+ var topicRepository = new CachedTopicRepository ( sqlTopicRepository ) ;
47+
48+ TopicRepository . DataProvider = topicRepository ;
49+
50+ /*------------------------------------------------------------------------------------------------------------------------
51+ | REGISTER ROUTES
52+ \-----------------------------------------------------------------------------------------------------------------------*/
53+ RouteTable . Routes . Ignore ( "{resource}.axd/{*pathInfo}" ) ;
54+
55+ }
56+
57+ } //Class
58+ } //Namespace
0 commit comments