musings

March 25, 2008

Fusebox powered blog

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 2:01 pm

I’ve finally got round to writing my own blog web app. It is built on Fusebox 5.5, using the new implicit cfc based circuits instead of the traditional XML method.

You can see my new blog at: www.aliaspooryorik.com/blog/

So, why did I write my own blog software? Well, I’m a ColdFusion developer and I wanted to try out the new no xml approach to writing Fusebox apps in a real world situation. If anyone wants a Fusebox based blog or just wants to see a Fusebox application written without XML, then let me know. If there is any interest then I’ll be happy to release it a a free and open source project on riaforge.

March 20, 2008

Fusebox 5.5 Application.cfc and webservice bug

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 4:21 pm

I just discovered a bug in Fusebox 5.5.1. You can replicate it by downloading the sample application from Fusebox.org.

If you create a CFC at the same level as your Application.cfc and call it as a webservice, it fails on line 32 of Fusebox.Application.cfc with the message

"Variable FORM is undefined. "

I solved this by changing the code in Fusebox5.Application.cfc to:

<cfif StructKeyExists(Variables, "URL")>
  <cfset structAppend(attributes,URL,true) />
</cfif>
<cfif StructKeyExists(Variables, "form")>
  <cfset structAppend(attributes,form,true) />
</cfif>

* Update *

Sean Corfield has now raised a ticket (#330) for this and added the fix to the Core files. He also spotted another scenario where this might occur. For now you need to download the latest trunk/corefiles/Application.cfc file from the SVN if you have the same problem until Fusebox 5.6 is released.

March 7, 2008

New in FB5.5.1

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 3:00 pm

Just been reading the trac to see what’s new in Fusebox 5.5.1. The main ones of interest to me are:

Implicit circuit does not allow multiple fuseactions!

Skeleton app does not work well with remote CFC calls

SES URL parsing not working on all web servers

Model/View implicit circuit permissions should be internal

prefuseaction/postfuseaction should be uncallable

That last two have been something I’ve been concerned about so good to see that it’s fixed.  Way to go Team Fusebox!

February 28, 2008

Fusebox 5.5 and SES URLs

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 11:18 am

I’ve been using Fusebox 5.5 since it was released but have been a bit slow to check out the SES handling (I have been using my own URL parsing in Application.cfm and an ASAPI plugin). This didn’t work with the XML-free version on Fusebox 5.5. After much head scratching I worked out why.

First this is what the official Fusebox 5.5 release notes say:

Fusebox 5.1 did not process these URLs coming into the framework so you needed to add your own home-brewed SES URL parser. Fusebox 5.5 will attempt to parse SES URLs coming into the framework if the queryStringStart parameter is set to something other than the default “?”) in fusebox.xml or FUSEBOX_PARAMETERS.

All you need to do is add these lines into the pseudo constructor of your Application.cfc and job done!

// search engine safe parameters...
FUSEBOX_PARAMETERS.queryStringStart ="/"; // default: ?
FUSEBOX_PARAMETERS.queryStringSeparator ="/"; // default: &
FUSEBOX_PARAMETERS.queryStringEqual = "/"; // default: =

Don’t forget to reinitialise the application to make it work!

In my case I also had to use a different script name to the usual index.cfm to stop Fusebox’s URL handling conflicting with my server wide ASAPI plugin URL handling.

February 26, 2008

Generate Fusebox Circuits and Fuses document

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 12:06 pm

Someone has just asked on Fusebox 5 group if there is a tool for Fusebox to generate a site map for development purposes. If you’re using the new fangled noxml version have a look here. For Fusebox xml users, this should do it. Hope it is useful - let me know!

<cfset lstHidefuses = "postfuseaction,prefuseaction" />

<cfoutput>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document Fusebox Application</title>
<style type="text/css">
body{
  font-family:'Lucida Sans Unicode', 'Lucida Sans', Verdana, Arial, Helvetica, sans-serif;
  font-size:62.5%;
  line-height:1.6em;
  margin: 15px 10 20px 10px;
  padding:0;
  background-color:##FAFAFA;
  color: ##525252;
}

h1{
  font-size:1.4em;
  font-weight:bold;
  margin:0 0 16px 0;
  padding:0 0 5px 0;
  border-bottom:1px solid ##e7e7e7;
  color:##5e5e5e;
}

h2{
  font-size:1.2em;
  font-weight:bold;
  padding:12px 0px 2px 3px;
  margin:15px 0 8px 0px;
  border-bottom:1px solid ##e7e7e7;
  color:##5e5e5e;
  clear:both;
}
p, li, dd, dt{font-size:1.1em;}
p{ margin: 0 0 20px 0; }

/* Tables */
table {width:100%;}
caption {text-align:left; font-style:italic}

th {text-align:left; background-color:##CCCCCC}
.property {background-color:##F3F3F3; width:20%;}

ul##nav{
  margin:0px;
  padding:4px 0 4px 0px;
  list-style:none;
}

##nav li{
  display:inline;
  margin:0 2px 0 0;
  padding:0px 10px 0 0px;
  font-size:1.1em;
  float:left;
}
</style>
</head>

<body id="top">

<h1>Fusebox Controller Circuits (defined in fusebox.xml)</h1>

<ul id="nav">
<cfloop collection="#Application.fusebox.Circuits#" item="ndxCircuit">
  <cfif ListFindNoCase(Application.fusebox.Circuits[ndxCircuit].path, “Controller”, “/”) neq 0>
  <li><a href=”##circuit_#ndxCircuit#”>#ndxCircuit#</a></li>
  </cfif>
</cfloop>
</ul>

<cfloop collection=”#Application.fusebox.Circuits#” item=”ndxCircuit”>
  <cfset oMetaData = Application.fusebox.Circuits[ndxCircuit] />

  <cfif ListFindNoCase(oMetaData.path, “Controller”, “/”) neq 0>
  <h2 id=”circuit_#ndxCircuit#”>#ndxCircuit#</h2>
  <p>
    <strong>Path:</strong> #oMetaData.path#<br />
    <strong>Parent:</strong> <cftry>#oMetaData.parent#<cfcatch>[none]</cfcatch></cftry>
    <strong>Access:</strong> <cftry>#oMetaData.access#<cfcatch>[none]</cfcatch></cftry>
    <strong>Permissions:</strong> <cftry>#oMetaData.permissions#<cfcatch>[none]</cfcatch></cftry>
  </p>

  <table summary=”fuses in the #ndxCircuit# circuit”>
    <caption>Fuses in the #ndxCircuit# circuit</caption>
    <cfloop collection=”#Application.fusebox.Circuits[ndxCircuit].FuseActions#” item=”ndxFuse”>
      <cfif ListFindNoCase(lstHidefuses, ndxFuse) eq 0>
        <tr>
          <th scope=”col” colspan=”2″>
            #ndxFuse# [#ndxCircuit#.#ndxFuse#]
          </th>
        </tr>
        <tr>
          <td class=”property”>access:</td>
          <td><cftry>#oMetaData.FuseActions[ndxFuse].access#<cfcatch>[none]</cfcatch></cftry></td>
        </tr>
        <tr>
          <td class=”property”>permissions:</td>
          <td><cftry>#oMetaData.FuseActions[ndxFuse].permissions#<cfcatch>[none]</cfcatch></cftry></td>
        </tr>
      </cfif>
    </cfloop>
  </table>
  <p><a href=”##top”>back to the top</a></p>
  </cfif>
</cfloop>

</body>
</html>
</cfoutput>
Next Page »

Blog at WordPress.com.