cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: quick question on logging and actions
Date Mon, 12 Mar 2001 22:12:56 GMT
Donald Ball wrote:
> 
> On Mon, 12 Mar 2001, Berin Loritsch wrote:
> 
> > My assumption is that the <map:generate/> section is serializing your form?
> 
> yah, i'm just writing raw XHTML for simplicity during testing.
> 
> > If your action is to be the handler for a form, then you must place it in
> > a URL where the ACTION of your form is pointing.
> >
> > For example:
> >
> > <form name="fu" action="handle-fu">
> >   <input type="submit"/>
> > </form>
> >
> > You will have two entries in the Sitemap (although if your desire is to
> > go directly to the same form you can collapse it into one):
> >
> > <map:match pattern="handle-fu">
> >   <map:act action="send-mail">
> >     <parameter name="smtphost" value="mail.webslingerZ.com"/>
> >   </map:act>
> >   <map:redirect-to uri="fu"/>
> > </map:match>
> >
> > <map:match pattern="fu">
> >   <map:generate src="docs/samples/forms/mail.xhtml"/>
> >   <map:serialize/>
> > </map:match>
> 
> my desire is to go directly to the same form, so i ripped off the employee
> update action model... incorrectly? yours is:
> 
>    <map:match pattern="forms/employee">
>      <map:act set="employee">
>        <parameter name="form-descriptor"
> value="context://docs/samples/forms/employee.xml"/>
>        <map:generate type="serverpages"
> src="docs/samples/forms/employee.xsp"/>
>        <map:transform src="stylesheets/dynamic-page2html.xsl"/>
>        <map:serialize/>
>      </map:act>
>    </map:match>
> 
> while mine is simply:
> 
>    <map:match pattern="forms/mail">
>      <map:act action="send-mail">
>        <parameter name="smtphost" value="mail.webslingerZ.com"/>
>        <map:generate src="docs/samples/forms/mail.xhtml"/>
>        <map:serialize/>
>      </map:act>
>    </map:match>
> 
> why would that not work?

The Action set is designed to kick off one of the actions in the
set based on a request Parameter named "cocoon-action" where the
value matches the name in the set.

The way yours is set up, it is _supposed_ to be executed every time
the URL is accessed.  Try deleting your sitemap, so that it gets
compiled fresh.  Also make sure the class is in the classpath.

There is some rudimentary documentation on actions in the
C2 CVS.  Let me know what helps, what confuses the matter, and
what needs further explanation.

I have to go for the day, but will see this tomorrow.

> 
> > Also note that if the Action does not return a Map object, then no
> > sitemap events contained inside will execute.  In that case, you
> > either have to return an empty map, or place those events outside
> > the <map:act/> event.
> 
> it returns an empty new HashMap...
> 
> - doanld
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message