cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Hailstone" <matthew.hailst...@waterford.org>
Subject Actions and multipage form processing
Date Mon, 15 Jul 2002 22:12:20 GMT
I'm finding that actions are looking/sounding really useful. I just
can't figure out how to use them efficiently yet. Here is my desire:

1) Form gets data from user
2) Cocoon processes form and returns customized form based on values
from form in step 1.
  a) Gets value(s) from input fields and performs queries on a database
  b) Returns results from database so that my transformer (xslt sheet)
transforms the data into HTML select inputs for next page's form
3) Ater desired inputs are given on last form page, a delimited text
file is returned for user to save and process in third-party tool.

Currently, I have one really messy xsp file that has a bunch of nested
if statements. The ifs are mostly on session data that I set from
previously encountered request parameters and their value(s). Works
kinda OK, but any variation from the user on the normal use of the
form/back button/type in URL by hand/etc. and my code is gone to pot in
logic. I got the Hello World action example to work fine.
(http://xml.apache.org/cocoon/userdocs/concepts/actions.html) The action
sets explanation was a little over my head at this point, though.

Any suggestions/examples of how to simplify my xsp implementation (get
rid of so many ifs) and do logic somewhere else by using actions/action
sets?

Using:
  Cocoon 2.0.3 release
  Tomcat 4.1.3
  Win2K

Here is a snippet from my pipeline:

      <map:match pattern="file">
        <map:generate type="serverpages" src="logic/file.xsp"/>
        <map:serialize type="text"/>
      </map:match>

      <map:match pattern="form">
        <map:generate type="serverpages" src="logic/form.xsp"/>
        <map:transform src="style/menupage.xsl">
          <map:parameter name="toc-file" value="../content/toc.xml"/>
          <map:parameter name="css-stylesheet" value="default.css"/>
          <map:parameter name="base-url" value="/cocoon/eval"/>
        </map:transform>
        <map:serialize/>
      </map:match>

Thanks!

Matthew

P.S. I'm willing to help Dianna and her team compile and make a nice
How-To on multipage form processing with actions depending on the amount
of input is given. ;)

---------------------------------------------------------------------
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