protected void StartPage() { if (Federation.GetPerformanceCounter(Federation.PerformanceCounterNames.TopicReads) != null) Federation.GetPerformanceCounter(Federation.PerformanceCounterNames.TopicReads).Increment(); MainEvent = TheFederation.LogEventFactory.CreateAndStartEvent(Request.UserHostAddress, VisitorIdentityString, GetTopicName().ToString(), LogEvent.LogEventType.ReadTopic); VisitorEvent e = new VisitorEvent(GetTopicName(), VisitorEvent.Read, DateTime.Now); LogVisitorEvent(e); }
protected void StartPage() { if (Federation.GetPerformanceCounter(PerformanceCounterNames.TopicsCompared) != null) { Federation.GetPerformanceCounter(PerformanceCounterNames.TopicsCompared).Increment(); } _mainEvent = Federation.LogEventFactory.CreateAndStartEvent(Request.UserHostAddress, VisitorIdentityString, RequestedTopic.LocalName, LogEventType.CompareTopic); VisitorEvent e = new VisitorEvent(RequestedTopic, VisitorEvent.Compare, DateTime.Now); LogVisitorEvent(e); }
// protected AbsoluteTopicName GetTopicName() // { // string topic; // // string topicFromQueryString = Request.QueryString["topic"]; // if (topicFromQueryString != null) // topic = topicFromQueryString; // else // { // topic = Request.PathInfo; // if (topic.StartsWith("/")) // topic = topic.Substring(1); // } // // RelativeTopicName rel; // if (topic == null || topic.Length == 0) // rel = new RelativeTopicName(DefaultContentBase.HomePage, DefaultContentBase.Namespace); // else // rel = new RelativeTopicName(topic); // IList topics = DefaultContentBase.AllAbsoluteTopicNamesThatExist(rel); // if (topics.Count == 0) // return rel.AsAbsoluteTopicName(DefaultContentBase.Namespace); // topic doesn't exist, assume in the wiki's home content base // if (topics.Count > 1) // { // throw TopicIsAmbiguousException.ForTopic(rel); // } // AbsoluteTopicName answer = (AbsoluteTopicName)topics[0]; // answer.Version = rel.Version; // return answer; // } /// <summary> /// Add a visitor event to the session state VisitorEvents /// </summary> /// <param name="e"></param> protected void LogVisitorEvent(VisitorEvent e) { ArrayList list = (ArrayList)(System.Web.HttpContext.Current.Session["VisitorEvents"]); if (list == null) { list = new ArrayList(); System.Web.HttpContext.Current.Session["VisitorEvents"] = list; } list.Insert(0, e); // Adding to the front means we're keeping it sorted with latest first }