For what it’s worth, here’s the code with a brief description. Been meaning to post this forever, so I figure this is as good a time as any. I don’t use this as often as I did, but it’s still a perfectly good pattern for form personalization where you want different users to be able to manage a different subset of fields (quite possible displaying in a different order).
http://www.pbell.com/index.cfm/2006/8/15/Attribute-Name-Lists-for-Form-Personalization
Best Wishes,
Peter
On 8/15/06 12:02 PM, "Kevin Roche" <[EMAIL PROTECTED]> wrote:
Peter,
I look forward to reading your blog. I am not sure what you mean here I was thinking of using the XML to generate a field name list, cfloop and cfswitch so perhaps we are talking about the same thing really and I am making it more complex than it needs. Wouldn't be the first time!! lol
Kevin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Peter Bell
Sent: 15 August 2006 16:53
To: [email protected]
Subject: Re: [Reactor for CF] Autogenerated reactor.xml files?
Hi Kevin,
Just so you know, if you only want to allow users to select a subset of standard fields (not sure if that IS your use case) and to set their order, you don’t need a generator at all – a field name list, cfloop and cfswitch will do the job very efficiently! (I’ll blog on it today or tomorrow.)
The list of check boxes with some kind of way to set display order (either enter a number next to each or ideally a nice little _javascript_) should work fine for the admin interface I’ve done that a bunch of times.
I’m not sure if you need to generate XML at all – just generate the scripts ad the db schema and unless you need aiases or something Reactor should do the rest.
Reason to use Reactor rather than generating everything yourself is if you have some requirements you don’t want to code from scratch like cross db capabilities or nice ORM features that justify the overhead of learning and installing a framework.
And you’re probably not putting yourself out of a job – just allowing you to focus on more interesting enhancements. I’ve been doing this for a while and keep getting busier!
Best Wishes,
Peter
On 8/15/06 11:14 AM, "Kevin Roche" <[EMAIL PROTECTED]> wrote:
Brian
The only problem with the code being MachII based was that I want to create an FB5 lexicon, and it seemed like an extra complexity. Since having never used MachII would have to understand it.
I liked the ColdSpring Snippet too!
I am toying with the idea that your code might be used to generate the reactor.xml file!
One thing I am trying to get my head around is the best way to generate some of my files when I want to give the user the option to hide fields or have them in a differnet sequence and one idea is to have a wizard which shows the user a list of fields and allows them to check which they want and what order they want them in on the generated page.
The other choice that needs to be made is the type of field in each case. Eg Radio Button versus Dropdown List or Text versus TextArea.
This mitigates against a completely on the fly solution but I am thinking now of a two step process, where step1 creates an XML file that will be used by step 2 to generate the actual code. Step1 could be done with a tool like your generator. Step2 would use Reactor.
That begs the question: why not use step1 to do the whole lot?
If you or anyone else has suggestions I am happy to hear them. Maybe I am putting myself out of the job here!
Kevin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> On Behalf Of Brian Rinaldi
Sent: 15 August 2006 15:48
To: [email protected]
Subject: RE: [Reactor for CF] Autogenerated reactor.xml files?
Kevin,
Glad the article helped and I would welcome any contributions. To be honest, all you need to add whatever you want to the existing generator is new XSL. If you wanted to share your stylesheets when you are done, that would be very much welcomed - though it does sound like you are headed in a slightly different direction. Also, not sure why it being built with mach-ii is off-putting...it is not built *for* mach-ii, just *with* mach-ii. The code that it generates is not specific to mach-ii or any other framework (although it did include the ColdSpring snippet - but that could be used with Model-Glue, Mach-ii, Fusebox, ColdBox or whatever). The nice thing about the reqrite is it encapsulated the a lot of the functionality in components (like how it assembles and implements the XSL) which you might find useful...this helped me make it much more extensible than the original which ran everything off a single template essentially.
- Brian Rinaldi
blog: http://www.remotesynthesis.com/blog
ColdFusion Open Source List: http://www.remotesynthesis.com/cfopensourcelist
Boston CFUG - http://www.bostoncfug.org
From: "Kevin Roche" <[EMAIL PROTECTED]>
Sent: Tuesday, August 15, 2006 10:34 AM
To: [email protected]
Subject: RE: [Reactor for CF] Autogenerated reactor.xml files?
Brian,
Yes I saw the rewrite, but thought the original article was easy to understand.
I also am using the ideas from your original article to create a scaffolding tag for FB5. I guess the templates I am working on would work equally with your new code. I will send them to you when they are complete, so you can try the complete scaffolding generator.
My intention is to use Reactor for the DB cfcs as I want to generate the whole thing on the fly, based on some xml config files, they may be significantly different from the ones generated by your code. I did also consider your Ill.... thingy (sorry but can't remember the name), but it did not seem to do all I wanted and the fact that it was Mach II based put me off a bit.
Thanks again for that article it has helped me a lot to get started.
Kevin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Brian Rinaldi
Sent: 15 August 2006 15:20
To: [email protected]
Subject: RE: [Reactor for CF] Autogenerated reactor.xml files?
Kevin,
Thanks for the link to my post. I have since totally rewritten that generator and released it as open-source (Apache 2.0 license). It supports MS SQL and MySQL and is built to be very easy to customize. You can find out more info here : http://www.remotesynthesis.com/blog/index.cfm/2006/8/3/New-OpenSource-Component-Generator
It does not handle table relations at the moment however. I am not sure when or if that will get added. Feel free to contibute if you like :)
- Brian Rinaldi
blog: http://www.remotesynthesis.com/blog
ColdFusion Open Source List: http://www.remotesynthesis.com/cfopensourcelist
Boston CFUG - http://www.bostoncfug.org
From: "Kevin Roche" <[EMAIL PROTECTED]>
Sent: Tuesday, August 15, 2006 4:37 AM
To: [email protected]
Subject: RE: [Reactor for CF] Autogenerated reactor.xml files?
Denny,
Take a look at:
http://www.remotesynthesis.com/blog/index.cfm/2005/12/16/Create-Your-Own-Code-Generator
I am planning to modify this to do just what you want for SQL Server. Havn't got there yet. If you get there first please send me the code.
Kevin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Denny Valliant
Sent: 15 August 2006 02:19
To: [email protected]
Subject: [Reactor for CF] Autogenerated reactor.xml files?
So, what clever reactor user wants to share their CF code for automagically generating a reactor.xml file for a given datasource?
If it's only for database X, that's fine, I'm sure I can mod it for database X2. And then share it with the community, of course.
Failing that, can I get a suggestion as to a tool which will export table relations in a format easily tweakable for Reactor?
My "XML exports" export the data as XML, but not the table structure. How lame is that? Damn non-ESP coders... ;-)
If this hasn't been attempted yet, I might make a auto-generator for MySQL...
:denny
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
