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