Ovidiu Predescu wrote:
Not really. You can automate this task by arranging in your sitemap to call a function that checks the login first, instead of your function. The following will do it:

Sitemap:

<map:match pattern="someUri/checkout">
<map:call function="checkLogin">
<map:parameter name="funarg" value="checkout"/>
</map:call>
</map:match>

Flow:

var user;

function login()
{
// send the necessary pages for the user
// to login. Assigns to the global 'user' variable
// the User object, which is later used throughout
// the script to identify the user. See the prefs.js
// sample in Cocoon for an example of such a function.
}

function checkLogin(funarg)
{
if (user == null)
login();
funarg();
}
This doesn't seem to work. It always generates an error message like "org.mozilla.javascript.EvaluatorException: checkout is not a function."

But if I invoke the same function directly from the sitemap, without passing its name as an argument, it works.

What's happening here?

Ugo


--
Ugo Cei - http://www.beblogging.com/blog/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Reply via email to