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

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 Display Modes
  #1 (permalink)  
Old 06-25-2008, 01:41 PM
Trained Alumni
 
Posts: 286
Default [SOLVED] AJAX Ticker On Login Page

Thought I'd post this in case anyone else might have this figured out or knows how to accomplish it. mmorse is already looking at it with me, but the more brains the better.

Here's the source... Dynamic Drive DHTML Scripts- Advanced RSS Ticker (Ajax invocation)

Basically the idea would be to create an RSS Ticker on the login page (much like the one at apple.com) to feed news, updates, whatnot to our users.

The problem seems to be the backend code is PHP and won't run on the Zimbra system so has to be hosted on an external web server. I've got the code added to the login.jsp file to present the ticker to the user, but it's not communicating to the offsite PHP backend. Anyone have thoughts about that?

Firebug produces these errors...

Access to restricted URI denied" code:"1012
XPCSafeJSObjectWrapper.cpp Line 445

Matt
Reply With Quote
  #2 (permalink)  
Old 06-25-2008, 01:50 PM
Zimbra-Yahoo Consultant
 
Posts: 5,608
Default

You're running FF3 and Firebug, aren't you?

I'm seeing this a lot in dev. Seems to be a firebug/ff3 issue. Restarting the browser should work. Also, try disabling firebug.
Reply With Quote
  #3 (permalink)  
Old 06-25-2008, 02:03 PM
Trained Alumni
 
Posts: 286
Default

OK....so the XPCSafeJSObjectWrapper.cpp (line 445) is a red herring?

I restarted Firefox (yes Firefox 3)...but the code doesn't call the PHP. I'm watching the webserver logs where the PHP is hosted and not getting any hits when I refresh the login page.

I've added the appropriate RSS Ticker code to login.jsp....
Code:
<script src="/zimbra/skins/wiu/rssticker.js" type="text/javascript">
MORE STUFF HERE
</script>
I think that path to the rssticker.js is correct as it's appearing in the Script tab in Firebug.

Is Zimbra preventing the script from calling out to the external webserver with the error...
Code:
Access to restricted URI denied"  code: "1012
Matt
Reply With Quote
  #4 (permalink)  
Old 06-25-2008, 02:57 PM
Trained Alumni
 
Posts: 286
Default

It may be trying to pass the request out through our proxy server back to the local webserver...and doesn't like that.

Does Zimbra get it's proxy information from the http_proxy/ftp_proxy/no_proxy environment variables?

Matt
Reply With Quote
  #5 (permalink)  
Old 06-25-2008, 03:18 PM
Trained Alumni
 
Posts: 286
Default

Not a proxy problem, so back to the drawing board.

Matt
Reply With Quote
  #6 (permalink)  
Old 06-25-2008, 11:20 PM
Trained Alumni
 
Posts: 286
Default A Working Ticker

Coolio!!

Test Server

I had to give up on the RSS Feed idea....AJAX does not work across servers...at least not easily. This code just uses a local XML file(that I placed in our skin folder) for the notices, and can be changed on the fly without restarting Zimbra. I'd just have to write a script to push updates to all servers at once so we only had to change it in one place.

The data in the XML file is just HTML formatted...so it can look anyway you want practically.

This is the code I used.... Dynamic Drive DHTML Scripts- Ajax XML Ticker (txt file source)

If anyone wants the details let me know, but basically I added the required info into the login.jsp file to present the ticker on the login page, and put the ajaxticker.js and tickercontent.txt files in our skin folder.

Matt
Reply With Quote
  #7 (permalink)  
Old 06-26-2008, 09:12 AM
Zimbra Consultant
 
Posts: 5,813
Default

Very cool! - makes for a perfect MOTD.

(Sticking this for a bit- who knows maybe someone will have another RSS idea, or even a good way to parse an rss (stripping other content & adding the div class) > .txt file, then use another script to grab that .txt file from somewhere > skins folder/push to servers.)

Pics before CSS tweaks:




Tweaks:
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com

Last edited by mmorse : 02-20-2009 at 11:56 AM. Reason: pic of tweaks
Reply With Quote
  #8 (permalink)  
Old 06-26-2008, 05:07 PM
Special Member
 
Posts: 166
Default

Chewie71@: Excellent work! End effect is quite impressive and I admire the design. Thumbs up
__________________
Craig Rodway » Flickr | Last.fm | Del.icio.us | Twitter
Reply With Quote
Reply


Thread Tools
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.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0