Hi,
This isn't exactly the answer you are looking for because I am using AJAX,
servlets and JSON data, but here is how I am doing it. Maybe you will see a
pattern that will help you. Note the CRITICAL line below.
var events = eval('(' + readReq.responseText + ')'); // this is a JSON
response returned from my Java servlet
var eventSource = new Timeline.DefaultEventSource(0);
var bandInfos = [...
Timeline.createBandInfo({
width: 400,
timeZone: 11,
intervalUnit: Timeline.DateTime.DAY,
intervalPixels: 50,
eventSource: eventSource,
date: new Date(),
layout: 'original', // original, overview, detailed
theme: theme
}),
...];
var tl = Timeline.create(document.getElementById("TIMELINE"), bandInfos,
Timeline.HORIZONAL);
eventSource.loadJSON(events, '' ); // THIS IS THE CRITICAL LINE, load
against eventSource, not Timeline.
tl.finishedEventLoading();
Btw... CGI? Wow, I haven't used that in a real long time now.
If you can't get the above method working with XML, try JSON data. If JSON
works then log a bug on the XML laod.
I hope this helps you. Good luck.
On Tue, Jan 20, 2009 at 8:36 AM, jake <[email protected]> wrote:
>
> Hi
> Hi,
>
> This is the first time I've tried anything like this before and I need
> some advice on deployment...
>
> I have a Java App which runs a query on a Sybase DB and generates the
> xml file which is then used by my Simile Timeline to generate my
> events.
>
> Being from a mainly unix background, I thought I could write a basic
> cgi script which would output the timeline when a user entered a
> particular URL into the web browser. However, when I browse to this
> URL, the timeline appears ok but I get an error msg saying "Unable to
> load data xml" and so just have a blank timeline. I have the cgi
> script and xml file inside the /cgi/bin directory.
>
> Was wondering if anyone can advise if its possible to generate a
> simile timeline using a CGI script? Or whether I should look at an
> alternative method for deployment?
>
> The reason I wanted it all to run from Unix is that I want the Java
> app to query the DB every 10 mins hence producing a new xmlfile every
> 10 minutes
>
> Any suggestions would be appreciated
>
> Thanks
> John
> >
>
--
Scott Thomson
0401 726 889
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---