/// <summary> /// A list of TopicChanges to a topic since a given date [sorted by date] /// </summary> /// <param name="topic">A given date</param> /// <param name="stamp">A non-null timestamp; changes before this time won't be included in the answer </param> /// <param name="rule">A composite cache rule to fill with rules that represented accumulated dependencies (or null)</param> /// <returns>Enumeration of TopicChanges</returns> public override TopicChangeCollection AllChangesForTopicSince(UnqualifiedTopicName topic, DateTime stamp) { TopicChangeCollection answer = new TopicChangeCollection(); SqlInfoForTopic[] infos = _sqlHelper.GetSqlTopicInfosForTopicSince(Namespace, topic.LocalName, stamp); ArrayList sortable = new ArrayList(); foreach (SqlInfoForTopic each in infos) { sortable.Add(new SqlInfoTopicData(each, Namespace)); } sortable.Sort(new TimeSort()); foreach (TopicData each in sortable) { if (each.LastModificationTime < stamp) { continue; } QualifiedTopicRevision name = new QualifiedTopicRevision(topic.LocalName, Namespace); name.Version = each.Version; TopicChange change = TopicChangeFromName(name); answer.Add(change); } return answer; }
// Methods /// <summary> /// A list of TopicChanges to a topic since a given date [sorted by date] /// </summary> /// <param name="stamp">Specifies that we are only interested in changes after this date.</param> /// <param name="stamp">A non-null timestamp; changes before this time won't be included in the answer </param> /// <returns>Enumeration of TopicChanges</returns> /// <remarks>Returns a collection with zero elements in it when the topic name does not exist, or has been deleted, /// or if the calling user does not have the <see cref="Permission.Read"/> permission.</remarks> public override TopicChangeCollection AllChangesForTopicSince(UnqualifiedTopicName topic, DateTime stamp) { TopicChangeCollection answer = new TopicChangeCollection(); FileInfo[] infos = FileInfosForTopic(topic.LocalName); ArrayList sortable = new ArrayList(); foreach (FileInfo each in infos) { sortable.Add(new FileInfoTopicData(each, Namespace)); } sortable.Sort(new TimeSort()); foreach (TopicData each in sortable) { if (each.LastModificationTime < stamp) { continue; } QualifiedTopicRevision name = new QualifiedTopicRevision(topic.ResolveRelativeTo(Namespace)); name.Version = each.Version; TopicChange change = TopicChangeFromName(name); answer.Add(change); } return answer; }
// Methods /// <summary> /// A list of TopicChanges to a topic since a given date [sorted by date] /// </summary> /// <param name="stamp">Specifies that we are only interested in changes after this date.</param> /// <param name="stamp">A non-null timestamp; changes before this time won't be included in the answer </param> /// <returns>Enumeration of TopicChanges</returns> /// <remarks>Returns a collection with zero elements in it when the topic name does not exist, or has been deleted, /// or if the calling user does not have the <see cref="Permission.Read"/> permission.</remarks> public override TopicChangeCollection AllChangesForTopicSince(UnqualifiedTopicName topic, DateTime stamp) { TopicChangeCollection answer = new TopicChangeCollection(); FileInformationCollection infos = FileInfosForTopic(topic.LocalName); ArrayList sortable = new ArrayList(); foreach (IFileInformation each in infos) { sortable.Add(new FileInfoTopicData(each, Namespace)); } sortable.Sort(new TimeSort()); foreach (TopicData each in sortable) { if (each.LastModificationTime < stamp) { continue; } QualifiedTopicRevision name = new QualifiedTopicRevision(topic.ResolveRelativeTo(Namespace)); name.Version = each.Version; // Version might be null if we grabbed the .wiki file instead of a .awiki file if (each.Version == null) { answer.Add(new TopicChange(name, each.LastModificationTime, "")); } else { TopicChange change = TopicChangeFromName(name); answer.Add(change); } } return answer; }
public override TopicChangeCollection AllChangesForTopicSince(UnqualifiedTopicName topicName, DateTime stamp) { MockTopic topic = GetTopic(topicName, ExistencePolicy.ExistingOnly); // If the topicName does not exist, return a null list if (topic == null) { return null; } TopicChangeCollection changes = new TopicChangeCollection(); foreach (MockTopicHistory topicHistory in topic.History) { if (topicHistory.Created >= stamp) { QualifiedTopicRevision namespaceQualifiedTopic = new QualifiedTopicRevision(topicName.LocalName, Namespace); namespaceQualifiedTopic.Version = TopicRevision.NewVersionStringForUser(topicHistory.Author, topicHistory.Created); changes.Add(new TopicChange(namespaceQualifiedTopic, topicHistory.Created, topicHistory.Author)); } } return changes; }