/// <summary> /// Generates a complete new ring into the provided <paramref name="ring" /> dataset. This should produce a complete 24 hour active ring which has no /// other logic then playing the right things at the right time, independet of the past. /// </summary> /// <param name="db">The source database</param> /// <param name="computerName">The name of the computer this ring is generated for.</param> /// <param name="ring">The target ring where all the generated data should be inserted at.</param> /// <remarks> /// Things which need to be done: /// <para>Set <see cref="RingMetaData.SenderId" /> to the targeting sender id.</para> /// <para>Generate <see cref="PageGroup" />s inside the database.</para> /// <para> /// Generate <see cref="Page" />s with the associated content (<see cref="Text" />, <see cref="Image" /> <see cref="Video" />, /// <see cref="DoubleTransition" />). /// </para> /// <para> /// Generate <see cref="PageSchedule" />s. <see cref="PageSchedule" />s in sequence which belongs to the same <see cref="PageGroup" /> needs to /// have the same <see cref="PageSchedule.PageGroupScheduleId" />. /// </para> /// </remarks> public void Generate(MultiMedia db, string computerName, RingMetaData ring) { MMSender sender = GetMMSenderFromSenderOrComputerName(db, computerName); ring.SenderId = sender.Id; sender.DataSet.SetHasBeenLoaded(); DistributionRoot DistributionRootInstance = new DistributionRoot(db, ring); DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded(); DistributionRootInstance.LoadActuallBalancers(sender); RingGenerator ringGenerator = new RingGenerator(sender, ring, DateTime.Now); ringGenerator.Generate(); }
public void Init() { SourceDb.LoadAll_IfHasNotBeenLoaded(); //SourceDb.LoadAllForScheduling_IfHasNotBeenLoaded(); TargetDb.LoadSchema(); foreach (CsDbTable table in TargetDb.Tables) { table.HasBeenLoaded = true; } DistributionRootInstance = new DistributionRoot(SourceSender.DataSet, TargetRing); DistributionRootInstance.LoadActuallBalancers(SourceSender); }