cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjoseph...@yahoo.com>
Subject Re: authentication framework and continuations
Date Fri, 15 Oct 2004 16:41:18 GMT
Hi,

The culprit appears to be the 

form.showForm(ArrayAdmin); 
line

It seems to loop *continously* on this line when I
match on 

 <map:match type="request-parameter"
 pattern="continuation-id">
    <map:call continuation="{1}"/>
 </map:match>

However, it does not loop if I use

<map:match pattern="*.continue">
    <map:call continuation="{1}"/>
 </map:match>

though in the latter case I loose authentication
capability.

Is there any way around this? Use authentication,
continuations and form.showForm together?

thx!
Paul


rather than


--- Paul Joseph <pjoseph_98@yahoo.com> wrote:

> Getting there, but not quite there yet...am getting
> into a "loop" situation with the hidden
> continuation.
> 
> When I use the continuation as a hidden field in my
> form template as shown below:
> 
> <ft:form-template action="" method="POST">
> <ft:continuation-id/>
> 
> and with my sitemap as below:
> 
> <map:match pattern="*">
>     <map:act type="auth-protect">
>     <map:parameter name="handler"
> value="simpleauthenticator"/>
>  
> <map:match type="request-parameter"
> pattern="continuation-id">
>    <map:call continuation="{1}"/>
> </map:match>
> 
> <map:match pattern="arrayadmin-display-pipeline">
>   <map:generate src="arrayadmin_template.xml"/>
>   <map:transform type="forms"/>
>   <map:transform
>
src="context://resources/resources/forms-arrayadmin-styling.xsl"/>
>   <map:serialize/>
> </map:match>
> 
> <map:match pattern="arrayAdmin">
>   <map:call function="arrayAdmin">
>   <map:parameter name="bindingURI"
> value="arrayadmin_bind.xml"/> 
>   </map:call>
> </map:match>
> 
> </map:act>
> </map:match>
> 
> it seems to go into a loop, till something times out
> at which point, it shows a blank page (any changed
> data *is* saved)...
> 
> any ideas?
> 
> My script is as follows and I suspect that the last
> line in it keeps causing it to loop. What should the
> last line be like to show the form again with the
> new
> (saved) values?
> 
> function arrayAdmin() {
>     var bindingURI =
> cocoon.parameters["bindingURI"];
>     var form = new Form("arrayadmin.xml");
>     var model = form.getModel();
>     form.createBinding("arrayadmin_bind.xml"); 
>     var beanClass = new
>
Packages.org.apache.cocoon.ojb.samples.bean.ArrayAdmin();
>     var bean  = dao.getObject(beanClass,"id",0);
>     form.load(bean);
>    form.showForm("arrayadmin-display-pipeline",
> selectListData);
>      
>     // Let Cocoon Forms handle the form
>    if(form.submitId == "save") {
>    	form.save(bean);
>         dao.setObject(bean);
> 	form.showForm("arrayAdmin"); //this same function
>    }
>       cocoon.releaseComponent(factory);
> }
> 
> I susepct the form.showForm("arrayAdmin") is causing
> it to loop, but strangely this used to work when the
> sitemap was unprotected and I was using the explicit
> continuation i.e. no hidden ft:continuation-id in
> template and using an explicit *.continuation match
> in
> the sitemap.
> 
> TIA!
> Paul
> 
> 
> 
> --- Jorg Heymans <jh@domek.be> wrote:
> 
> > you would just do
> > 
> > <ft:form-template action="" method="POST">
> > <ft:continuation-id/>
> > <ft:widget id ="mywidget"/>
> > ......
> > 
> > </ft:form>
> > 
> > 
> > 
> > Paul Joseph wrote:
> > > Jorg,
> > > 
> > > thank you very much.
> > > 
> > > I will try this approach - just wasn't sure how
> to
> > use
> > > the <ft:continuation-id> tag in my template.
> > > 
> > > Do I simpley do this anywhere reasonable in the
> > > template:
> > > 
> > > <ft:continuation-id><fi:styling
> > > type="hidden"/></ft:continuation-id>
> > > 
> > > -hopefully, this will be my last question, sorry
> > for
> > > the bother and thanks for the help so far.
> > > 
> > > rgds
> > > Paul
> > > --- Jorg Heymans <jh@domek.be> wrote:
> > > 
> > > 
> > >>
> > >>Paul Joseph wrote:
> > >>
> > >>>1. So for this to work there is no need to use
> > >>>encodeURL? I was under the impression that
> > >>
> > >>encodeURL
> > >>
> > >>>was needed as the auth framework created a
> > session
> > >>>behind the scenes.
> > >>
> > >>If the browser doesn't support cookies then the
> > >>webapplication should 
> > >>rewrite or encode all URL's in the page to
> attach
> > >>the sessionID to it. 
> > >>If your browser allows cookies then there is no
> > need
> > >>for this. The 
> > >>auth-framework or cocoon itself creates the
> > session
> > >>transparently.
> > >>
> > >>
> > >>>2. How are you matching the *.continue i.e.
> > >>>
> > >>>If I use
> > >>><map:match type="request-parameter"
> > >>>pattern="continuation-id"> instead of 
> > >>>
> > >>><map:match pattern="*.continue">
> > >>>I get the following msg.
> > >>>
> > >>>org.apache.cocoon.ResourceNotFoundException: No
> > >>>pipeline matched request:
> > >>>
> > >>
> > >
> >
>
webtask/array/3b3639336a20303b2b63112f7046410573643157.continue
> > > 
> > >>This is because this matcher uses the hidden
> input
> > >>field i told you 
> > >>about earlier. Put <ft:continuation-id> in your
> > >>form-template. You are 
> > >>seeing this error probably because your form
> > action
> > >>has still the 
> > >>continuation construct in it. Just set your form
> > >>action to "".
> > >>
> > >><map:match type="request-parameter"
> > >>pattern="continuation-id"> works 
> > >>just like a normal pipeline match, but acts on a
> > >>requestparameter 
> > >>instead of an URL path.
> > >>
> > >>
> > >>Regards
> > >>Jorg
> > >>
> > >>
> > >>
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > 
> > >>To unsubscribe, e-mail:
> > >>users-unsubscribe@cocoon.apache.org
> > >>For additional commands, e-mail:
> > >>users-help@cocoon.apache.org
> > >>
> > >>
> 
=== message truncated ===


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


Mime
View raw message