Solved

Using Coldfusion Fusebox 5 Model

Posted on 2011-09-07
2
587 Views
Last Modified: 2012-05-12
I've created the following alias in the root fusebox.xml.cfm.
<circuit alias="mContact" path="/model/mContact/" parent="" />

Open in new window


The pathing is correct, and the mContact directory exists.  Within it, there are three query files and an action file.  There is also the circuit.xml.cfm, which is shown below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE circuit>
<!--
	Example circuit.xml file for the model portion of an application.
-->
<circuit access="internal">
	
	<!--
		Example model fuseaction that just references an action fuse.
		Model fuseactions should only reference actions and queries.
	-->
	
	<fuseaction name="buildForm">
		<include template="qry_formBuild" />
	</fuseaction>
	
	<fuseaction name="returnAddresses">
		<include template="qry_addresses" />
	</fuseaction>
	
	<fuseaction name="returnNumbers">
		<include template="qry_numbers" />
	</fuseaction>
	
	<fuseaction name="formSubmit">
		<include template="act_formSubmit" />
	</fuseaction>
	
	<!--
		This is executed at application startup (from <appinit>) and
		therefore is thread safe (and does not need a lock):
	-->
	<fuseaction name="initialize">
		<set name="myFusebox.getApplication().getApplicationData().startTime" value="#now()#" />
	</fuseaction>
	
</circuit>

Open in new window


This is my first time working with Fusebox 5.  How do I call each model fuseaction?  (E.G. Say I want to return the query data from the 'returnAddresses' fuseaction in the mContact model.)  Everything I have tried has equaled 'fail' so far.
0
Comment
Question by:brianmfalls
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
devilJinKazama earned 500 total points
ID: 36499611
When you call a fuseaction in the URL, fusebox looks in the controller xml to run the appropriate fuseactions for that call. So lets say you wan to run the 'returnAddress' fuseaction.

firstly you will need to define the fuseaction in the root fusebox xml file :

<circuit alias="mContact" path="/model/mContact/" parent="m" />  --(parent 'm' for model, would be 'v' for view)
<circuit alias="vContact" path="/view/vContact/" parent="v" />
<circuit alias="contact" path="controller/contact" parent="app" />

Now inside your controller folder you would have a folder called 'contact' and inside that your circuit.xml.cfm file.

put this code in that file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE circuit PUBLIC "circuit.dtd" "circuit.dtd">
<circuit access="public">

  <fuseaction name="returnAddresses">
          <do action="mContact.returnAddresses" />
          <do action="vContact.showAddresses" contentvariable="content.body" />
  </fuseaction>

</circuit>

controller : controls your fuseactions, model : gets your data, view : displays data.

so have your view file set up as well. inside view folder you have 'contact' folder and in the circuit.xml.cfm file you will put this code:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE circuit PUBLIC "circuit.dtd" "circuit.dtd">
<circuit access="internal">

      <fuseaction name="showAddresses">
             <include template="dsp_showAddresses" />
       </fuseaction>

</circuit>

inside the dsp_showAddresses file you can dump your qry results. the url u will call to view that page will be

 www.mysite.com/contact/returnAddresses

lemme know if u need more help
0
 
LVL 1

Author Closing Comment

by:brianmfalls
ID: 36536652
Sorry for the delayed response.  Thanks for the help.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi,      I've been learning Spring and Jersey for the past few months and to say in simple, i am pretty much impressed with these frameworks. Many developers feel it awkward to implement a RESTful Web Services with such a popular Web Application Fr…
The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question