cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: 2 return values from an action?
Date Thu, 30 Jan 2003 08:51:09 GMT
From: <Johannes.Becker@o2.com>

>
> Cool. Thanks for the quick response Konstantin.
>
> >>This one should work fine. But it'd be even better if you've used input
> >>modules instead of an action. Something like this:
>
> <map:match pattern="blabla">
>       <map:generate src="sampleoutput.xml"/>
>       <map:transform src
> ="stylesheets/{request-param:report_id}{request-param:service_id}_{reques
>                   t-param:output_id}.xsl"/>
>       <map:serialize type="{request-param:output_id}"/>
> </map:match>
>
> Do I have to place "something extra" in my sitemap for this solution?

Nothing.
Just make sure that you are using the latest Cocoon (2.0.4 or 2.1), where
input modules are implemented. Also, you could check that you have
'request-param' input module declared in WEB-INF/cocoon.xconf.

--
  Konstantin

>
> Cheers
> Jonny
>
> --------------------------------------------------------------------------
--------------------------
>
> This electronic message contains information from the mmo2 plc Group which
> may be
> privileged or confidential. The information is intended to be for the use
> of the
> individual(s) or entity named above. If you are not the intended recipient
> be aware
> that any disclosure, copying, distribution or use of the contents of this
> information
> is prohibited. If you have received this electronic message in error,
> please notify
> us by telephone or email (to the numbers or address above) immediately.
>
>
>
> |---------+---------------------------->
> |         |           "Konstantin      |
> |         |           Piroumian"       |
> |         |           <kpiroumian@apach|
> |         |           e.org>           |
> |         |                            |
> |         |           01/30/03 09:32 AM|
> |         |           Please respond to|
> |         |           cocoon-users     |
> |         |                            |
> |---------+---------------------------->
>
>---------------------------------------------------------------------------
---------------------------------------------------|
>   |
|
>   |       To:       <cocoon-users@xml.apache.org>
|
>   |       cc:
|
>   |       Subject:  Re: 2 return values from an action?
|
>
>---------------------------------------------------------------------------
---------------------------------------------------|
>
>
>
>
> From: <Johannes.Becker@o2.com>
>
>
> > Hi,
> >
> > thanks to you guys I got my action running finally.
> > Now I have another question.
> >
> > For example: I have 1 xml file that could be displayed in 15
> > xsl-Stylesheets (in various formats: html, pdf, xls).
> >
> > Currently in my first action I choose the corresponding file.
> >
>
> <skip what="first_action_code"/>
>
> >
> > In the other action I choose the output format.
> >
>
> <skip what="second_action_code"/>
>
> > Thats how I use it in the sitemap:
> > ...
> > <map:match pattern="blabla">
> >             <map:generate src="sampleoutput.xml"/>
> >             <map:act type="xslSelect">
> >                    <map:transform src="stylesheets/{results}.xsl"/>
> >             </map:act>
> >             <map:act type="outputSelect">
> >                  <map:serialize type="{output-choice}"/>
> >              </map:act>
> >  </map:match>
>
> This won't work, you should use nested actions in such cases. Actions work
> like an if ... else ... statement: if an action returns a non-null value
> then it's contents is processed, otherwise the following part is
processed.
>
> In your particular case it'd be much better to return two values from the
> action, just you different keys in the HashMap to do it:
>
> results.put("xsl-choice", "style.xsl");
> results.put("format", "pdf");
>
> and then use it in your sitemap like this:
>
> <map:match pattern="blabla">
>              <map:act type="allSelect">
>                     <map:generate src="sampleoutput.xml"/>
>                     <map:transform src="stylesheets/{xsl-choice}.xsl"/>
>                     <map:serialize type="{format}"/>
>              </map:act>
>   </map:match>
>
> This one should work fine. But it'd be even better if you've used input
> modules instead of an action. Something like this:
>
> <map:match pattern="blabla">
>               <map:generate src="sampleoutput.xml"/>
>               <map:transform
> src="stylesheets/{request-param:report_id}{request-param:service_id}
> _{reques
> t-param:output_id}.xsl"/>
>               <map:serialize type="{request-param:output_id}"/>
>   </map:match>
>
> --
>   Konstantin
>
> > ...
> >
> > My question:
> > Can I handle this somehow in one action (something like "2 return
> values")?
> > Or do it somehow else?
> >
> > Jonny
> >
> --------------------------------------------------------------------------
> --------------------------
> >
> > This electronic message contains information from the mmo2 plc Group
> which
> > may be
> > privileged or confidential. The information is intended to be for the
use
> > of the
> > individual(s) or entity named above. If you are not the intended
> recipient
> > be aware
> > that any disclosure, copying, distribution or use of the contents of
this
> > information
> > is prohibited. If you have received this electronic message in error,
> > please notify
> > us by telephone or email (to the numbers or address above) immediately.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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>
>
>


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