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 08-02-2010, 11:15 AM
Intermediate Member
 
Posts: 22
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.
Reply With Quote
  #2 (permalink)  
Old 08-02-2010, 04:11 PM
Moderator
 
Posts: 75
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
Reply With Quote
  #3 (permalink)  
Old 08-03-2010, 11:44 AM
Intermediate Member
 
Posts: 22
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?
Reply With Quote
  #4 (permalink)  
Old 11-05-2010, 01:30 PM
Banned
 
Posts: 8
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)
Reply With Quote
  #5 (permalink)  
Old 11-05-2010, 01:38 PM
Moderator
 
Posts: 75
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
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.