Subject: [xsl] implementing Page Iteration From: Oleg Konovalov <olegkon@xxxxxxxxx> Date: Tue, 22 Nov 2005 10:40:56 -0500 |
Hi, I am trying to implement the following enhancement in Cocoon 2.0.4 project (with sitemap actions). Imagine you have 2 databases (one is Master, one is Current). Users can upload information from external Excel files given by 3rd party companies (new, same, partially modified records). So user uploads the new records to the Current database and should be able to manually go through them (program calculates the difference between uploaded and existing records) and decide whether to Add, Change, Reject, Multi-Match or Ignore a record (can update just selective fields as well). So we have Main Screen, user clicks on Change, sees a list of records which do not match (ChangeRecs Screen), selects (one or a few of them) and Clicks on Change button which brings him to Details screen (where he sees field by field comparison of fields that record (current and updated) and selects fields he wants to change. As of now user can only select 1 record at a time, then in brings him back to the ChangeRecs screen. Enhancement is in allowing to select a bunch of records and iterate through all of them (with options to Update, Skip one or Cancel the whole sequence). 1) Is there a sample of implementation such "page iteration" using sitemap actions? 2) Any sitemap iteractions constructs ? 3) Could you please suggest me how to design such thing ? As of now, here is a core of the sitemap I have: <map:match pattern="change_recs"> <map:act type='request'> <map:parameter name="parameters" value="true"/> <map:generate src='xml/change_query.xml'/> <map:transform type="sql"> <map:parameter name="Id" value="{Id}"/> <map:parameter name="use-connection" value="mbrdb"/> <map:parameter name="show-nr-of-rows" value="true"/> </map:transform> <map:transform type="xslt" src="change_recs.xsl"> <map:parameter name="use-request-parameters" value="true" </map:transform> <map:serialize type="html"/> </map:act> </map:match> part of changerecs.xsl : <form name="ChangeRecs" id="ChangeRecs" method="post" action="executeAction" onsubmit="some javascript checks"> <map:match pattern="executeAction"> <map:act type='request'> <map:parameter name='parameters' value='true'/> <map:parameter name="default.industry_code" value="%"/> <map:act type="cda"> <map:redirect-to uri="{../action}?params... &ok=1"/> </map:act> <map:redirect-to uri="{action}?params...&error=1"/> </map:act> </map:match> <map:action name="cda" src="ExecuteCDAAction"> Change-Delete-Add <map:action name="request" src="org.apache.cocoon.acting.RequestParamAction"/> One thing I should add is that the mechanism for passing checked checkboxes is in place and works fine (for Add, Delete & Reject), via the same Java class ExecuteCDAAction. My main question is: Is there any mechanism in sitemap allowing page iteration (e.g. conditional loop) or should I use some Java mechanism for that, e.g. for loop with servlet's sendRedirect or maybe call some method recursively passing it IDs ? I see that act() method has redirector parameter, don't know what it is for or how to use it: public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters par) which is a method of class: ExecuteCDAAction extends AbstractMbrAction implements Composable, Configurable, Disposable There is also RedirectTransformer implemented but never used: public class RedirectTransformer extends AbstractSAXTransformer Sorry for the newbie questions. Any help is very appreciated. TIA, Oleg.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] schema aware - validating, andrew welch | Thread | Re: [xsl] implementing Page Iterati, Jon Gorman |
RE: [xsl] schema aware - validating, Michael Kay | Date | Re: [xsl] schema aware - validating, andrew welch |
Month |