Fusebox 4.1 XML Cheat Sheet
Defines folders of fuses and their relationships with each other.
<circuit alias="any_name" path="my_circuit" parent(optional)/>
Defines objects that you will use in your application. Does not create any instances of them.
<class alias="Employee" classpath="com.company.Employee" type="component" constructor="init">
Defines a 'custom tags' folder for your circuit files that are included at compile time.
<lexicon namespace="tagprefix" path="relative to the lexicon folder, include trailing slash/" />
To call a lexicon in the above-defined lexicon folder:
name/value pairs for important fusebox parameters
Defines any fuses that are executed at the beginning and ending of every request to the fusebox app.
Allows you to include files at specified places in the processing of your fuse. Put your plugin files in the plugins folder.
<phase name="preProcess|preFuseaction|fuseactionException, etc."><plugin name="pluginName" template="file"/></phase>
Sets a variable.
<set name="variables.name" value="value" Overwrite(optional) Evaluate(optional)>
"Does" a fuse from another circuit (action="circuit.myFuse") or from the current circuit (action="myFuse").
<do action="circuit.fuse" contentvariable(optional) append(optional, for contentvariable) overwrite(optional i.e. cfparam)>
Includes a file. File should be from the current folder (circuit). Does not require the file extension.
<include template="myfile" required(optional) contentvariable(optional) append(optional, for contentvariable)>
Required="false" will not throw a missing file error.
Forwards the user to another request.
<relocate url="http//..." addtoken(optional) type="(optional)client|server">
type="server" is equivalent to getPageContext().forward('page.cfm') - a server-side redirect.
Creates a simple loop.
<loop condition="i lt 3">
Conditional processing. Somewhat limited in the way that there is no 'else if' and you cannot nest <if> tags.
<if condition="myVar GT 4">
Defines exit points, can be used in href= or form action=, etc. XFAs should always be in the format of "circuit.fuse"
<xfa name="myXfa" value="circuit.fuse">
Creates an instance of an object referenced in fusebox.xml's classes section.
<instantiate object="application.blog" class="blog" arguments="#params#">
Invokes a method from an object that has been instantiated. Does not implicitly rely on the <instantiate> tag.
<invoke object="application.myObject" methodcall="myMethod(id,true,'hello')" returnvariable=(optional)"myVariable">
Defines the section for events that fire before any fuses from this circuit are called. Beware of possible recursion issues.
Defines the section for events that fire after any fuses from this circuit are called. Again, beware of possible recursion issues.
Fusebox 4.1 General Notes
thisCircuit, thisFuseaction, originalCircuit, originalFuseaction
Should consist of (at minimum):
request.self = "index.cfm";
request.myself = "#request.self#?#application.fusebox.fuseactionVariable#=";
So you can say <a href="#request.myself#circuit.fuse">
Circuit and fuseaction tags have access modifiers:
Public = Can be called from a browser
internal = Can only be called from fusebox (via <do>)
private = Can only be called from the current circuit