cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ypom...@freemail.gr
Subject Re: Re: (newbiew) Determine program flow
Date Wed, 02 May 2007 14:35:50 GMT

> ypomonh@freemail.gr napisa�(a):
> > I need to determine the program flow depending on the result of a DB query: if the
query returns zero reselts execute this pipeline or else execute that pipeline.
> >
> > It might trivial but I can't find an example anywhere :(
> 
> The best way is to use flowscript. How do you query your DB?

Through the SQL transformer:


###### map ######
<map:pipeline>
	<map:match pattern="checkParameters">
  <map:generate src="sql/checkParameters.xml"/>
	<map:transform type="sql">
	<map:parameter name="rid" value="{request-param:rid}"/>
	</map:transform>
	<map:serialize type="xml"/>
	</map:match>
</map:pipeline>

###### query ######
<document xmlns:sql="http://apache.org/cocoon/SQL/2.0">
 <sql:execute-query>
  <sql:use-connection>datamed</sql:use-connection>
  <sql:query>
  SELECT * FROM report_parameter_map WHERE  report_id = '<sql:substitute-value name="rid"/>'
  </sql:query>
</sql:execute-query>
</document>


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


Mime
View raw message