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

New transfer lexicon: listByPropertyMap

As you may or may not know I'm quite big fan of fusebox and one of the things I love is its power with lexicons.

Alex Lloyd, from my company Talkwebsolutions, today put together a new lexicon for Transfer. This lexicon allows use of the lisByPropertyObject from within Transfer.

Nice work Alex.


Error: Element SYSTEM is undefined in INSTANCE - Transfer?

Ok - so this was a first time i'd ever seen this error and I was a little stumped. The error come when I tried to login to a site which I'd done a 'thousand' times before. Looking at the stack trace I could see the error was caused by Transfer. Hmmm ok, I've just updated transfer locally so was that it? I looked over the code (a parsed fusebox file) but I couldn't see anything different? It really had me stumped. Time to call in some help. Mark Mandel to the rescue. After sending Mark some details about the error he came back with a simple solution...

"Have you cleared out the Transfer Cache files since the upgrade?"

Doh! I'd cleared the fusebox parsed files when I did the Transfer upgrade but I hadn't cleared the transfer cached files. After doing this it worked fine...

The moral of the story: Clear cached files if anything doesn't appear to be working correctly before bothering people!

BTW: If you've not upgraded to yet it has a load of enhancements.


TQL and params lexicon update

I've made another change to the tql.cfm and parameter.cfm lexicon for Transfer and Fusebox.

This now takes into account the dataType argument and it allows for the 'list' argument to be set - which is helpful if you're doing a select IN statement.

I've changed in tql.cfm line 32 to:

[More]


Quick update to the TQL fusebox lexicon

Anyone using the TQL lexicon which a wrote about a while back should update it to use the following code:

<cfscript>
   // usage inside other verbs:    //      <transfer:parameter
   //            name="paramName"
   //            value="someVal"
   //            dataType="date" />

   if (fb_.verbInfo.executionMode is "start") {
      // validate attributes       // <parameter> must have a parent verb this lexicon:       if (structKeyExists(fb_.verbInfo,"parent") and
            fb_.verbInfo.parent.lexicon is fb_.verbInfo.lexicon and
            listFind("delete,read,save,tql",fb_.verbInfo.parent.lexiconVerb) neq 0) {

         // name - string - required          if (not structKeyExists(fb_.verbInfo.attributes,"name")) {
            fb_throw("fusebox.badGrammar.requiredAttributeMissing",
                     "Required attribute is missing",
                     "The attribute 'name' is required, for a 'parameter' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
         }
         // value - string - required          if (not structKeyExists(fb_.verbInfo.attributes,"value")) {
            fb_throw("fusebox.badGrammar.requiredAttributeMissing",
                     "Required attribute is missing",
                     "The attribute 'value' is required, for a 'parameter' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
         }
         // check to see if we're passing in a datatype          if (structKeyExists(fb_.verbInfo.attributes,"dataType")) {
               thisValue = '#fb_.verbInfo.attributes.value#,"#fb_.verbInfo.attributes.dataType#"';
         }
         else{
            thisValue = fb_.verbInfo.attributes.value;
         }
         // add this parameter to the parent data:          fb_.verbInfo.parent.parameters[fb_.verbInfo.attributes.name]   = thisValue;
         

      } else {

         fb_throw("fusebox.badGrammar.parameterInvalidParent",
                  "Verb 'parameter' has invalid parent verb",
                  "Found 'parameter' verb with no valid parent verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");

      }

   }
</cfscript>

[More]

Learn Transfer ORM - this Thursday!

If you don't already know the Transfer ORM framework

automate[s] the repetitive tasks of creating the SQL and custom CFCs that are often required when developing a ColdFusion application.

If you want to learn more about this framework be sure to check out Mark Mandels workshop on Thursday

TQL Transfer lexicon for fusebox

Transfer is getting better all the time, with some recent speed improvements it keeps growing. If you've not used Transfer in fusebox yet check out this post.

Since March Transfer has supported TQL, which is transfers own scripting language:

There is also a scripting language that allows you to perform database queries based on the information and naming scheme that you set up in your transfer configuration file called Transfer Query Language (TQL). TQL is very similar to SQL, however since Transfer already knows about the relationships in your system, you don't have to write as much code to perform complicated queries against your database.

This is a fantastic addition as it allows you to quickly manipulate your data. One thing that I thought could make easy to use via fusebox was to create a lexicon, which I have done here:

[More]

Framework code generation

Over at cfFrameworks.com we are continuing our workshops with Brian Rinaldi. Brian will be giving a workshop on his Illudium PU-36 Code Generator. If you're a Coldspring or Transfer fan then this is a must see workshop.

[More]

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

[More]

Transfer ORM error... what did I do wrong?

I have been playing around with Mark Mandels Transfer ORM a bit more recently and tonight I got a strange error:

Element ID is undefined in XOBJECT.

What does this mean..

well after searching sadly i didn't find that much info, so I did the following things:

1. Validated my transfer.xml - nope
2. Made sure I had a primary key.. err, okay stupidly I didn't, after fixing this the error was still persistent
3. Define the id in transfer.xml (this tells transfer what the primary key is) - bingo!

What i had before was:

<property name="contactID"       type="numeric" />

and what i needed was

<id       name="contactID"       type="numeric" />

D'oh.

Setting up and using Transfer within fusebox via the Transfer lexicons

Setting up Transfer within fusebox via the Transfer lexicons

After my previous post where I cover Setting up Coldspring within fusebox via the CS lexicons I've now just got Transfer working with the Transfer lexicons.

To get Transfer setup you need to initilise the Transfer factory, you do this using the initialize verb. The best place to do this is in the appinit section of fusebox.xml.cfm as this is called when you start your app (it's like the onApplicationStart function in application.cfm). Within this function I call a fuseaction in my model circuit:

<appinit>
<fuseaction action="m.transferSetup" /> </appinit>
Then inside my model circuit I have this fuseaction
...
<circuit access="public" xmlns:tr="transfer/">
<fuseaction name="transferSetup">
<tr:init
            datasource="/config/datasource.xml.cfm"
            configuration="/config/transfer.xml.cfm"
            definitions="/model/transferData" />

</fuseaction>

So what's heppening here:

[More]

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.