I want to display the components modified by particular user using core service for which I m using SearchQueryData filter. I m getting the list of modified components but details of user who last modified the component is missing. For getting these details I m iterating through each item and getting the Version history but doing this way degrades the performance.
Here is the code:
//search query
SearchQueryData filter = new SearchQueryData();
filter.ModifiedAfter = fromDate;
filter.ModifiedBefore = toDate;
filter.ItemTypes = new ItemType[]
{
ItemType.Component,
ItemType.ComponentTemplate,
ItemType.Page,
ItemType.PageTemplate,
ItemType.Publication,
ItemType.Schema
};
filter.BlueprintStatus = SearchBlueprintStatus.Unspecified;
filter.SearchIn = new LinkToIdentifiableObjectData { Title = publicationId };
//returns the list of items changed by date
IdentifiableObjectData[] dataModified = client.GetSearchResults(filter);
List<IdentifiableObjectData> modifiedData_User = new List<IdentifiableObjectData>();
//iterate through each item and get the details of the user who modified this item
foreach (var d in dataModified)
{
VersionsFilterData versionsFilter = new VersionsFilterData();
versionsFilter.IncludeRevisorDescriptionColumn = true;
IdentifiableObjectData versionList = client.GetList(d.Id, versionsFilter).Last();
var versionInfo = (FullVersionInfo)versionList.VersionInfo;
LinkToUserData revisor = versionInfo.Revisor;
if (revisor.Title.ToLower() == username.ToLower())
modifiedData_User.Add(d);
}
1) Can I get the details of user who modified the component using SearchQueryDataFilter so that I dont have to iterate through the result. 2) Is there any better way through which this can be achieved.