|
Fusebox
|
Fusebox 5.1 EnhancementsThis page documents the major enhancements in Fusebox 5.1. Globally Shared FilesCircuits, plugins, errortemplates and lexicons can all be shared across multiple Fusebox applications because you can specify absolute paths, i.e., that begin with a "/" so they are webroot-relative or resolved via a ColdFusion mapping. Globally Shared CircuitsBy default, circuits paths are relative to the application root. With Fusebox 5.1, you can now specify a new attribute on a <circuit> declaration in fusebox.xml that specifies whether a circuit path is relative or not (i.e., absolute or mapped). The default is relative="true". If you specify relative="false" and your path= attribute begins with a / then the circuit path will be treated as absolute (relative to your server's webroot) or mapped (resolved via a ColdFusion mapping).<circuits> Globally Shared PluginsWhen you declare a plugin, you can specify a template name and, optionally, a path that is relative to the plugins subdirectory of your application root:<plugin name="myplug" template="plugin_page" path="relative/"/> With Fusebox 5.1, you have several new options:
You can either specify a relative path:<parameter name="pluginsPath" value="../../plugins"/> Globally Shared Error TemplatesBy default, every Fusebox application has to have a copy of the error templates. With Fusebox 5.1, you can now override the location of the error templates by specifying the errortemplatesPath parameter in fusebox.xml. You can either specify a path relative to your application root or an absolute (or mapped) path:<parameter name="errortemplatesPath" value="/sharederrors"/> Globally Shared Lexiconshttp://trac.fuseboxframework.org/fusebox/wiki/Fusebox51Enhancements#GloballySharedLexiconsBy default, lexicons are introduced with the xmlns declaration in a fusebox or circuit tag as a prefix and a path that is relative to the lexicon directory under your application root. With Fusebox 5.1, you now have two additional options:
If you specify an absolute or mapped path in a xmlns declaration, that defines the complete path for the declared lexicon, e.g.,xmlns:prefix="/sharedlexicon/mylexicon" You can also override the default lexicon search location for the entire application by specifying lexiconPath within fusebox.xml. The default is *lexicon/*which is a directory below the application root. You can either specify a different path relative to your application root such as:<parameter name="lexiconPath" value="../../externallexicon"/> Search Engine Safe URLsHandling of self, myself, <xfa> and <relocate> has been enhanced to allow you to specify how the URLs are constructed by the framework. <xfa> now allows child tags: <parameter> can be used to specify URL parameter name / value pairs instead of specifying them directly in the XFA value. In other words, instead of saying:<xfa name="edit" value="app.edittask&id=#attributes.id#"/> Fusebox uses fusebox.xml parameters to construct the URL parameter string. The following (optional) fusebox.xml parameters have been added:
This means that you can construct so-called "Search Engine Safe" URLs automatically by specifying different values for these parameters. For example, by setting them all to "/", the XFA shown above becomes:app.edittask/id/#attributes.id# In addition, you can now specify an XFA name in the <relocate> verb:<relocate xfa="edit"/>
Using event as an alternative to attributesFor developers who want a more object-oriented way to handle data that comes in from the URL and form scope, there is now an alternative to the attributes scope. An object called eventis now available in the main variables scope with methods that allow you to get and set values within the underlying attributes scope. The following methods are available on the event object:
The event object is automatically created in the fusebox5.cfm file and is available in the main variables scope, just like the attributes structure. The intent is that eventwould be more idiomatic for use with a CFC-based model. It's full component name depends on the location of the Fusebox core files (it might be fusebox5.fuseboxEvent, for example) so developers should simply declare the argument type in their model component method to be type="any" and avoid direct dependence on the Fusebox path. |
Add Comment