I do something similar with a Servlet...

//timeline init code.
//type equals url to my servlet
//time equals an integer to dynamically set the timespan in ethers.
function onLoad(type,time) {
...
...
...
tl.loadJSON(type, function(json, url) {eventSource.loadJSON(json, url);});

I basically pass the PrintWriter output stream from my servlet to timeline
as json.

Is that what you are trying to do?

On 3/9/07, Derek Keats <[EMAIL PROTECTED]> wrote:


On Thu, 2007-03-08 at 14:55 -0500, Michael McDougall wrote:
> I assume your timeline gets its data using something like
>
>  Timeline.loadXML("example1.xml", function(xml, url) {
eventSource.loadXML(xml, url); });
>
> This should work the same whether 'example1.xml' is a static file or is
> generated dynamically (using JSP, Java servlets, PHP, CGI or whatever
> web framework you like best).
>
> Do you need something different?


Thanks Michael, but I cannot seem to make it work. Let me try to
explain. These are test data and a snippet in PHP.

The script generation works when $this->timeLine is assigned to a file,
but not when $this->timeLine is assigned to the string containing the
data.

Hope this makes sense.

Thanks for any suggestions.
regards
derek

public function teststream()
    {
        $this->timeLine = '<data date-time-format="iso8601">
    <event
        start="1955-08-12"
        title="Derek Keats born"
        image="http://localhost/images/csail-logo.gif";>
        Derek Keats born at James Payton Memorial Hospital, in Gander,
Newfoundland, Canada.
    </event>
    <event
        start="1989-01"
        title="Joins UWC"
        link="http://www.uwc.ac.za/";>
        Derek Keats joined  the University of the Western Cape in Cape
Town, South Africa as a lecturer in the Botany Department.
    </event>
</data>';
...
}


and the Javascript generation

   /**
     *
     * Method to return the Javascript to create a basic timeline
     * @return string The javascript for rendering the timeline
     *
     */
    public function getScript()
    {
                //die($this->timeLine);
        $ret = "\n\n<script language=\"javascript\"><!--
                        var tl;
                        var eventSource = new Timeline.DefaultEventSource
();
                        function onLoad() {
                          var bandInfos = [
                            {BOTTOMBAND}
                            Timeline.createBandInfo({
                                eventSource:    eventSource,
                                date:           \"" . $this->focusDate .
"\",
                                width:          \"100%\",
                                intervalUnit:   Timeline.DateTime." .
$this->intervalUnit .
",
                                intervalPixels: " . $this->intervalPixels
. "
                            })
                          ];
                          tl = Timeline.create(document.getElementById
(\"my-timeline\"),
bandInfos);
                          Timeline.loadXML(\""
>>>>>>$this->timeLine  <<<<<<<-----------------------ITS
HERE!!!!!!!!!!!!!!
"\", , function(xml, url) { eventSource.loadXML(xml, url); });
                        }
..
}




All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general


_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to