Results 1 to 10 of 10

Thread: Problem reading config_template.xml from .js

  1. #1
    lhuovine is offline New Member
    Join Date
    Nov 2006
    Posts
    4
    Rep Power
    8

    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?

  2. #2
    riogd is offline Senior Member
    Join Date
    Apr 2006
    Posts
    50
    Rep Power
    8

    Default

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

    Cheers,

    RioGD

  3. #3
    lhuovine is offline New Member
    Join Date
    Nov 2006
    Posts
    4
    Rep Power
    8

    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.

  4. #4
    riogd is offline Senior Member
    Join Date
    Apr 2006
    Posts
    50
    Rep Power
    8

    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

  5. #5
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    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

  6. #6
    lhuovine is offline New Member
    Join Date
    Nov 2006
    Posts
    4
    Rep Power
    8

    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.

  7. #7
    riogd is offline Senior Member
    Join Date
    Apr 2006
    Posts
    50
    Rep Power
    8

    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

  8. #8
    lhuovine is offline New Member
    Join Date
    Nov 2006
    Posts
    4
    Rep Power
    8

    Default

    I've been using Default COS only.

  9. #9
    riogd is offline Senior Member
    Join Date
    Apr 2006
    Posts
    50
    Rep Power
    8

    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

  10. #10
    sanil.naik is offline Junior Member
    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    5

    Default

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem with reading the html email templates
    By Anuradha in forum Developers
    Replies: 4
    Last Post: 08-31-2006, 10:22 PM
  2. Is it started or not
    By kwelipatton in forum Installation
    Replies: 10
    Last Post: 03-28-2006, 11:11 PM
  3. Move server to different OS
    By EriSan500 in forum Administrators
    Replies: 7
    Last Post: 03-05-2006, 01:00 PM
  4. Reading attachments problem
    By lenjacobs in forum Users
    Replies: 2
    Last Post: 12-27-2005, 11:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •