WebService-like
authortotetm <>
Tue, 09 Feb 2010 15:30:46 +0100
changeset 39 0f2bde8fdfeb
parent 38 bd33267300aa
child 40 581829b5ddd9
WebService-like
client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs
client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs
client/src/Iri.Modernisation.Data/Ldt/LDTDecoupage.cs
client/src/Iri.Modernisation.Data/Ldt/LDTDisplay.cs
client/src/Iri.Modernisation.Data/Ldt/LDTElement.cs
client/src/Iri.Modernisation.Data/Ldt/LDTFile.cs
client/src/Iri.Modernisation.Data/Ldt/LDTRelation.cs
client/src/Iri.Modernisation.Data/Ldt/Readers.cs
client/src/Iri.Modernisation.Data/Models/FactoryVideoLivre.cs
client/src/Iri.Modernisation.Data/Models/SettingsProject.cs
client/src/Iri.Modernisation.Data/Models/VideoBook.cs
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/AvailableVideoBooks.xml
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/FranceInterENMI29.ldt
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/iri_matinalefi28nov2009/iri_matinalefi28nov2009.iri
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/test.ldt
client/test/FranceCulture/FranceCulture/FranceCulture.Web/FranceCulture.Web.csproj
client/test/FranceCulture/FranceCulture/FranceCulture.Web/ProjectConfig.xml
client/test/FranceCulture/FranceCulture/FranceCulture.Web/UpdateBookService.aspx
client/test/FranceCulture/FranceCulture/FranceCulture.Web/UpdateBookService.aspx.cs
client/test/FranceCulture/FranceCulture/FranceCulture.Web/UpdateBookService.aspx.designer.cs
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Web.Debug.config
client/test/FranceCulture/FranceCulture/FranceCulture.Web/Web.config
client/test/FranceCulture/FranceCulture/FranceCulture.Web/clientaccesspolicy.xml
client/test/FranceCulture/FranceCulture/FranceCulture.Web/crossdomain.xml
--- a/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -15,8 +15,8 @@
 using System.Collections.Generic;
 using System.Linq;
 using Iri.Modernisation.Controls.View;
+using System.IO;
 using Iri.Modernisation.Data.LDTClass;
-
 namespace Iri.Modernisation.Controls.ViewModel
 {
 
@@ -322,6 +322,14 @@
         {
             _newAnnotation.Type = _selectedType ;
             _basicRelation.ToElement = _newAnnotation;
+            _basicRelation.Type = _newAnnotation.Type;
+            _refElement.Chapter.Annotations.Add(_newAnnotation);
+            _refElement.Chapter.Book.BasicLinks.Add(_basicRelation);
+            if(_polemicRelation.ToElement != null)
+            {
+                _refElement.Chapter.Book.PolemicLinks.Add(_polemicRelation);
+            }
+
             LDTElement newAnnotation = new LDTElement(_newAnnotation);
             
            /* 
@@ -335,6 +343,7 @@
             
             LDTFile newfile = new LDTFile()
             {
+               
                 Medias  = new List<LDTMedia>()
                 {
                     new LDTMedia()
@@ -342,7 +351,7 @@
                         Src = _refElement.Chapter.Book.IriPath
                     }
                 },
-                Relations = new List<LDTRelation>()
+                BasicRelations = new List<LDTRelation>()
                 {
                     new LDTRelation()
                     {
@@ -351,6 +360,7 @@
                         //Title = _basicRelation.Title
                     }
                 },
+
                 Annotations = new List<LDTAnnotationsContent>()
                 {
                     new LDTAnnotationsContent()
@@ -377,18 +387,31 @@
                     IdElementTo = _polemicRelation.ToElement.Id,
                     Title = _polemicRelation.Title
                 };
-                newfile.Relations.Add(polemicRelation);
+                newfile.BasicRelations.Add(polemicRelation);
             }
+
+
             //MessageBox.Show(newfile.ToString());
-           
-            /** HttpSend For Web Mode **/
-           /* Application app = Application.Current as Application;
-            HttpSender helper = new HttpSender(new Uri("http://mtotet.free.fr/TestHttpSender/index.php"), "POST",
-                new KeyValuePair<string, string>("authKey", "123456" ),
-                new KeyValuePair<string, string>("newAnnotation", newfile.ToString()),
-                new KeyValuePair<string, string>("msg", "303"));
+
+            /* HttpSend For Web Mode */
+            Application app = Application.Current as Application;
+            HttpSender helper = new HttpSender(new Uri(FactoryVideoLivre.UpdateBookService, UriKind.RelativeOrAbsolute), "POST",
+                new KeyValuePair<string, string>("newAnnotation",System.Windows.Browser.HttpUtility.UrlEncode(
+                                                                    System.Windows.Browser.HttpUtility.HtmlEncode(
+                                                                        _refElement.Chapter.Book.GetLDTFile().ToString())
+                                                    )),
+                new KeyValuePair<String,String>("ldtFileURI",_refElement.Chapter.Book.LdtPath));
             helper.ResponseComplete += new HttpResponseCompleteEventHandler(helper_ResponseComplete);
-            helper.Execute();*/
+            helper.Execute();
+             
+        
+          /*  HttpSendHelper hsh = new HttpSendHelper("POST", FactoryVideoLivre.UpdateBookService,
+                new Dictionary<String, String> { 
+                                                   { "ldtIs", "world" },
+                                                   {"AnnotationLdtFile",newfile.ToString()} 
+                                                });
+            hsh.Execute();*/
+
 
         /** Local Mode **/
             Commands.AnnotationMaker.NewAnnotationFinished.Execute(_newAnnotation,_refElement);
@@ -400,7 +423,7 @@
             OnPropertyChanged("IsControlEnable");
            
         }
-
+        
         private String _sendAnnotationResponse;
         public String SendAnnotationResponse
         {
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -126,7 +126,7 @@
         {
             Annotation createdAnnotation = ((Annotation)e.Parameter);
             PolemicElement refElement = ((PolemicElement)e.Source);
-            refElement.Chapter.Annotations.Add(createdAnnotation);
+           // refElement.Chapter.Annotations.Add(createdAnnotation);
             //refElement.Chapter.Book.Save();
 
            
--- a/client/src/Iri.Modernisation.Data/Ldt/LDTDecoupage.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/LDTDecoupage.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -21,7 +21,9 @@
         /// Attribut
         /// </summary>
         public String Id { get; set; }
-        public LDTDecoupage(){}
+        public LDTDecoupage(){
+            Id = System.Guid.NewGuid().ToString();
+        }
 
 
     }
--- a/client/src/Iri.Modernisation.Data/Ldt/LDTDisplay.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/LDTDisplay.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -60,10 +60,12 @@
             Zoom = int.Parse(e.Attribute("zoom").Value);
             Scroll = int.Parse(e.Attribute("scroll").Value);
             InfoBAB = e.Attribute("infoBAB").Value;
-
-            foreach (XElement Elem in e.Element("content").Elements())
+            if (e.Element("content")!=null)
             {
-                Content.Add(new LDTDisplaysContent(Elem));                
+                foreach (XElement Elem in e.Element("content").Elements())
+                {
+                    Content.Add(new LDTDisplaysContent(Elem));                
+                }
             }
         }
         public XElement XML
--- a/client/src/Iri.Modernisation.Data/Ldt/LDTElement.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/LDTElement.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -62,11 +62,7 @@
         /// Elements
         /// </summary>
         public List<String> Tags { get; set; }
-
-        /// <summary>
-        /// Attribute
-        /// </summary>
-        public int Type { get; set; }
+   
 
         /// <summary>
         /// Elements
@@ -88,7 +84,7 @@
             Video = String.Empty;
         
             Color = double.Parse(annotation.Type.Color.A.ToString() + annotation.Type.Color.R.ToString() + annotation.Type.Color.G.ToString() + annotation.Type.Color.B.ToString());
-            Type = 0;
+
             
         }
 
@@ -114,14 +110,7 @@
             {
                 Video = e.Element("video").Value;
             }
-            if(e.Attribute("type")==null)
-            {
-                Type = 0;
-            }
-            else
-            {
-                Type = int.Parse(e.Attribute("type").Value);
-            }
+           
             foreach (XElement Str in e.Element("tags").Elements())
             {
                 Tags.Add(Str.Value);
@@ -130,7 +119,7 @@
         public LDTElement()
         {
             Id = System.Guid.NewGuid().ToString();
-            Type = 0;
+      
             Begin = 0;
             Dur = 0;
             Author = String.Empty;
@@ -156,7 +145,6 @@
                     new XAttribute("date",Date.ToString("")),
                     new XAttribute("color",Color),
                     new XAttribute("src",Src),
-                    new XAttribute("type",Type.ToString()),
                     new XElement("title",Title),
                     new XElement("abstract",Abstract),
                     new XElement("audio",Audio),
--- a/client/src/Iri.Modernisation.Data/Ldt/LDTFile.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/LDTFile.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -46,7 +46,9 @@
         /// </summary>
         public List<LDTEditing> Edits { get; set; }
 
-        public List<LDTRelation> Relations { get; set; }
+        public List<LDTRelation> BasicRelations { get; set; }
+
+        public List<LDTRelation> PolemicRelations { get; set; }
        
         public LDTFile()
         {
@@ -55,7 +57,8 @@
             Annotations = new List<LDTAnnotationsContent>();
             Displays = new List<LDTDisplay>();
             Edits = new List<LDTEditing>();
-            Relations = new List<LDTRelation>();
+            BasicRelations = new List<LDTRelation>();
+            PolemicRelations = new List<LDTRelation>();
         }
         public void Load(String _path)
         {
@@ -91,11 +94,18 @@
                 Edits.Add(new LDTEditing(Elem));
             }
 
-            if(xdoc.Root.Element("realtions")!=null)
+            if(xdoc.Root.Element("basicRelations")!=null)
             {
-                foreach (XElement Elem in xdoc.Root.Element("realtions").Elements())
+                foreach (XElement Elem in xdoc.Root.Element("basicRelations").Elements())
                 {
-                    Relations.Add(new LDTRelation(Elem));
+                    BasicRelations.Add(new LDTRelation(Elem));
+                }
+            }
+            if (xdoc.Root.Element("polemicRelations") != null)
+            {
+                foreach (XElement Elem in xdoc.Root.Element("polemicRelations").Elements())
+                {
+                    PolemicRelations.Add(new LDTRelation(Elem));
                 }
             }
         }
@@ -123,11 +133,18 @@
                 returnFile.Edits.Add(new LDTEditing(Elem));
             }
 
-            if (xdoc.Root.Element("realtions") != null)
+            if (xdoc.Root.Element("basicRelations") != null)
             {
-                foreach (XElement Elem in xdoc.Root.Element("realtions").Elements())
+                foreach (XElement Elem in xdoc.Root.Element("basicRelations").Elements())
                 {
-                    returnFile.Relations.Add(new LDTRelation(Elem));
+                    returnFile.BasicRelations.Add(new LDTRelation(Elem));
+                }
+            }
+            if (xdoc.Root.Element("polemicRelations") != null)
+            {
+                foreach (XElement Elem in xdoc.Root.Element("polemicRelations").Elements())
+                {
+                    returnFile.PolemicRelations.Add(new LDTRelation(Elem));
                 }
             }
             return returnFile;
@@ -191,12 +208,20 @@
                 temp.Add(XEdits);
 
                 //
-                XElement XRelations = new XElement("relations");
-                foreach (LDTRelation relation in Relations)
+                XElement XBasicRelations = new XElement("basicRelations");
+                foreach (LDTRelation relation in BasicRelations)
                 {
-                    XRelations.Add(relation.XML);
+                    XBasicRelations.Add(relation.XML);
                 }
-                temp.Add(XRelations);
+                temp.Add(XBasicRelations);
+
+                //
+                XElement XPolemicRelations = new XElement("polemicRelations");
+                foreach (LDTRelation relation in PolemicRelations)
+                {
+                    XPolemicRelations.Add(relation.XML);
+                }
+                temp.Add(XPolemicRelations);
 
                 return temp;
             }
--- a/client/src/Iri.Modernisation.Data/Ldt/LDTRelation.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/LDTRelation.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -17,12 +17,13 @@
         public String IdElementFrom { get; set; }
         public String IdElementTo { get; set; }
         public String Title { get; set; }
-
+        public String Type { get; set; }
         public LDTRelation()
         {
             IdElementFrom = String.Empty;
             IdElementTo = String.Empty;
             Title = String.Empty;
+            Type = String.Empty;
         }
         public LDTRelation(XElement elem)
         {
@@ -31,6 +32,7 @@
             IdElementFrom = elem.Attribute("idElementFrom").Value;
             IdElementTo = elem.Attribute("idElementTo").Value;
             Title = elem.Attribute("title").Value;
+            Type = elem.Attribute("type").Value;
         }
 
         public XElement XML
@@ -49,11 +51,15 @@
                 {
                     Title = String.Empty;
                 }
+                if(Type == null)
+                {
+                    Type = String.Empty;
+                }
                 return new XElement("relation",
                     new XAttribute("idElementFrom", IdElementFrom),
                     new XAttribute("idElementTo", IdElementTo),
-                    new XAttribute("title", Title)
-                   
+                    new XAttribute("title", Title),
+                    new XAttribute("type",Type)
                     );
             }
         }
--- a/client/src/Iri.Modernisation.Data/Ldt/Readers.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Ldt/Readers.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -10,6 +10,7 @@
 using System.Windows.Shapes;
 using Iri.Modernisation.Data.Models;
 using System.Xml.Linq;
+using System.Collections.Generic;
 namespace Iri.Modernisation.Data.LDTClass
 {
     public class LDTFileReader
@@ -151,28 +152,35 @@
                 }
                 chapter++;
             }
-           
+
+            Dictionary<String, String> BasicRelation = new Dictionary<string, string>();
+            foreach (LDTRelation LDTR in ldt.BasicRelations)
+            {
+                BasicRelation.Add(LDTR.IdElementTo, LDTR.Type);
+            }
+
             foreach (LDTAnnotationsContent LDTAC in ldt.Annotations)
             {
                int chapterIndex = 0;
                foreach(LDTAnnotationsDecoupage LDTAD  in LDTAC.Content)
                {
                    User author = new User() {UserName = LDTAD.Author };
-                   foreach(LDTElement elem in LDTAD.Elements)
-                   {
+                   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.AnnotationDescriptions[elem.Type],
+                             Type = FactoryVideoLivre.DictionaryAnnotationDescriptions[BasicRelation[elem.Id]],
                                Contributer = author
 
                            });
-                   }
+                   
                  
                }
                chapterIndex++;
--- a/client/src/Iri.Modernisation.Data/Models/FactoryVideoLivre.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Models/FactoryVideoLivre.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -14,12 +14,26 @@
 {
     public static class FactoryVideoLivre
     {
+       
          public static WebClient xmlClient = new WebClient();
          private static XDocument _configDoc; 
          public static VideoChapterDescription[] VideoChapterDescriptions {get;private set;}
+         public static Dictionary<String, PolemicTypeDescription> DictionaryAnnotationDescriptions
+         {
+             get
+             {
+                 Dictionary<String, PolemicTypeDescription> returnDic = new Dictionary<string, PolemicTypeDescription>();
+                 foreach(PolemicTypeDescription Ptd in AnnotationDescriptions)
+                 {
+                     returnDic.Add(Ptd.Title, Ptd);
+                 }
+                 return returnDic;
+             }
+         }
          public static PolemicTypeDescription[] AnnotationDescriptions { get; private set; }
          public static String VideoBookListPath;
          public static String ProductionVideoPath;
+         public static String UpdateBookService;
          public static int NumberOfChapters
          {
              get
@@ -60,6 +74,7 @@
                 int nb = 0;
                 VideoBookListPath = _configDoc.Root.Attribute("VideoBookList").Value;
                 ProductionVideoPath = _configDoc.Root.Attribute("ProductionVideo").Value;
+                UpdateBookService = _configDoc.Root.Attribute("UpdateBookService").Value;
                 foreach (XElement XChapter in _configDoc.Root.Element("VideoBook").Elements())
                 {
                     temp.Add(new VideoChapterDescription(nb, XChapter.Attribute("name").Value, XChapter.Attribute("color").Value));
--- a/client/src/Iri.Modernisation.Data/Models/SettingsProject.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Models/SettingsProject.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -19,15 +19,16 @@
     /// </summary>
     public static class SettingsProject
     {
-        
-        
-        
+
 
+
+        static public User ActualUser { get; set; }
         static public List<VideoBook> ListVideoBook { get; set; }
         static public List<VideoSequence> ProductionVideo { get; set; }
         static public Sync Synchronizer { get; set; }
         static SettingsProject()
         {
+            ActualUser = new User() { UserName = "TestUser" };
             Synchronizer = new Sync();
             Synchronizer.Completed += new EventHandler<EventArgs>(Synchronizer_Completed);
         }
--- a/client/src/Iri.Modernisation.Data/Models/VideoBook.cs	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/src/Iri.Modernisation.Data/Models/VideoBook.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -55,13 +55,17 @@
         /// </summary>
         public String IriPath { get; set; }
 
-        
 
+        public List<PolemicLink> BasicLinks { get; set; }
+
+        public List<PolemicLink> PolemicLinks { get; set; }
         /// <summary>
         /// Constructeur par défaut
         /// </summary>
         public VideoBook()
         {
+            BasicLinks = new List<PolemicLink>();
+            PolemicLinks = new List<PolemicLink>();
             Chapters = new VideoChapter[FactoryVideoLivre.VideoChapterDescriptions.Length];
             for (int nbChapitre = 0; nbChapitre < FactoryVideoLivre.VideoChapterDescriptions.Length; nbChapitre++)
             {
@@ -74,6 +78,78 @@
          
         }
 
+        public LDTFile GetLDTFile()
+        {
+            LDTFile ldt = new LDTFile();
+            ldt.Project = new LDTProject()
+             {
+                 
+             };
+            ldt.Medias = new List<LDTMedia>()
+             {
+                 new LDTMedia()
+                 {
+                     Src = IriPath
+                 }
+             };
+            foreach (VideoChapter Vc in Chapters)
+            {
+                ldt.Annotations.Add(
+                       new LDTAnnotationsContent()
+                       {
+
+                       });
+                foreach (Annotation An in Vc.Annotations)
+                {
+                    LDTAnnotationsDecoupage decoupage = new LDTAnnotationsDecoupage()
+                    {
+                        Title = Vc.Title,
+                        Author = SettingsProject.ActualUser.UserName
+                    };
+                    decoupage.Elements.Add(
+                                            new LDTElement()
+                                            {
+                                                Id = An.Id,
+                                                Title = An.Title,
+                                                Abstract = An.Description,
+                                                Date = DateTime.Now,
+                                                Begin = An.TimerIn.TotalMilliseconds,
+                                                Dur = An.Duration.TotalMilliseconds,
+                                                Tags = An.Tags,
+                                                Author = SettingsProject.ActualUser.UserName,
+                                            }
+                                                );
+
+
+
+                    ldt.Annotations[ldt.Annotations.Count - 1].Content.Add(decoupage);
+                }
+                foreach (PolemicLink Pl in BasicLinks)
+                {
+                    ldt.BasicRelations.Add(new LDTRelation()
+                    {
+                        Type = Pl.Type.Title,
+                        IdElementFrom = Pl.FromElement.Id,
+                        IdElementTo = Pl.ToElement.Id,
+                        Title = Pl.ToElement.Title
+                    });
+                }
+                foreach (PolemicLink Pl in PolemicLinks)
+                {
+                    ldt.PolemicRelations.Add(new LDTRelation()
+                    {
+                        Type = Pl.Type.Title,
+                        IdElementFrom = Pl.FromElement.Id,
+                        IdElementTo = Pl.ToElement.Id,
+                        Title = Pl.ToElement.Title
+                    });
+                   
+                }
+               
+            }
+            return ldt;
+        }
+
       
 
         /// <summary>
@@ -128,36 +204,61 @@
         {
             ldt = ((LoaderEventArgs<LDTFile>)e).CreatedObject;
             ldt.Annotations.Clear();
+            
             foreach (VideoChapter Vc in videoBookToUpdate.Chapters)
             {
-                LDTAnnotationsDecoupage decoupage = new LDTAnnotationsDecoupage()
+                 ldt.Annotations.Add(
+                        new LDTAnnotationsContent()
+                        {
+                         
+                        });
+                foreach(Annotation An in Vc.Annotations)
+                {
+                    LDTAnnotationsDecoupage decoupage = new LDTAnnotationsDecoupage()
                     {
                         Title = Vc.Title,
-                        Id = Vc.IdChap.ToString()
+                        Author = SettingsProject.ActualUser.UserName
                     };
-                foreach(Annotation An in Vc.Annotations)
-                {
                     decoupage.Elements.Add(
                                             new LDTElement()
                                             {
+                                                Id = An.Id,
                                                 Title = An.Title,
                                                 Abstract = An.Description,
                                                 Date = DateTime.Now,
                                                 Begin = An.TimerIn.TotalMilliseconds,
                                                 Dur = An.Duration.TotalMilliseconds,
                                                 Tags = An.Tags,
-                                               Type =  An.Type.Id
+                                                Author = SettingsProject.ActualUser.UserName,
                                             }
-                                            );
-                }
+                                                );
+                  
+
 
-                ldt.Annotations.Add(
-                        new LDTAnnotationsContent()
+                    ldt.Annotations[ldt.Annotations.Count - 1].Content.Add(decoupage);
+                }
+                foreach (PolemicLink Pl in videoBookToUpdate.BasicLinks)
+                {
+                    ldt.BasicRelations.Add(new LDTRelation()
                         {
-                            Content = new List<LDTAnnotationsDecoupage>() { decoupage},
+                            Type = Pl.Type.Title,
+                            IdElementFrom = Pl.FromElement.Id,
+                            IdElementTo = Pl.ToElement.Id,
+                            Title = Pl.ToElement.Title
                         });
+                }
+                foreach (PolemicLink Pl in videoBookToUpdate.PolemicLinks)
+                {
+                    ldt.PolemicRelations.Add(new LDTRelation()
+                    {
+                        Type = Pl.Type.Title,
+                        IdElementFrom = Pl.FromElement.Id,
+                        IdElementTo = Pl.ToElement.Id,
+                        Title = Pl.ToElement.Title
+                    });
+                }
             }
-
+           
                      WebClient WebWriter = new WebClient();
             
                
@@ -190,13 +291,13 @@
                 fs.Close();
 
             }*/
-           
-                using (StreamWriter fs = Sw)
-                {
+
+            StreamWriter fs = Sw;
+         
                   
                     fs.Write(ldt.ToString());
                     fs.Close();
-                }
+               
             
             /*StreamWriter fs = new StreamWriter(e.Result);
             //MessageBox.Show(ldt.ToString());
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/AvailableVideoBooks.xml	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/AvailableVideoBooks.xml	Tue Feb 09 15:30:46 2010 +0100
@@ -8,7 +8,7 @@
 	-->
 	<VideoBooks metafile="/Content/FranceInterENMI28.ldt" title="France Inter ENMI 28-11-2009"/>
   <VideoBooks  metafile="/Content/FranceInterENMI29.ldt" title="France Inter ENMI 29-11-2009"/>
-    <VideoBooks  metafile="/Content/test.ldt" title="France Inter ETest"/>
+   <VideoBooks metafile="/Content/test2.ldt" title="Test"/>
   <!--<<VideoBooks  metafile="/Content/ENMI08-III_elizabethrosse-psychologie_et_reseaux_sociaux-jauffret.ldt" title="Titre 3"/>-->
   
 </AvailableVideoBooks>
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/FranceInterENMI29.ldt	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/FranceInterENMI29.ldt	Tue Feb 09 15:30:46 2010 +0100
@@ -1,39 +1,62 @@
 <iri xmlns:dc="http://dublincore.org/documents/dcmi-namespace/">
-  <project id="1" user="" title="France Inter ENMI 29-11-2009" abstract=""/>
+  <project id="0" user="" title="" abstract="" />
   <medias>
-    <media id="iri_matinalefi29nov2009" src="/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri" video="" pict="" extra=""/>
+    <media id="" src="/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri" video="" pict="" extra="" />
   </medias>
   <annotations>
-
-</annotations>
-  <displays>
-    <display id="0" title="View at the last recording" idsel="iri_matinalefi29nov2009" tc="3369796" zoom="20" scroll="100" infoBAB="">
-      <content id="iri_matinalefi28nov2009">
-        <decoupage idens="en_2" id="de_PPP" tagsSelect=""/>
-        <decoupage idens="ens_perso" id="c_523A9725-8128-E51D-D51C-B0E861656A29" tagsSelect=""/>
-      </content>
-      <content id="iri_matinalefi29nov2009">
-        <decoupage idens="en_2" id="de_PPP" tagsSelect=""/>
-        <decoupage idens="ens_perso" id="c_05607756-2F9A-9E05-638E-3190B6F8AB87" tagsSelect=""/>
-      </content>
-    </display>
-  </displays>
-  <edits>
-    <editing id="0" tags="">
-      <title>Bout à bout 1</title>
-      <abstract/>
-      <edit id="edit1" tags="">
-        <eList/>
-        <caption/>
-        <audio/>
-        <mList/>
-      </edit>
-      <edit id="edit2" tags="">
-        <eList/>
-        <caption/>
-        <audio/>
-        <mList/>
-      </edit>
-    </editing>
-  </edits>
+    <content id="293da7d3-967b-47f6-80aa-151d03761251" title="" author="" abstract="">
+      <decoupage id="a4906e03-68b4-490e-bc2d-73626c8044ef" author="TestUser">
+        <title>Emission France Culture</title>
+        <abstract></abstract>
+        <elements>
+          <element id="f511d11a-8627-4c56-b40c-0e24115d5eaa" begin="0" dur="636088" author="TestUser" date="09/02/2010 15:25:01" color="0" src="">
+            <title>aze</title>
+            <abstract>ze</abstract>
+            <audio></audio>
+            <video></video>
+            <tags>
+              <tag>aze</tag>
+            </tags>
+          </element>
+        </elements>
+      </decoupage>
+      <decoupage id="8498b671-e918-4adf-a23b-7e3595ddfbd2" author="TestUser">
+        <title>Emission France Culture</title>
+        <abstract></abstract>
+        <elements>
+          <element id="358f746a-57ad-43f4-ad9b-1520ecbaf3b8" begin="847179" dur="94825" author="TestUser" date="09/02/2010 15:25:01" color="0" src="">
+            <title>tt</title>
+            <abstract>tt</abstract>
+            <audio></audio>
+            <video></video>
+            <tags>
+              <tag>tt</tag>
+            </tags>
+          </element>
+        </elements>
+      </decoupage>
+      <decoupage id="2ae5a2e2-cd2a-4e82-aa3b-e3318b8a92a7" author="TestUser">
+        <title>Emission France Culture</title>
+        <abstract></abstract>
+        <elements>
+          <element id="c47def89-499a-420f-96cb-e5f401da8664" begin="1004233" dur="70378" author="TestUser" date="09/02/2010 15:25:01" color="0" src="">
+            <title>ar</title>
+            <abstract>arar</abstract>
+            <audio></audio>
+            <video></video>
+            <tags>
+              <tag>arar</tag>
+            </tags>
+          </element>
+        </elements>
+      </decoupage>
+    </content>
+  </annotations>
+  <displays />
+  <edits />
+  <basicRelations>
+    <relation idElementFrom="s_F47370B1-C509-1630-A07B-748EAB0156D8" idElementTo="358f746a-57ad-43f4-ad9b-1520ecbaf3b8" title="tt" type="Adhésion" />
+    <relation idElementFrom="s_F47370B1-C509-1630-A07B-748EAB0156D8" idElementTo="c47def89-499a-420f-96cb-e5f401da8664" title="ar" type="Question" />
+  </basicRelations>
+  <polemicRelations />
 </iri>
\ No newline at end of file
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/iri_matinalefi28nov2009/iri_matinalefi28nov2009.iri	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/iri_matinalefi28nov2009/iri_matinalefi28nov2009.iri	Tue Feb 09 15:30:46 2010 +0100
@@ -832,7 +832,7 @@
 		<links/>
 		<medias>
 			<media id="video">
-				<video dur="7231314" begin="0" src="http://localhost:2831/Content/iri_matinalefi28nov2009/iri_matinalefi28nov2009.mp3" id="a1" q=""/>
+				<video dur="7231314" begin="0" src="http://localhost:11137/Content/iri_matinalefi28nov2009/iri_matinalefi28nov2009.mp3" id="a1" q=""/>
 			</media>
 		</medias>
 		<display>
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri	Tue Feb 09 15:30:46 2010 +0100
@@ -541,7 +541,7 @@
 		<links/>
 		<medias>
 			<media id="video">
-				<video dur="7209241" begin="0" src="http://localhost:2831/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.mp3" id="a1" q="0"/>
+				<video dur="7209241" begin="0" src="http://localhost:11137/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.mp3" id="a1" q="0"/>
 			</media>
 		</medias>
 		<display>
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/test.ldt	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Content/test.ldt	Tue Feb 09 15:30:46 2010 +0100
@@ -1,90 +1,25 @@
 <iri xmlns:dc="http://dublincore.org/documents/dcmi-namespace/">
-  <project id="1" user="" title="France Inter ENMI 28-11-2009" abstract="" />
+  <project id="1" user="" title="France Inter ENMI 29-11-2009" abstract="" />
   <medias>
-    <media id="iri_matinalefi28nov2009" src="/Content/iri_matinalefi28nov2009/iri_matinalefi28nov2009.iri" video="" pict="" extra="" />
+    <media id="iri_matinalefi29nov2009" src="/Content/iri_matinalefi29nov2009/iri_matinalefi29nov2009.iri" video="" pict="" extra="" />
   </medias>
   <annotations>
-    <content id="6c62a798-16be-4a18-9ca1-16b91b14d6ca" title="" author="" abstract="">
-      <decoupage id="0" author="TestUser">
+    <content id="8f534a40-e9d0-4bd3-91ab-c4a0e08b38f6" title="" author="" abstract="">
+      <decoupage id="461cb9b2-bd8f-4b2a-a03a-5158508fc6de" author="TestUser">
         <title>Emission France Culture</title>
         <abstract></abstract>
         <elements>
-          <element id="90f23dfc-324b-47df-9e14-54e491d0b51d" begin="891498" dur="159061" author="" date="04/02/2010 14:39:51" color="0" src="" type="0">
-            <title>a</title>
-            <abstract>a</abstract>
-            <audio></audio>
-            <video></video>
-            <tags>
-              <tag>a</tag>
-            </tags>
-          </element>
-          <element id="c87757f7-b519-42dc-810c-83310b6ea1d5" begin="0" dur="105542" author="" date="04/02/2010 14:39:51" color="0" src="" type="1">
-            <title>b</title>
-            <abstract>b</abstract>
-            <audio></audio>
-            <video></video>
-            <tags>
-              <tag>b</tag>
-            </tags>
-          </element>
-          <element id="204c9408-c5a5-4c7b-94a9-3270d12f0760" begin="2927520" dur="94402" author="" date="04/02/2010 14:39:51" color="0" src="" type="0">
-            <title>c</title>
-            <abstract>c</abstract>
+          <element id="d1f2ec3a-5e97-40b2-9165-59ff9982a2df" begin="0" dur="636088" author="TestUser" date="08/02/2010 14:05:58" color="0" src="">
+            <title>r</title>
+            <abstract>r</abstract>
             <audio></audio>
             <video></video>
             <tags>
-              <tag>c</tag>
-            </tags>
-          </element>
-          <element id="0cab7299-eff6-4eb9-82b2-be43a676aeb1" begin="2983463" dur="38459" author="" date="04/02/2010 14:39:51" color="0" src="" type="3">
-            <title>d</title>
-            <abstract>d</abstract>
-            <audio></audio>
-            <video></video>
-            <tags>
-              <tag>d</tag>
+              <tag>r</tag>
             </tags>
           </element>
         </elements>
       </decoupage>
-      <decoupage id="c_A7D4BEFE-2057-CCE9-6E10-98AC7F6B3637" author="Z05">
-        <title>Oui mais ?</title>
-        <abstract/>
-        <elements>
-          <element id="s_91643FBC-B631-E2FC-6E2F-98AC7F6D5C71" begin="1077424" dur="92756" author="" date="2010/02/04" color="16776960" type="3" src="">
-            <title>Z05</title>
-            <abstract>Peut on vraiment prétendre répondre à une telle question sans étudier au préalable le sens de chaque mot ?</abstract>
-            <audio/>
-            <tags/>
-          </element>
-        </elements>
-      </decoupage>
-      <decoupage id="c_FB6B1873-22A2-6A49-C03D-989BBD09C7D8" author="G-raldo">
-      
-<decoupage id="c_B1794278-6C32-D485-4FD6-988ECA9DFE02" author="Julius">
-        <title>Annot Julius </title>
-        <abstract/>
-        <elements>
-          <element id="s_47AEC12D-AB8D-955B-1D39-988F36640629" begin="1371138" dur="74041" author="" date="2010/02/04" color="65280" src="" type="1">
-            <title>Notre mémoire</title>
-            <abstract>Si les objets nous constituent et s'ils sont à ce point tracables, alors c'est nous-même qui seront tracables à travers nos faits et gestes. La notion de mémoire devrait considérablement changer.</abstract>
-            <audio/>
-            <tags/>
-          </element>
-        </elements>
-      </decoupage>
-            
-        <title></title>
-        <abstract/>
-        <elements>
-          <element id="s_33A2B55A-A04F-DE70-BFE9-989C2665F0FC" begin="1320415" dur="123278" author="" date="2010/02/04" color="16776960" src="" type="2">
-            <title>Référence</title>
-            <abstract>Sur la tracabilité, voir http://www.tracenews.info/</abstract>
-            <audio/>
-            <tags/>
-          </element>
-        </elements>
-      </decoupage>
     </content>
   </annotations>
   <displays>
@@ -111,5 +46,8 @@
       </edit>
     </editing>
   </edits>
-  <relations />
+  <basicRelations>
+    <relation idElementFrom="s_92506216-25D0-6E9F-A10B-748EAAFA09B9" idElementTo="d1f2ec3a-5e97-40b2-9165-59ff9982a2df" title="r" type="Polémique" />
+  </basicRelations>
+  <polemicRelations />
 </iri>
\ No newline at end of file
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/FranceCulture.Web.csproj	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/FranceCulture.Web.csproj	Tue Feb 09 15:30:46 2010 +0100
@@ -33,6 +33,9 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Iri.Modernisation.Data">
+      <HintPath>..\..\..\..\src\Iri.Modernisation.Data\Bin\Debug\Iri.Modernisation.Data.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Web.DynamicData" />
     <Reference Include="System.Web.Entity" />
@@ -42,7 +45,6 @@
     <Reference Include="System.Core" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="System.Web.Extensions" />
-    <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Web" />
     <Reference Include="System.Xml" />
@@ -50,12 +52,14 @@
     <Reference Include="System.Web.Services" />
     <Reference Include="System.EnterpriseServices" />
     <Reference Include="System.Web.Mobile" />
+    <Reference Include="System.Xml.Linq" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="ClientBin\FranceCulture.xap" />
     <Content Include="FranceCultureTestPage.aspx" />
     <Content Include="FranceCultureTestPage.html" />
     <Content Include="Silverlight.js" />
+    <Content Include="UpdateBookService.aspx" />
     <Content Include="Web.config" />
     <Content Include="Web.Debug.config">
       <DependentUpon>Web.config</DependentUpon>
@@ -66,6 +70,13 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="UpdateBookService.aspx.cs">
+      <DependentUpon>UpdateBookService.aspx</DependentUpon>
+      <SubType>ASPXCodeBehind</SubType>
+    </Compile>
+    <Compile Include="UpdateBookService.aspx.designer.cs">
+      <DependentUpon>UpdateBookService.aspx</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup />
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
@@ -76,7 +87,7 @@
         <WebProjectProperties>
           <UseIIS>False</UseIIS>
           <AutoAssignPort>True</AutoAssignPort>
-          <DevelopmentServerPort>6048</DevelopmentServerPort>
+          <DevelopmentServerPort>6848</DevelopmentServerPort>
           <DevelopmentServerVPath>/</DevelopmentServerVPath>
           <IISUrl>
           </IISUrl>
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/ProjectConfig.xml	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/ProjectConfig.xml	Tue Feb 09 15:30:46 2010 +0100
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ProjectConfig 
 	VideoBookList="/Content/AvailableVideoBooks.xml"
+	UpdateBookService="http://localhost:6848/UpdateBookService.aspx"
 	ProductionVideo="/ProductionContent/ProductionVideo.xml"
 >
 	<VideoBook>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/UpdateBookService.aspx	Tue Feb 09 15:30:46 2010 +0100
@@ -0,0 +1,17 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdateBookService.aspx.cs" Inherits="FranceCulture.Web.UpdateBookService" %>
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+    <title></title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+  
+    </div>
+    </form>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/UpdateBookService.aspx.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.IO;
+using System.Xml.Linq;
+using Iri.Modernisation.Data.LDTClass;
+namespace FranceCulture.Web
+{
+    public partial class UpdateBookService : System.Web.UI.Page
+    {
+
+        protected void Page_Load(object sender, EventArgs e)
+        {
+            
+            
+              
+            // Recive Data
+            // ldtFileURI & newAnnotation
+
+                String DecodeData = Server.HtmlDecode(Request.Form["newAnnotation"]);
+
+                //String saveURI = Server.MapPath(".") + Request.Form["ldtFileURI"];
+                String SaveURI = Server.MapPath("./") + Request.Form["ldtFileURI"].Replace("/", @"\\");
+                StreamWriter monStreamWriter = new StreamWriter(SaveURI);
+               // monStreamWriter.Write(fileLdt.ToString());
+                monStreamWriter.Write(DecodeData);
+                // Fermeture du StreamWriter (
+                monStreamWriter.Close();
+           
+         
+          
+        }
+        
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/UpdateBookService.aspx.designer.cs	Tue Feb 09 15:30:46 2010 +0100
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace FranceCulture.Web
+{
+
+
+    public partial class UpdateBookService
+    {
+
+        /// <summary>
+        /// form1 control.
+        /// </summary>
+        /// <remarks>
+        /// Auto-generated field.
+        /// To modify move field declaration from designer file to code-behind file.
+        /// </remarks>
+        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+    }
+}
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Web.Debug.config	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Web.Debug.config	Tue Feb 09 15:30:46 2010 +0100
@@ -15,6 +15,7 @@
     </connectionStrings>
   -->
   <system.web>
+   
     <!--
       In the example below, the "Replace" transform will replace the entire 
       <customErrors> section of your web.config file.
--- a/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Web.config	Thu Feb 04 16:38:04 2010 +0100
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/Web.config	Tue Feb 09 15:30:46 2010 +0100
@@ -3,9 +3,10 @@
 
     <system.web>
         <compilation debug="true" targetFramework="4.0" />
+
     </system.web>
     <system.webServer>
       <modules runAllManagedModulesForAllRequests="true"/>
     </system.webServer>
-
+    
 </configuration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/clientaccesspolicy.xml	Tue Feb 09 15:30:46 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<access-policy>
+  <cross-domain-access>
+    <policy>
+      <allow-from http-request-headers="*">
+        <domain uri="*"/>
+      </allow-from>
+      <grant-to>
+        <resource path="/"
+            include-subpaths="true"/>
+      </grant-to>
+    </policy>
+  </cross-domain-access>
+</access-policy>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/test/FranceCulture/FranceCulture/FranceCulture.Web/crossdomain.xml	Tue Feb 09 15:30:46 2010 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+  <allow-http-request-headers-from domain="*" headers="*"/>
+</cross-domain-policy>
\ No newline at end of file