Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
  #11 (permalink)  
Old 09-05-2006, 07:19 AM
Zimbra Employee
 
Join Date: Sep 2005
Posts: 2,068
marcmac is on a distinguished road
Default

Your communication problem is probably because the site you're hitting isn't in the proxy allowed domains - check the ymaps config_template.xml for info on this.

For debugging zimlets, learn to love the js debugger (venkman) that works with firefox. Load the app with ?mode=mjsf&gzip=false, and step through your code to find the problem.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #12 (permalink)  
Old 09-06-2006, 01:32 AM
Moderator
 
Join Date: May 2006
Location: England
ZCS Version: Release 5.0.9_GA_2533.UBUNTU6 UBUNTU6 NETWORK edition
Posts: 406
Dirk is on a distinguished road
Default

That javascript debugger looks very powerfull, thanks. I've installed it and when I view the section relating to the zimlet I'm working on, I see:

Code:
 // Locale: en
    2 
    3 // Basename: /msgs/uk_co_oaktyres_stockcode
 -  4 function uk_co_oaktyres_stockcode(){}
    5 
    6 // resource bundle not found
and I've no idea why that may be. I've spent a few days on this now and I'm close to simply giving up (at least for a few weeks) I dont know if writing zimlets is supposed to be this hard, but even with the ability to look at existing files, without a decent guide or syntax instruction, it's pretty damn hard to know what to do and how to get started. The fact that I'm trying to do something really quite basic, and still failing, is frustrating me no end.

The code I have so far is below, if anyone has any comments, throw them in but for now I a server cabinet move to plan

Code:
config_template.xml
<zimletConfig name="uk_co_oaktyres_stockcode" version="1.0">
  <global>
    <property name="allowedDomains">*</property>
  </global>
</zimletConfig>
Code:
uk_co_oaktyres_stockcode.xml
<zimlet name="uk_co_oaktyres_stockcode" version="1.0" description="Stock Code">
	<include>ZmStockObjectHandler.js</include>
	<handlerObject>uk_co_oaktyres_stockcode</handlerObject>
	<contentObject type="stock">
        <matchOn>
            <regex attrs="ig">(?:\d\d\d\d\d\d\d\D+)\b</regex>
        </matchOn>
    </contentObject>
</zimlet>
Code:
ZmStockObjectHandler.js
function uk_co_oaktyres_stockcode() {
}

uk_co_oaktyres_stockcode.prototype = new ZmZimletBase();
uk_co_oaktyres_stockcode.prototype.constructor = uk_co_oaktyres_stockcode;

uk_co_oaktyres_stockcode.prototype.toolTipPoppedUp =
function(spanElement, obj, context, canvas) {
	canvas.innerHTML = context;
	var request = new AjxRpcRequest("zimlet");
	var info_url = "http://oaknet.oaktyres.co.uk:81/Cambra.asp?mode=stcode&id="+context;
	var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
	request.invoke(null, url, null, new AjxCallback(this, uk_co_oaktyres_stockcode._callback, canvas), true);
};

uk_co_oaktyres_stockcode._callback =
function(canvas, result) {
	canvas.innerHTML = result.text;
};
Reply With Quote
  #13 (permalink)  
Old 09-06-2007, 09:34 AM
Senior Member
 
Join Date: Apr 2006
ZCS Version: 4.5.10_GA_1571.UBUNTU6 UBUNTU6 NETWORK edition
Posts: 50
riogd is on a distinguished road
Default

Did you ever resolve your proxy service and allowed domains problem ? I believe I am running into the same issues with both the template config and the COS configs. I have documented it more in detail here.
I didn't find this post till after that one and am not entirely sure the problem is the same you were having, but if you've resolved your problem and it is the same could you please share your solution ?

Cheers,

RioGD
Reply With Quote
  #14 (permalink)  
Old 09-07-2007, 11:39 AM
Senior Member
 
Join Date: Apr 2006
ZCS Version: 4.5.10_GA_1571.UBUNTU6 UBUNTU6 NETWORK edition
Posts: 50
riogd is on a distinguished road
Default

I believe I have found the problem, and it may be a bug. As reported elsewhere, the config_template only is applied to the default COS. Thus the only way to make Zimlets work under non-default COS's, that I have found, is to manually:
Code:
zmprov mc <non-default-COS> zimbraProxyAllowedDomains "*.domain.com"
Now the rather large problem, and what makes this seem even more like a bug, is that although the config isn't applied to non-default COS's, re-deploying the Zimlet wipes out the zimbraProxyAllowedDomains for all non-default COS's. So each time you redeploy the Zimlet you have to go and make that manual change. This is why I was constantly getting 403's, my manual settings kept getting wiped without my knowing it.

If it can automatically wipe my manual settings, it would be nice if it could automatically apply the supplied config settings I want to begin with so I don't need to do it manually I suspect this may also be why I couldn't access the global settings from within the js code, the config_template is probably not accessible from non-default COS's. Time to test that theory now.

Cheers,

RioGD
Reply With Quote
  #15 (permalink)  
Old 09-07-2007, 12:24 PM
Moderator
 
Join Date: Nov 2005
ZCS Version: Release 5.0.0_BETA2_1092.FC5_20070718124259 FC5_64 FOSS edition
Posts: 380
JoshuaPrismon is on a distinguished road
Send a message via AIM to JoshuaPrismon
Default

Quote:
Originally Posted by Dirk View Post
That javascript debugger looks very powerfull, thanks. I've installed it and when I view the section relating to the zimlet I'm working on, I see:

Code:
 // Locale: en
    2 
    3 // Basename: /msgs/uk_co_oaktyres_stockcode
 -  4 function uk_co_oaktyres_stockcode(){}
    5 
    6 // resource bundle not found
and I've no idea why that may be. I've spent a few days on this now and I'm close to simply giving up (at least for a few weeks) I dont know if writing zimlets is supposed to be this hard, but even with the ability to look at existing files, without a decent guide or syntax instruction, it's pretty damn hard to know what to do and how to get started. The fact that I'm trying to do something really quite basic, and still failing, is frustrating me no end.

The code I have so far is below, if anyone has any comments, throw them in but for now I a server cabinet move to plan

Code:
config_template.xml
<zimletConfig name="uk_co_oaktyres_stockcode" version="1.0">
  <global>
    <property name="allowedDomains">*</property>
  </global>
</zimletConfig>
Code:
uk_co_oaktyres_stockcode.xml
<zimlet name="uk_co_oaktyres_stockcode" version="1.0" description="Stock Code">
	<include>ZmStockObjectHandler.js</include>
	<handlerObject>uk_co_oaktyres_stockcode</handlerObject>
	<contentObject type="stock">
        <matchOn>
            <regex attrs="ig">(?:\d\d\d\d\d\d\d\D+)\b</regex>
        </matchOn>
    </contentObject>
</zimlet>
Code:
ZmStockObjectHandler.js
function uk_co_oaktyres_stockcode() {
}

uk_co_oaktyres_stockcode.prototype = new ZmZimletBase();
uk_co_oaktyres_stockcode.prototype.constructor = uk_co_oaktyres_stockcode;

uk_co_oaktyres_stockcode.prototype.toolTipPoppedUp =
function(spanElement, obj, context, canvas) {
	canvas.innerHTML = context;
	var request = new AjxRpcRequest("zimlet");
	var info_url = "http://oaknet.oaktyres.co.uk:81/Cambra.asp?mode=stcode&id="+context;
	var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
	request.invoke(null, url, null, new AjxCallback(this, uk_co_oaktyres_stockcode._callback, canvas), true);
};

uk_co_oaktyres_stockcode._callback =
function(canvas, result) {
	canvas.innerHTML = result.text;
};
You might check and see if the HTML that is getting returned is in a <html> tag or not. If it isn't, it might not display correct in pre Zimbra 5.0B3.
Reply With Quote
  #16 (permalink)  
Old 09-20-2007, 08:32 AM
Junior Member
 
Join Date: Jan 2007
Posts: 7
ei99045 is on a distinguished road
Default non-default COS

@riogd: thank you for the non-default COS tip!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed. Simple Zimlet Martinchin2289 Zimlets 4 06-18-2008 04:15 PM
Admin interface fails after install of posix/samba zimlets Franck Zimlets 5 01-11-2008 04:34 AM
Amavisd-Postfix RCPT TO Takes a long time samuraii Administrators 6 03-09-2007 03:26 AM
Post instsallation problems Assaf Installation 14 01-29-2007 10:38 AM
Kickstart for automated installation and disaster recovery mubley Installation 19 01-10-2006 02:45 PM


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.1.0