| 45 | | // Verify the config file, else set it to our convention. |
| 46 | | if( not propertyExists('configFile') ){ |
| 47 | | setProperty('configFile','config/Routes.cfm'); |
| 48 | | } |
| 49 | | |
| 50 | | // Setup the config Path |
| 51 | | configFilePath = configFilePath & reReplace(getProperty('ConfigFile'),"^/",""); |
| 52 | | |
| 53 | | // We are ready to roll. Import config to setup the routes. |
| 54 | | try{ |
| 55 | | $include(configFilePath); |
| 56 | | } |
| 57 | | catch(Any e){ |
| 58 | | $throw("Error including config file: #e.message# #e.detail#",e.tagContext.toString(),"SES.executingConfigException"); |
| 59 | | } |
| 60 | | |
| 61 | | // Validate the base URL |
| 62 | | if ( len(getBaseURL()) eq 0 ){ |
| 63 | | $throw('The baseURL property has not been defined. Please define it using the setBaseURL() method.','','interceptors.SES.invalidPropertyException'); |
| 64 | | } |
| | 36 | //Import Config |
| | 37 | importConfiguration(); |
| | 760 | |
| | 761 | <!--- importConfiguration ---> |
| | 762 | <cffunction name="importConfiguration" output="false" access="private" returntype="void" hint="Import the routing configuration file"> |
| | 763 | <cfscript> |
| | 764 | var appLocPrefix = "/"; |
| | 765 | var configFilePath = ""; |
| | 766 | var controller = getController(); |
| | 767 | var local = structnew(); |
| | 768 | |
| | 769 | // Verify the config file, else set it to our convention in the config/Routes.cfm |
| | 770 | if( not propertyExists('configFile') ){ |
| | 771 | setProperty('configFile','config/Routes.cfm'); |
| | 772 | } |
| | 773 | |
| | 774 | //Check if file exists in our App |
| | 775 | if( len(getSetting('AppMapping')) ){ |
| | 776 | appLocPrefix = appLocPrefix & getSetting('AppMapping') & "/"; |
| | 777 | } |
| | 778 | |
| | 779 | // Setup the config Path for relative location first. |
| | 780 | configFilePath = appLocPrefix & reReplace(getProperty('ConfigFile'),"^/",""); |
| | 781 | if( NOT fileExists(expandPath(configFilePath)) ){ |
| | 782 | //Check absolute location as not found inside our app |
| | 783 | configFilePath = getProperty('ConfigFile'); |
| | 784 | if( NOT fileExists(expandPath(configFilePath)) ){ |
| | 785 | $throw(message="Error locating routes file: #configFilePath#",type="SES.ConfigFileNotFound"); |
| | 786 | } |
| | 787 | } |
| | 788 | |
| | 789 | // We are ready to roll. Import config to setup the routes. |
| | 790 | try{ |
| | 791 | $include(configFilePath); |
| | 792 | } |
| | 793 | catch(Any e){ |
| | 794 | $throw("Error including config file: #e.message# #e.detail#",e.tagContext.toString(),"SES.executingConfigException"); |
| | 795 | } |
| | 796 | |
| | 797 | // Validate the base URL |
| | 798 | if ( len(getBaseURL()) eq 0 ){ |
| | 799 | $throw('The baseURL property has not been defined. Please define it using the setBaseURL() method.','','interceptors.SES.invalidPropertyException'); |
| | 800 | } |
| | 801 | </cfscript> |
| | 802 | </cffunction> |