diff -r 4eca4ee558a3 -r 6328901da7bf src/js/serializers/JSONSerializer.js --- a/src/js/serializers/JSONSerializer.js Mon Jan 23 11:19:47 2012 +0100 +++ b/src/js/serializers/JSONSerializer.js Mon Jan 23 17:26:07 2012 +0100 @@ -365,7 +365,7 @@ @param name of the ligne de temps */ IriSP.JSONSerializer.prototype.getId = function(name) { - if (typeof(this._data.lists) === "undefined" || this._data.lists === null) + if (IriSP.null_or_undefined(this._data["annotation-types"])) return; name = name.toUpperCase(); @@ -381,6 +381,20 @@ return id; }; +/** return the list of id's of the ligne de temps which contains name + @param name of the ligne de temps +*/ +IriSP.JSONSerializer.prototype.getIds = function(name) { + if (IriSP.null_or_undefined(this._data["annotation-types"])) + return; + + name = name.toUpperCase(); + var e = []; + e = IriSP.underscore.filter(this._data["annotation-types"], + function(entry) { return (entry["dc:title"].toUpperCase().indexOf(name) !== -1) }); + return IriSP.underscore.pluck(e, "id"); +}; + /** return the id of the ligne de temps named "Chapitrage" */ IriSP.JSONSerializer.prototype.getChapitrage = function() { var val = this.getId("Chapitrage");