cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Konovalov <oleg...@yahoo.com>
Subject Query in the loop?
Date Mon, 05 Dec 2005 04:35:55 GMT
Hi,

I am trying to enhance an existing Cocoon 2.0.4 app with sitemap
actions.

Application allows user to do a partial synchronization
of records in 2 databases (Current and Master) 
It is easy in case of Add, Delete, but not easy if they
partially
mismatch.

On screen1 I show a list of mismatching records with checkboxes
(all have the same name, but different value=rowId, see below)
next to each of them (up to 200 per page). 
User is supposed to select many of them and synchronize selected
in bulk.
So I am creating a popup windows displaying all the fields
for all these mismatching record (to help user in making
decision which ones to process in bulk).
I have a query that returns me records from Current and Master
DB for 1 ID, but in that popup window I have to display that
info for all IDs selected on Screen1.

1) Is there a way to loop through the query and create a bunch
of resultsets rs1,rs2,rs3... to be displayed ?
Or do I have to have a Stored Procedure for that ?

2) How do I pass an array of IDs from XSL stylesheet for Screen1
to the query [in XML file] or stored proc ?

Any code sample ?

Please help Cocoon newbie !

Thank you in advance,
Oleg. 

P.S.: Here is my current sitemap fragment for the popup:
<map:match pattern="dir1/popup1">
  <map:act type='request'>
    <map:parameter name="parameters" value="true"/>
    <map:generate src='xml/popup_query.xml'/>
    <map:transform type="sql">
	<map:parameter name="Id" value="{Id}"/>
	<map:parameter name="use-connection" value="mydb"/>
	<map:parameter name="show-nr-of-rows" value="true"/>
    </map:transform>
    <map:transform type="xslt" src="xslt/dir1/popup1.xsl">
	<map:parameter name="use-request-parameters" value="true"/>
    </map:transform>
    <map:serialize type="html"/>
</map:act>
</map:match>	

Checkbox(es):
<input name="v1" type="checkbox"> 
  <xsl:attribute name='value'><xsl:value-of
select='$therow/id'/></xsl:attribute>
</input>

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


Mime
View raw message