Refactor ordering in services to support listviews variants sorting
This commit is contained in:
@@ -1746,7 +1746,7 @@ WHERE cmsContentXml.nodeId IN (
|
||||
long total;
|
||||
do
|
||||
{
|
||||
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
|
||||
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
const bool published = true; // contentXml contains published content!
|
||||
var items = descendants.Select(c => new ContentXmlDto { NodeId = c.Id, Xml =
|
||||
EntityXmlSerializer.Serialize(_serviceContext.ContentService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, c, published).ToDataString() }).ToArray();
|
||||
@@ -1819,7 +1819,7 @@ WHERE cmsPreviewXml.nodeId IN (
|
||||
{
|
||||
// .GetPagedResultsByQuery implicitely adds ({Constants.DatabaseSchema.Tables.Document}.newest = 1) which
|
||||
// is what we want for preview (ie latest version of a content, published or not)
|
||||
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
|
||||
var descendants = _documentRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
const bool published = true; // previewXml contains edit content!
|
||||
var items = descendants.Select(c => new PreviewXmlDto
|
||||
{
|
||||
@@ -1892,7 +1892,7 @@ WHERE cmsContentXml.nodeId IN (
|
||||
long total;
|
||||
do
|
||||
{
|
||||
var descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
|
||||
var descendants = _mediaRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml =
|
||||
EntityXmlSerializer.Serialize(_serviceContext.MediaService, _serviceContext.DataTypeService, _serviceContext.UserService, _serviceContext.LocalizationService, _segmentProviders, m).ToDataString() }).ToArray();
|
||||
db.BulkInsertRecords(items);
|
||||
@@ -1961,7 +1961,7 @@ WHERE cmsContentXml.nodeId IN (
|
||||
long total;
|
||||
do
|
||||
{
|
||||
var descendants = _memberRepository.GetPage(query, pageIndex++, groupSize, out total, "Path", Direction.Ascending, true);
|
||||
var descendants = _memberRepository.GetPage(query, pageIndex++, groupSize, out total, null, Ordering.By("Path"));
|
||||
var items = descendants.Select(m => new ContentXmlDto { NodeId = m.Id, Xml = EntityXmlSerializer.Serialize(_serviceContext.DataTypeService, _serviceContext.LocalizationService, m).ToDataString() }).ToArray();
|
||||
db.BulkInsertRecords(items);
|
||||
processed += items.Length;
|
||||
|
||||
Reference in New Issue
Block a user