I would look into using a BeanEditForm and making a BeanModel with all synthetic properties based on your XML configuration. If you have a definite set of parameter types and you can map each into some field type, then you should be able to do it. See http://tapestry.apache.org/tapestry5/guide/beaneditform.html
Kalle On Mon, Sep 28, 2009 at 12:08 PM, Kevin White <tapestry-ke...@kevbo.org> wrote: > Hello all... > > I've been using Tapestry for a while...first 3, then 4. My main app is > still in 4, but I'm willing to move it to 5...so...we can talk about T5, and > apologies for what might be basic T5 questions, because I haven't delved too > deeply into T5 yet. I keep waiting for a book. :) > > I have found Jumpstart and have looked around there. > > Anyways...most of my app has static forms and fits right in to the whole > "static structure, dynamic behavior" thing. But I'm running smack dab into > the one thing that I think I'm going to have trouble with. > > I need to generate a configuration file for another system. That config > file is XML, although that's pretty inconsequential. The point is, I need > to run a text file through some processing and substitute specific values > for parameters. > > I have template config files. A given device will combine a template with > values and produce a filled-in file. An example at the top of the template > config file looks like this: > > <parameters> > <parameter name="internal_ip_address" > description="IP Address for internal network"/> > <parameter name="external_ip_address" > description="IP Address for external network"/> > </parameters> > > You can guess where this is going. > > I want to build a Web GUI to provide the parameter values. It will need to > open up the specified template, read through the list of parameters, and > make a form. > > The only way I can see to do something like that is by using a Grid, where > each parameter would be a row in the grid. I can't use a BeanEdit, because > I can't define the Bean itself at compile time...it comes from the XML > template at run time. > > The problem I see with using Grid is losing the ability to do field > validators...each particular row in the Grid would have a "value" field that > might require a different validation for each parameter. > > I'm just looking for a suggestion as to what to look at to solve this. The > general response to questions like this seems to be "redefine your problem > and nail down your data model". I could...I could require that each > template have an associated JavaBean associated with it. This means a Java > developer would have to be involved whenever a new template is needed, which > I wanted to avoid. OTOH, I can see that I could quickly end up > reimplementing a T4 looking description language in the <parameter> section > there if I get any more complicated (ie, validators). > > I've been writing web apps for a while, primarily by hand in Perl, then > stumbling through it by hand in JSP, then with Tapestry. I can conceive of > how to do this by hand using the scary old methods. I'd like to try to stay > "in model" with Tapestry...but I fear that my requirements are at odds with > Tapestry's base assumptions. I'm willing to reconsider my requirements, but > I'd like to try to avoid requiring new Java code for a new template. > > Anyways, thanks for any help or suggestions. > > Kevin > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org