Dashboard > FarCry Core Coding Guidelines > Home > Percolator > Reactor
Added by Geoff Bowers , last edited by Geoff Bowers on Jul 16, 2007  (view change)
Labels: 
(None)

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:

  1. deploy svn://www.alagad.com/reactor/trunk/reactor to farcry_core parent (ie. where the /farcry CFMAPPING points)
  2. create CFMAPPING /reactor to the reactor subdirectory
  3. create REACTOR project data mapping eg. /reactor/projectname -> e:\webapps\projectname\reactordata\
  4. create a REACTOR config file eg. e:\webapps\projectname\reactordata\reactor.xml
  5. manually update values for the project (see sample below)
Sample Reactor reactor.xml
<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

  1. Deploy reactortest.cfm under the webroot of the farcry application and run
  2. check ../projectname/reactordata directory structure for generated reactor files
reactortest.cfm
<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.

Powered by a free Atlassian Confluence Open Source Project License granted to FarCry CMS. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators