Upload
antonia-quinn
View
225
Download
8
Tags:
Embed Size (px)
Citation preview
Fusebox Conference 2001
Out with the oldin with the new
An introduction to Fusebox 3.0for current Fusebox developers
By Erik Voldengen [email protected]
Fusebox Conference 2001
What WILL WE talk about?
Look at the FB2 Methodology
Migrate to the new FB3 spec
Change is Good!
Fusebox Conference 2001
A Sample FB2 Site
• Let’s take a quick look at our sample FB2 application…
–index.cfm
–app_globals / app_Locals
–CF_FormURL2Attributes
–CF_BodyContent / app_Layout.cfm
Fusebox Conference 2001
2 New Elements of Fusebox
• Exit FuseActions (XFAs)
• Fusedocs
Fusebox Conference 2001
Exit FuseActions (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
<H2><b>Envision your question to the Magic Eight Ball...</b></H2>
<BR><BR>
<A HREF="#request.self#?fuseaction=answer">VIEW YOUR ANSWER</A>
<BR><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 FuseAction…
<cfcase value="question">
<cfset XFA.mainMenu = "cover">
<cfset XFA.answer = "answer">
<cfinclude template="dsp_question.cfm">
</cfcase>
<cfinclude template="app_locals.cfm"><cf_bodycontent><cfswitch expression = "#attributes.fuseaction#">
<cfcase value="question"><cfset XFA.mainMenu = "home"><cfset XFA.answer = "answer">
<cfinclude template="dsp_question.cfm"></cfcase><cfcase value="answer">
<cfset XFA.mainMenu = “cover"><cfset XFA.question = “question">
<cfinclude template="act_generateAnswer.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
<H2><b>Envision your question to the Magic Eight Ball...</b></H2>
<BR><BR>
<A HREF="#request.self#?fuseaction=#XFA.answer#">VIEW YOUR ANSWER</A>
<BR><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
FuseDocs
The Big Picture:– Fusedocs are the blueprint of the fuse.
– You should be able to know everything about a fuse just by reading its FuseDoc.
Fusebox Conference 2001
Example FuseDoc
• 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 FB2 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 FB2 index.cfm…
<cfinclude template="app_locals.cfm">
App_Locals.cfm fbx_settings.cfm
(MyGlobals.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 FB2 index.cfm
<cf_bodycontent></cf_bodycontent>
<cfinclude template=“../app_layout.cfm">
cf_bodycontent
app_layout.cfm
fbx_fusebox_cfxx.cfm
fbx_layouts.cfm
Fusebox Conference 2001
fbx_layouts.cfm
• Layout settings for the circuit
<cfset fusebox.layoutdir=""><cfset fusebox.layoutfile=“testLayout.cfm">
Let’s take a look at a layout file…
Fusebox Conference 2001
Typical FB2 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 FB2 index.cfm
<cfinclude template="app_locals.cfm">
<cf_bodycontent>
</cf_bodycontent>
<cfinclude template=“../app_layout.cfm">
<cfswitch expression = "#attributes.fuseaction#">
<cfcase value="cover"> <cfinclude template="dsp_cover.cfm"> </cfcase>
</cfswitch>
Fusebox Conference 2001
Typical FB2 index.cfm
<cf_bodycontent>
</cf_bodycontent>
<cfinclude template=“../app_layout.cfm">
<cfswitch expression = "#attributes.fuseaction#">
<cfcase value="cover"> <cfinclude template="dsp_cover.cfm"> </cfcase>
</cfswitch>
Fusebox Conference 2001
Typical FB2 index.cfm
<cf_bodycontent>
</cf_bodycontent>
<cfinclude template=“../app_layout.cfm">
Fusebox Conference 2001
Typical FB2 index.cfm
Fusebox Conference 2001
So what’s in index.cfm?
Index.cfm contains the core Fusebox file
• cfinclude the fbx_fusebox30_cfxx.cfm file
-or-
• copy/paste the code from fbx_fusebox into index.cfm
Fusebox Conference 2001
Fbx_Fusebox30_CFXX.cfm
• Contains the “guts” of fusebox.
• Combines several FB2 tags (and then some)
• You never need to touch this file.
Fusebox Conference 2001
All Done! That was easy!
• Transitioning from FB2 to FB3 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 FB3 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!