Fusebox Model-Glue Lexicon
Sean Corfield has written Fusebox Lexicons which utilize the popular Framework of Model Glue. The Model-Glue lexicon provides a Model-Glue style syntax but runs entirely natively in Fusebox 5. You could have a circuit in this Model-Glue style (perhaps a Model-Glue 1.x application converted to a Fusebox 5 circuit) alongside regular Fusebox circuits.
Model-Glue style Fusebox Fuseaction
<mg:broadcasts>
<mg:message name="checkIdentity"/>
<mg:message name="needMembers"/>
<mg:message name="needMembersByID"/>
<mg:message name="needTasks"/>
<mg:message name="needStatii"/>
<mg:message name="needStatiiByID"/>
</mg:broadcasts>
<mg:views>
<mg:include template="dspShowTaskList.cfm" name="content">
<mg:value name="XFA.AddTask" value="ggcc.newtask"/>
<mg:value name="XFA.ChangeIdentity" value="ggcc.identify"/>
<mg:value name="XFA.TaskDetail" value="ggcc.showtask"/>
</mg:include>
<mg:include template="layGGCC.cfm"/>
</mg:views>
</fuseaction>
The original Model-Glue event-handler
<broadcasts>
<message name="checkIdentity"/>
<message name="needMembers"/>
<message name="needMembersByID"/>
<message name="needTasks"/>
<message name="needStatii"/>
<message name="needStatiiByID"/>
</broadcasts>
<views>
<include template="dspShowTaskList.cfm" name="content">
<value name="XFA.AddTask" value="ggcc.newtask"/>
<value name="XFA.ChangeIdentity" value="ggcc.identify"/>
<value name="XFA.TaskDetail" value="ggcc.showtask"/>
</include>
<include template="layGGCC.cfm" name="final"/>
</views>
</event-handler>
As Sean points out, this is mimicking Model-Glue 1.x and is not planned to mimick 2.0 only mimicking enough of the syntax to make the example work.
Model-Glue Lexicon Explained
Sean stripped the extends=, returntype= and type= attributes out of the controllers and replaced the (few) init() methods with simple pseudo-constructors, initializing variables directly from application.fusebox parameters.
Then he copied all of the controller declarations out of the Modelglue.xml file into fusebox.xml.cfm and made them class declarations with custom attributes to specify the listeners.
Model-Glue Lexicon Verbs
The Fusebox 5 Lexicon for Model-Glue contains the following verbs:
- argument
- broadcast
- include
- message
- preprocess
- results
- state.cfc
- value
- views
External Links
-
Sample Application by Sean Corfield
-
Model-Glue Framework Official Site