Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-2006, 12:02 AM
New Member
 
Posts: 4
Default Problem reading config_template.xml from .js

Hello,

I'm trying to read a global property define in config_template.xml but I'm always getting value undefined. My config_template.xml looks as follows:
Code:
<zimletConfig name="net_mydomain_myzimlet" version="0.4">
 <global>
  <property name="allowedDomains">*.mydomain.net</property>
  <property name="outputStyle">graphical</property>
 </global>
</zimletConfig>
Now I'm trying to read the value of the global property 'ouputStyle' as follows in my javascript:

Code:
 
Net_Mydomain_Myzimlet._handleResponse =
    function(cnvsInfo, result)
{
    ...
style = this.getConfigProperty("global.outputStyle");
    ...
or
Code:
 
Net_Mydomain_Myzimlet._handleResponse =
    function(cnvsInfo, result)
{
   ...
style = this.getConfigProperty("outputStyle");
   ...
but both of them return 'undefined'.

What I'm doing wrong?
Reply With Quote
  #2 (permalink)  
Old 09-05-2007, 06:55 PM
Senior Member
 
Posts: 50
Default

Did you ever resolve this or does anyone know the solution. I am having the same problem.

Cheers,

RioGD
Reply With Quote
  #3 (permalink)  
Old 09-05-2007, 11:19 PM
New Member
 
Posts: 4
Default

Hi,

Never got any replies to this issue. It's still unsolved as the feature was not so important for me at that time.

Anyway, if you find a solution, please, let me know. It would probably be useful in the future.
Reply With Quote
  #4 (permalink)  
Old 09-06-2007, 09:11 AM
Senior Member
 
Posts: 50
Default

Temporarily, as a workaround, I have hardcoded the config values in the .js file. I must say though that it does seem strange no one else has documented this problem. Also it seems that allowedDomains is not working for me either (config or COS set values on the server).

Good luck and I will give you an update if I figure out the problem. And I encourage anyone reading this who has ideas to let us know as well!

Cheers,

RioGD
Reply With Quote
  #5 (permalink)  
Old 09-06-2007, 09:46 AM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by riogd View Post
Temporarily, as a workaround, I have hardcoded the config values in the .js file. I must say though that it does seem strange no one else has documented this problem. Also it seems that allowedDomains is not working for me either (config or COS set values on the server).

Good luck and I will give you an update if I figure out the problem. And I encourage anyone reading this who has ideas to let us know as well!

Cheers,

RioGD
I am working on a book on zimlets right now, and I have not seen the behavior that you are listing. Are you sure that you are incrementing your version number in the zimlet cfg each time? Take a look at the mailbox.log after doing a zmzimletctl deploy
Reply With Quote
  #6 (permalink)  
Old 09-06-2007, 11:40 PM
New Member
 
Posts: 4
Default

Hello,

At least in my case changing the config version number didn't help.

However, allowedDomains is working in my case.

Anyway, thanks for the hint! I didn't realize that there was a log file that could have some info. I'll check it soon.
Reply With Quote
  #7 (permalink)  
Old 09-07-2007, 11:47 AM
Senior Member
 
Posts: 50
Default

I suspect I may have found the problem but I have yet to test. I must also note that I am using the AdminUI for deployment and enabling in the COS's.
Non-default COS's do not get the config_template applied to it, which seems quite possibly like a bug, more info on that here (in summary even though the allowedDomains isn't automatically applied to non-default COS's, if you add them manually they are automatically wiped while re-deploying. I suspect similar oddity is happening with properties in the config_template for non-default COS's).
Since all of my testing was in non-default COS's, I wonder if the global/host properties were also not available?
lhuovine, what COS's have you been testing with ? Default and non-default or only one or the other ?

Cheers,

RioGD
Reply With Quote
  #8 (permalink)  
Old 09-10-2007, 01:02 AM
New Member
 
Posts: 4
Default

I've been using Default COS only.
Reply With Quote
  #9 (permalink)  
Old 09-10-2007, 09:11 AM
Senior Member
 
Posts: 50
Default

Unfortunately the default COS did not resolve the global property problem. I will have to wait for the book. I even tried accessing global.allowedDomains without luck. It comes up as Undefined as well.

Using Firebug I tried the following:
Code:
alert(Com_My_Zimlet.prototype.getConfigProperty("global.allowedDomains"));
alert(Com_My_Zimlet.prototype.getConfigProperty("allowedDomains"));
I did the same for other global properties and those returned undefined as well (in the Default COS as well).

Cheers,

RioGD
Reply With Quote
  #10 (permalink)  
Old 06-08-2010, 06:06 AM
Junior Member
 
Posts: 5
Default

hii,
it can be retrived using this._zimletContext.getConfig("property_name");
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.