You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Joseph <pj...@yahoo.com> on 2004/10/14 04:50:26 UTC

authentication framework and continuations

Hi,

I have implented an authentication handler and all
works well as far as authentication of a given page -
if the user is not logged in, (s)he gets redirected to
the right login page etc.

However, I am having one problem - dealing with the
following lines in the sitemap:

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

I get the following error:
cause: org.apache.cocoon.ProcessingException: No
function nor continuation given in <map:call function>
at
file:/C:/Tomcat/webapps/cocoon/webtask/array/sitemap.xmap:28:33

I am using encodeURL before anything that gets
serialized.

TIA!
-Paul

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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
>>FYI, you can use cocoon.log.debug() to print debug
statements in flow

This should be very useful to me, thanks!

--- Jorg Heymans <jh...@domek.be> wrote:

> > 
> > In my login screen, on submit, I call a login.js
> that
> > authenticates the user in the database, and as a
> > result of the db call, creates a user bean.
> > 
> > I simply put that user bean into the session using
> the
> > following:
> >     cocoon.session.setAttribute('userBean' ,
> > userBean);
> > 
> > then, on every js, I check to see if the session
> has
> > the bean 
> > 
> > var userBean = cocoon.session.get('userBean');
> > 
> > If the user is authenticated the userBean should
> be
> > validated else, I redirect the user to the login
> page.
> >  If the user has already logged in, and the
> session is
> > still alive, and would get the requested
> protetected
> > page seamlessly.
> > 
> > I then don't have to mess around with the sitemap
> > adding protections etc., the single js library
> > function does it for me.
> 
> Shame though that you didn't get it to work, my
> setup is very similar 
> and runs smoothly. I remember now i had the same
> problem once where 
> cocoon was going crazy and kept looping somewhere.
> Sadly, i can't 
> remember what i did to trigger this or what i did to
> fix this :(
> 
> FYI, you can use cocoon.log.debug() to print debug
> statements in flow.
> This can help seeing where cocoon jumps in and out
> of the flowscript 
> while displaying forms.
> 
> 
> Regards
> Jorg
> 
> 
>
---------------------------------------------------------------------
> 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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.
> 
> In my login screen, on submit, I call a login.js that
> authenticates the user in the database, and as a
> result of the db call, creates a user bean.
> 
> I simply put that user bean into the session using the
> following:
>     cocoon.session.setAttribute('userBean' ,
> userBean);
> 
> then, on every js, I check to see if the session has
> the bean 
> 
> var userBean = cocoon.session.get('userBean');
> 
> If the user is authenticated the userBean should be
> validated else, I redirect the user to the login page.
>  If the user has already logged in, and the session is
> still alive, and would get the requested protetected
> page seamlessly.
> 
> I then don't have to mess around with the sitemap
> adding protections etc., the single js library
> function does it for me.

Shame though that you didn't get it to work, my setup is very similar 
and runs smoothly. I remember now i had the same problem once where 
cocoon was going crazy and kept looping somewhere. Sadly, i can't 
remember what i did to trigger this or what i did to fix this :(

FYI, you can use cocoon.log.debug() to print debug statements in flow.
This can help seeing where cocoon jumps in and out of the flowscript 
while displaying forms.


Regards
Jorg


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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
Jorg,

Thank you for all your help.

It would seem that should be the case, but it is
included in the "if(form.submitID == "save") and so,
(when I use the non-hidden continuations), it does not
loop.

For some reason when the continuation becomes hidden
and the matching is on Type, it loops on the
form.showForm(arrayAdmin) inside the if block - i.e.
it does not seem to realize that on the second loop
that form.submitID should no longer be "save".

Anyway, what I have done is this - move to a simpler,
but hopefully as useful version that was almost
trivial to implement.

In my login screen, on submit, I call a login.js that
authenticates the user in the database, and as a
result of the db call, creates a user bean.

I simply put that user bean into the session using the
following:
    cocoon.session.setAttribute('userBean' ,
userBean);

then, on every js, I check to see if the session has
the bean 

var userBean = cocoon.session.get('userBean');

If the user is authenticated the userBean should be
validated else, I redirect the user to the login page.
 If the user has already logged in, and the session is
still alive, and would get the requested protetected
page seamlessly.

I then don't have to mess around with the sitemap
adding protections etc., the single js library
function does it for me.

regards
Paul


--- Jorg Heymans <jh...@domek.be> wrote:

> <snip/>
> 
> > 
> > <map:match pattern="arrayAdmin">
> >   <map:call function="arrayAdmin">
> >   <map:parameter name="bindingURI"
> > value="arrayadmin_bind.xml"/> 
> >   </map:call>
> > </map:match>
> > 
> > function arrayAdmin() {
> 
> <snipped/>
> 
> >      function arrayAdmin() {
>       ........
> >     // Let Cocoon Forms handle the form
> >    if(form.submitId == "save") {
> >    	form.save(bean);
> >         dao.setObject(bean);
> > 	form.showForm("arrayAdmin"); //this same function
> >    }
> 
> showForm("arrayAdmin") calls a pipeline that matches
> "arrayAdmin", but 
> in that pipeline you call the function "arrayAdmin"
> again. Are you sure 
> this is how it's supposed to work? I think that is
> the source of your 
> infinite loop.
> 
> Regards
> Jorg
> 
> 
>
---------------------------------------------------------------------
> 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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.
<snip/>

> 
> <map:match pattern="arrayAdmin">
>   <map:call function="arrayAdmin">
>   <map:parameter name="bindingURI"
> value="arrayadmin_bind.xml"/> 
>   </map:call>
> </map:match>
> 
> function arrayAdmin() {

<snipped/>

>      function arrayAdmin() {
      ........
>     // Let Cocoon Forms handle the form
>    if(form.submitId == "save") {
>    	form.save(bean);
>         dao.setObject(bean);
> 	form.showForm("arrayAdmin"); //this same function
>    }

showForm("arrayAdmin") calls a pipeline that matches "arrayAdmin", but 
in that pipeline you call the function "arrayAdmin" again. Are you sure 
this is how it's supposed to work? I think that is the source of your 
infinite loop.

Regards
Jorg


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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
Thanks!
--- 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
> >>
> >>
> 
> 
>
---------------------------------------------------------------------
> 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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
I login - the template file for the login has the
hidden <ft:continuation-id/>

this takes me to an admin form.

The template for this form has the <ft:continuation/>

The sitemap is set to match the type.

In my logs I see lines like this (it keeps going in a
loop)

thx
Paul

Processor24/ForwardRedirector: Redirecting to
'cocoon:/login-display-pipeline'
INFO    (2004-10-15) 13:27.44:529   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor24/ForwardRedirector: Redirecting
to 'cocoon:/login-display-pipeline'
INFO    (2004-10-15) 13:27.56:106   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor24/ForwardRedirector: Redirecting
to 'cocoon:/login-display-pipeline'
INFO    (2004-10-15) 13:28.02:966   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor24/ForwardRedirector: Redirecting
to 'cocoon:/login-display-pipeline'
INFO    (2004-10-15) 13:29.21:849   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor23/ForwardRedirector: Redirecting
to 'cocoon:/authenticate'
INFO    (2004-10-15) 13:29.21:859   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor23/ForwardRedirector: Redirecting
to 'cocoon:/authenticate'
INFO    (2004-10-15) 13:29.21:869   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor23/ForwardRedirector: Redirecting
to 'cocoon:/authenticate'
INFO    (2004-10-15) 13:29.21:869   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor23/ForwardRedirector: Redirecting
to 'cocoon:/authenticate'
INFO    (2004-10-15) 13:29.21:869   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor23/ForwardRedirector: Redirecting
to 'cocoon:/authenticate'
INFO    (2004-10-15) 13:29.21:879   [sitemap]
(/array/webtask/dictionary/login)
http-9090-Processor23/ForwardRedirector: Redirecting
to 'cocoon:/authenticate'
I

--- Jorg Heymans <jh...@domek.be> wrote:

> did you change *all* your forms to have the
> <ft:continuation-id /> ?
> 
> Paul Joseph wrote:
> > 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 <pj...@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
> 
=== message truncated ===


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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.
did you change *all* your forms to have the <ft:continuation-id /> ?

Paul Joseph wrote:
> 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 <pj...@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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
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 <pj...@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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
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
> >>
> >>
> 
> 
>
---------------------------------------------------------------------
> 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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.
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
>>
>>


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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
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
> 
> 


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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.

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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
I will try this.

Two questions:

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.

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

thx
Paul

--- Jorg Heymans <jh...@domek.be> wrote:

> Put the <map:call continuation> tag inside of the
> auth-protect block. 
> Your forms are inside a protected area, so your
> continuations will be 
> called with a "protected" URL.
> 
> My working setup is like
> 
> <map:match pattern="protected/**">
>    <map:act type="auth-protect">
> 
>       <map:match type="request-parameter"
> pattern="continuation-id">
>         <map:call contination="{1}"/>
>       </map:match>
> 
>       <map:match pattern="protected/doaction1">
>          ....
>       </map:match>
>       <map:match pattern="protected/doaction2">
>           ....
>       </map:match>
>       <map:match pattern="protected/thisfile.html">
> 	 ...
>       </map:match>
>    </map:act>
> </map:match>
> 
> HTH
> Jorg
> 
> Paul Joseph wrote:
> > Hi,
> > 
> > Thank you for your respones.
> > 
> > I can take out the encodeURL and the same thing
> > happens...I thought I needed it to maintain
> session -
> > no?
> > 
> > The way I do it is as follows:
> > 
> > <map:match pattern="*.continue"><!--this is the
> > problem area-->
> >   <map:call continuation="{1}"/>
> >  </map:match>
> > 
> > <!--these *seem* to work ok-->
> > <map:match pattern="arrayadmin-display-pipeline">
> >   <map:act type="auth-protect">  <!-- check
> > authentication -->
> >     <map:parameter name="handler"
> > value="simpleauthenticator"/>
> >   <map:generate src="arrayadmin_template.xml"/>
> >   <map:transform type="forms"/>
> >   <map:transform type="i18n">
> >     <map:parameter name="locale" value="en-US"/>
> >   </map:transform>
> >   <map:transform
> >
>
src="context://resources/resources/forms-arrayadmin-styling.xsl"/>
> >   <map:transform type="encodeURL"/>
> >   <map:serialize/>
> >   </map:act>
> > </map:match>
> > 
> > <map:match pattern="arrayAdmin">
> >   <map:act type="auth-protect">  <!-- check
> > authentication -->
> >     <map:parameter name="handler"
> > value="simpleauthenticator"/>
> >   <map:call function="arrayAdmin">
> >   <map:parameter name="bindingURI"
> > value="arrayadmin_bind.xml"/> 
> >   </map:call>
> >   </map:act>
> > </map:match>
> > 
> > </map:pipeline>
> > </map:pipelines>
> > 
> > 
> > --- Jorg Heymans <jh...@domek.be> wrote:
> > 
> > 
> >>There is a continuation id construct you can use
> to
> >>set it as a hidden 
> >>variable in your form (<ft:continuation-id> IIRC),
> >>try using this. Don't 
> >>know if you URL encoding is interfering. How do
> you
> >>encodeURL btw?
> >>
> >>Jorg
> >>
> >>Paul Joseph wrote:
> >>
> >>>Hi,
> >>>
> >>>I have implented an authentication handler and
> all
> >>>works well as far as authentication of a given
> >>
> >>page -
> >>
> >>>if the user is not logged in, (s)he gets
> >>
> >>redirected to
> >>
> >>>the right login page etc.
> >>>
> >>>However, I am having one problem - dealing with
> >>
> >>the
> >>
> >>>following lines in the sitemap:
> >>>
> >>><map:match pattern="*.continue">
> >>>   <map:call continuation="{1}"/>
> >>></map:match>
> >>>
> >>>I get the following error:
> >>>cause: org.apache.cocoon.ProcessingException: No
> >>>function nor continuation given in <map:call
> >>
> >>function>
> >>
> >>>at
> >>>
> >>
> >
>
file:/C:/Tomcat/webapps/cocoon/webtask/array/sitemap.xmap:28:33
> > 
> >>>I am using encodeURL before anything that gets
> >>>serialized.
> >>>
> >>>TIA!
> >>>-Paul
> >>
> >>
> >>
> >
>
---------------------------------------------------------------------
> > 
> >>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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.
Put the <map:call continuation> tag inside of the auth-protect block. 
Your forms are inside a protected area, so your continuations will be 
called with a "protected" URL.

My working setup is like

<map:match pattern="protected/**">
   <map:act type="auth-protect">

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

      <map:match pattern="protected/doaction1">
         ....
      </map:match>
      <map:match pattern="protected/doaction2">
          ....
      </map:match>
      <map:match pattern="protected/thisfile.html">
	 ...
      </map:match>
   </map:act>
</map:match>

HTH
Jorg

Paul Joseph wrote:
> Hi,
> 
> Thank you for your respones.
> 
> I can take out the encodeURL and the same thing
> happens...I thought I needed it to maintain session -
> no?
> 
> The way I do it is as follows:
> 
> <map:match pattern="*.continue"><!--this is the
> problem area-->
>   <map:call continuation="{1}"/>
>  </map:match>
> 
> <!--these *seem* to work ok-->
> <map:match pattern="arrayadmin-display-pipeline">
>   <map:act type="auth-protect">  <!-- check
> authentication -->
>     <map:parameter name="handler"
> value="simpleauthenticator"/>
>   <map:generate src="arrayadmin_template.xml"/>
>   <map:transform type="forms"/>
>   <map:transform type="i18n">
>     <map:parameter name="locale" value="en-US"/>
>   </map:transform>
>   <map:transform
> src="context://resources/resources/forms-arrayadmin-styling.xsl"/>
>   <map:transform type="encodeURL"/>
>   <map:serialize/>
>   </map:act>
> </map:match>
> 
> <map:match pattern="arrayAdmin">
>   <map:act type="auth-protect">  <!-- check
> authentication -->
>     <map:parameter name="handler"
> value="simpleauthenticator"/>
>   <map:call function="arrayAdmin">
>   <map:parameter name="bindingURI"
> value="arrayadmin_bind.xml"/> 
>   </map:call>
>   </map:act>
> </map:match>
> 
> </map:pipeline>
> </map:pipelines>
> 
> 
> --- Jorg Heymans <jh...@domek.be> wrote:
> 
> 
>>There is a continuation id construct you can use to
>>set it as a hidden 
>>variable in your form (<ft:continuation-id> IIRC),
>>try using this. Don't 
>>know if you URL encoding is interfering. How do you
>>encodeURL btw?
>>
>>Jorg
>>
>>Paul Joseph wrote:
>>
>>>Hi,
>>>
>>>I have implented an authentication handler and all
>>>works well as far as authentication of a given
>>
>>page -
>>
>>>if the user is not logged in, (s)he gets
>>
>>redirected to
>>
>>>the right login page etc.
>>>
>>>However, I am having one problem - dealing with
>>
>>the
>>
>>>following lines in the sitemap:
>>>
>>><map:match pattern="*.continue">
>>>   <map:call continuation="{1}"/>
>>></map:match>
>>>
>>>I get the following error:
>>>cause: org.apache.cocoon.ProcessingException: No
>>>function nor continuation given in <map:call
>>
>>function>
>>
>>>at
>>>
>>
> file:/C:/Tomcat/webapps/cocoon/webtask/array/sitemap.xmap:28:33
> 
>>>I am using encodeURL before anything that gets
>>>serialized.
>>>
>>>TIA!
>>>-Paul
>>
>>
>>
> ---------------------------------------------------------------------
> 
>>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


Re: authentication framework and continuations

Posted by Paul Joseph <pj...@yahoo.com>.
Hi,

Thank you for your respones.

I can take out the encodeURL and the same thing
happens...I thought I needed it to maintain session -
no?

The way I do it is as follows:

<map:match pattern="*.continue"><!--this is the
problem area-->
  <map:call continuation="{1}"/>
 </map:match>

<!--these *seem* to work ok-->
<map:match pattern="arrayadmin-display-pipeline">
  <map:act type="auth-protect">  <!-- check
authentication -->
    <map:parameter name="handler"
value="simpleauthenticator"/>
  <map:generate src="arrayadmin_template.xml"/>
  <map:transform type="forms"/>
  <map:transform type="i18n">
    <map:parameter name="locale" value="en-US"/>
  </map:transform>
  <map:transform
src="context://resources/resources/forms-arrayadmin-styling.xsl"/>
  <map:transform type="encodeURL"/>
  <map:serialize/>
  </map:act>
</map:match>

<map:match pattern="arrayAdmin">
  <map:act type="auth-protect">  <!-- check
authentication -->
    <map:parameter name="handler"
value="simpleauthenticator"/>
  <map:call function="arrayAdmin">
  <map:parameter name="bindingURI"
value="arrayadmin_bind.xml"/> 
  </map:call>
  </map:act>
</map:match>

</map:pipeline>
</map:pipelines>


--- Jorg Heymans <jh...@domek.be> wrote:

> There is a continuation id construct you can use to
> set it as a hidden 
> variable in your form (<ft:continuation-id> IIRC),
> try using this. Don't 
> know if you URL encoding is interfering. How do you
> encodeURL btw?
> 
> Jorg
> 
> Paul Joseph wrote:
> > Hi,
> > 
> > I have implented an authentication handler and all
> > works well as far as authentication of a given
> page -
> > if the user is not logged in, (s)he gets
> redirected to
> > the right login page etc.
> > 
> > However, I am having one problem - dealing with
> the
> > following lines in the sitemap:
> > 
> > <map:match pattern="*.continue">
> >    <map:call continuation="{1}"/>
> > </map:match>
> > 
> > I get the following error:
> > cause: org.apache.cocoon.ProcessingException: No
> > function nor continuation given in <map:call
> function>
> > at
> >
>
file:/C:/Tomcat/webapps/cocoon/webtask/array/sitemap.xmap:28:33
> > 
> > I am using encodeURL before anything that gets
> > serialized.
> > 
> > TIA!
> > -Paul
> 
> 
>
---------------------------------------------------------------------
> 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


Re: authentication framework and continuations

Posted by Jorg Heymans <jh...@domek.be>.
There is a continuation id construct you can use to set it as a hidden 
variable in your form (<ft:continuation-id> IIRC), try using this. Don't 
know if you URL encoding is interfering. How do you encodeURL btw?

Jorg

Paul Joseph wrote:
> Hi,
> 
> I have implented an authentication handler and all
> works well as far as authentication of a given page -
> if the user is not logged in, (s)he gets redirected to
> the right login page etc.
> 
> However, I am having one problem - dealing with the
> following lines in the sitemap:
> 
> <map:match pattern="*.continue">
>    <map:call continuation="{1}"/>
> </map:match>
> 
> I get the following error:
> cause: org.apache.cocoon.ProcessingException: No
> function nor continuation given in <map:call function>
> at
> file:/C:/Tomcat/webapps/cocoon/webtask/array/sitemap.xmap:28:33
> 
> I am using encodeURL before anything that gets
> serialized.
> 
> TIA!
> -Paul


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