Example usage for com.liferay.portal.kernel.util.comparator LayoutPrototypeCreateDateComparator LayoutPrototypeCreateDateComparator

List of usage examples for com.liferay.portal.kernel.util.comparator LayoutPrototypeCreateDateComparator LayoutPrototypeCreateDateComparator

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util.comparator LayoutPrototypeCreateDateComparator LayoutPrototypeCreateDateComparator.

Prototype

public LayoutPrototypeCreateDateComparator(boolean ascending) 

Source Link

Usage

From source file:com.liferay.layout.prototype.web.internal.display.context.LayoutPrototypeDisplayContext.java

License:Open Source License

public SearchContainer getSearchContainer() {
    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    SearchContainer searchContainer = new SearchContainer(_renderRequest, _renderResponse.createRenderURL(),
            null, "there-are-no-page-templates");

    if (isShowAddButton()) {
        searchContainer/*  ww  w .jav  a 2 s .  c o m*/
                .setEmptyResultsMessageCssClass("there-are-no-page-templates.-you-can-add-a-page-template-by-"
                        + "clicking-the-plus-button-on-the-bottom-right-corner");
        searchContainer.setEmptyResultsMessageCssClass("taglib-empty-result-message-header-has-plus-btn");
    }

    searchContainer.setId("layoutPrototype");
    searchContainer.setRowChecker(new EmptyOnClickRowChecker(_renderResponse));

    boolean orderByAsc = false;

    if (getOrderByType().equals("asc")) {
        orderByAsc = true;
    }

    OrderByComparator<LayoutPrototype> orderByComparator = new LayoutPrototypeCreateDateComparator(orderByAsc);

    searchContainer.setOrderByCol(getOrderByCol());
    searchContainer.setOrderByComparator(orderByComparator);
    searchContainer.setOrderByType(getOrderByType());

    searchContainer.setTotal(getTotal());

    List results = LayoutPrototypeLocalServiceUtil.search(themeDisplay.getCompanyId(), getActive(),
            searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByComparator());

    searchContainer.setResults(results);

    return searchContainer;
}