Get changed page count from a week back

376 views Asked by At

I want a widget on the front page of an intranet. It should display the count of number of pages that have been changed n number of days back.

I tried something like this, but it always returns 0

var changeLog = (IChangeLog)ClassFactory.CreateInstance(typeof(IChangeLog), new object[0]);
ChangeLogQueryInfo query = new ChangeLogQueryInfo();
query.From = DateTime.Now.AddDays(-7);
query.Category = new int?(1);
query.Action = (int)ChangeLogPage.ActionType.Publish;
query.MaxRecordsToReturn = 100;
return changeLog.GetChangeCountBackwards(query);

Any suggestions?

1

There are 1 answers

2
tompipe On

Silly question but is the change log enabled?

Have you tried

IList<IChangeLogItem> list = changeLog.GetChanges(query, ReadDirection.Backwards, SortOrder.Descending);

Do you get any results?

Also it's worth noting that using the change log is unsupported