mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9367. Added new/improved Unit Tests in area of tagged blogposts and sorted result sets.
Also fixed a bug-ette whereby for 'get all' blogposts, the drafts at the end where sorted the wrong way. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29071 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -137,17 +137,17 @@ public class DraftsAndPublishedBlogPostsCannedQuery extends AbstractCannedQueryP
|
||||
}
|
||||
|
||||
List<Pair<? extends Object, SortOrder>> sortPairs = parameters.getSortDetails().getSortPairs();
|
||||
// For now, the BlogService only sorts by a single property.
|
||||
if (sortPairs != null && !sortPairs.isEmpty())
|
||||
{
|
||||
Pair<? extends Object, SortOrder> sortPair = sortPairs.get(0);
|
||||
|
||||
QName sortProperty = (QName) sortPair.getFirst();
|
||||
final PropertyBasedComparator comparator = new PropertyBasedComparator(sortProperty);
|
||||
|
||||
if (sortPair.getSecond() == SortOrder.DESCENDING)
|
||||
for (Pair<? extends Object, SortOrder> sortPair : sortPairs)
|
||||
{
|
||||
Collections.sort(filtered, Collections.reverseOrder(comparator));
|
||||
QName sortProperty = (QName) sortPair.getFirst();
|
||||
final PropertyBasedComparator comparator = new PropertyBasedComparator(sortProperty);
|
||||
|
||||
if (sortPair.getSecond() == SortOrder.DESCENDING)
|
||||
{
|
||||
Collections.sort(filtered, Collections.reverseOrder(comparator));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user