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:
// 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>




