Changeset 2345
- Timestamp:
- 06/24/09 20:13:47 (15 months ago)
- Location:
- coldbox/trunk
- Files:
-
- 2 added
- 5 modified
-
system/config/config.xsd (modified) (1 diff)
-
system/plugins/Renderer.cfc (modified) (3 diffs)
-
system/plugins/XMLParser.cfc (modified) (2 diffs)
-
testharness/config/coldbox.xml.cfm (modified) (1 diff)
-
testharness/extlayouts (added)
-
testharness/extlayouts/ext.cfm (added)
-
testharness/handlers/ehGeneral.cfc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
coldbox/trunk/system/config/config.xsd
r2286 r2345 62 62 <xs:enumeration value="IOCDefinitionFile" /> 63 63 <xs:enumeration value="IOCObjectCaching" /> 64 <xs:enumeration value="LayoutsExternalLocation" /> 64 65 <xs:enumeration value="MessageboxStyleOverride" /> 65 66 <xs:enumeration value="ModelsExternalLocation" /> -
coldbox/trunk/system/plugins/Renderer.cfc
r2211 r2345 37 37 instance.appMapping = controller.getSetting("AppMapping"); 38 38 instance.viewsExternalLocation = controller.getSetting('ViewsExternalLocation'); 39 instance.layoutsExternalLocation = controller.getSetting('LayoutsExternalLocation'); 39 40 40 41 /* Inject UDF For Views/Layouts */ … … 197 198 <!--- Render the layout ---> 198 199 <cffunction name="renderLayout" access="Public" hint="Renders the current layout + view Combinations if declared." output="false" returntype="any"> 199 <cfset var cbox_RederedLayout = "">200 200 <cfset var Event = controller.getRequestService().getContext()> 201 201 <cfset var rc = event.getCollection()> 202 202 <cfset var cbox_CurrentLayout = Event.getcurrentLayout()> 203 <cfset var cbox_layoutPath = ""> 204 <cfset var cbox_RederedLayout = ""> 203 205 204 206 <!--- Check if no view has been set. ---> … … 219 221 <cfif cbox_CurrentLayout eq ""> 220 222 <cfset cbox_RederedLayout = renderView()> 221 <cfelse> 222 <cfsavecontent variable="cbox_RederedLayout"><cfoutput><cfinclude template="/#instance.appMapping#/#instance.layoutsConvention#/#cbox_CurrentLayout#"></cfoutput></cfsavecontent> 223 <cfelse> 224 <!--- The Layout Path is by convention or external?? ---> 225 <cfset cbox_layoutPath = "/#instance.appMapping#/#instance.layoutsConvention#/#cbox_CurrentLayout#"> 226 <!--- Check if View does not exists in Conventions ---> 227 <cfif not fileExists(expandPath(cbox_layoutPath))> 228 <!--- Set the Path to be the External Location ---> 229 <cfset cbox_layoutPath = "#instance.layoutsExternalLocation#/#cbox_CurrentLayout#"> 230 <!--- Verify the External Location now ---> 231 <cfif not fileExists(expandPath(cbox_layoutPath))> 232 <cfthrow message="Layout not located" 233 detail="The layout: #cbox_layoutPath# could not be located in the conventions folder or in the external location. Please verify the layout name" 234 type="Renderer.LayoutNotFoundException"> 235 </cfif> 236 </cfif> 237 <!--- RenderLayout ---> 238 <cfsavecontent variable="cbox_RederedLayout"><cfoutput><cfinclude template="#cbox_layoutPath#"></cfoutput></cfsavecontent> 223 239 </cfif> 224 240 <cfset controller.getDebuggerService().timerEnd(timerHash)> -
coldbox/trunk/system/plugins/XMLParser.cfc
r2294 r2345 205 205 //return settings 206 206 return settingsStruct; 207 } //end of try207 } 208 208 catch( Any Exception ){ 209 209 throw("Error Loading Framework Configuration.","#Exception.Message# #Exception.Detail#","ColdBox.plugins.XMLParser.ColdboxSettingsParsingException"); … … 633 633 } 634 634 635 /* ::::::::::::::::::::::::::::::::::::::::: EXTERNAL LAYOUTS LOCATION :::::::::::::::::::::::::::::::::::::::::::: */ 636 637 /* check for LayoutsExternalLocation */ 638 if( structKeyExists(configStruct,"LayoutsExternalLocation") and configStruct["LayoutsExternalLocation"] neq "" ){ 639 /* Verify the locations, do relative to the app mapping first */ 640 if( directoryExists(controller.getAppRootPath() & configStruct["LayoutsExternalLocation"]) ){ 641 configStruct["LayoutsExternalLocation"] = "/" & ConfigStruct["AppMapping"] & "/" & configStruct["LayoutsExternalLocation"]; 642 } 643 else if( not directoryExists(expandPath(configStruct["LayoutsExternalLocation"])) ){ 644 throw("LayoutsExternalLocation could not be found.","The directories tested was relative and expanded using #configStruct['LayoutsExternalLocation']#. Please verify your setting.","XMLParser.ConfigXMLParsingException"); 645 } 646 /* Cleanup */ 647 if ( right(configStruct["LayoutsExternalLocation"],1) eq "/" ){ 648 configStruct["LayoutsExternalLocation"] = left(configStruct["LayoutsExternalLocation"],len(configStruct["LayoutsExternalLocation"])-1); 649 } 650 }else{ 651 configStruct["LayoutsExternalLocation"] = ""; 652 } 653 635 654 /* ::::::::::::::::::::::::::::::::::::::::: MAIL SETTINGS :::::::::::::::::::::::::::::::::::::::::::: */ 636 655 -
coldbox/trunk/testharness/config/coldbox.xml.cfm
r2285 r2345 43 43 <Setting name="RequestContextDecorator" value="coldbox.testharness.model.myRequestContextDecorator" /> 44 44 <Setting name="ProxyReturnCollection" value="false"/> 45 46 <Setting name="LayoutsExternalLocation" value="extlayouts" /> 45 47 </Settings> 46 48 -
coldbox/trunk/testharness/handlers/ehGeneral.cfc
r2285 r2345 203 203 <cfscript> 204 204 var rc = Event.getCollection(); 205 //external location; 206 event.setLayout("ext"); 205 207 Event.setView("tags/test1"); 206 208 </cfscript>
