You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Oleg Konovalov <ol...@yahoo.com> on 2005/11/22 17:37:28 UTC

Re: Page iteration & redirect in Cocoon

Hi,

What 

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

Any examples of using that redirector ?

There is also RedirectTransformer implemented but never used:
public class RedirectTransformer extends AbstractSAXTransformer

What is that for, any clue ?


Sorry for the newbie questions.

Any help is very appreciated.

TIA,
Oleg.

--- Oleg Konovalov <ol...@yahoo.com> wrote:

> 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 whether there is some 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 redirect or maybe call some
> method recursively ?
> 
> Sorry for the newbie question.
> 
> Any help is very appreciated.
> 
> TIA,
> Oleg.
> 
> --- Oleg Konovalov <ol...@yahoo.com> wrote:
> 
> > 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...
> &amp;ok=1"/>
> >     </map:act>
> >     <map:redirect-to uri="{action}?params...&amp;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"/>
> > 
> > TIA,
> > Oleg.
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail:
> users-help@cocoon.apache.org
> > 
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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