powered by Authenteo
by Xucia  

Learn more

Utility API

util.externalDependency(scriptUrl)

This function will simply loads an script by url. If the script is already loaded, it will not do anything (it is safe to make multiple calls to this function). Because of the continuation framework, you can call this function inline and it will safely do an asynchronous (non-locking) call to retrieve the script. For example:

            {
            

util.externalDependency("yahoo.js");

YAHOO...

}

util.setTimeout(function,time)

This function does the same thing as the native setTimeout function. However, setTimeout does not work in Firefox in designMode and this function corrects this problem, so you should always make calls to the setTimeout with this technique.

util.serverAction(className,method,parameters)

This function load Java object on the server makes a method call. The first argument specifies the name of the class to call. The Java class must implement com.xucia.auth.action.ServerAction (so you can't just call anything). The method is the name of the method to call. The parameters object is which will be used to call setters on the target Java object. Each field of the object will be correspond to a setter call. 

For example, if we wrote a Java class on the server:

            public class MyAdder implements ServerAction {
            

int firstValue,secondValue;

public void setFirstValue(value) {

firstValue=value;

}

public void setSecondValue(value) {

secondValue=value;

}

public int add() {

return firstValue + secondValue;

}

}
Now if we make a call from one of our JavaScript functions like this:
            var total = util.serverAction("com.acme.MyAdder","add",{
            

firstValue:5,

secondValue:10

});

This would make an (asynchronous) remote call to the server and the  setFirstValue method would be called with a value of 5 and the setSecondValue method would be called with a value of 10 and then the add method would be executed. The add method would return a value of 15 and the total variable would equal 15 after executing.

News

Authenteo 1.1 is available.

Firebug - Web Development Evolved Now with Firebug integration . Make changes to CSS and HTML with Firebug and save the changes

Check out press releases and the following articles on Authenteo:

Authenteo beta