cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivelin Ivanov <ive...@apache.org>
Subject Re: Combining Cocoon with Struts Tag libs
Date Tue, 18 Jun 2002 03:41:24 GMT

I think you're getting into a discussion which has already been covered 
numerous times on the dev-list.
Look at the recent discussions on Struts to see what others thought.

Before that though, take a quick look at this:
http://xml.apache.org/cocoon/howto/xmlform-wizard/howto-xmlform-wizard.html

> 1) I need to accomplish a validation of a 5 part form that is validated and
> filled incrementally.

XMLForm allows use of Schematron schemas which are designed especially 
for this kind of problems.

> 2) Take the contents of this composite form and create one xml from it's
> contents.

XMLForm provides W3C XForms like xml markup.

> 3) Submit to a Transforming servlet that takes this xml and spits back an
> xml response after retrieving info from a Mainframe app.

You'll need to extend the AbstractXMLFormAction and implement the logic 
for talking to the mainframe.

> 4a) Display xml response as a page with 6 tabs ( one page w/ layers or six
> pages with links to the others)

Cocoon's best at that.

> 4b) If there are errors in the response for any of the six parts it needs
> to display the form with the corresponding inputs filled in for corrections
> to be made.

XMLForm has the answer for this too.
See the howto and the feedback wizard demo.

> 5) Accept re-submission and re-validate

you've got it.

> 6) Submit reponse to back-end again, loop sequence.

Your custom action will handle this.
The XMLForm demo shows one way to do it.

> This sequence is the bulk of the app.  There is security and other stuff,
> but that is the core of it.
> 
> The debate is over performance, use of languages, and ease of support.
> With performance coming at the top of that list.

I can safely claim that XMLForm is not slower than Struts.
The libraries it is build on are shared by Jakarta JSTL and are 
production quality.

> One other concern I have about splitting the architecture into two servlets
> is session management.  Where do I put the timeout logic is another
> question I need to answer?

I like using standards. So I give this to the app server by hooking in a 
J2EE Realm implementation.

> The developers not surprisingly are skeptic of anything that involves xml
> based coding, instead of what they are comfortable with(Model 2).

Can't help you here :)

> 
> I need to come up with a good reason not to use Struts.

Struts is great for what it does.
If your application is all HTML, stick to Struts.




Ivelin


> 
> -Adam
> 
> 
>                                                                                     
                                                         
>                       Werner Guttmann                                               
                                                         
>                       <Werner.Guttmann@morgans        To:       cocoon-users@xml.apache.org,
ldexp-dev <ldexp-dev@ms.com>, ldwebdeb@ms.com    
>                       tanley.com>                     cc:                        
                                                            
>                                                       Subject:  Re: Combining Cocoon
with Struts Tag libs                                     
>                       06/17/02 10:53 AM                                             
                                                         
>                       Please respond to                                             
                                                         
>                       cocoon-users                                                  
                                                         
>                                                                                     
                                                         
>                                                                                     
                                                         
> 
> 
> 
> 
> Adam,
> 
> there's a couple of alternatives you seem to have, one of them using
> XMLForms
> et alias to implement functionality of Struts in Cocoon. As this
> functionality
> has only become available in the recent past, we have taken a different
> approach using the XMLizable interface of Cocoon to integrate our business
> domain model with both Struts and Coccon.
> 
> In our case, an inbound HTTP request is
> 
> 1) picked up by Struts, which a) populates its FormBean(s) , and b)
> forwards
> to a pre-configured Action for additional validation. If successful, we
> then
> forward control to an XSP ... in order to avoid introducing dependencies
> between Struts and Cocoon, we decided to implement our own set of JavaBeans
> to
> keep the set of parameters as selected in the HTML form, which we attached
> to
> the request/session scope as attributes.
> 
> b) On Coccon receiving the HTTP request (forward), Coocon kicked in and
> invoked the relevant pipeline. That pipeline uses the ServerPages generator
> to
> invoke an XSP that uses the following code fragment:
> 
> <xsp:logic>
>    XMLizable xmlizable = new XTransformer();
> </xsp:logic>
> 
> <some_entities><xsp:expr>xmlizable</xsp:expr></some_entities>
> 
> Cocoon - when processing the <xsp:exp> element - will invoke the
> toSAX(ContentHandler) method on our XTransformer class, and expects this
> method to insert SAX events into the event stream. In our case, for each
> business entity we have a corresponding Transformer instance that uses the
> aforementioned Criteria object, a business delegate and (potentially) a
> value
> list handler implementation to get a collection of business entities from
> our
> business backend, and render them to SAX events. From there on, it's
> business
> as usual with Cocoon executing the remainder of the pipeline.
> 
> Now, having followed some of the traffic on this list re: XMLForms, etc., I
> am
> under the impression that most of the stuff could (and maybe should) be
> done
> through the use of XMLForms, ValidatorAction, etc. Unfortunately, I have
> not
> had the time to evaluate the various offering (yet).
> 
> I hope this helps.
> Werner
> 
> 
> 
> Adam_Waldal@eFunds.com wrote:
> 
> 
>>Cocoon-Collective,
>>
>>I am still trying to make architecture decisions.  I have a pretty good
>>understanding of both Struts and Cocoon architectures.  I have seen a
>>couple of other people inquire about a hybrid solution using the
> 
> strengths
> 
>>in both.  Has anyone considered or done this successfully and seemingly
>>painlessly?
>>
>>I guess this really comes down to a comparison of xsp vs. jsp and which
> 
> to
> 
>>use.  The other major consideration is performance, the system I need to
>>build will be high traffic and transactional.  Does anyone have a similar
>>situation or opinion that will help my decision process?
>>
>>Thanks,
>>Adam
>>
>>---------------------------------------------------------------------
>>Please check that your question  has not already been answered in the
>>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>>
>>To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
>>For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> 
> 



-- 

-= Ivelin =-


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message