Solved

Using Coldfusion Fusebox 5 Model

Posted on 2011-09-07
2
584 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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