You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by beyaNet Consultancy <be...@ntlworld.com> on 2004/04/21 02:31:21 UTC

redirect problem with flowscript : No pipeline matched request: safe_user_area

Hi,
i have a flowscript funtion which does the following:

var user = null;
importClass(Packages.test.User);
var newUser = new User();
var msg = "";

function login() {

	while (user == null) {
		
		cocoon.sendPageAndWait("login.jx", {"msg":msg});
		try {
			user = newUser.getUser(cocoon.request.get("username"), 
cocoon.request.get("password") );
			break;
		}catch(e){
			msg = "The username password combination you entered does not exist. 
Please retry.";
		}
	}
	
	cocoon.sendPage("safe_user_area");
}

So, when a user has been accepted at login redirect them to 
safe_user_area. I have tried cocoon.redirect(uri) but keep getting an 
error which says that the redirect function does not exist, when it 
does! When am I being told that a map pattern which exists, doesn't????

			<map:match pattern="safe_user_area">
						<map:aggregate element="home">
							<map:part src="cocoon:/support/beya-menu"/>
								<map:part src="cocoon:/support/contract-summary"/>
									<map:part src="context://beyarecords/content/adv-xyz-01.xml"/>
										<map:part src="cocoon:/support/banner"/>
						</map:aggregate>
						
						<map:transform type="xslt" src="style/home-page.xsl"/>
					<map:call resource="serialize"/>

Peter

Re: redirect problem with flowscript : No pipeline matched request: safe_user_area

Posted by Joerg Heinicke <jo...@gmx.de>.
On 21.04.2004 09:09, Jan Hoskens wrote:

> As found on http://cocoon.apache.org/2.1/userdocs/flow/api.html
> 
> To send:  cocoon.sendPage("mypipeline", {} );
> 
> I think the function expects a biz data (bean)  to be delivered (thus two parameters, not one), so just give {}.

AFAIK JavaScript can live with less parameters than in the function 
declaration. Don't ask me how this feature is called. Of course it could 
be that the function does something with the biz data and fails if it is 
not passed at all.

Joerg


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


Re: redirect problem with flowscript : No pipeline matched request: safe_user_area

Posted by Jan Hoskens <jh...@schaubroeck.be>.
As found on http://cocoon.apache.org/2.1/userdocs/flow/api.html

To send:  cocoon.sendPage("mypipeline", {} );

I think the function expects a biz data (bean)  to be delivered (thus two parameters, not one), so just give {}.

To redirect: cocoon.redirectTo("mypipeline");

Kind Regards,
Jan
  ----- Original Message ----- 
  From: beyaNet Consultancy 
  To: users@cocoon.apache.org 
  Sent: Wednesday, April 21, 2004 2:31 AM
  Subject: redirect problem with flowscript : No pipeline matched request: safe_user_area


  Hi,
  i have a flowscript funtion which does the following:

  var user = null;
  importClass(Packages.test.User);
  var newUser = new User();
  var msg = "";

  function login() {

  while (user == null) {

  cocoon.sendPageAndWait("login.jx", {"msg":msg});
  try {
  user = newUser.getUser(cocoon.request.get("username"), cocoon.request.get("password") );
  break;
  }catch(e){
  msg = "The username password combination you entered does not exist. Please retry.";
  }
  }

  cocoon.sendPage("safe_user_area");
  }

  So, when a user has been accepted at login redirect them to safe_user_area. I have tried cocoon.redirect(uri) but keep getting an error which says that the redirect function does not exist, when it does! When am I being told that a map pattern which exists, doesn't????

  <map:match pattern="safe_user_area">
  <map:aggregate element="home">
  <map:part src="cocoon:/support/beya-menu"/>
  <map:part src="cocoon:/support/contract-summary"/>
  <map:part src="context://beyarecords/content/adv-xyz-01.xml"/>
  <map:part src="cocoon:/support/banner"/>
  </map:aggregate>

  <map:transform type="xslt" src="style/home-page.xsl"/>
  <map:call resource="serialize"/>

  Peter