Setting up Reactor for Fusebox
The following is a short setup guide to get your Fusebox Application and Reactor working together, or a how to use Reactor with Fusebox if you will.
What you need
Before we get started there are some prerequisites to using Reactor with Fusebox, ones which I am not going to assume you already have.
- Fusebox 5 Core Files
- Reactor core files
- Fusebox 5 skeleton code
- Reactor Fusebox Lexicon
- Reactor.xml - Configuration file for Reactor
If you do not already have the above items setup and configured, you will need to unzip/extract them into your web root (you can also setup /reactor/ & /fusebox5/ mappings for 1 & 2). For 3, use the traditional code for your webroot codebase(fusebox550.Skeleton\skeleton\traditional).
For Framework extentions such as Reactor and Coldspring it is common to have a Configuration folder under your webroot (wwwroot/mysite/config/). This is where you will place your Reactor.xml file.
Now that you have your application setup and your Reactor.xml file in place, lets make the modifications to the file so that is is aware of your database. For now, this is very basic:
<config>
<project value="My-Application" />
<dsn value="myDSNNAME" />
<type value="mssql" />
<mapping value="/mySiteRoot/model/data/" />
<mode value="development" />
</config>
</reactor>
We should now be able to run our application.
Reactor Fusebox Lexicon
To now take advantage of Reactor within our Fusebox 5 xml namespace we need to tell our circuit.xml file about the Reactor Namespace:
Now you can use the Reactor verbs within your traditional fusebox xml code:
<reactor:record alias="User" returnvariable="variables.userRecord" />
<reactor:gateway alias="User" returnvariable="variables.userGateway" />