001
014
015 package com.liferay.portlet.blogsadmin.search;
016
017 import com.liferay.portal.kernel.dao.search.SearchContainer;
018 import com.liferay.portlet.blogs.model.BlogsEntry;
019
020 import java.util.ArrayList;
021 import java.util.List;
022
023 import javax.portlet.PortletRequest;
024 import javax.portlet.PortletURL;
025
026
029 public class EntrySearch extends SearchContainer<BlogsEntry> {
030
031 static List<String> headerNames = new ArrayList<String>();
032
033 static {
034 headerNames.add("title");
035 headerNames.add("author");
036 headerNames.add("createDate");
037 headerNames.add("status");
038 }
039
040 public static final String EMPTY_RESULTS_MESSAGE = "no-entries-were-found";
041
042 public EntrySearch(PortletRequest portletRequest, PortletURL iteratorURL) {
043 super(
044 portletRequest, new EntryDisplayTerms(portletRequest),
045 new EntrySearchTerms(portletRequest), DEFAULT_CUR_PARAM,
046 DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
047
048 EntryDisplayTerms displayTerms = (EntryDisplayTerms)getDisplayTerms();
049
050 iteratorURL.setParameter(
051 EntryDisplayTerms.AUTHOR, displayTerms.getAuthor());
052 iteratorURL.setParameter(
053 EntryDisplayTerms.STATUS, String.valueOf(displayTerms.getStatus()));
054 iteratorURL.setParameter(
055 EntryDisplayTerms.TITLE, displayTerms.getTitle());
056 }
057
058 }