Changeset 282
- Timestamp:
- 12/21/06 12:20:33 (2 years ago)
- Location:
- framework/trunk
- Files:
-
- 4 modified
-
.settings/org.eclipse.core.resources.prefs (modified) (1 diff)
-
fuseboxApplication.cfc (modified) (9 diffs)
-
fuseboxCircuit.cfc (modified) (3 diffs)
-
myFusebox.cfc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
framework/trunk/.settings/org.eclipse.core.resources.prefs
r280 r282 1 # Wed Dec 20 12:07:13PST 20061 #Thu Dec 21 11:09:00 PST 2006 2 2 eclipse.preferences.version=1 3 encoding//skeleton/controller/circuit.xml.cfm=UTF-8 3 4 encoding//skeleton/fusebox.xml.cfm=UTF-8 4 5 encoding//skeleton/model/circuit.xml.cfm=UTF-8 -
framework/trunk/fuseboxApplication.cfc
r281 r282 93 93 hint="I am the myFusebox data structure." /> 94 94 95 <!--- updated fix for ticket 135--->95 <!--- fixes ticket 95 for errortemplates and lexicons ---> 96 96 <cfset var myVersion = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#" /> 97 97 … … 108 108 <cfset variables.coreRoot = replace(getDirectoryFromPath(getCurrentTemplatePath()),"\","/","all") /> 109 109 110 <cfset this.approotdirectory = this.webrootdirectory & replace(arguments.appPath,"\","/","all") /> 111 <cfif right(this.approotdirectory,1) is not "/"> 112 <cfset this.approotdirectory = this.approotdirectory & "/" /> 113 </cfif> 110 <cfset this.approotdirectory = normalizePartialPath(this.webrootdirectory & arguments.appPath) /> 114 111 <!--- remove pairs of directory/../ to form canonical path: ---> 115 112 <cfloop condition="find('/../',this.approotdirectory) gt 0"> … … 302 299 </cffunction> 303 300 301 <cffunction name="expandFuseboxPath" returntype="any" access="public" output="false" 302 hint="I expand a path in the context of a Fusebox application."> 303 <cfargument name="partialPath" type="any" required="true" 304 hint="I am the partial path to expand. If I do not begin with a /, prepend the Fusebox application root." /> 305 306 <cfif left(arguments.partialPath,1) is "/"> 307 <!--- absolute path, i.e., root-relative or mapped ---> 308 <cfreturn replace(expandPath(arguments.partialPath),"\","/","all") /> 309 <cfelse> 310 <!--- relative, i.e., relative to the Fusebox application root ---> 311 <cfreturn getApplicationRoot() & arguments.partialPath /> 312 </cfif> 313 314 </cffunction> 315 304 316 <cffunction name="getFuseboxXMLFilename" returntype="string" access="public" output="false" 305 317 hint="I return the actual name of the fusebox.xml(.cfm) file."> … … 538 550 <cfset var __ext = "." & this.scriptFileDelimiter /> 539 551 <cfset var __errorFile = this.errortemplatesPath & __type & __ext /> 540 <cfset var __handlerExists = fileExists( getApplicationRoot() & __errorFile) />552 <cfset var __handlerExists = fileExists(expandFuseboxPath(__errorFile)) /> 541 553 <cfset var FUSEBOX_APPLICATION_KEY = arguments.appKey /> 542 554 … … 544 556 <cfset __type = listDeleteAt(__type,listLen(__type,"."),".") /> 545 557 <cfset __errorFile = this.errortemplatesPath & __type & __ext /> 546 <cfset __handlerExists = fileExists( getApplicationRoot() & __errorFile) />558 <cfset __handlerExists = fileExists(expandFuseboxPath(__errorFile)) /> 547 559 </cfloop> 548 560 <cfif __handlerExists> 549 <cfinclude template="#getCoreToAppRootPath()##__errorFile#" /> 561 <cfif left(__errorFile,1) is "/"> 562 <cfinclude template="#__errorFile#" /> 563 <cfelse> 564 <cfinclude template="#getCoreToAppRootPath()##__errorFile#" /> 565 </cfif> 550 566 <cfset __handled = true /> 551 567 </cfif> … … 746 762 <cfset aLex = structNew() /> 747 763 <cfset aLex.namespace = children[i].xmlAttributes.namespace /> 748 <cfset aLex.path = replace(children[i].xmlAttributes.path,"\","/","all") /> 749 <cfif right(aLex.path,1) is not "/"> 750 <cfset aLex.path = aLex.path & "/" /> 751 </cfif> 752 <cfset aLex.path = getCoreToAppRootPath() & "lexicon/" & aLex.path /> 764 <cfset aLex.path = normalizePartialPath(children[i].xmlAttributes.path) /> 765 <!--- FB41 lexicons are deprecated so we don't support absolute / mapped paths: ---> 766 <cfset aLex.path = getCoreToAppRootPath() & this.lexiconPath & aLex.path /> 753 767 <cfset variables.fb41Lexicons[children[i].xmlAttributes.namespace] = aLex /> 754 768 </cfloop> … … 767 781 detail="You have attempted to declare a namespace '#aLex.namespace#' (in fusebox.xml) which is reserved by the Fusebox framework." /> 768 782 </cfif> 769 <cfset attributes[attr] = replace(attributes[attr],"\","/","all") />783 <cfset attributes[attr] = normalizePartialPath(attributes[attr]) /> 770 784 <cfif left(attributes[attr],1) is "/"> 771 785 <!--- assume mapped / root-relative path ---> 772 786 <cfset aLex.path = attributes[attr] /> 787 <cfelseif left(this.lexiconPath,1) is "/"> 788 <!--- assume mapped / root-relative path ---> 789 <cfset aLex.path = this.lexiconPath & attributes[attr] /> 773 790 <cfelse> 774 <cfset aLex.path = getApplication().getCoreToAppRootPath() & getApplication().lexiconPath & attributes[attr] /> 775 </cfif> 776 <cfif right(aLex.path,1) is not "/"> 777 <cfset aLex.path = aLex.path & "/" /> 791 <!--- relative paths ---> 792 <cfset aLex.path = getCoreToAppRootPath() & 793 this.lexiconPath & attributes[attr] /> 778 794 </cfif> 779 795 <cfset variables.lexicons[aLex.namespace] = aLex /> … … 959 975 </cfloop> 960 976 977 <!--- 978 if the user overrides certain path variables, we need to normalize them: 979 - this.parsePath (reset parseRootPath) 980 - this.pluginsPath 981 - this.lexiconPath 982 - this.errortemplatesPath 983 normalizing means changing all \ to / and appending / if not present 984 ---> 985 <cfset this.parsePath = normalizePartialPath(this.parsePath) /> 986 <cfset this.parseRootPath = relativePath(expandFuseboxPath(this.parsePath),getApplicationRoot()) /> 987 <cfset this.pluginsPath = normalizePartialPath(this.pluginsPath) /> 988 <cfset this.lexiconPath = normalizePartialPath(this.lexiconPath) /> 989 <cfset this.errortemplatesPath = normalizePartialPath(this.errortemplatesPath) /> 990 961 991 </cffunction> 962 992 … … 1059 1089 </cffunction> 1060 1090 1091 <cffunction name="normalizePartialPath" returntype="string" access="public" output="false" 1092 hint=""> 1093 <cfargument name="partialPath" type="string" required="true" 1094 hint="" /> 1095 1096 <cfset var unixPath = replace(arguments.partialPath,"\","/","all") /> 1097 1098 <cfif right(unixPath,1) is not "/"> 1099 <cfset unixPath = unixPath & "/" /> 1100 </cfif> 1101 1102 <cfreturn unixPath /> 1103 1104 </cffunction> 1105 1061 1106 </cfcomponent> -
framework/trunk/fuseboxCircuit.cfc
r281 r282 189 189 190 190 </cftry> 191 <!--- 192 this was initially implemented as part of ticket 135 but feedback on 193 the mailing list seems to indicate people think it is too draconian 194 a restriction, even in strict mode - and I agree! -- Sean Corfield 191 195 192 196 <cfif variables.fuseboxApplication.strictMode and not circuitImplicit and … … 196 200 detail="The circuit xml file, #circuitFile#, in #variables.fullPath#, uses a different file extension to the application's fusebox xml file. Strict requires consistency." /> 197 201 </cfif> 198 202 ---> 199 203 <cftry> 200 204 … … 466 470 detail="You have attempted to declare a namespace '#aLex.namespace#' (in Circuit #getAlias()#) which is reserved by the Fusebox framework." /> 467 471 </cfif> 468 <cfset attributes[attr] = replace(attributes[attr],"\","/","all") />472 <cfset attributes[attr] = variables.fuseboxApplication.normalizePartialPath(attributes[attr]) /> 469 473 <cfif left(attributes[attr],1) is "/"> 470 474 <!--- assume mapped / root-relative path ---> 471 475 <cfset aLex.path = attributes[attr] /> 476 <cfelseif left(variables.fuseboxApplication.lexiconPath,1) is "/"> 477 <!--- assume mapped / root-relative path ---> 478 <cfset aLex.path = variables.fuseboxApplication.lexiconPath & attributes[attr] /> 472 479 <cfelse> 473 <cfset aLex.path = variables.fuseboxApplication.getCoreToAppRootPath() & variables.fuseboxApplication.lexiconPath & attributes[attr] /> 474 </cfif> 475 <cfif right(aLex.path,1) is not "/"> 476 <cfset aLex.path = aLex.path & "/" /> 480 <!--- relative paths ---> 481 <cfset aLex.path = variables.fuseboxApplication.getCoreToAppRootPath() & 482 variables.fuseboxApplication.lexiconPath & attributes[attr] /> 477 483 </cfif> 478 484 <cfset variables.lexicons[aLex.namespace] = aLex /> -
framework/trunk/myFusebox.cfc
r281 r282 51 51 <cfcomponent hint="I provide the per-request myFusebox data structure and some convenience methods."> 52 52 <cfscript> 53 // updated fix for ticket 13553 // fixes ticket 95 for errortemplates and lexicons 54 54 this.version.runtime = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#"; 55 55
