Fusebox Conference 2001 Out with the old in
Fusebox Conference 2001 Out with the old in with the new An introduction to Fusebox 3. 0 for current Fusebox developers By Erik Voldengen erikv@erikv. com
Fusebox Conference 2001 What WILL WE talk about? Change is Good! Look at the FB 2 Methodology Migrate to the new FB 3 spec
Fusebox Conference 2001 A Sample FB 2 Site • Let’s take a quick look at our sample FB 2 application… –index. cfm –app_globals / app_Locals –CF_Form. URL 2 Attributes –CF_Body. Content / app_Layout. cfm
Fusebox Conference 2001 2 New Elements of Fusebox • Exit Fuse. Actions (XFAs) • Fusedocs
Fusebox Conference 2001 Exit Fuse. Actions (XFAs) • What is an Exit ? Exit – an exit point of a fuse, e. g. links, forms, and redirects.
Fusebox Conference 2001 Fun Time! Find the Exits <H 2><b>Envision your question to the Magic Eight Ball. . . </b></H 2> <BR> <A HREF="#request. self#? fuseaction=answer"> VIEW YOUR ANSWER</A> <BR><BR> <A HREF=“. . /#request. self#? fuseaction=cover"> back to main menu</A>
Fusebox Conference 2001 XFA’s – the Big Picture The Big Picture: We use variables for our exit fuseactions.
Fusebox Conference 2001 Defined in each Fuse. Action… <cfinclude template="app_locals. cfm"> <cf_bodycontent> <cfswitch expression = "#attributes. fuseaction#"> <cfcase value="question"> <cfset XFA. main. Menu = "home"> <cfset XFA. answer = "answer"> <cfcase value="question"> <cfset XFA. main. Menu = "cover"> <cfset XFA. answer = "answer"> <cfinclude template="dsp_question. cfm"> </cfcase> <cfcase value="answer"> <cfset XFA. main. Menu = “cover"> <cfset XFA. question = “question"> <cfinclude template="dsp_question. cfm"> </cfcase> <cfinclude template="act_generate. Answer. cfm"> <cfinclude template="dsp_answer. cfm"> </cfcase> <cfdefaultcase> Sorry, unknown fuseaction </cfdefaultcase> </cfswitch> </cf_bodycontent> <cfinclude template="#request. fuse_root#/app_layout. cfm">
Fusebox Conference 2001 …And Used in Your Code <H 2><b>Envision your question to the Magic Eight Ball. . . </b></H 2> <BR> <A HREF="#request. self#? fuseaction=#XFA. answer#"> VIEW YOUR ANSWER</A> <BR><BR> <A HREF=“. . /#request. self#? fuseaction=#XFA. menu#"> back to main menu</A>
Fusebox Conference 2001 Example Exit Fuseactions • Link <a href=“#request. self#? fuseaction=#XFA. add#”> Add User </a> • Form <form action=“#request. self#? fuseaction=#XFA. edit#” method=“post”> • Redirect <cflocation template=“#request. self#? fuseaction=#XFA. true#”>
Fusebox Conference 2001 Fuse. Docs The Big Picture: – Fusedocs are the blueprint of the fuse. – You should be able to know everything about a fuse just by reading its Fuse. Doc.
Fusebox Conference 2001 Example Fuse. Doc • Let’s look at an example Fusedoc…
Fusebox Conference 2001 On to the nuts and bolts…
Fusebox Conference 2001 A New Prefix – fbx • “app_” denotes “application” • “fbx_” denotes “fusebox” Our settings only apply to a fusebox, not the entire application, so we’re going with fbx_
Fusebox Conference 2001 THE FBX FILES • • • fbx_fusebox_cfxx. cfm fbx_settings. cfm fbx_layouts. cfm fbx_switch. cfm fbx_circuits. cfm
Fusebox Conference 2001 What CHANGED IN index. cfm?
Fusebox Conference 2001 Typical FB 2 index. cfm <cfinclude template="app_locals. cfm"> <cf_bodycontent> <cfswitch expression = "#attributes. fuseaction#"> <cfcase value="cover"> <cfinclude template="dsp_cover. cfm"> </cfcase> </cfswitch> </cf_bodycontent> <cfinclude template=“. . /app_layout. cfm">
Fusebox Conference 2001 Typical FB 2 index. cfm… <cfinclude template="app_locals. cfm"> App_Locals. cfm fbx_settings. cfm (My. Globals. cfm = fbx_settings. cfm)
Fusebox Conference 2001 fbx_settings. cfm • Takes the place of app_globals and app_locals. • One fbx_settings file per circuit • Let’s take a look…
Fusebox Conference 2001 Typical FB 2 index. cfm <cf_bodycontent> </cf_bodycontent> <cfinclude template=“. . /app_layout. cfm"> cf_bodycontent fbx_fusebox_cfxx. cfm app_layout. cfm fbx_layouts. cfm
Fusebox Conference 2001 fbx_layouts. cfm • Layout settings for the circuit <cfset fusebox. layoutdir=""> <cfset fusebox. layoutfile=“test. Layout. cfm"> Let’s take a look at a layout file…
Fusebox Conference 2001 Typical FB 2 index. cfm <cfswitch expression = "#attributes. fuseaction#"> <cfcase value="cover"> <cfinclude template="dsp_cover. cfm"> </cfcase> </cfswitch> Fusebox code in the cfswitch fbx_switch. cfm
Fusebox Conference 2001 Fbx_switch. cfm • Contains the <cfswitch> code, nothing else.
Fusebox Conference 2001 Typical FB 2 index. cfm <cfinclude template="app_locals. cfm"> <cf_bodycontent> <cfswitch expression = "#attributes. fuseaction#"> <cfcase value="cover"> <cfinclude template="dsp_cover. cfm"> </cfcase> </cfswitch> </cf_bodycontent> <cfinclude template=“. . /app_layout. cfm">
Fusebox Conference 2001 Typical FB 2 index. cfm <cf_bodycontent> <cfswitch expression = "#attributes. fuseaction#"> <cfcase value="cover"> <cfinclude template="dsp_cover. cfm"> </cfcase> </cfswitch> </cf_bodycontent> <cfinclude template=“. . /app_layout. cfm">
Fusebox Conference 2001 Typical FB 2 index. cfm <cf_bodycontent> </cf_bodycontent> <cfinclude template=“. . /app_layout. cfm">
Fusebox Conference 2001 Typical FB 2 index. cfm
Fusebox Conference 2001 So what’s in index. cfm? Index. cfm contains the core Fusebox file • cfinclude the fbx_fusebox 30_cfxx. cfm file -or • copy/paste the code from fbx_fusebox into index. cfm
Fusebox Conference 2001 Fbx_Fusebox 30_CFXX. cfm • Contains the “guts” of fusebox. • Combines several FB 2 tags (and then some) • You never need to touch this file.
Fusebox Conference 2001 All Done! That was easy! • Transitioning from FB 2 to FB 3 is not as intimidating as it may sound! • If you (or your boss) have strong resistance to change, try doing it in phases…
Fusebox Conference 2001 FB TRANSITION Phases In the real world, not every organization will switch to FB 3 instantly. If this is you, you can transition your methodology in phases: 1. XFAs 2. Fusedocs 3. Plunge in 100%
Fusebox Conference 2001 Questions? Time permitting, I’d be happy to answer any questions…
Fusebox Conference 2001 Thank you!
- Slides: 33