diff -r 0f2bde8fdfeb -r 581829b5ddd9 client/src/Iri.Modernisation.Data/Ldt/Readers.cs --- a/client/src/Iri.Modernisation.Data/Ldt/Readers.cs Tue Feb 09 15:30:46 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Ldt/Readers.cs Wed Feb 10 14:09:58 2010 +0100 @@ -113,7 +113,7 @@ public static VideoBook ConvertToVideoBook(LDTFile ldt, IRIFile iri) { - + Dictionary polemicElement = new Dictionary(); // Initialisation du VideoBook VideoBook _videoBook = new VideoBook() { @@ -138,7 +138,7 @@ foreach (IRIElement elem in Iens.Decoupages[0].Elements) { - _videoBook.Chapters[chapter].Index.Add(new SegmentIndex(_videoBook.Chapters[chapter]) + SegmentIndex Si = new SegmentIndex(_videoBook.Chapters[chapter]) { Id = elem.Id, Title = elem.Title, @@ -147,8 +147,10 @@ TimerIn = elem.Begin, Duration = elem.Dur - }); + }; + _videoBook.Chapters[chapter].Index.Add(Si); totalDur += elem.Dur; + polemicElement.Add(Si.Id, Si); } chapter++; } @@ -166,25 +168,37 @@ { User author = new User() {UserName = LDTAD.Author }; LDTElement elem = LDTAD.Elements[0]; - - _videoBook.Chapters[chapterIndex].Annotations.Add( - new Annotation(_videoBook.Chapters[chapterIndex]) - { - Id = elem.Id, - Title = elem.Title, - Description = elem.Abstract, - Tags = elem.Tags, - TimerIn = new TimeSpan(0, 0, 0, 0, (int)elem.Begin), - Duration = new TimeSpan(0, 0, 0, 0, (int)elem.Dur), - Type = FactoryVideoLivre.DictionaryAnnotationDescriptions[BasicRelation[elem.Id]], - Contributer = author + Annotation an = new Annotation(_videoBook.Chapters[chapterIndex]) + { + Id = elem.Id, + Title = elem.Title, + Description = elem.Abstract, + Tags = elem.Tags, + TimerIn = new TimeSpan(0, 0, 0, 0, (int)elem.Begin), + Duration = new TimeSpan(0, 0, 0, 0, (int)elem.Dur), + Type = FactoryVideoLivre.DictionaryAnnotationDescriptions[BasicRelation[elem.Id]], + Contributer = author - }); + }; + _videoBook.Chapters[chapterIndex].Annotations.Add(an + ); + polemicElement.Add(an.Id,an); } chapterIndex++; } + foreach (LDTRelation Rel in ldt.BasicRelations) + { + _videoBook.BasicLinks.Add(new PolemicLink() + { + FromElement = (polemicElement[Rel.IdElementFrom]), + ToElement = polemicElement[Rel.IdElementTo], + Title = Rel.Title, + Type = FactoryVideoLivre.DictionaryAnnotationDescriptions[Rel.Type] + + }); + } _videoBook.Duration = iri.Body.Medias[0].Videos[0].Dur; _videoBook.LdtPath = ldt.Path; return _videoBook;