I am new to Zimlets and quite puzzled with the lack of "howto" docs ot very simple Zimlet examples.
I had to crawl in many forums just to guess how to use a ZmZimletBase.PROXY for example
My problem is that I am facing 403 http errors every time I want to do some very simple AjxRpcRequest (even when avoiding cross-domain attempts).
Let's say I want to call an URL like "http://www.google.com" after I drop a ZmContact on my zimlet (silly example but just to be simple...)
In my javascript HandlerObject file I wrote :
var req = new AjxRpcRequest();
var info_url = "http://www.google.com";
var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
req.invoke(null,url,null, new AjxCallback(this, this._resultCallback), true);
And my callback function is :
Com_Zimbra_Myexample.prototype._resultCallback=
function(result) {
var r = result.text;
alert(r);
DBG.println(AjxDebug.DBG2, "result:" + r);
this.displayStatusMessage(r);
};
I also added a config_template.xml in my zimlet directory that I expected to allow the "google.com" domain.
So my questions so far are :
1) How can I get rid of the 403 http error and allow "nydomainname.com" domain ? Would not it be nice to have such info on wiki ??
2) How would you call an https:// URL ? same as for http:// ?
3) One of the arguments of the invoke method (BTW which one ?) allow to set http headers. How would you aggregate several Http headers to the request ?
I am just evaluating Zimbra as an Ajax mashup solution but I am getting lost with the Ajax Toolkit whitepaper as my only starting point.
Any help appreciated
Eric