cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: xsp call url
Date Fri, 27 Aug 2004 06:11:24 GMT

Flowscript is certainly an option... in fact, makes good
sense here where, as you say, you effectively have
different XSP as generators and hence efffectively
different matches.

You could have something like:

function switch() {

  var userID = cocoon.request.get("userid");
  var passwd = cocoon.request.get("passwd");
  var thisKey = cocoon.request.get("key");

  //and any others...

  if (thisKey == "login") {
    cocoon.sendPage ("xx/mail/login?userID=" + userID + "&amp;passwd="
+ passwd);
  } elsif  (thisKey == "read") {
    cocoon.sendPage ("xx/mail/read?userID=" + userID + "&amp;passwd=" +
  } elsif  (thisKey == "send") {
    cocoon.sendPage ("xx/mail/send?userID=" + userID + "&amp;passwd=" +
  } else {
    cocoon.sendPage ("no-key-match");


Then you could match patterns as below... with the addition of 
a "primary" match at the end, to call the above floescript
(assuming the call is http://xx/mail?key=abc&userid=fred&passwd=joe)

    <map:match pattern="xx/mail">
      <map:call function="switch"/>


>>> 2004/08/26 07:46:58 AM >>>
In this case i cannot change the input.

ie the parameters are passed from the url and it contains the keyword
along with 2 other parameters.

The keyword can be login,read,reply,send etc...

Therefore the only access i have to the keyword is through the url. So
i do something like 

<map:match pattern=\"xx/mail/login\">
  <map:generate src=\"login.xsp\" type=\"generator\"/>


<map:match pattern=\"xx/mail/read\">
  <map:generate src=\"read.xsp\" type=\"generator\"/>

The generated xsp\'s are different for each keyword and the other
parameters are also different.

how can this branching to different uri\'s based on the keyword be
done. Can i use flowscript to do this? 

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message