Results 1 to 5 of 5

Thread: Tips and alerts zimlet

  1. #1
    BCamp is offline Active Member
    Join Date
    Dec 2009
    Posts
    25
    Rep Power
    5

    Default Tips and alerts zimlet

    Has anybody gotten the Tips and Alerts Zimlet | Zimbra :: Gallery zimlet working in 6.0.7? I'm almost ready to deploy this to some testers, but I'm encountering one error that's holding me up.

    When I have an alert turned on (PA message, for those using the zimlet), everything works fine. The alert shows up when I log in, it polls and re-displays correctly after the proper polling interval. I'm able to click the zimlet to get tips. Works great, as long as there's an alert (or MOTD) to display at least one time.

    The problem happens when there is no alert. If all PA messages are turned off, or if they're on but out of the time range, I get an error when logging in to Zimbra. The error is "PaPollingInterval is not defined". Basically, this happens whenever the zimlet is enabled, but it's not supposed to display anything when I first log in.

    I checked what's probably the obvious stuff, looking through the files to make sure that PoPollingInterval is actually defined, but I'm not a developer. Has anybody come across this? I see on the gallery page for the zimlet, it's developed for version 5. Is this error the tip of the iceberg of a zimlet that's going to be lots of headaches in version 6? If so, does anyone have a recommendation for something similar? I'd really like to get this functionality working, as it looks like it has the potential to be one of our most used and helpful zimlets.

  2. #2
    hillman's Avatar
    hillman is offline Moderator
    Join Date
    May 2007
    Location
    Vancouver, Canada
    Posts
    75
    Rep Power
    7

    Default

    The PaPollingInterval variable (actually it's "paPollingInterval") is read from the server with a REST call when the user first logs in. It's one of the 'global prefs' that can be set from the zimlet's admin interface. Try using Firebug to watch the REST call happen and make sure something's coming back. That's all I can suggest at the moment.

    I wrote the server-side stuff (zimbrarest.cgi) and did some work on the admin interface to decouple it from our site-specific authentication, but it was another developer at our site who did all of the client-side work. I just adapted his work for the world to enjoy

    We haven't moved to 6.0.7 yet, but we're testing it.
    Steve Hillman
    IT Architect
    Simon Fraser University

  3. #3
    BCamp is offline Active Member
    Join Date
    Dec 2009
    Posts
    25
    Rep Power
    5

    Default

    Quote Originally Posted by hillman View Post
    (actually it's "paPollingInterval")
    I've looked at that enough times I should have known that by now.

    Thanks for the reply. I think I've got the information you were asking about. First of all, in the Firebug console, I'm watching only JavaScript errors and XMLHttpRequests. Should I have anything else enabled in the Firebug console to help track this down?
    As for the problem itself-
    Beginning where it loads ca_sfu_icat_motd: First thing I notice is all 5 GET requests have a code of 200, so nothing obvious there. "isup" is the first request, that responds "ok".

    The second GET I see is for global.js. That responds correctly with all the correct information I've got put in on the Settings page. It does see paPollingInterval and does send a value of 900000. The JSON tab also correctly shows paPollingInterval set at 900000. I've got more to say about this one below.

    The third GET looks like an attempt to see what my current pa message should be.

    Code:
    https://***/service/proxy?target=http://***/zimbra/zimbrarest.cgi/motd/pa/current.js?1280857932078
    That gets a response of "[]". I'm not sure if that's a problem or not.

    The last two look alright. Those are looking for my lastseen and showtips. The responses are the correct file name, and a value of "true", respectively.

    Now, back to the second GET from above. Here's what the request is.

    Code:
    https://***/service/proxy?target=http://***/zimbra/zimbrarest.cgi/datastore/motd/global.js
    That got me looking around for a file on the Apache side named global.js. I didn't find one (I'm sure you knew that already), but I did run across the file "rest.php" inside the "_util" directory. Here are three of the variables defined in that file:

    Code:
    $restUrl        = "https://cgi.sfu.ca/~hillman/zimbrarest.cgi/motd/$type/".$id.".js?art=$token";
    $settingsUrl    = "https://cgi.sfu.ca/~hillman/zimbrarest.cgi/datastore/motd/global.js?art=$token";
    $setSettingsUrl = "https://cgi.sfu.ca/~hillman/zimbrarest.cgi/datastore/motd/global/$var";
    Now, I had a problem when first setting this up, I could get to the settings page just fine, and then I could get to either one of the two message pages. But, just one time. After that, the links were broken. In the index.html files in both the "pa" and "tips" directories, there were a few links pointing to your home directory, which of course I don't have. After adjusting those links the pages worked properly. Do you think something similar could be happening in the rest.php file?

  4. #4
    jbrowne is offline Banned
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default

    how difficult would it be for this to use the same server as zimbra for the REST/admin piece? (on zimbra 6.0.7)

  5. #5
    hillman's Avatar
    hillman is offline Moderator
    Join Date
    May 2007
    Location
    Vancouver, Canada
    Posts
    75
    Rep Power
    7

    Default

    Quote Originally Posted by jbrowne View Post
    how difficult would it be for this to use the same server as zimbra for the REST/admin piece? (on zimbra 6.0.7)
    It shouldn't be that hard. I wouldn't recommend using Zimbra's Apache though, as you'd have to redo your customizations after every upgrade. Instead, run your own Apache out of a separate directory and bind it to a port not in use by Zimbra. Then just configure the URL the zimlet talks back to to use the alternate port.

    Of course, this is all just off the top of my head - I haven't tried it
    Steve Hillman
    IT Architect
    Simon Fraser University

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Alert Zimlet for 6.0
    By Himanshu in forum Zimlets
    Replies: 4
    Last Post: 03-02-2010, 11:42 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
  •