Listing 1:

<!--- BH: Change these variables to reflect the path of the app on your webserver --->
<cfset Request.thisApp = StructNew() />
<!--- BH: CFC Path to this dir --->
<cfset Request.thisApp.CFCPath = 'hotfixes.' />
<!--- BH: File path to the dir this app resides in --->
<cfset Request.thisApp.FilePath = 'C:\wwwroot\Default\hotfixes\' />
<!--- BH: XML File which contains our app information --->
<cfset Request.thisApp.XMLFile = 'hotfixes.xml' />

<!--- BH: This is where our hotfix info will be stored --->
<cfset Request.hotfixes = StructNew() />

<!--- BH: Invoke the Hotfixes Application --->
<cfset Request.CFC = StructNew() />
<cfset Request.CFC.Hotfixes = CreateObject("component", "#Request.thisApp.CFCPath#.hotfixes") />
<cfset Request.CFC.Hotfixes.init() />

<!--- <cfsetting showdebugoutput="no" /> --->

Listing 2:

<div id="voteForm">
  <form action="hotfixes.cfc?method=tallyVote" method="post" onsubmit="this.onsubmit = new
  Function('return false');">
    <table>
      <cfloop from="1" to="3" index="i">

        <cfoutput>
          <tr>
            <td><input type="radio" name="ID"
			value="#theHotfixes[i].XmlAttributes.id#"></td>
            <td align="left">#theHotfixes[i].article.xmltext#</td>
          </tr>
        </cfoutput>
      </cfloop>
      <tr>
      	<td></td>
      	<td><br /><input type="submit" value="Vote Now!"
		onclick="disableSubmit(this,'voteForm','Thank you!');" /></td>
      </tr>
    </table>
  </form>
</div>

Listing 3:

<script type="text/javascript">
  function disableSubmit(theButton,inputForm,newText) {
    theButton.value=newText;
    theButton.disabled = true;
    var theForm = eval("document." + inputForm);
    theForm.submit();
  }
</script>


Listing 4:

<cffunction name="tallyVote" hint="Registers a vote for a particular hotfix" output="true"
access="remote">
  <cfargument name="ID" hint="The hotfix ID which to add this vote to" type="numeric"
  required="yes" />
  <!--- BH: Return the 204 to the browser --->
  <cfset return204() />
  <cfset Request.hotfixes.appxml.hotfixes.hotfix[ID].votes.Xmltext =
  Request.hotfixes.appxml.hotfixes.hotfix[ID].votes.Xmltext + 1 />
</cffunction>

<cffunction name="return204" hint="Returns an HTTP StatusCode of 204 to a requesting client.
Debugging MUST be turned-off for this to work consistently." returntype="void" output="true">
  <cfheader statuscode="204" statustext="No Response" />
  <cfflush />
</cffunction>


Listing 5:

<table>
  <cfset theHotfixes = XMLSearch(Request.hotfixes, "/appxml/hotfixes/hotfix")>
    <cfloop from="1" to="#arrayLen(theHotfixes)#" index="i">
      <cfoutput>
        <tr>
          <td>
          <h4>Article #theHotfixes[i].article.xmltext#</h4>
          <a href="#theHotfixes[i].articleURL.xmltext#">#theHotfixes[i].title.xmltext#</a>
          <br /><br />
          #theHotfixes[i].desc.xmltext#
          <br /><br />
          <cfif NOT theHotfixes[i].downloaded.xmltext>
            <div id="downloadForm#1#">
              <form action="hotfixes.cfc?method=downloadHotfix&ID=#theHotfixes[i].XmlAttributes.id#"
method="post" onsubmit="this.onsubmit = new Function('return
false');">
                <input type="submit" value="Download To Server"
				onclick="disableSubmit(this,'downloadForm','Downloading...');">
              </form>
            </div>
          <cfelse>
            <a href="#theHotfixes[i].filename.xmltext#">Download to Browser</a>
          </cfif>
          <hr />
        </td>
      </tr>
    </cfoutput>
  </cfloop>
</table>


Listing 6:

<cffunction name="threadDownloads" hint="Threads all of the downloads so that they are all
downloaded at the same time" returntype="void" access="remote" output="true">
  <cfset var theHotfixes = XMLSearch(Request.hotfixes, "/appxml/hotfixes/hotfix")>
  <cfset var i = '' />
  <cfset return204() />
  <cfloop from="1" to="#arrayLen(theHotfixes)#" index="i">
    <cfhttp url="http://#CGI.HTTP_HOST#:#CGI.SERVER_PORT#/hotfixes/hotfixes.cfc?method=downloadHotfix&ID=#theHot
fixes[i].XmlAttributes.id#" timeout="5" resolveurl="no" />
   </cfloop>
</cffunction>