Ticket #1 (closed defect: fixed)
Add mechanism to allow users to create their own xsl files to add plugins to reactor.
| Reported by: | dhughes | Owned by: | dhughes |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Reactor - Reactor Factory | Version: | 1.0 |
| Severity: | blocker | Keywords: | plugin xsl |
| Cc: |
Description (last modified by dhughes) (diff)
Several people have requested the ability to be able to write or customize their own xsl files to generate objects that meet their specific needs.
Of particular note is João Fernandes has been working to integrate reactor with Flex. To accoplish this goal he has to create objects that interface ColdFusion to Flex. (I don't know the details.) Right now this has to be accomplished by hand. However, he could use this feature to add his own generators to Reactor.
Here's how I think this would work. In the reactor.xml config file there would be an optional config attribute call "plugins". This would point to a directory which would contain xsl style sheets.
For example:
<config> <project value="Scratch" /> <dsn value="scratch" /> <type value="mssql" /> <mapping value="/reactorData" /> <mode value="development" /> <plugins value="/plugins" /> <!-- These config values are not required --> <!-- <username value="" /> <password value="" /> --> </config>
In the /plugins directory the user would place three xsl stylesheets. These xsl stylesheets would follow the same patterns as the ones that come with reactor. In otherwords, there would be one xsl style sheet for base, custom and project.
- Project = the stylesheet that will generate the base object in the reactor project folder.
- Base = the customizable object in the user's data directory
- Custom = the dbms-specific customizable version of the object in the user's data directory
The plugin files would all be named in this pattern: pluginName.objectType.xsl.
For example, if you were to create a plugin called foo your three xsl stylesheets would be namd:
- foo.project.xsl
- foo.base.xsl
- foo.custom.xsl
To create an instance of a foo object using reactor you would use a new method on the reactorFactory called createPlugin(). This method would have the following signature:
Any = createPlugin(objectAlias, pluginName)
ObjectAlias would be the alias of an object in the database, just as with all the other create methods.
PluginName would be the name of the plugin. IE: "foo".
