Started documentation translation new-model
authorveltr
Fri, 27 Jul 2012 19:22:25 +0200
branchnew-model
changeset 929 a39ff507b050
parent 928 5aadbc9f27cd
child 930 165f236e42f2
Started documentation translation
.hgignore
doc/architecture.en.md
doc/architecture.fr.md
doc/data-api.fr.md
doc/data-api.md
doc/integration.en.md
sbin/doc/convertdocs.sh
sbin/doc/markdown2dokuwiki.py
sbin/doc/markdown2html.py
sbin/res/Markdown-2.2.0.tar.gz
--- a/.hgignore	Fri Jul 20 17:15:53 2012 +0200
+++ b/.hgignore	Fri Jul 27 19:22:25 2012 +0200
@@ -22,4 +22,6 @@
 syntax: regexp
 \.dokuwiki$
 syntax: regexp
-^\.pydevproject$
\ No newline at end of file
+^\.pydevproject$
+syntax: regexp
+^doc/.+\.html$
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/architecture.en.md	Fri Jul 27 19:22:25 2012 +0200
@@ -0,0 +1,331 @@
+# Architecture of Metadataplayer #
+
+WARNING !
+This documentation refers to version 0.3 of Metadataplayer, now available under the **new-model** branch in our repository
+http://www.iri.centrepompidou.fr/dev/hg/metadataplayer
+
+## External Libraries ##
+
+External libraries are bundled in the *src/libs* directory
+
+### LAB.js ###
+
+- **File**: LAB.min.js
+- **License**: MIT.
+- **Role**: Loads other librairies and widgets.
+- **Used in**: Metadataplayer core.
+- As LAB.js is used to load other libraries, it's the only library called before loading the Metadataplayer core.
+- **Library homepage**: http://labjs.com/
+
+### jQuery ###
+
+- **File**: jquery.min.js
+- **License**: Double, MIT and GPL.
+- **Role**: Manages HTML document (DOM) access and Ajax calls.
+- **Used in**: Metadataplayer core and all widgets.
+- **Library homepage**: http://jquery.org/
+
+### jQuery UI ###
+
+- **Fichiers**: jquery-ui.min.js and jquery-ui.css
+- **License**: Double, MIT and GPL.
+- **Role**: Manages User Interface elements, such as *Sliders*
+- **Used in**: Widgets : Controller (for volume control) et Slider (Time *progress slider*)
+- **Library homepage**: http://jqueryui.com/
+
+### Underscore ###
+
+- **File**: underscore-min.js
+- **License**: MIT.
+- **Role**: Adds functional-programming facilities to handle objects, arrays and functions.
+- **Used in**: Metadataplayer core and most widgets.
+- **Library homepage**: http://underscorejs.org/
+
+### Popcorn ###
+
+- **File**: popcorn-complete.min.js
+- **License**: MIT.
+- **Role**: Handles HTML5 Video Playback.
+- **Used in**: HTML5 and Youtube video players. Also handles Metadataplayer events when one of these players is used.
+- **Library homepage**: http://popcornjs.org/
+
+### Mustache ###
+
+- **File**: mustache.js
+- **License**: MIT.
+- **Role**: A templating library to generate HTML code.
+- **Used in**: widgets.
+- **Library homepage**: http://mustache.github.com/
+
+### Raphael ###
+
+- **File**: raphael-min.js
+- **License**: MIT.
+- **Role**: A vectorial drawing interface (using SVG or VML depending on browsers)
+- **Used in**: Arrow and Sparkline widgets
+- **Library homepage**: http://raphaeljs.com/
+
+### ktbs4js Tracemanager ###
+
+- **File**: tracemanager.js
+- **License**: LGPL.
+- **Role**: Interface with the KTBS trace management system, created by Olivier Aubert (Liris)
+- **Used in**: Trace widget
+- **Library homepage**: http://github.com/oaubert/ktbs4js
+
+## Metadataplayer core ##
+
+In Metadataplayer, Javascript and CSS files are divided in *core* and *widgets*.
+
+In the release (compiled) version, the JS part of the core is a single file, *LdtPlayer-core.js* compiled by concatenating JS files located dans *src/js*:
+
+### header.js ###
+
+Contains credits and licence information (The license is CEA, CNRS and Inria's *CeCILL-C*)
+
+### LAB.js ###
+
+see *external libraries*.
+
+### init.js ###
+
+Defines the *IriSP* object, used as a namespace for the whole Metadataplayer.
+Contains the declaration and methods of the *IriSP.Metadataplayer* class, whose instantiation is the main entry point for the code.
+
+### pop.js ###
+
+Defines the *IriSP.PopcornReplacement* class, i.e. a simplified version of the Popcorn API used to interface with video players (jwplayer, dailymotion) not supported by Popcorn.
+When this part of the Metadataplayer was written, Popcorn and jwplayer didn't interface well, but it should be replaced by a real Popcorn.js plugin.
+
+### utils.js ###
+
+Contains some utility functions such as *IriSP.loadCss*, an equivalent to LAB.js for CSS files.
+
+### model.js ###
+
+Contains classes managing the Cinelab data model, grouped in the *IriSP.Model* namespace.
+
+### widgets.js ###
+
+Contains the (abstract) class *IriSP.Widgets.Widget*, containing base functionalities for all widgets.
+
+### players ###
+
+Files in this directory interface *Popcorn Replacement* (see *pop.js*) with third-party video players.
+
+Five players are available:
+
+1. **player.jwplayer**, for JwPlayer, used to play RTMP streams on the *Ligne de temps* platform.
+2. **player.dailymotion**, to play videos on Dailymotion.
+3. **player.allocine**, to play videos on allocine.net
+4. **player.mashup**, for the flash based mashup player written by Thibaut Cavalié.
+5. **player.htmlMashup**, for the Popcorn-based HTML5 mashup player.
+
+### serializers ###
+
+Serializers are converters between the internal data representation in the metadata player and formats used for communication with servers.
+
+Two serializers are available:
+
+1. **ldt**, to read JSON projects provided by the *Lignes de Temps* platform.
+2. **ldt\_annotate**, for communications with the Add Widget API, whose format is slightly different.
+
+## Widgets ##
+
+Widgets are modules, visible or not, adding functionalities to the Metadataplayer.
+
+Located in the *src/widgets* directory, they're composed of a mandatory JavaScript file, *WidgetName.js* and an optional stylesheet, *WidgetName.css*
+
+#### Common Widget Options ####
+
+- **metadata**, metadata source, as an object with the following properties: { url: *URL of the data source*, type: *Serializer type* }
+- **container**, used to position the widget in a given HTML element, given its ID. If omitted, the widget will be automatically aligned vertically below the player.
+- **annotation\_type**, in widgets displaying annotations. This option can have the following values:
+    - *String*: will display widgets whose annotation type title includes the string. Example: "segments" will show annotations whose annotation type have a title with "Segments" in it.
+    - *Array of string*: to display several annotation types. Example: "Segments"
+    - *false*: to display all annotations related to the media.
+
+Here's a list of available widgets:
+
+### HelloWorld ###
+
+- **Role**: Example widget demonstration the API capabilities
+- **Options**:
+    - **text**: (default: "world"), text to display after "Hello, "
+- Uses a CSS stylesheet: yes
+
+### Slider ###
+
+- **Role**: A combination of a Progress bar and a Slider displaying and allowing repositioning of the current video playback position.
+- **Options**:
+   - **minimized\_height**: (default: 4), height in pixels of the *Slider* in minimized mode
+   - **maximized\_height**: (default: 10), height in pixels du *Slider* in maximized mode (on mouseover)
+   - **minimize\_timeout**: (default: 1500), duration in milliseconds before the *Slider* is automatically minimized. If set to 0, *Slider* stays maximized.
+- Uses external library: jQuery UI
+- Uses a CSS stylesheet: yes
+
+### Controller ###
+
+- **Role**: Play, Pause, Search, Annotate buttons and volume control
+- **Options**:
+    - **disable\_annotate\_btn**: (default: false), disables Annotate button if set to *true*
+    - **disable\_search\_btn**: (default: true), disables Search button
+- Uses external library: jQuery UI
+- Uses a CSS stylesheet: yes
+
+### Arrow ###
+
+- **Role**: Draws the position arrow showing where the annotation is.
+- **Options**:
+    - **arrow\_height**: (default: 16), arrow height in pixels
+    - **arrow\_width**: (default: 24), arrow width in pixels
+    - **base\_height**: (default: 0), distance between arrow bottom and widget button. Mandatory for a rounded widget.
+    - **base\_curve**: (default: 0), curvature radius in pixels for a rounded widget.
+    - **fill\_url**: fill image URL.
+    - **fill\_color**: (default: "#ffffff" = white), fill color. Can be replaced by a gradient described by : gradient angle-start color-end color, e.g.: "90-#000-#fff"
+    - **stroke\_color**: (default: "#b7b7b7" = grey), border color.
+    - **stroke\_width**: (default: 1.5), border width.
+    - **animation\_speed**: (default: 20), arrow animation speed.
+    - **pilot\_widget**: (default: "Annotation"), widget driving the arrow position.
+- Uses external library: Raphael
+- Uses a CSS stylesheet: no
+
+### Annotation ###
+
+- **Role**: Displays information relative to a single segment/annotation while it is being played
+- **Options**:
+    - **annotation\_type**: (default: "chapitrage"), see *Common widget options*.
+    - **show\_top\_border**: (default: false), show top widget border (useful depending on whether it is used in combination with the *Arrow* widget)
+    - **site\_name**: "Lignes de Temps", site name to display when users click on "Share on social networks".
+- Uses a CSS stylesheet: yes
+
+### CreateAnnotation ###
+
+- **Role**: Displays a form to create a new annotation
+- **Options**:
+    - **show\_title\_field**: (default: true), shows or hides the annotation title field.
+    - **creator\_name**: Default annotation creator name.
+    - **creator\_avatar**: Creator profile thumbnail URL.
+    - **tag\_titles**: (default: false), list of tags to display, as an array of strings: [ "#firstTag", "#secondTag" ]
+    - **tags**: (default: false), list of tags to display, as an array of objects: [ { id: "tag-001", title: "#firstTag" } ]. Overrides *tag\_titles*. If both options are set to *false*, the most frequent tags in the project will be displayed.
+    - **max\_tags**: (default: 8), maximum number of tags to display.
+    - **polemics**: polemic buttons to display, as an array of objects, e.g.: [ { keyword: "++", background\_color: "#00a000", text\_color: "#ffffff" } ]
+    - **annotation\_type**: (default: "Contributions"), see *Common widget options*.
+    - **api\_serializer**: (default: "ldt\_annotate"), serializer to use when sending annotations.
+    - **api\_endpoint\_template**: API Endpoint URL, with {{id\}\} as a placeholder for project ID, e.g.: "http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/annotations/{{id}}.json".
+    - **api\_method**: (default: "PUT"), HTTP method used to send annotations. *Lignes de temps* platform uses PUT.
+    - **close\_widget\_timeout**: (default: 0), duration in milliseconds before widget is closed after send. If value is set to 0, the widget stays open.
+- Uses a CSS stylesheet: yes
+
+### Polemic ###
+
+- **Role**: Shows the *polemical timeline*, i.e. tweets colored according to the polemical syntax. Depending on the number of tweets, two visualization modes exist:
+    - Below the threshold (low volume mode), tweets are represented as individual squares.
+    - Above the threshold, columns show aggregated numbers of tweets by color.
+- **Options**:
+    - **element\_width**: (default: 5), width in pixels of a tweet column.
+    - **element\_height**: (default: 5), height in pixels of a tweet, in low volume mode.
+    - **max\_elements**: (default: 15), threshold between low and high volume mode, in tweets per column.
+    - **annotation\_type**: (default: "tweet"), see *Common widget options*.
+    - **defaultcolor**: (default: "#585858" = grey), default color for tweets with no polemical coloring.
+    - **foundcolor**: (default: "#fc00ff" = magenta), color for tweets in a search result.
+    - **polemics**: polemical colors to display, as an array of objects, e.g. [ { name: "OK", keywords: [ "++" ], color: "#1D973D" } ]
+- Uses a CSS stylesheet: yes
+
+### Tweet ###
+
+- **Role**: Show the contents on a tweet when clicj
+- **Options**:
+    - **hide_timeout**: (default: 5000), durée en milliseconds, avant que l’affichage du Tweet ne se referme
+    - **polemics**: identique au paramètre *polemics* du widget *Polemic*
+
+### Sparkline ###
+
+- **Role**: Affiche une courbe indiquant l’évolution du volume d’annotations au cours du temps.
+- **Options**:
+    - **annotation\_type**: see *Common widget options*, above
+    - **lineColor**: (default: "#7492b4" = gris-bleu), couleur de la courbe
+    - **fillColor**: (default: "#aeaeb8" = gris), couleur de la surface sous la courbe
+    - **lineWidth**: (default: 2), épaisseur en pixels de la courbe
+    - **slice\_count**: (default: 20), nombre des tranches horaires dans lesquelles les annotations sont réparties pour calculer la courbe
+    - **height**: (default: 50), hauteur en pixels de la courbe
+    - **margin**: (default: 5), marge en pixels au-dessus de la courbe
+- Uses external library: Raphael
+- Uses a CSS stylesheet: no
+
+### Tagcloud ###
+
+- **Role**: Shows a tag cloud - WARNING: Doesn't work well with Japanese language because of word splitting issues
+- **Options**:
+    - **include\_titles**: (default: true), includes annotation titles when computing tag cloud.
+    - **include\_descriptions**: (default: true), includes annotation descriptions when computing tag cloud.
+    - **include\_tag\_texts**: (default: true), includes tags in annotations when computing tag cloud.
+    - **tag\_count**: (default: 30), maximum number of tags to display.
+    - **stopword\_language**: (default: "fr"), language code for the stopword list.
+    - **custom\_stopwords**: (default: []), custom stopwords to filter out.
+    - **exclude\_pattern**: (default: false), regexp to filter out.
+    - **annotation\_type**: (default: false), see *Common widget options*, above. The annotation type of the annotations whose text is extracted to compute the cloud.
+    - **segment\_annotation\_type**: (default: false), permet de définir la segmentation du nuage de mots-clés et de calculer un nuage pour chaque segment du type d’annotation choisi. Lorsque ce paramètre est à *false*, un seul nuage est calculé pour toute la durée de la vidéo.
+    - **min\_font\_size**: (default: 10), taille de caractères (en pixels) pour le mot le moins fréquent.
+    - **max\_font\_size**: (default: 26), taille de caractères (en pixels) pour le mot le plus fréquent.
+- Uses a CSS stylesheet: yes
+
+### AnnotationsList ###
+
+- **Role**: Show a list of annotations.
+- **Options**:
+    - **ajax\_url**: (default: false), specifies an API template when annotations have to be loaded from an external source. In the URL, {{media}} will be replaced by the media ID, {{begin}} by the start *timecode* in milliseconds, {{end}} by the end *timecode* in milliseconds. If set to *false*, displayed annotations will be the ones loaded from the default metadata source. On the *Lignes de Temps*, the URL of the segments API is http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=?
+    - **ajax\_granularity**: (default: 300000 ms = 5 minutes), specifies the timespan to be loaded from the segment API, around the current timecode. 
+    - **default\_thumbnail**: thumbnail to display when an annotation doesn't have one.
+    - **foreign\_url**: Specifies an URL template for when an annotation doesn't have an URL and is not in the current project. In that template, {{media}} will be replaced by the media ID, {{project}} by the project ID, {{annotationType}} by the annotation type ID and {{annotation}} by the annotation ID. For the *Lignes de temps* platform, this URL is http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}}
+    - **annotation\_type**: (default: false), see *Common widget options*, above
+    - **refresh\_interval**: (default: 0), Ajax refresh interval, to get annotations added while watching (works with either the default source or the external segment API)
+    - **limit\_count**: (default: 10), Maximum number of annotations to display at once.
+    - **newest\_first**: (default: false), When *true*, annotations are sorted by decreasing creation date. When *false*, annotations are sorted by increasing timecode.
+- Uses a CSS stylesheet: yes
+
+### Media ###
+
+- **Role**: Shows current media, as well as other medias in the project. Mostly used for mashups
+- **Options**:
+    - **default\_thumbnail**: thumbnail to display when a media doesn't have one
+    - **media\_url\_template**: Specifies an URL template for when a media doesn't include URL information, e.g.: "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/"
+- Uses a CSS stylesheet: yes
+
+### Tooltip ###
+
+- **Role**: Displays a tooltip. Is mainly used as a subwidget, embedded and called from another widget.
+- No options
+- Uses a CSS stylesheet: yes
+
+### Trace ###
+
+- **Role**: Sends traces to the KTBS server.
+- **Options**:
+    - **js\_console**: (default: false), shows logs in the browser console.
+    - **url**: (default: "http://traces.advene.org:5000/"), URL of the trace server
+    - **requestmode**: (default: "GET"), HTTP method used to send traces (only *"GET"* allows *cross-domain* sending).
+    - **syncmode**: (default: "sync"), allows traces to be sent grouped (*"delayed"* mode) or as single events (*"sync"*).
+- Uses external library: ktbs4js tracemanager
+- Uses a CSS stylesheet: no
+
+### Mediafragment ###
+
+- **Role**: Handles *Media fragments*-compliant URIs (W3C Recommandation): Changing the playing position changes the URL and vice-versa.
+- An URL ending with #id=*annotation ID* points to an annotation, one with #t=*time in seconds* to a precise position.
+- No options
+- Uses a CSS stylesheet: no
+
+### Social ###
+
+- **Role**: Adds buttons to share an URL on social networks
+- **Options**:
+    - **text**: displays a text
+    - **url**: the URL to share
+    - **show_url**: Shows a button to copy/paste an URL
+    - **show_twitter**: Shows a button to share on Twitter
+    - **show_fb**: Shows a button to share on Facebook
+    - **show_gplus**: Shows a button to share on Google+
+    - **show_mail**: Shows a button to share by e-mail
+- Uses a CSS stylesheet: yes
+- Uses external library: ZeroClipboard
--- a/doc/architecture.fr.md	Fri Jul 20 17:15:53 2012 +0200
+++ b/doc/architecture.fr.md	Fri Jul 27 19:22:25 2012 +0200
@@ -119,6 +119,7 @@
 2. **player.dailymotion**, pour lire des vidéos du *Youtube à la française*
 3. **player.allocine**, pour le player de allocine.net
 4. **player.mashup**, pour le player de bout à bout Flash créé par Thibaut Cavalié.
+5. **player.htmlMashup**, pour le lecteur de bout à bout de vidéos HTML5 basé sur Popcorn.
 
 ### serializers ###
 
@@ -306,11 +307,25 @@
     - **requestmode**: (défaut: "GET"), méthode HTTP utilisée pour l’envoi des traces (seul *"GET"* permet le *cross-domain*).
     - **syncmode**: (défaut: "sync"), envois groupés (mode *"delayed"*) ou non (*"sync"*) des traces
 - Utilise la bibliothèque: ktbs4js tracemanager
-- Utilise un fichier CSS: non
+- Utilise un fichier CSS: non.
 
 ### Mediafragment ###
 
 - **Rôle**: Gère les URLs à la norme *Mediafragment*: change la position de la tête de lecture en fonction de l’URL et inversement.
 - Une URL finissant par #id=*id de l’annotation* pointe sur une annotation, par #t=*temps en secondes* vers un timecode de la vidéo.
 - Pas d’options
-- Utilise un fichier CSS: non
+- Utilise un fichier CSS: non.
+
+### Social ###
+
+- **Role**: Affiche des boutons pour partager une URL sur les réseaux sociaux
+- **Options**:
+    - **text**: un texte à afficher (dans le tweet, etc.)
+    - **url**: l’URL à partager
+    - **show_url**: Affiche un bouton pour copier-coller une URL.
+    - **show_twitter**: Affiche un bouton pour partager sur Twitter.
+    - **show_fb**: Affiche un bouton pour partager sur Facebook.
+    - **show_gplus**: Affiche un bouton pour partager sur Google+.
+    - **show_mail**: Affiche un bouton pour partager par e-mail.
+- Utilise un fichier CSS: oui.
+- Utilise la bibliothèque: ZeroClipboard
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/data-api.fr.md	Fri Jul 27 19:22:25 2012 +0200
@@ -0,0 +1,304 @@
+# API d’accès aux métadonnées #
+
+ATTENTION !
+Cette documentation se réfère à la v.3 du Metadataplayer, actuellement disponible dans la branche **new-model** du repository
+http://www.iri.centrepompidou.fr/dev/hg/metadataplayer
+
+## Élément de base ##
+
+    IriSP.Model.Element
+
+### Rôle ###
+
+Classe de base dont héritent les différents types d’objets utilisés dans le Metadataplayer: annotations, types d’annotations, médias, etc.
+
+### Instanciation ###
+
+**Element** fonctionne comme une classe abstraite est n’est jamais instancié directement.
+
+Néanmoins, tous les objets en héritant seront instanciés de la manière suivante :
+
+    var myElement = new IriSP.Model.Element(id, source);
+
+- **id** est l’identifiant unique de l’élément. S’il est à *false*, un identifiant unique sera généré.
+- **source** identifie la source de données dont provient l’élément (cf. Source de Données, *IriSP.Model.Source*, plus bas).
+
+### Propriétés ###
+
+#### type ####
+
+Type d’élément, surchargé par les classes qui héritent de l’élément de base:
+
+- **element** pour IriSP.Model.Element
+- **media** pour IriSP.Model.Media
+- **annotationType** pour IriSP.Model.AnnotationType
+- **tag** pour IriSP.Model.Tag
+- **annotation** pour IriSP.Model.Annotation
+- **mashup** pour IriSP.Model.Mashup
+- **mashedAnnotation** pour IriSP.Model.MashedAnnotation
+
+#### id ####
+
+Identifiant unique de l’élément
+
+#### title ####
+
+Titre de l’élément, par défaut une chaîne vide ("")
+
+#### description ####
+
+Description de l’élément, par défaut une chaîne vide ("")
+
+## Media ##
+
+    IriSP.Model.Media
+
+### Rôle ###
+
+Représente un média (vidéo ou audio).
+
+Hérite de l’Élément de base
+
+### Propriétés ###
+
+#### video ####
+
+Il s’agit de l’URL de la vidéo à charger
+
+#### duration ####
+
+Il s’agit de la durée du média (telle que renseignée dans les métadonnées -- peut ne pas être égale à la durée telle que lue dans la fenêtre vidéo).
+
+Il s’agit d’un objet durée (cf. *IriSP.Model.Time* plus bas)
+
+### Méthodes ###
+
+#### getDuration ####
+
+Permet de spécifier la durée du média, en millisecondes
+
+#### getAnnotations ####
+
+Retourne la liste des annotations associées au média
+
+#### getAnnotationsByTypeTitle ####
+
+Retourne la liste des annotations associées au média et dont le type d’annotation (ou découpage, ou ligne, c.f. Type d’Annotation plus bas) correspond à l’argument de la fonction
+
+## Type d’Annotation ##
+
+    IriSP.Model.AnnotationType
+
+### Rôle ###
+
+Représente un type d’annotation, correspondant également à ce qui peut être nommé découpage ou ligne dans *Lignes de Temps*
+
+Hérite de l’Élément de base.
+
+### Méthodes ###
+
+#### getAnnotations ####
+
+Retourne la liste des annotations associées au type d’annotation
+
+## Annotation ##
+
+    IriSP.Model.Annotation
+
+### Rôle ###
+
+Représente une annotation, correspondant à un segment temporel (dont la durée peut être nulle) d’un média
+
+Hérite de l’Élément de base.
+
+### Propriétés ###
+
+#### begin ####
+
+Timecode de fin de l’annotation. Est un objet de type durée (cf. plus bas)
+
+#### begin ####
+
+Timecode de début de l’annotation. Est un objet de type durée (cf. plus bas)
+
+### Méthodes ###
+
+#### getMedia ####
+
+Retourne l’objet **Média** (*IriSP.Model.Media*) auquel se réfère l’annotation
+
+#### getAnnotationType ####
+
+Retourne l’objet **Type d’Annotation** (*IriSP.Model.AnnotationType*) auquel se réfère l’annotation
+
+#### getTags ####
+
+Retourne la liste (cf. Liste d’éléments *IriSP.Model.List*) des tags associés à l’annotation.
+
+#### getTagTexts ####
+
+## Mashup ##
+
+    IriSP.Model.Mashup
+
+### Rôle ###
+
+Il s’agit d’un bout à bout, composé d’une liste de segments (définis par des annotations de durée non nulle) accolés les uns après les autres.
+
+### Méthodes ###
+
+**À compléter**
+
+## Liste d’éléments ##
+
+    IriSP.Model.List
+
+### Rôle ###
+
+Etend les fonctionnalités des tableaux javascript (*Array*) pour lister des éléments (cf. types d’éléments ci-dessus).
+
+### Instanciation ###
+
+    var myList = new IriSP.Model.List(directory);
+
+- **directory** est le répertoire de données auxquelles la liste permet d’accéder (cf. plus bas)
+
+### Méthodes ###
+
+#### Méthodes de parcours de liste ####
+
+Ces méthodes sont fournies grâce à la bibliothèque extérieure *underscore.js* et sont documentées sur http://documentcloud.github.com/underscore/
+
+Il s’agit de:
+
+- **map**: Renvoie un tableau (*Array*) dont les éléments correspondent aux éléments de la liste, via une fonction passée en argument de map
+- **forEach**: Itère une fonction sur la liste.
+- **filter**: Ne renvoie que les éléments de la liste dont la valeur correspond au résultat d’une fonction.
+- **sortBy**: Fonction de tri, par ordre croissant de la valeur retournée par la fonction passée en argument.
+
+#### searchByTitle, searchByDescription, searchByTextFields ####
+
+Méthodes retournant une nouvelle liste d’éléments, contenant les éléments de la liste dont respectivement le titre, la description ou les deux correspondent à l’argument de la méthode.
+
+    myList.searchByTitle("texte"); // => un *IriSP.Model.List* contenant les éléments de myList dont le titre contient "texte"
+
+## Durée ##
+
+    IriSP.Model.Time
+
+### Rôle ###
+
+Facilite la gestion des durées en millisecondes utilisées dans le Metadataplayer
+
+### Instanciation ###
+
+    var myTime = new IriSP.Model.Time(ms);
+
+- **ms** est une durée en millisecondes
+
+### Méthodes ###
+
+#### getSeconds ####
+
+Renvoie la durée convertie en secondes
+
+#### toString ####
+
+Renvoie la durée au format (hh:)mm:ss
+
+#### setSeconds ####
+
+Permet d’affecter une durée en secondes
+
+    myTime.setSeconds(12); // 12000 millisecondes
+
+## Source de données ##
+
+    IriSP.Model.Source
+
+et
+    IriSP.Model.RemoteSource
+
+### Rôle ###
+
+Gère une source de données : fichier externe JSON, XML, etc. pour *IriSP.Model.RemoteSource*, projet créé à la volée pour *IriSP.Model.Source*.
+
+*IriSP.Model.RemoteSource* hérite de *IriSP.Model.Source* et ne diffère que par son implémentation de la méthode *get*.
+
+Sur la plateforme *Lignes de Temps*, il existe plusieurs API qui sont utilisées comme sources :
+
+- L’API projet, qui renvoie un fichier JSON contenant un projet LDT complet.
+- L’API segment, qui renvoie toutes les annotations d’un média situées entre deux timecodes fournis en argument.
+- L’API de publication d’annotation, qui demande l’envoi (par la méthode HTTP PUT) d’une liste d’annotation et renvoie celle-ci en retour, avec les identifiants des annotations en base de données.
+
+### Instanciation ###
+
+    var config = { directory: myDirectory };
+    var mySource = new IriSP.Model.Source(config);
+
+- **config** est un objet contenant les options de configuration:
+    - Il doit nécessairement contenir une propriété **directory**, désignant le répertoire de données (cf. plus bas).
+    - La propriété **serializer** doit désigner le *Sérialiseur* utilisé pour désérialiser les données importées ou sérialiser l’export.
+    - un *IriSP.Model.RemoteSource* doit également être appelé avec une propriété **url**, désignant l’URL de la source.
+
+Une Source ne doit pas être instanciée directement, ce rôle est donné aux répertoires de données, ce qui permet notamment d’éviter des accès multiples à une même URL.
+
+### Propriétés ###
+
+#### currentMedia ####
+
+*TODO: transférer dans un objet "Project"*
+
+Donne accès au média en cours du projet. Peut désigner un vrai média ou un mashup.
+
+### Méthodes ###
+
+#### get ####
+
+Permet de récupérer ou de rafraîchir, via Ajax, les données de la source. Pour un *IriSP.Model.Source* de base, n’a aucun effet.
+
+#### onLoad ####
+
+Permet d’exécuter une fonction, passée en argument, au chargement de la source.
+
+#### serialize, deSerialize ####
+
+Transforme les données de la source en données sérialisées, au format du sérialiseur associées à la source, et inversement.
+
+#### getAnnotations, getAnnotationTypes, getMedias, getTags, getMashups ####
+
+Retourne les listes respectives d’annotations, types d’annotations, médias, tags et mashups de la source.
+
+#### getAnnotationsByTypeTitle ####
+
+Retourne la liste des annotations dont le type d’annotation correspond à l’argument de la fonction.
+
+## Répertoire de données ##
+
+    IriSP.Model.Directory
+
+### Rôle ###
+
+Gère l’instanciation des sources de données et la mise en cache de ces sources lorsque plusieurs appels à la même URLs sont faits.
+
+Permet également aux objets de plusieurs sources d’interagir entre eux.
+
+### Instanciation ###
+
+    var myDirectory = new IriSP.Model.Directory
+
+### Méthodes ###
+
+#### newLocalSource ####
+
+Crée une nouvelle source non attachée à une URL. S’il faut exporter des données, un sérialiseur doit être passé en paramètres.
+
+    var myConfig = { serializer: IriSP.serializers.ldt };
+    var myLocalSource = myDirectory.newLocalSource(myConfig);
+
+#### remoteSource ####
+
+Crée ou récupère (si celle-ci existe déjà) une source attachée à une URL. Le sérialiseur est obligatoire.
+
+    var myConfig = { url: "source-data.json", serializer: IriSP.serializers.ldt };
+    var myLocalSource = myDirectory.remoteSource(myConfig);
--- a/doc/data-api.md	Fri Jul 20 17:15:53 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-# API d’accès aux métadonnées #
-
-ATTENTION !
-Cette documentation se réfère à la v.3 du Metadataplayer, actuellement disponible dans la branche **new-model** du repository
-http://www.iri.centrepompidou.fr/dev/hg/metadataplayer
-
-## Élément de base ##
-
-    IriSP.Model.Element
-
-### Rôle ###
-
-Classe de base dont héritent les différents types d’objets utilisés dans le Metadataplayer: annotations, types d’annotations, médias, etc.
-
-### Instanciation ###
-
-**Element** fonctionne comme une classe abstraite est n’est jamais instancié directement.
-
-Néanmoins, tous les objets en héritant seront instanciés de la manière suivante :
-
-    var myElement = new IriSP.Model.Element(id, source);
-
-- **id** est l’identifiant unique de l’élément. S’il est à *false*, un identifiant unique sera généré.
-- **source** identifie la source de données dont provient l’élément (cf. Source de Données, *IriSP.Model.Source*, plus bas).
-
-### Propriétés ###
-
-#### type ####
-
-Type d’élément, surchargé par les classes qui héritent de l’élément de base:
-
-- **element** pour IriSP.Model.Element
-- **media** pour IriSP.Model.Media
-- **annotationType** pour IriSP.Model.AnnotationType
-- **tag** pour IriSP.Model.Tag
-- **annotation** pour IriSP.Model.Annotation
-- **mashup** pour IriSP.Model.Mashup
-- **mashedAnnotation** pour IriSP.Model.MashedAnnotation
-
-#### id ####
-
-Identifiant unique de l’élément
-
-#### title ####
-
-Titre de l’élément, par défaut une chaîne vide ("")
-
-#### description ####
-
-Description de l’élément, par défaut une chaîne vide ("")
-
-## Media ##
-
-    IriSP.Model.Media
-
-### Rôle ###
-
-Représente un média (vidéo ou audio).
-
-Hérite de l’Élément de base
-
-### Propriétés ###
-
-#### video ####
-
-Il s’agit de l’URL de la vidéo à charger
-
-#### duration ####
-
-Il s’agit de la durée du média (telle que renseignée dans les métadonnées -- peut ne pas être égale à la durée telle que lue dans la fenêtre vidéo).
-
-Il s’agit d’un objet durée (cf. *IriSP.Model.Time* plus bas)
-
-### Méthodes ###
-
-#### getDuration ####
-
-Permet de spécifier la durée du média, en millisecondes
-
-#### getAnnotations ####
-
-Retourne la liste des annotations associées au média
-
-#### getAnnotationsByTypeTitle ####
-
-Retourne la liste des annotations associées au média et dont le type d’annotation (ou découpage, ou ligne, c.f. Type d’Annotation plus bas) correspond à l’argument de la fonction
-
-## Type d’Annotation ##
-
-    IriSP.Model.AnnotationType
-
-### Rôle ###
-
-Représente un type d’annotation, correspondant également à ce qui peut être nommé découpage ou ligne dans *Lignes de Temps*
-
-Hérite de l’Élément de base.
-
-### Méthodes ###
-
-#### getAnnotations ####
-
-Retourne la liste des annotations associées au type d’annotation
-
-## Annotation ##
-
-    IriSP.Model.Annotation
-
-### Rôle ###
-
-Représente une annotation, correspondant à un segment temporel (dont la durée peut être nulle) d’un média
-
-Hérite de l’Élément de base.
-
-### Propriétés ###
-
-#### begin ####
-
-Timecode de fin de l’annotation. Est un objet de type durée (cf. plus bas)
-
-#### begin ####
-
-Timecode de début de l’annotation. Est un objet de type durée (cf. plus bas)
-
-### Méthodes ###
-
-#### getMedia ####
-
-Retourne l’objet **Média** (*IriSP.Model.Media*) auquel se réfère l’annotation
-
-#### getAnnotationType ####
-
-Retourne l’objet **Type d’Annotation** (*IriSP.Model.AnnotationType*) auquel se réfère l’annotation
-
-#### getTags ####
-
-Retourne la liste (cf. Liste d’éléments *IriSP.Model.List*) des tags associés à l’annotation.
-
-#### getTagTexts ####
-
-## Mashup ##
-
-    IriSP.Model.Mashup
-
-### Rôle ###
-
-Il s’agit d’un bout à bout, composé d’une liste de segments (définis par des annotations de durée non nulle) accolés les uns après les autres.
-
-### Méthodes ###
-
-**À compléter**
-
-## Liste d’éléments ##
-
-    IriSP.Model.List
-
-### Rôle ###
-
-Etend les fonctionnalités des tableaux javascript (*Array*) pour lister des éléments (cf. types d’éléments ci-dessus).
-
-### Instanciation ###
-
-    var myList = new IriSP.Model.List(directory);
-
-- **directory** est le répertoire de données auxquelles la liste permet d’accéder (cf. plus bas)
-
-### Méthodes ###
-
-#### Méthodes de parcours de liste ####
-
-Ces méthodes sont fournies grâce à la bibliothèque extérieure *underscore.js* et sont documentées sur http://documentcloud.github.com/underscore/
-
-Il s’agit de:
-
-- **map**: Renvoie un tableau (*Array*) dont les éléments correspondent aux éléments de la liste, via une fonction passée en argument de map
-- **forEach**: Itère une fonction sur la liste.
-- **filter**: Ne renvoie que les éléments de la liste dont la valeur correspond au résultat d’une fonction.
-- **sortBy**: Fonction de tri, par ordre croissant de la valeur retournée par la fonction passée en argument.
-
-#### searchByTitle, searchByDescription, searchByTextFields ####
-
-Méthodes retournant une nouvelle liste d’éléments, contenant les éléments de la liste dont respectivement le titre, la description ou les deux correspondent à l’argument de la méthode.
-
-    myList.searchByTitle("texte"); // => un *IriSP.Model.List* contenant les éléments de myList dont le titre contient "texte"
-
-## Durée ##
-
-    IriSP.Model.Time
-
-### Rôle ###
-
-Facilite la gestion des durées en millisecondes utilisées dans le Metadataplayer
-
-### Instanciation ###
-
-    var myTime = new IriSP.Model.Time(ms);
-
-- **ms** est une durée en millisecondes
-
-### Méthodes ###
-
-#### getSeconds ####
-
-Renvoie la durée convertie en secondes
-
-#### toString ####
-
-Renvoie la durée au format (hh:)mm:ss
-
-#### setSeconds ####
-
-Permet d’affecter une durée en secondes
-
-    myTime.setSeconds(12); // 12000 millisecondes
-
-## Source de données ##
-
-    IriSP.Model.Source
-
-et
-    IriSP.Model.RemoteSource
-
-### Rôle ###
-
-Gère une source de données : fichier externe JSON, XML, etc. pour *IriSP.Model.RemoteSource*, projet créé à la volée pour *IriSP.Model.Source*.
-
-*IriSP.Model.RemoteSource* hérite de *IriSP.Model.Source* et ne diffère que par son implémentation de la méthode *get*.
-
-Sur la plateforme *Lignes de Temps*, il existe plusieurs API qui sont utilisées comme sources :
-
-- L’API projet, qui renvoie un fichier JSON contenant un projet LDT complet.
-- L’API segment, qui renvoie toutes les annotations d’un média situées entre deux timecodes fournis en argument.
-- L’API de publication d’annotation, qui demande l’envoi (par la méthode HTTP PUT) d’une liste d’annotation et renvoie celle-ci en retour, avec les identifiants des annotations en base de données.
-
-### Instanciation ###
-
-    var config = { directory: myDirectory };
-    var mySource = new IriSP.Model.Source(config);
-
-- **config** est un objet contenant les options de configuration:
-    - Il doit nécessairement contenir une propriété **directory**, désignant le répertoire de données (cf. plus bas).
-    - La propriété **serializer** doit désigner le *Sérialiseur* utilisé pour désérialiser les données importées ou sérialiser l’export.
-    - un *IriSP.Model.RemoteSource* doit également être appelé avec une propriété **url**, désignant l’URL de la source.
-
-Une Source ne doit pas être instanciée directement, ce rôle est donné aux répertoires de données, ce qui permet notamment d’éviter des accès multiples à une même URL.
-
-### Propriétés ###
-
-#### currentMedia ####
-
-*TODO: transférer dans un objet "Project"*
-
-Donne accès au média en cours du projet. Peut désigner un vrai média ou un mashup.
-
-### Méthodes ###
-
-#### get ####
-
-Permet de récupérer ou de rafraîchir, via Ajax, les données de la source. Pour un *IriSP.Model.Source* de base, n’a aucun effet.
-
-#### onLoad ####
-
-Permet d’exécuter une fonction, passée en argument, au chargement de la source.
-
-#### serialize, deSerialize ####
-
-Transforme les données de la source en données sérialisées, au format du sérialiseur associées à la source, et inversement.
-
-#### getAnnotations, getAnnotationTypes, getMedias, getTags, getMashups ####
-
-Retourne les listes respectives d’annotations, types d’annotations, médias, tags et mashups de la source.
-
-#### getAnnotationsByTypeTitle ####
-
-Retourne la liste des annotations dont le type d’annotation correspond à l’argument de la fonction.
-
-## Répertoire de données ##
-
-    IriSP.Model.Directory
-
-### Rôle ###
-
-Gère l’instanciation des sources de données et la mise en cache de ces sources lorsque plusieurs appels à la même URLs sont faits.
-
-Permet également aux objets de plusieurs sources d’interagir entre eux.
-
-### Instanciation ###
-
-    var myDirectory = new IriSP.Model.Directory
-
-### Méthodes ###
-
-#### newLocalSource ####
-
-Crée une nouvelle source non attachée à une URL. S’il faut exporter des données, un sérialiseur doit être passé en paramètres.
-
-    var myConfig = { serializer: IriSP.serializers.ldt };
-    var myLocalSource = myDirectory.newLocalSource(myConfig);
-
-#### remoteSource ####
-
-Crée ou récupère (si celle-ci existe déjà) une source attachée à une URL. Le sérialiseur est obligatoire.
-
-    var myConfig = { url: "source-data.json", serializer: IriSP.serializers.ldt };
-    var myLocalSource = myDirectory.remoteSource(myConfig);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/integration.en.md	Fri Jul 27 19:22:25 2012 +0200
@@ -0,0 +1,136 @@
+# Integrating the Metadataplayer in an HTML page #
+
+WARNING !
+This documentation refers to version 0.3 of Metadataplayer, now available under the **new-model** branch in our repository
+http://www.iri.centrepompidou.fr/dev/hg/metadataplayer
+
+## Loading the script ##
+
+The *LdtPlayer-core.js* must be declared in the HTML header.
+
+    <head>
+        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+        <title>Metadataplayer integration test</title>
+        <script type="text/javascript" src="metadataplayer/LdtPlayer-core.js" type="text/javascript"></script>
+    </head>
+
+## Declaration of a container HTML element ##
+
+    <body>
+        <div id="Metadataplayer"></div>
+
+The script for configuring and loading the Metadataplayer must be executed after this element is declared either by :
+    - Adding a <*script*> element at the bottom of the page
+    - Using an event such as *body.onload*
+    - Using jQuery's *$(function(){})* syntax or an equivalent in your favorite framework
+
+    <script type="text/javascript">
+
+## Interface language configuration ##
+
+Language is defined ISO 639-1 (e.g., "es" pour l’Espagnol, "ja" pour le Japonais, "eu" pour le Basque). As of July 2012, only English ("en") and French ("fr") are available.
+
+    IriSP.language = "fr";
+
+## Library location configuration ##
+
+By default (as defined in *defaults.js*), librairies are loaded from either a CDN (Content Distribution Network) or from the *js/libs* directory.
+
+Configuration is done by overriding the properties of *IriSP.libFiles*
+
+To use the CDN:
+
+    IriSP.libFiles.useCdn = true;
+
+To change the location of the library directory:
+
+    IriSP.libFiles.defaultDir = "/path/libs";
+
+To change individual locations or to point to files outside the default directory:
+
+    IriSP.libFiles.locations.jQueryUI = "libs/jquery-ui-1.8.16.custom.min.js";
+    IriSP.libFiles.locations.jwPlayerSWF = "libs/jwplayer/player.swf";
+
+## Configuration of metadata source ##
+
+A metadata source is defined by its url and file type (which defines the *serializer* to use).
+
+Example:
+
+    var metadataSource = {
+        url: "data/mydata.json",
+        type: "ldt"
+    };
+
+Metadata sources are then used to configure both the video player and the widgets.
+
+## Configuration of the video player ##
+
+The video player is configured through an object having the following properties:
+
+- **metadata**: Metadata source.
+- **type**: Video player type :
+    - **"jwplayer"**: Uses flash-based jwPlayer, compatible with many video and audio formats, including MP3 audio, MP4 video and RTMP streams.
+    - **"html5"**: Uses the Popcorn.js library to play HTML5 videos. Supported formats : OGG and WebM on Firefox and Chrome, H.264 on Internet Explorer, Safari and Chrome.
+    - **"youtube"**: Uses Popcorn's Youtube plugin.
+    - **"dailymotion"**
+    - **"auto"**: Replaced by *Youtube* or *Dailymotion* for a video hosted on one of these platform, or *jwPlayer* in other cases.
+- **width** and **height** of the video player.
+- **video**: Video URL. Optional: If present, it overrides the video URL defined in the metadata source.
+- Player-specific options, such as **provider** or **streamer** for JwPlayer
+
+Example:
+
+    var playerConfig = {
+        metadata: metadataSource,
+        type: "jwplayer",
+        height: 350,
+        width: 620,
+        provider: "rtmp"
+    };
+
+## User Interface Configuration ##
+
+L’interface se configure par un objet GUI, contenant les propriétés suivantes:
+
+- **container**: l’ID de l’élément HTML dans lequel le player sera instancié.
+- **width** et **height**: largeur et hauteur de l’interface (*height* est optionnel).
+- **default\_options**: des options de configuration communes à tous les widgets, par exemple, comme ci-dessous, une source de métadonnées communes.
+- **css**: l’URL du fichier CSS de base (LdtPlayer-core.css)
+- **widgets**: la liste des widgets, sous la forme [ { type: *Type du widget*, option_1: *Valeur de l’option 1* } ]. Pour les options des widgets, se référer au document *Architecture générale*
+
+Exemple:
+
+    var guiConfig = {
+        container : "Metadataplayer",
+        default_options: {
+            metadata: metadataSource
+        },
+        css : "metadataplayer/css/LdtPlayer-core.css",
+        widgets: [
+            {
+                type: "Slider"
+            },{
+                type: "Controller",
+                disable\_annotate\_btn: true
+            },{
+                type: "Segments",
+                annotation\_type: "Chapters"
+            },{
+                type: "AnnotationsList",
+                container: "AnnotationsListContainer"
+            }
+        ]
+    };
+
+## Instanciation du player ##
+
+Le player s’instancie en créant un objet de type **IriSP.Metadataplayer**.
+
+Exemple:
+
+    var config = {
+        player: playerConfig,
+        gui: guiConfig
+    };
+    var monPlayer = new IriSP.Metadataplayer(config);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/doc/convertdocs.sh	Fri Jul 27 19:22:25 2012 +0200
@@ -0,0 +1,5 @@
+#!/bin/bash
+for f in ../../doc/*.md
+do
+    python markdown2html.py $f
+done
\ No newline at end of file
--- a/sbin/doc/markdown2dokuwiki.py	Fri Jul 20 17:15:53 2012 +0200
+++ b/sbin/doc/markdown2dokuwiki.py	Fri Jul 27 19:22:25 2012 +0200
@@ -3,6 +3,8 @@
 inputname = sys.argv[1]
 outputname = re.sub("\.\w+$",".dokuwiki",inputname)
 
+print "Converting %s to %s"%(inputname,outputname)
+
 inputfile = open(inputname,'r')
 
 markdowntext = inputfile.read()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/doc/markdown2html.py	Fri Jul 27 19:22:25 2012 +0200
@@ -0,0 +1,32 @@
+import re, sys, markdown, codecs
+
+inputname = sys.argv[1]
+outputname = re.sub("\.\w+$",".html",inputname)
+shortname = re.sub("(^.+\/|\.\w+$)","",inputname)
+
+print "Converting %s"%shortname
+
+f = codecs.open(inputname, mode="r", encoding="utf8")
+mdtext = f.read()
+f.close()
+html = markdown.markdown(mdtext)
+
+f = codecs.open(outputname, "w", encoding="utf8")
+
+header = """<!doctype html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<title>Metadataplayer docs: %s</title>
+</head>
+<body>
+"""%shortname
+footer = """
+</body>
+</html>"""
+
+f.write(header)
+f.write(html)
+f.write(footer)
+
+f.close()
\ No newline at end of file
Binary file sbin/res/Markdown-2.2.0.tar.gz has changed