001
014
015 package com.liferay.portlet.journal.search;
016
017 import com.liferay.portal.kernel.dao.search.SearchContainer;
018 import com.liferay.portlet.journal.model.JournalTemplate;
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 TemplateSearch extends SearchContainer<JournalTemplate> {
030
031 static List<String> headerNames = new ArrayList<String>();
032
033 static {
034 headerNames.add("id");
035 headerNames.add("description");
036 }
037
038 public static final String EMPTY_RESULTS_MESSAGE =
039 "no-templates-were-found";
040
041 public TemplateSearch(
042 PortletRequest portletRequest, int delta, PortletURL iteratorURL) {
043
044 super(
045 portletRequest, new TemplateDisplayTerms(portletRequest),
046 new TemplateSearchTerms(portletRequest), DEFAULT_CUR_PARAM, delta,
047 iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
048
049 TemplateDisplayTerms displayTerms =
050 (TemplateDisplayTerms)getDisplayTerms();
051
052 iteratorURL.setParameter(
053 TemplateDisplayTerms.DESCRIPTION, displayTerms.getDescription());
054 iteratorURL.setParameter(
055 TemplateDisplayTerms.GROUP_ID,
056 String.valueOf(displayTerms.getGroupId()));
057 iteratorURL.setParameter(
058 TemplateDisplayTerms.NAME, displayTerms.getName());
059 iteratorURL.setParameter(
060 TemplateDisplayTerms.STRUCTURE_ID, displayTerms.getStructureId());
061 iteratorURL.setParameter(
062 TemplateDisplayTerms.TEMPLATE_ID, displayTerms.getTemplateId());
063 }
064
065 public TemplateSearch(
066 PortletRequest portletRequest, PortletURL iteratorURL) {
067
068 this(portletRequest, DEFAULT_DELTA, iteratorURL);
069 }
070
071 }