guys, thought i'd throw in my 2cents as i enjoyed reading your discussion so far.
i have been trying to solve the same problem - to generate the struts forms and resource properties (maybe actions too). First there was a chap posted an announcement to the list recently to that used XSL transforms acting on the struts config did you see it? And secondly i use XMI (XML Metadata Interchange) from the OMG to model the metadata before applying another set of XSL transforms to generate the code. I guess the question is with the proliferation of metadata (all in XML of course+ACE-) what is your preferred starting point? rgds, tim -----Original Message----- From: Jon Ferguson +AFs-mailto:ferguson+AEA-ieee.org+AF0- Sent: Thursday, 10 January 2002 7:22 PM To: Struts Developers List Subject: Re: Building Form Beans from XML Schema? Arron, I agree with the analysis. There are of course other tools that do similar things (including the Digester) but I've seen no others that do all three (XML/Schema/SQL) at least opensource. It seems like a natural way to proceed in order to automate some of this stuff. When I noticed that you could get Castor to generate beans with the validate method I thought the author probably had Struts in mind.. If I get a chance, I'll look into it further. Thanks, Jon Arron Bates wrote: +AD4- Jon, +AD4- +AD4- I'm quite certain the parser has the ability, it just doesn't do it. +AD4- It's the generation of the Java code which is stopping it. I would think +AD4- you could hack it, so when an object's setter is called automatically +AD4- call it's validate() method (which the system creates both, so all you'd +AD4- have to hack is when and where) for each object continuing to set all +AD4- data (it carries invalid data quite happily, only complains when you ask +AD4- it to marshal the document out or validate it) and remember all the +AD4- validation errors which were thrown and just pop them into the pile for +AD4- Struts. Could be groovy... but it's not an out-of-the-box ability. +AD4- +AD4- I've only had the chance to use the schema side of the matter. We use it +AD4- to create the XML documents against the schema, when we have to do +AD4- something which requires XML. I don't think my current client is a +AD4- particular fan of XML per-se. +AD4- +AD4- Arron. +AD4- +AD4- Jon Ferguson wrote: +AD4- +AD4- +AD4-Arron, +AD4- +AD4- +AD4- +AD4-Thanks for the hands-on. Shame really.. surely the parser provides this data.. +AD4- +AD4-wonder if there's another way to 'compile' that information into a method. +AD4- +AD4- +AD4- +AD4-BTW, have you used Castor's Object-Relational mapping? The second half of the +AD4- +AD4-equation would be to use that to persist the populated beans from within the +AD4- +AD4-Action. +AD4- +AD4- +AD4- +AD4-Cheers, +AD4- +AD4- +AD4- +AD4-Jon +AD4- +AD4- +AD4- +AD4-Arron Bates wrote: +AD4- +AD4- +AD4- +AD4APg-I've tried to do this with Castor generated objects. Problem is though, +AD4- +AD4APg-is that the errors are not fine grained at all. +AD4- +AD4APg-You validate the document by calling the validate() method on the top +AD4- +AD4APg-node, and you get a yes or a no. +AD4- +AD4APg-You can do this for all of the sub objects, but it's just that, you +AD4- +AD4APg-still have to implement the field validation yourself. +AD4- +AD4APg- +AD4- +AD4APg-Naturally you can't play any tricks with the calling of property methods +AD4- +AD4APg-to work around various issues as your objects are locked down to the +AD4- +AD4APg-automation process. +AD4- +AD4APg- +AD4- +AD4APg-Otherwise it's quite excellent. +AD4- +AD4APg- +AD4- +AD4APg-Arron. +AD4- +AD4APg- +AD4- +AD4APg-Jon Ferguson wrote: +AD4- +AD4APg- +AD4- +AD4APgA+-( Republished under appropriate Subject :-( ). +AD4- +AD4APgA+- +AD4- +AD4APgA+-Hey, +AD4- +AD4APgA+- +AD4- +AD4APgA+-I've been toying with the idea of Modelling my form beans using XML Schema, +AD4- +AD4APgA+-then generating the actual beans using some XML binding tool like Castor (which +AD4- +AD4APgA+-should also generate my validate function). I should also be able to use +AD4- +AD4APgA+-Castor to do RDBMS mapping as well.. (but from a session bean manipulating the +AD4- +AD4APgA+-formbeans for example). +AD4- +AD4APgA+- +AD4- +AD4APgA+-I'm thinking of utilising schema from developments such as RosettaNet, BizTalk +AD4- +AD4APgA+-Frameworks and ebXML - noting that often the info entered into forms could be +AD4- +AD4APgA+-the same message information that might be passed between businesses. (Eg. a +AD4- +AD4APgA+-Purchase Order, etc.). +AD4- +AD4APgA+- +AD4- +AD4APgA+-I'm hoping that the result would: a) help to standardize the business app. b) +AD4- +AD4APgA+-leave it wide open for making use of b-2-b developments such as webServices and +AD4- +AD4APgA+-the above efforts. c) provide automatic form validation (inherent in the +AD4- +AD4APgA+-Schema), d) obviate the hand-coading of formbeans. +AD4- +AD4APgA+- +AD4- +AD4APgA+-Any comments on this approach? Has anyone tried this? +AD4- +AD4APgA+- +AD4- +AD4APgA+-Cheers, +AD4- +AD4APgA+- +AD4- +AD4APgA+-Jon +AD4- +AD4APgA+- +AD4- +AD4APgA+- +AD4- +AD4APgA+------------------------------------------------------------------------- +AD4- +AD4APgA+- +AD4- +AD4APgA+--- +AD4- +AD4APgA+-To unsubscribe, e-mail: +ADw-mailto:struts-dev-unsubscribe+AEA-jakarta.apache.org+AD4- +AD4- +AD4APgA+-For additional commands, e-mail: +ADw-mailto:struts-dev-help+AEA-jakarta.apache.org+AD4- +AD4- +AD4APgA+- +AD4- +AD4APg--- +AD4- +AD4APg-To unsubscribe, e-mail: +ADw-mailto:struts-dev-unsubscribe+AEA-jakarta.apache.org+AD4- +AD4- +AD4APg-For additional commands, e-mail: +ADw-mailto:struts-dev-help+AEA-jakarta.apache.org+AD4- +AD4- +AD4APg- +AD4- +AD4- +AD4- +AD4- +AD4- +AD4------------------------------------------------------------------------- +AD4- +AD4- +AD4- +AD4--- +AD4- +AD4-To unsubscribe, e-mail: +ADw-mailto:struts-dev-unsubscribe+AEA-jakarta.apache.org+AD4- +AD4- +AD4-For additional commands, e-mail: +ADw-mailto:struts-dev-help+AEA-jakarta.apache.org+AD4- +AD4- +AD4- +AD4- +AD4- Part 1.2 +AD4- +AD4- +AD4- +AD4- Content-Type: +AD4- +AD4- +AD4- +AD4- text/plain +AD4- +AD4- +AD4- +AD4- +AD4- +AD4- -- +AD4- To unsubscribe, e-mail: +ADw-mailto:struts-dev-unsubscribe+AEA-jakarta.apache.org+AD4- +AD4- For additional commands, e-mail: +ADw-mailto:struts-dev-help+AEA-jakarta.apache.org+AD4- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>