>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

Transfer list lexicon update for fusebox

I've just made a quick change to the Transfer ORM list lexicon so it takes the argument 'orderProperty'. This will allow you to order your query.

From fusebox call the lexicon like

<tr:list object="directory.directory" query="qGetDirectories" orderProperty="directoryName" />

Check out my other post for setting transfer up in fusebox.

The updated lexicon code is:

<cfscript>
   // usage:    //      <transfer:list
   //            object="dbObject"
   //            query="cfQueryVar"
   //            orderProperty="orderBy"   />

   if (fb_.verbInfo.executionMode is "start") {
      // validate attributes       // object - string       if (not structKeyExists(fb_.verbInfo.attributes,"object")) {
         fb_throw("fusebox.badGrammar.requiredAttributeMissing",
                  "Required attribute is missing",
                  "The attribute 'object' is required, for a 'list' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
      }
      // query - string       if (not structKeyExists(fb_.verbInfo.attributes,"query")) {
         fb_throw("fusebox.badGrammar.requiredAttributeMissing",
                  "Required attribute is missing",
                  "The attribute 'query' is required, for a 'list' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
      }
      // orderProperty - string.       if (NOT structKeyExists(fb_.verbInfo.attributes,"orderProperty")) {
         fb_.verbInfo.attributes.orderProperty = '';
      }      
      // generate code:       fb_appendLine('<cfset #fb_.verbInfo.attributes.query# = ' &
            'myFusebox.getApplication().getApplicationData().transferFactory.getTransfer().list("#fb_.verbInfo.attributes.object#","#fb_.verbInfo.attributes.orderProperty#") />
');
      fb_appendLine('<cfset myFusebox.trace("Transfer","Listed Records") />');
   } else {
   }
</cfscript>


 
Comments
dickbob's Gravatar @nick - re your other post, I am testing that update I mentioned in my comments with a view to submitting it to Sean for upload to the Subversion repository. I'll look to include your new attribute for list as well.
# Posted By dickbob | 11/05/07 10:01 | Report abusive comment
Nick Tong's Gravatar Hi dickbob, that's great - please let me know how that goes. I may have some other updates soon as well. Watch this space.
# Posted By Nick Tong | 12/05/07 12:31 | Report abusive comment
dickbob's Gravatar Will do. In fact I might extend it even further by including the [asc] and [useAlias] attributes.
# Posted By dickbob | 14/05/07 14:59 | Report abusive comment
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.