REACTOR Integration
Thought this might be used in fourQ COAPI but there's a lot of overlap and not a great deal of advantage at this stage. Will concentrate on other advantages at this point.
Potential advantages:
- leverage REACTOR community support for different database platforms
- improve management of query data that falls outside of content type records
- provide the basis of refactoring all non-content type areas of the code base (for example security model, reference tables and external integration points)
Potential disadvantages:
- must create another compulsory CF mapping /reactor
- must create yet another CF mapping for /reactor/projectname (though this is fully customisable); possibly could use /farcry/projectname/reactordata instead
- upgrading users will need to add reactordata folder to project and configure reactor.xml
Deploy REACTOR
Steps to deploy REACTOR integration prototype:
- deploy svn://www.alagad.com/reactor/trunk/reactor to farcry_core parent (ie. where the /farcry CFMAPPING points)
- create CFMAPPING /reactor to the reactor subdirectory
- create REACTOR project data mapping eg. /reactor/projectname -> e:\webapps\projectname\reactordata\
- create a REACTOR config file eg. e:\webapps\projectname\reactordata\reactor.xml
- manually update values for the project (see sample below)
<reactor> <config> <project value="devmodius" /> <dsn value="devmodius" /> <type value="mysql4" /> <!-- reactor: dbtype --> <mapping value="/reactor/devmodius" /> <!-- reactor: cf mapping to reactordata --> <mode value="development" /> <!-- reactor: production, development, always --> <!-- These config values are not required --> <!-- <username value="" /> <password value="" /> --> </config> <objects /> </reactor>
Test REACTOR Installation
- Deploy reactortest.cfm under the webroot of the farcry application and run
- check ../projectname/reactordata directory structure for generated reactor files
<cfset request.Reactor = CreateObject("Component", "reactor.reactorFactory").init("/reactor/devmodius/reactor.xml") /> <!--- create a userGateway ---> <cfset dmHTMLGateway = request.reactor.createGateway("dmHTML") /> <!--- get all records ---> <cfset qdmHTML = dmHTMLGateway.getAll() /> <!--- VIEW ---> <cfoutput><h2>Reactor Installation Test</h2></cfoutput> <cfdump var="#qdmHTML#">
Deploy Integrated fourQ
Known Issues
- All content types must have a primary key specified in order for REACTOR to function properly
- must manually update reactor config file (no runtime variables)
- need to update installer to pre-populate reactor config.xml
- shared hosts may have issues with additional CF Mappings
Summary of Example Naming Convention
| CF Mapping | Directory | Notes |
|---|---|---|
| /farcry | e:\farcry\HEAD\ | Note: sample setup for multiple versions |
| /farcry/projectname | e:\webapps\projectname\ | Note: sample has project in a different location to farcry_core |
| /reactor | e:\farcry\HEAD\reactor\ | Note: storing /reactor library similarly to /fourq library |
| /reactor/projectname | e:\webapps\projectname\reactordata\ | Note: this will be a required change for all subsequent farcry projects (will need to be added to an updater) may not need this as we can do /farcry/projectname/reactordata |
If it seems an odd setup that's because it's based on Geoff's default workstations installation; allowing for the installation of multiple farcry versions on a single machine.
Additional Thoughts
Looks like we can load the config dynamically ie. independent of the config file. This would allow us to run a FarCry core specific reactor factory dynamically loaded with the active projects DSN and other details. This also means we can have a farcry_core content type specific config XML for object relationships independent of the project which is a very good thing. Certainly looking promising at this time.