Arjunsos / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TIMELINE: isDuration event attribute is defined with opposite meaning in JSON vs XML/SPARQL #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As I've been working my way through implementation of my production 
Timeline app, I was quite puzzled by the definition the isDuration event 
attribute. As you can see from the test example,
http://simile-
widgets.googlecode.com/svn/timeline/trunk/src/webapp/examples/test_example/
test.html

if isDuration is true, then a "instance" icon is shown. If isDuration is 
false or missing, then only the event's tape is shown. Further digging has 
revealed that isDuration for json is the opposite of isDuration for XML and 
SPARQL data formats!

{{{
// See http://code.google.com/p/simile-
widgets/source/browse/timeline/tags/2.2.0/src/webapp/api/scripts/sources.js

// line 48, loadXML format:
                     instant: node.getAttribute("isDuration") != "true",

// line 101 loadJSON format:
                     instant: event.isDuration || false,

// line 188 loadSPARQL format:
                     instant: bindings["isDuration"] != "true",
}}}

I checked the repository and it has been like this for over a year. 
Of course, it would not be a good idea to change JSON's isDuration 
definition now since that would break existing implementations. But the 
current situation is pretty wrong from the documentation and "it just 
doesn't seem to make sense" points of view.

My plan:
* add a new event attribute of "durationEvent" which will be defined the 
same as XML's "isDuration" attribute. 
* Still support durationEvent exactly the same as it is now. Add comments 
to the source so future maintainers won't remove it.

Original issue reported on code.google.com by larryklu...@gmail.com on 23 Oct 2008 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by larryklu...@gmail.com on 24 Oct 2008 at 3:04

GoogleCodeExporter commented 9 years ago
durationEvent added in rev 1654.

Original comment by larryklu...@gmail.com on 2 Nov 2008 at 5:41