The Infusion Preferences Framework includes a tool called the Builder, which automatically creates all the components you need given primary and auxiliary schemas. The builder constructs all the components necessary to render the preferences editor, store preferences, and respond to changes in preferences. However, you'll generallyl want to use the simpler method "fluid.prefs.create" for creating and instantiating a Preferences Editor.
NOTE: In this form, the
namespace property of the auxiliary schema is required.
| ||(Object) The configuration options for the builder. See Options below for more information.|
|Object||The builder object. See Builder Structure below for more information.|
(Optional) A list of grade names to be used for the builder.
This option can be used to specify the names of grades that define schemas, as an alternative to specifying the schemas through the direct options. If you do not provide the
|Array of strings||none|
NOTE: You must provide at least one of
gradeNameindicating an auxiliary schema.
If you provide both, they will be merged (with the
auxiliarySchema overriding anything in the grade schema), but you must provide at least one.
The simplest usage of the builder is through the two schema options:
The Preferences Framework includes primary and auxiliary schema for a set of preferences, referred to to as the "starter set." This set includes the following preferences:
To use these preferences and the panels that come with them, simply use the Framework-provided starter auxiliary schema grade name,
fluid.prefs.auxSchema.starter, as shown below:
You may need to override the template and message bundle path prefixes, if your relative paths are different than the defaults:
It is not necessary to specify the primary schema; The builder will automatically find the preference specifications provided by the Framework and build a primary schema (see Processing the Schemas below for more information).
If a grade name is used to provide the auxiliary schema, the grade must meet certain criteria:
The Preferences Framework builds an internal, preliminary primary schema as follows:
This preliminary schema is then filtered based on the preferences found in the auxiliary schema to produce the subset of only preferences found in both the primary and auxiliary schemas. This set of preferences will be the final set supported by the builder. NOTE: All panels and enactors defined in the auxiliary schema will be created and rendered, but only those that have corresponding preferences in the primary schema will actually work.
The builder object returned by a call to
fluid.prefs.builder has the following properties that can be used to instantiate the constructed preferences editor:
|String||Grade name of the constructed preferences editor; Can be used to instantiate the preferences editor, enhancer and settings store using |
|String||Grade name of the constructed enhancer; Can be used to instantiate the enhancer and settings store using |
The builder also creates free functions that can be used to instantiate the preferences editor and enhancer. These functions are created within the namespace specified in the auxiliary schema, if specified, or in a unique namespace,
The functions created include:
prefsEditor()which can be used to instantiate the preferences editor, enhancer and settings store
uie()which can be used to instantiate the enhancer and settings store