PageRenderTime 162ms CodeModel.GetById 121ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

/SampleApplication/ColdBox3/Application.cfc

http://github.com/bobsilverberg/ValidateThisColdBoxPlugin
ColdFusion CFScript | 92 lines | 73 code | 18 blank | 1 comment | 2 complexity | 40a09e36ac7a50ca4dfc4852d3787072 MD5 | raw file
 1<!-----------------------------------------------------------------------
 2********************************************************************************
 3Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
 4www.coldboxframework.com | www.luismajano.com | www.ortussolutions.com
 5********************************************************************************
 6
 7Author     :	Luis Majano
 8Date        :	10/16/2007
 9Description :
10	This is the Application.cfc for usage withing the ColdBox Framework.
11	Make sure that it extends the coldbox object:
12	coldbox.system.coldbox
13	
14	So if you have refactored your framework, make sure it extends coldbox.
15----------------------------------------------------------------------->
16<cfcomponent extends="coldbox.system.coldbox" output="false">
17
18	<!--- APPLICATION CFC PROPERTIES --->
19	<cfset this.name = hash(getCurrentTemplatePath())> 
20	<cfset this.sessionManagement = true>
21	<cfset this.sessionTimeout = createTimeSpan(0,0,30,0)>
22	<cfset this.setClientCookies = true>
23	
24	<!--- COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP --->
25	<cfset COLDBOX_APP_ROOT_PATH = getDirectoryFromPath(getCurrentTemplatePath())>
26
27	<!--- COLDBOX PROPERTIES --->
28	<cfset COLDBOX_CONFIG_FILE = "">
29	
30	<!--- Applicaiton Mappings --->	
31	<cfset this.mappings["/model"] = COLDBOX_APP_ROOT_PATH & "model">
32	
33	<!--- ORM SETTINGS --->	
34	<cfset this.ormenabled = true>
35	<cfset this.datasource = "cfartgallery">
36	
37	<!--- on Application Start --->
38	<cffunction name="onApplicationStart" returnType="boolean" output="false">
39		<cfscript>
40			//Load ColdBox
41			loadColdBox();
42			return true;
43		</cfscript>
44	</cffunction>
45	
46	<!--- on Request Start --->
47	<cffunction name="onRequestStart" returnType="boolean" output="true">
48		<!--- ************************************************************* --->
49		<cfargument name="targetPage" type="string" required="true" />
50		<!--- ************************************************************* --->
51		<cfsetting enablecfoutputonly="yes">
52
53		<!--- Reload Checks --->
54		<cfset reloadChecks()>
55		
56		<!--- Process A ColdBox Request Only --->
57		<cfif findNoCase('index.cfm', listLast(arguments.targetPage, '/'))>
58			<cfset processColdBoxRequest()>
59		</cfif>
60			
61		<!--- WHATEVER YOU WANT BELOW --->
62		<cfsetting enablecfoutputonly="no">
63
64		
65		<cfreturn true>
66	</cffunction>
67	
68	<!--- on Application End --->
69	<cffunction name="onApplicationEnd" returnType="void"  output="false">
70		<!--- ************************************************************* --->
71		<cfargument name="applicationScope" type="struct" required="true">
72		<!--- ************************************************************* --->
73		<!--- WHATEVER YOU WANT BELOW --->
74	</cffunction>
75	
76	<!--- on Session Start --->
77	<cffunction name="onSessionStart" returnType="void" output="false">			
78		<cfset super.onSessionStart()>
79		<!--- WHATEVER YOU WANT BELOW --->
80	</cffunction>
81	
82	<!--- on Session End --->
83	<cffunction name="onSessionEnd" returnType="void" output="false">
84		<!--- ************************************************************* --->
85		<cfargument name="sessionScope" type="struct" required="true">
86		<cfargument name="appScope" 	type="struct" required="false">
87		<!--- ************************************************************* --->
88		<cfset super.onSessionEnd(argumentCollection=arguments)>
89		<!--- WHATEVER YOU WANT BELOW --->
90	</cffunction>
91	
92</cfcomponent>